query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Optional. The filter applied to the endpoints of the resolved service. If no filter is specified, all endpoints will be considered. An endpoint will be chosen arbitrarily from the filtered list for each request. For endpoint filter syntax and examples, see Generated from protobuf field string endpoint_filter = 2 [(.google.api.field_behavior) = OPTIONAL];
public function setEndpointFilter($var) { GPBUtil::checkString($var, True); $this->endpoint_filter = $var; return $this; }
[ "public function setEndpoint($var)\n {\n GPBUtil::checkString($var, True);\n $this->endpoint = $var;\n\n return $this;\n }", "public function add_endpoints() {\n $mask = $this->get_endpoints_mask();\n \n foreach ( $this->get_query_vars() as $key => $var ) {\n if ( ! empty( $var ) ) {\n add_rewrite_endpoint( $var, $mask );\n }\n }\n }", "public function setEndpoint(string $endpoint = null): QueryInterface\n {\n $this->_endpoint = $endpoint;\n return $this;\n }", "public function setEndpoint($var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->endpoint = $arr;\n\n return $this;\n }", "public function setEndpoint($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\ServiceDirectory\\V1\\Endpoint::class);\n $this->endpoint = $var;\n\n return $this;\n }", "public function getOptionalFilterType(): string;", "public function setEndpoint(Endpoint $endpoint);", "public function filter_endpoint_url( $str ) {\n if ( is_admin() || ! $this->client->options[ 'wps3_endpoint_replace' ]\n || empty( $this->client->options[ 'wps3_endpoint_replace_url' ] ) ){\n return $str;\n }\n\n if ( empty( $this->client->options[ 'wps3_endpoint' ] ) ) {\n return $str;\n }\n\n return str_replace( $this->client->options[ 'wps3_endpoint' ], $this->client->options[ 'wps3_endpoint_replace_url' ], $str );\n }", "public function setEndpoints($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->endpoints = $arr;\n\n return $this;\n }", "public function setEndpointIp($var)\n {\n GPBUtil::checkString($var, True);\n $this->endpoint_ip = $var;\n\n return $this;\n }", "function wprc_add_acf_posts_endpoint( $allowed_endpoints ) {\n if ( ! isset( $allowed_endpoints[ 'cds/v1' ] ) || ! in_array( 'posts', $allowed_endpoints[ 'cds/v1' ] ) ) {\n $allowed_endpoints[ 'cds/v1' ][] = 'initiatives';\n $allowed_endpoints[ 'cds/v1' ][] = 'groups';\n $allowed_endpoints[ 'cds/v1' ][] = 'group-distance';\n $allowed_endpoints[ 'cds/v1' ][] = 'trainers';\n $allowed_endpoints[ 'cds/v1' ][] = 'hubs';\n }\n return $allowed_endpoints;\n}", "function get_other_resources() {\n $resources = apply_filters('dls_additional_endpoints', array());\n return $resources;\n }", "private static function getEsEndpoint() {\n // Request can modify the endpoint, but only if on a list of allowed\n // endpoints.\n if (!empty($_GET['endpoint']) && !empty(self::$config['es']['alternative_endpoints'])\n && in_array($_GET['endpoint'], helper_base::explode_lines(self::$config['es']['alternative_endpoints']))) {\n return $_GET['endpoint'];\n }\n else {\n return self::$config['es']['endpoint'];\n }\n }", "public function setEndpoint(string $endpoint = null): Query\n {\n $this->_endpoint = $endpoint;\n return $this;\n }", "public static function getDefaultEndpoint(array $endpoints, array $bindings = NULL) {\n\n\t\t$firstNotFalse = NULL;\n\t\t$firstAllowed = NULL;\n\n\t\t/* Look through the endpoint list for acceptable endpoints. */\n\t\tforeach ($endpoints as $i => $ep) {\n\t\t\tif ($bindings !== NULL && !in_array($ep['Binding'], $bindings, TRUE)) {\n\t\t\t\t/* Unsupported binding. Skip it. */\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (array_key_exists('isDefault', $ep)) {\n\t\t\t\tif ($ep['isDefault'] === TRUE) {\n\t\t\t\t\t/* This is the first endpoitn with isDefault set to TRUE. */\n\t\t\t\t\treturn $ep;\n\t\t\t\t}\n\t\t\t\t/* isDefault is set to FALSE, but the endpoint is still useable as a last resort. */\n\t\t\t\tif ($firstAllowed === NULL) {\n\t\t\t\t\t/* This is the first endpoint that we can use. */\n\t\t\t\t\t$firstAllowed = $ep;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($firstNotFalse === NULL) {\n\t\t\t\t\t/* This is the first endpoint without isDefault set. */\n\t\t\t\t\t$firstNotFalse = $ep;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($firstNotFalse !== NULL) {\n\t\t\t/* We have an endpoint without isDefault set to FALSE. */\n\t\t\treturn $firstNotFalse;\n\t\t}\n\n\t\t/*\n\t\t * $firstAllowed either contains the first endpoint we can use, or it\n\t\t * contains NULL if we cannot use any of the endpoints. Either way we\n\t\t * return the value of it.\n\t\t */\n\t\treturn $firstAllowed;\n\t}", "protected function resolveFilter(){ }", "public function setEndpointId($var)\n {\n GPBUtil::checkString($var, True);\n $this->endpoint_id = $var;\n\n return $this;\n }", "public static function indexIsOptional( $endpoint ) {\n\n // For index endpoints, make the index keyword optional.\n if( self::isIndex($endpoint) ) return [\n preg_replace('/index$/', '', $endpoint),\n preg_replace('/index$/', '', $endpoint).'index'\n ];\n\n // Otherwise, for all other endpoints, use it as is.\n return $endpoint;\n\n }", "public function fc_endpoint_add_endpoint() {\n\t\tadd_rewrite_endpoint( 'arbitrary', EP_PERMALINK | EP_PAGES );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get albums by short description
public function getAlbumsByTitle($description) { $success = $this->_db->query("SELECT * FROM albums WHERE album_description LIKE%'$description'%"); if ($success) { $albums = []; while ($row = $success->fetch_assoc()) { $albums[] = $row; } return $albums; } return NULL; }
[ "public function getAlbumsByDescription($longdescription) {\n $success = $this->_db->query(\"SELECT * FROM albums WHERE album_long_description LIKE %'$longdescription'% \");\n\n if ($success) {\n $albums = [];\n while ($row = $success->fetch_assoc()) {\n $albums[] = $row;\n }\n return $albums;\n }\n\n return NULL;\n }", "public function getAlbums();", "public function album_list();", "function getAlbums(){\n\t\t$q = \"SELECT AlbumName, Artist FROM Albums;\";\n\t\treturn query($q);\n\t}", "public function getAllAlbumsDesc()\n {\n \n $this->db->cache_on();\n $this->db->select(\"*\");\n $this->db->from(\"albums\");\n $this->db->order_by(\"albums.date_create\", \"DESC\");\n $albums = $this->db->get();\n \n return $albums->result();\n \n }", "public function getCovers($title);", "function getAlbums() {\n\n $ro = new GetAlbumsRO();\n $files = glob('Pics/*');\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $onefile = $files[$i];\n $imgs_in_album = glob(\"$onefile/*.[jJ][pP][gG]\");\n if (count($imgs_in_album) > 0)\n $album_image = $imgs_in_album[0];\n else\n $album_image = \"res/GenericAlbum.jpg\";\n $album_name = basename($onefile);\n\n $oneAlbum = new AlbumInfo($album_name, $album_image);\n array_push($ro->albums, $oneAlbum);\n }\n\n return $ro;\n}", "public function getAlbum() {\n return db_select('cfas_albums', 'cfas')\n ->fields('cfas', array('album_url', 'created', 'images'))\n ->condition('album_url', $this->album_url)\n ->condition('created', time() - $this->time_limit, '>')\n ->execute()\n ->fetchAssoc();\n }", "public function getAlbum($id);", "public function get_album_suite()\n {\n $results = array();\n\n $catalog_where = \"\";\n $catalog_join = \"LEFT JOIN `catalog` ON `catalog`.`id` = `song`.`catalog`\";\n if ($catalog) {\n $catalog_where .= \" AND `catalog`.`id` = '$catalog'\";\n }\n if (AmpConfig::get('catalog_disable')) {\n $catalog_where .= \" AND `catalog`.`enabled` = '1'\";\n }\n\n $sql = \"SELECT DISTINCT `album`.`id` FROM album LEFT JOIN `song` ON `song`.`album`=`album`.`id` $catalog_join \" .\n \"WHERE `album`.`mbid`='$this->mbid' $catalog_where ORDER BY `album`.`disk` ASC\";\n\n $db_results = Dba::read($sql);\n\n while ($r = Dba::fetch_assoc($db_results)) {\n $results[] = $r['id'];\n }\n\n return $results;\n\n }", "function getOGMusicMusicians();", "public function album()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" album ?\");\n\t}", "public function getAlbums()\n {\n $sql=\"SELECT * FROM album where alb_art= \". $this->getId();\n $resultat=MonPdo::getInstance()->query($sql);\n $lesAlbums=$resultat->fetchAll(PDO::FETCH_CLASS|PDO::FETCH_PROPS_LATE,'Album');\n return $lesAlbums;\n }", "public function findAlbum($id);", "function GetArquivosByAlbum($album)\n{\n\t$arquivo = new Arquivos();\n\t\n\t$list_arquivos = $arquivo->GetArquivosFromAlbum($album);\n\t\n\treturn $list_arquivos;\n}", "public function photos_list($albumid);", "function get_albums()\n {\n $retval = array();\n if ($source = $this->object->get_source()) {\n if (in_array('album', $source->returns)) {\n $mapper = C_Album_Mapper::get_instance();\n $album_key = $mapper->get_primary_key_column();\n if ($this->object->container_ids) {\n $mapper->select()->where(array(\"{$album_key} IN %s\", $this->object->container_ids));\n }\n $retval = $mapper->run_query();\n }\n }\n return $retval;\n }", "public function testSearchAlbum()\n {\n if (TEST_SPOTIFY_LIVE_API == false) {\n return;\n }\n\n $this->overallSearchTest('The Best Of', 'album');\n }", "public abstract function getAlbumPhotos($id_album);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a list of all updatable instances of this package.
public function getUpdatableInstances() { $packages = $this->getDuplicates(); $updatable = array(); $newVersion = $this->packageInfo['version']; foreach ($packages as $package) { if (Package::compareVersion($newVersion, $package['packageVersion']) == 1) { $updatable[$package['packageID']] = $package; } } return $updatable; }
[ "public function getUpdatesList()\n {\n return $this->updates;\n }", "public function getUpdatedByIds() {\n\t\treturn $this->updatedByIds;\n\t}", "protected function getPackagesToUpdate() {\n return $this->packagesToUpdate;\n }", "public function getUpdatableProperties(): UpdatablePropertyCollection;", "public function getUpdatedOids() {\n \treturn $this->updatedOids;\n }", "public function getUpdatableAttributes(): array\n {\n return [];\n }", "public function find_updatable_packages() {\n\tif ($this->updatable === null) {\n\t\t/**\n\t\t * @todo don't call installed_packages here\n\t\t * instead, make calls to installed_version find out if there are installed\n\t\t * and let them cache the composer.lock themselves\n\t\t */\n\t\t$installed_packages = $this->find_installed_packages();\n\t\t$required_packages = $this->find_required_packages();\n\t\t\n\t\tif (debby\\VERBOSE) {\n\t\t\tdebby\\debby::log('Checking '.$this->get_name().' for updatable packages');\n\t\t}\n\t\t\n\t\tif (debby\\VERBOSE) {\n\t\t\t$debug_index = 0;\n\t\t\t$debug_count = count($required_packages);\n\t\t\t$debug_padding = strlen($debug_count);\n\t\t}\n\t\t\n\t\t$this->updatable = [];\n\t\tforeach ($required_packages as $package) {\n\t\t\tif (debby\\VERBOSE) {\n\t\t\t\t$debug_index++;\n\t\t\t\t$debug_prefix = \"\\t\".str_pad($debug_index, $debug_padding, $string=' ', $type=STR_PAD_LEFT).'/'.$debug_count.': ';\n\t\t\t\tdebby\\debby::log($debug_prefix.$package->get_name());\n\t\t\t}\n\t\t\t\n\t\t\t$version_regex = '/versions\\s*:.+v?([0-9]+\\.[0-9]+(\\.[0-9]+)?)(,|$)/U';\n\t\t\tif ($package->is_installed_by_reference()) {\n\t\t\t\t$version_regex = '/source\\s*:.+ ([a-f0-9]{40})$/m';\n\t\t\t}\n\t\t\t\n\t\t\t// find out the latest release\n\t\t\t$package_info = shell_exec('cd '.$this->path.' && '.$this->executable.' show -a '.escapeshellarg($package->get_name()));\n\t\t\tpreg_match($version_regex, $package_info, $latest_version);\n\t\t\tif (empty($latest_version)) {\n\t\t\t\t$e = new exception('can not find out latest release for '.$package->get_name());\n\t\t\t\t$e->stop();\n\t\t\t}\n\t\t\t\n\t\t\tif ($package->is_later_version($latest_version[1])) {\n\t\t\t\t$package->mark_updatable($latest_version[1]);\n\t\t\t\t$this->updatable[$package->get_name()] = $package;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn array_values($this->updatable);\n}", "public function find_updatable_packages() {\n\tif ($this->updatable === null) {\n\t\t/**\n\t\t * @todo don't call installed_packages here\n\t\t * instead, make calls to installed_version find out if there are installed\n\t\t * and let them cache the composer.lock themselves\n\t\t */\n\t\t$this->find_required_packages();\n\t\t$this->find_installed_packages();\n\t\t\n\t\tif (debby\\VERBOSE) {\n\t\t\tdebby\\debby::log('Checking '.$this->get_name().' for updatable packages');\n\t\t}\n\t\t\n\t\t// get all current outdated packages\n\t\t$updatable_packages = shell_exec('cd '.$this->path.' && npm outdated --json');\n\t\t$updatable_packages = json_decode($updatable_packages, true);\n\t\tif ($updatable_packages === null) {\n\t\t\t$error_code = json_last_error();\n\t\t\t$error_message = exception::get_json_error_message($error_code);\n\t\t\t\n\t\t\t$e = new exception('unable to read list of updatable npm packages, \"'.$error_message.'\"', $error_code);\n\t\t\t$e->stop();\n\t\t}\n\t\t\n\t\t$this->updatable = [];\n\t\tif (empty($updatable_packages)) {\n\t\t\treturn $this->updatable;\n\t\t}\n\t\t\n\t\tif (debby\\VERBOSE) {\n\t\t\t$debug_index = 0;\n\t\t\t$debug_count = count($updatable_packages);\n\t\t\t$debug_padding = strlen($debug_count);\n\t\t}\n\t\t\n\t\tforeach ($updatable_packages as $package_name => $package_info) {\n\t\t\t$package = $this->get_package_by_name($package_name);\n\t\t\tif (debby\\VERBOSE) {\n\t\t\t\t$debug_index++;\n\t\t\t\t$debug_prefix = \"\\t\".str_pad($debug_index, $debug_padding, $string=' ', $type=STR_PAD_LEFT).'/'.$debug_count.': ';\n\t\t\t\tdebby\\debby::log($debug_prefix.$package->get_name());\n\t\t\t}\n\t\t\t\n\t\t\tif ($package->is_later_version($package_info['latest'])) {\n\t\t\t\t$package->mark_updatable($package_info['latest']);\n\t\t\t\t$this->updatable[$package->get_name()] = $package;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn array_values($this->updatable);\n}", "public function getEntriesToUpdate(): Collection\n {\n return $this->entriesToUpdate;\n }", "public function get_instances() {\n\t\t\treturn $this->_instances;\n\t\t}", "public static function getUpdates() {\n $reflector = new ReflectionClass(__CLASS__);\n $parameters = $reflector->getMethod(__FUNCTION__)->getParameters();\n $args = [];\n foreach ($parameters as $parameter) {\n $args[$parameter->name] = ${$parameter->name};\n }\n log_util::logFunctionStart($args);\n\n $updates = [];\n\n $pdo = lib_database::connect();\n\n if (!empty($pdo)) {\n log_util::log(LOG_LEVEL_DEBUG, \"pdo connection WAS NOT empty\");\n\n $stmt = $pdo->prepare(\"SELECT * FROM recent_updates ORDER BY date DESC\");\n $stmt->execute();\n\n /** @noinspection PhpAssignmentInConditionInspection */\n while ($row = $stmt->fetch()) {\n $update = new Update();\n $update->setId((int)$row['id']);\n $update->setTitle($row['title']);\n $update->setText($row['text']);\n $update->setDate($row['date']);\n\n array_push($updates, $update);\n }\n } else {\n log_util::log(LOG_LEVEL_ERROR, \"pdo connection WAS empty\");\n }\n\n $pdo = NULL;\n\n log_util::log(LOG_LEVEL_DEBUG, \"updates: \", $updates);\n log_util::logDivider();\n\n return $updates;\n }", "public function getUpdateableModules()\n {\n $modules = array();\n \n foreach($this->_getCollection(self::COLLECTION) as $moduleName => $module) {\n if(key_exists('installed', $module) && $module['installed'] === true\n && key_exists('updateable', $module) && $module['updateable'] === true) {\n $modules[$moduleName] = $module;\n }\n }\n\n return $modules;\n }", "public function getUpdates()\n\t\t{\n\t\t\tif(!isset($this->id))\n\t\t\t\treturn FALSE;\n\t\t\t\n\t\t\tglobal $conn;\n\t\t\t\n\t\t\t$get = $conn->prepare(\"SELECT id FROM ITSM_ApplicationUpdate WHERE application = ? ORDER BY \n\t\t\t\ttime DESC\");\n\t\t\t$get->bindParam(1, $this->id);\n\t\t\t$get->execute();\n\t\t\t\n\t\t\t$updates = [];\n\t\t\t\n\t\t\tforeach($get->fetchAll(\\PDO::FETCH_COLUMN, 0) as $updateId)\n\t\t\t{\n\t\t\t\t$update = new ApplicationUpdate($updateId);\n\t\t\t\t\n\t\t\t\tif($update->load())\n\t\t\t\t\t$updates[] = $update;\n\t\t\t}\n\t\t\t\n\t\t\treturn $updates;\n\t\t}", "public function getAvailableUpdates()\n {\n $register = new Register($this->app);\n $items = $register->selectAll();\n\n $catalog = new Catalog($this->app);\n $result = array();\n foreach ($items as $item) {\n $cat = array();\n if (null !== ($cat_id = $catalog->selectIDbyGUID($item['guid']))) {\n $cat = $catalog->select($cat_id);\n }\n if ((isset($cat['release']) && isset($item['release'])) && (version_compare($cat['release'], $item['release'], '>'))) {\n $result[] = $this->getExtensionData($item);\n }\n }\n\n return $result;\n }", "public function getUpdates()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('updates');\n }", "public static function get_all_instances() {\n\t\t\treturn self::$instances;\n\t\t}", "public function getList()\n {\n \n return $this->getResponse(self::URL_PAGEUPDATES_LIST);\n }", "public function getUpdatableThemes()\n {\n $items = [];\n $repository = $this->repository['themes'];\n\n // local cache to speed things up\n if (isset($this->cache[__METHOD__])) {\n return $this->cache[__METHOD__];\n }\n\n foreach ($this->installed['themes'] as $slug => $plugin) {\n if (!isset($repository[$slug]) || $plugin->symlink) {\n continue;\n }\n\n $local_version = $plugin->version ? $plugin->version : 'Unknown';\n $remote_version = $repository[$slug]->version;\n\n if (version_compare($local_version, $remote_version) < 0) {\n $repository[$slug]->available = $remote_version;\n $repository[$slug]->version = $local_version;\n $items[$slug] = $repository[$slug];\n }\n }\n\n $this->cache[__METHOD__] = $items;\n\n return $items;\n }", "public function getInstanceOwners()\n {\n return $this->instance_owners;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tries to get the real error code from the $report array of GeneralUtility::getURL()
protected function getErrorCode($report) { $message = $report['message']; $errorCode = $report['error']; if (strstr($message, '404')) { $errorCode = '404'; } else { if (strstr($message, '501')) { $errorCode = '501'; } else { if (strstr($message, '401')) { $errorCode = '401'; } } } return $errorCode; }
[ "public function get_error_code();", "abstract protected function getErrorURL();", "public function getCode(){\n return $this -> file['error'];\n }", "public function get_error_codes() {}", "public function getErrorNumber()\n {\n return curl_errno($this->handle);\n }", "public function get_error_code()\n {\n }", "public function getErrorNumber()\n {\n return curl_errno($this->curl);\n }", "function get_error_code() {\n\t\t$codes = $this->get_error_codes();\n\n\t\tif ( empty($codes) )\n\t\t\treturn '';\n\n\t\treturn $codes[0];\n\t}", "public function getFailCode();", "public function get_error_code() {\n $codes = $this->get_error_codes();\n \n if (empty($codes)) {\n return ''; \n } else {\n return $codes[0];\n }\n }", "function get_result_error_code($result) {\n return $result['errror'];\n}", "public function getErrorCode($i) {}", "public function ical_get_error_code() {\n\t\treturn $this->errNo;\n\t}", "function get_error_code() {\n return $this->uploaded_file['error'];\n }", "public function get_error_code() {\n\t\t$codes = $this->get_error_codes();\n\n\t\tif ( empty($codes) )\n\t\t\treturn '';\n\n\t\treturn $codes[0];\n\t}", "public function get_error_code() {\n\n\t\treturn isset( $this->response_data->error->code ) ? (int) $this->response_data->error->code : 500;\n\t}", "public function getErrorCode() {\r\n\t\treturn $_FILES[$this->name]['error'];\r\n\t}", "function getErrorCode()\r\n\t{\r\n \t\tif( $this->request_status == \"ok\" )\r\n \t\t\treturn \"\";\r\n\r\n\t\t$errcode = $this->parser_getTagValue( $this->tmp_res, \"errcode\" );\r\n\r\n\t\treturn $errcode;\r\n\t}", "public function getErrcode()\n {\n return $this->get(self::ERRCODE);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
tests the value update tracing
public function testValueUpdateTracing() { if (version_compare(PHP_VERSION, '5.2') < 0) { // Skip next tests for PHP versions before 5.2 return; } $memoryManager = new Zend_Memory_Manager_Dummy(); $memObject = new Zend_Memory_Container_Movable($memoryManager, 10, '0123456789'); // startTrace() method is usually invoked by memory manager, when it need to be notified // about value update $memObject->startTrace(); $this->assertFalse($memoryManager->processUpdatePassed); $memObject->value[6] = '_'; $this->assertTrue($memoryManager->processUpdatePassed); $this->assertTrue($memoryManager->processedObject === $memObject); $this->assertEquals($memoryManager->processedId, 10); }
[ "abstract protected function updateValue();", "public function testV1UpdateVaration()\n {\n\n }", "public function testElementUpdate()\r\n {\r\n\r\n }", "public function test_updateQuickAdjustment() {\n\n }", "public function testPointUpdate()\r\n {\r\n\r\n }", "public function testUpdateMeasurement()\n {\n }", "public function logUpdate() {\n $this->instance = $this->getMockInstance(300, 'ConfigEntityRevisionsRevertFormTest2');\n $this->instance->logUpdate();\n }", "protected function updated($value) {}", "public function testPriceCanBeUpdated();", "public function testGetUpdateState(): void\n {\n $this->assertEquals($this->attributes->updatestate, \n $this->softwareUpdate->getUpdateState());\n }", "public function testCompanyUpdateSettingsValue()\n {\n }", "public function testCloudPosCheckUpdateCheck()\n {\n }", "public function testSettingsUpdateSetting()\n {\n }", "public function test__fcpoCheckUpdateField_AlreadyChanged()\n {\n $blMockUserChanged = true;\n $sMockDbField = 'someDbField';\n $sMockType = 'kls';\n $sMockDynValueField = 'someDynValueField';\n $aMockDynValue = array(\n 'fcpo_' . $sMockType . '_fon' => '123456',\n 'fcpo_' . $sMockType . '_birthday' => 'someBirthday',\n 'fcpo_' . $sMockType . '_personalid' => 'someId',\n 'fcpo_' . $sMockType . '_sal' => 'someSal',\n 'fcpo_' . $sMockType . '_addinfo' => 'someAddinfo',\n 'fcpo_' . $sMockType . '_del_addinfo' => 'someDelAddinfo',\n );\n\n $oMockUser = oxNew('oxUser');\n $oTestObject = oxNew('fcPayOnePaymentView');\n\n $this->assertEquals(true, $oTestObject->_fcpoCheckUpdateField($blMockUserChanged, $sMockType, $aMockDynValue, $sMockDbField, $sMockDynValueField, $oMockUser));\n }", "public function testIncrementAmountByValueSuccess()\n {\n $product = $this->createProduct();\n\n $valueToAdd = 2;\n $product->incrementAmountByValue($valueToAdd);\n\n $this->assertEquals(2, $product->getAmount());\n }", "public function testUpdateExecutionVariable()\n {\n }", "public function testCacheUpdate() \n {\n $this->cache->set(20, \"random value\");\n $this->cache->get(1);\n $this->cache->set(21, \"another random value\");\n $this->assertTrue($this->cache->hasKey(1));\n $this->assertFalse($this->cache->hasKey(2));\n }", "public function testUpdate()\n\t{\n\t\techo \"\\n\\nCONTROL RESULTS CONTROLLER TEST\\n\\n\";\n\t\tInput::replace($this->inputUpdateResults);\n\t\t$controlResultsController = new ControlResultsController;\n\t\t$controlResultsController->update(1);\n\n\t\t$results = ControlTest::orderBy('id', 'asc')->first()->controlResults;\n\t\tforeach ($results as $result) {\n\t\t\t$key = 'm_'.$result->control_measure_id;\n\t\t\t$this->assertEquals($this->inputUpdateResults[$key], $result->results);\n\t\t}\n\t}", "public function test_updateQuickAdjustmentCustomFields() {\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add comment to country
public function storeComment($country_id,Request $request){ $request->validate([ 'comment' => 'required' ]); $country = Country::findOrFail($country_id); $comment = $country->comments()->create([ 'comment' => $request->comment, ]); return response()->json(['comment' => $comment]); }
[ "function addComment($comment) {\n\n $comment = \"<!-- $comment -->\";\n $this->addHtml($comment);\n\n }", "function render_geolocation_comments_table() {\n\t\techo \"<table id='geolocate_table'>\\n\";\n\t\techo \"\\t<tr><td><strong>Location</strong></td><td><strong>Number of Comments</strong></td></tr>\\n\";\n\t\tforeach ( $this->countries as $countryKey => $eachCountry ) {\n\t\t\techo \"\\t<tr><td>$countryKey</td><td align='center'>$eachCountry</td></tr>\\n\";\n\t\t}\n\t\techo \"\\n</table>\\n\";\n\t}", "public function setCountry(string $newCountry): void;", "function addComment(AddedComment $comment);", "function addComment($comment) {\n $comment = ltrim($comment,\"#,;\");\n array_push($this->comment,$comment);\n }", "public function comment ($comment) {}", "public function add_comment() {\n $this->comments++;\n }", "public function sayCountry()\n {\n print_r(\"BMW: I was made in China\".\"\\n\");\n }", "public function sayCountry()\n {\n print_r(\"Audi: I was made in China!\".\"\\n\");\n }", "function miller_labels_placeholders( $f ) {\n\n\t$f['order']['order_comments']['placeholder'] = 'How can we help you?';\n\t$f['billing']['billing_city']['label'] = 'City';\n \n\treturn $f;\n }", "protected function country()\n {\n $this->parts['{country}'] = $this->form->field($this->model, $this->model->getCountryPropertyName(), ['options' => ['class' => 'form-group']])->dropDownList(\n ArrayHelper::map(Country::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), [\n 'id' => $this->fieldIds['country']\n , 'prompt' => Yii::t('jlorente/location', 'Select country')\n , 'name' => $this->getSubmitModelName($this->model->getCountryPropertyName())\n ]);\n }", "function custom_override_order_comments_placeholder( $fields ) {\n $fields['order']['order_comments']['placeholder'] = 'Notes about your order, e.g. special delivery notes. (Note that we can not adjust any credit card payment amounts after the order is placed.)';\n return $fields;\n}", "public function setCountry($country);", "public function setBillingCountry()\n\t{\n\t\t// Ensure we have an argument to work with\n\t\tif (func_num_args()<1)\n\t\t{\n\t\t\t$this->error[]=\"Invalid number of arguments in function '\".__FUNCTION__.\"()'\";\n\t\t\treturn;\n\t\t}\n\t\t$value=func_get_arg(0);\n\t\t$this->billingCountry = $this->dom->createElement('country',substr($value,0,60));\n\t\treturn;\n\t}", "function setCountry($country = ''){\n $this->country = $country;\n }", "function addComment($key, $comment){\n\t\t$this->tracklist['tracks'][$key]['comment'] = $comment;\n\t}", "public function getAddCountry()\n {\n $list = has_admin_permission(ModuleEnum::COUNTRY, CountryPermission::ADD_COUNTRY);\n $payment_options = Config::get('app.payment_options');\n if ($list == false) {\n return parent::getAdminError($this->theme_path);\n }\n $crumbs = [\n trans('admin/dashboard.dashboard') => 'cp',\n trans('admin/country.manage_country_list') => 'country',\n trans('admin/country.add_country_pagetitle') => '',\n ];\n $this->layout->breadcrumbs = Common::getBreadCrumbs($crumbs);\n $this->layout->pageicon = trans('admin/country.add_country_pageicon');\n $this->layout->header = view('admin.theme.common.header');\n $this->layout->sidebar = view('admin.theme.common.sidebar')\n ->with('mainmenu', 'country');\n\n $this->layout->pagetitle = trans('admin/country.add_country_pagetitle');\n $this->layout->pagedescription = trans('admin/country.add_country_pagedescription');\n $this->layout->content = view('admin.theme.country.add_country')\n ->with('payment_options', $payment_options);\n $this->layout->footer = view('admin.theme.common.footer');\n }", "function scbirs_woocommerce_order_comments_placeholder( $fields ) {\r\n $fields['order']['order_comments']['placeholder'] = 'Anmerkungen zu deiner Bestellung.';\r\n\r\n return $fields;\r\n}", "function dataplus_print_add_comment() {\n global $cm, $CFG;\n\n $ps = optional_param('ps', 0, PARAM_INT);\n $ri = optional_param('ri', null, PARAM_INT);\n $url = $CFG->wwwroot.'/mod/dataplus/view.php';\n $form = dataplus_get_comment_form();\n $qs = '?id='.$cm->id.'&amp;mode=single&amp;changecom='.$form.'&amp;ps='.$ps;\n if (!is_null($ri)) {\n $qs .= '&ri='.$ri;\n }\n $qs .= '#amendcomment';\n $langaddcomment = get_string('addcomment', 'dataplus');\n\n return '<a href=\"'.$url.$qs.'\">'.$langaddcomment.'</a>';\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a whereGeoDistance condition.
public function whereGeoDistance(string $field, $value, $distance, string $boolean = 'must'): self { $this->wheres[$boolean][] = [ 'geo_distance' => [ 'distance' => $distance, $field => $value, ], ]; return $this; }
[ "public function search_engine_client_add_filter_geolocation_distance( $field_name, $geo_latitude, $geo_longitude, $distance ) {\n\n\t\t$this->query_select->addFilterQuery(\n\t\t\t[\n\t\t\t\t'key' => sprintf( 'distance %s', $field_name ),\n\t\t\t\t'query' => $this->query_select->getHelper()->geofilt(\n\t\t\t\t\t$field_name,\n\t\t\t\t\t$geo_latitude,\n\t\t\t\t\t$geo_longitude,\n\t\t\t\t\t$distance\n\t\t\t\t),\n\t\t\t] );\n\t}", "public function whereGeoDistance($field, $value, $distance)\n {\n $this->wheres['must'][] = [\n 'geo_distance' => [\n 'distance' => $distance,\n $field => $value,\n ],\n ];\n\n return $this;\n }", "protected function compileWhereGeoDistance($builder, $where): array\n {\n $query = [\n 'geo_distance' => [\n 'distance' => $where['distance'],\n $where['column'] => $where['location'],\n ],\n ];\n\n return $query;\n }", "public function setApiFilterDistance($filter) {\n\t\tstatic $as_count = 0;\n\n\t\t// Mandatory parameters\n\t\tif (\n\t\t\t!isset($filter['point1']['lat'])\n\t\t\tor !isset($filter['point1']['lon'])\n\t\t\tor !isset($filter['point2']['lat'])\n\t\t\tor !isset($filter['point2']['lon'])\n\t\t\tor !isset($filter['distance'])\n\t\t){\n\t\t\treturn false;\n\t\t}\n\n\t\t// Default comparison : =\n\t\tif (!isset($filter['comparison'])){\n\t\t\t$filter['comparison'] = '<=';\n\t\t}\n\n\t\t// Default \"as\"\n\t\tif (!isset($filter['as'])){\n\t\t\t$filter['as'] = 'distance_' . $as_count;\n\t\t\t$as_count++;\n\t\t}\n\n\t\t$this->select('geodist(double(' . $filter['point1']['lat'] . '), double(' . $filter['point1']['lon'] . '), double(' . $filter['point2']['lat'] . '), double(' . $filter['point2']['lon'] . '), {in=deg}) as ' . $filter['as']);\n\t\t$this->where($filter['as'] . ' ' . $filter['comparison'] . ' ' . $this->quote($filter['distance']));\n\n\t\treturn true;\n\t}", "public function addDistance($select)\n {\n $lat = (float)$this->request->getPost('lat');\n $lng = (float)$this->request->getPost('lng');\n $sortByDistance = $this->configProvider->getAutomaticLocate()\n || (bool)$this->request->getPost('sortByDistance');\n $ip = $this->httpRequest->getClientIp();\n\n if ($this->scopeConfig->isSetFlag('amlocator/geoip/use')\n && (!$lat)\n ) {\n $geodata = $this->geolocation->locate($ip);\n $lat = $geodata->getLatitude();\n $lng = $geodata->getLongitude();\n }\n\n $radius = (float)$this->request->getPost('radius');\n\n if ($lat && $lng && ($sortByDistance || $radius)) {\n if ($radius) {\n $select->having('distance < ' . $radius);\n }\n\n if ($sortByDistance) {\n $select->order(\"distance\");\n }\n\n $select->columns(\n [\n 'distance' => 'SQRT(POW(69.1 * (main_table.lat - ' . $lat . '), 2) + '\n . 'POW(69.1 * (' . $lng . ' - main_table.lng) * COS(main_table.lat / 57.3), 2))'\n ]\n );\n } else {\n $select->order('main_table.position ASC');\n }\n\n return $select;\n }", "public function scopeDistance($query,$dist,$location)\n {\n return $query->whereRaw('st_distance(departure,POINT('.$location.')) < '.$dist);\n }", "function where_clause($where) {\n\t\tif ((isset($_GET['location']) || $wp->query_vars['location'] != null) && $_GET['location'] != \"\") {\n\t\t\tglobal $wpdb, $id, $post, $posts;\n\t\t\tglobal $table_prefix;\n\t\t\t$geo_table_name = $table_prefix . \"geopress\";\n\t\t\t$post_table_name = $table_prefix . \"posts\";\n\t\t\t$postmeta_table_name = $table_prefix . \"postmeta\";\n\t\t\n\t\t\t$location = $_GET['location'];\n\t\t\t\t\n\t\t\t$where.= \" AND $geo_table_name.geopress_id = $wpdb->postmeta.meta_value AND $wpdb->posts.id = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '_geopress_id'\"; \n\t\t\t// If the location= is a number, assume they're referring to the location id\n\t\t\tif( preg_match('/[0-9]+/', $location, $matches )) {\n\t\t\t\t$where .= \" AND $wpdb->postmeta.meta_value=\".mysql_real_escape_string($location);\n\t\t\t}\n\t\t\t// otherwise, look for the name\n\t\t\telse {\n\t\t\t\t$where .= \" AND $geo_table_name.name='\".mysql_real_escape_string($location).\"'\";\t\n\t\t\t}\n\t\t}\n\t\treturn $where;\n\t }", "function where_clause($where) {\n\t\tif ((isset($_GET['location']) || $wp->query_vars['location'] != null) && $_GET['location'] != \"\") {\n\t\t\tglobal $wpdb, $id, $post, $posts;\n\t\t\tglobal $table_prefix;\n\t\t\t$geo_table_name = $table_prefix . \"geopress\";\n\t\t\t$post_table_name = $table_prefix . \"posts\";\n\t\t\t$postmeta_table_name = $table_prefix . \"postmeta\";\n \n\t\t\t$location = $_GET['location'];\n \n\t\t\t$where.= \" AND $geo_table_name.geopress_id = $wpdb->postmeta.meta_value AND $wpdb->posts.id = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '_geopress_id'\"; \n\t\t\t// If the location= is a number, assume they're referring to the location id\n\t\t\tif( preg_match('/[0-9]+/', $location, $matches )) {\n\t\t\t\t$where .= \" AND $wpdb->postmeta.meta_value=\".mysql_real_escape_string($location);\n\t\t\t}\n\t\t\t// otherwise, look for the name\n\t\t\telse {\n\t\t\t\t$where .= \" AND $geo_table_name.name='\".mysql_real_escape_string($location).\"'\";\t\n\t\t\t}\n\t\t}\n\t\treturn $where;\n\t }", "public function nearbyAddresses($distance = 1)\n {\n $addresses = static::get()->where(\n# \"( 6371 * 2 * ATAN2( \"\n# . \"SQRT( POW( SIN( ( Address.Latitude - {$this->Latitude} ) * PI() / 360 ), 2 ) + COS( {$this->Latitude} * PI() / 180 ) * COS( Address.Latitude * PI() / 180 ) * POW( SIN( ( Address.Longitude - {$this->Longitude} ) * PI() / 360 ), 2 ) ), \"\n# . \"SQRT( 1 - ( POW( SIN( ( Address.Latitude - {$this->Latitude} ) * PI() / 360 ), 2 ) + COS( {$this->Latitude} * PI() / 180 ) * COS( Address.Latitude * PI() / 180 ) * POW( SIN( ( Address.Longitude - {$this->Longitude} ) * PI() / 360 ), 2 ) ) ) \"\n# . \") ) <= {$distance}\"\n sprintf(\n '(%5$s * ATAN2('\n . 'SQRT(POW(SIN((Address.Latitude - %1$s) * PI() / 360), 2) + %4$s * COS(Address.Latitude * PI() / 180) * POW(SIN((Address.Longitude - %2$s) * PI() / 360), 2 )), '\n . 'SQRT(1 - (POW(SIN((Address.Latitude - %1$s) * PI() / 360), 2) + %4$s * COS(Address.Latitude * PI() / 180) * POW(SIN((Address.Longitude - %2$s) * PI() / 360), 2)))'\n . ')) <= %3$s',\n (float) $this->Latitude,\n (float) $this->Longitude,\n (float) $distance,\n cos(static::deg2rad($this->Latitude)), // Take calculation out of SQL statement - unsure if SQL optimiser would take care of it automatically.\n 6371 * 2\n )\n );\n \n return $addresses;\n }", "public function filterByDistanceKeepsElementWithinDistance() {\n\t\t$bonn = new Tx_Oelib_Tests_Unit_Fixtures_TestingGeo();\n\t\t$bonn->setGeoCoordinates(\n\t\t\tarray('latitude' => 50.72254683, 'longitude' => 7.07519531)\n\t\t);\n\t\t$cologne = new Tx_Oelib_Tests_Unit_Fixtures_TestingGeo();\n\t\t$cologne->setGeoCoordinates(\n\t\t\tarray('latitude' => 50.94458443, 'longitude' => 6.9543457)\n\t\t);\n\n\t\t$list = new Tx_Oelib_List();\n\t\t$list->add($bonn);\n\n\t\t$filteredList = $this->subject->filterByDistance(\n\t\t\t$list, $cologne, 27.0\n\t\t);\n\n\t\t$this->assertSame(\n\t\t\t1,\n\t\t\t$filteredList->count()\n\t\t);\n\t\t$this->assertSame(\n\t\t\t$bonn,\n\t\t\t$filteredList->first()\n\t\t);\n\t}", "function get_geo_distance_query($table, $columns, $column_lat, $column_lng, $latitude, $longitude, $conditions, $distance, $number)\n{\n $radius = 6378.137; // kilometers\n $diameter = 2 * $radius;\n $factor1 = pi() / 180;\n $factor2 = $factor1 / 2;\n $factor3 = $factor1 * $radius;\n $factor4 = $distance / $factor3;\n $factor5 = $factor4 / abs(cos(deg2rad($latitude)));\n\n $lat1 = $latitude - $factor4;\n $lat2 = $latitude + $factor4;\n $lng1 = $longitude - $factor5;\n $lng2 = $longitude + $factor5;\n\n $query = \"SELECT \".$columns.\",\";\n\n $query = $query.$diameter.\"*ASIN(SQRT(POWER(SIN((\".$latitude.\"-\".$column_lat.\")*\".$factor2.\"),2)+COS(\".$latitude.\"*\".$factor1.\")*COS(\".$column_lat.\"*\".$factor1.\")*POWER(SIN((\".$longitude.\"-\".$column_lng.\")*\".$factor2.\"),2)))\";\n\n $query = $query.\" AS distance FROM \".$table.\" WHERE \";\n\n $query = $query.$column_lat.\" BETWEEN \".$lat1.\" AND \".$lat2;\n $query = $query.\" AND \".$column_lng.\" BETWEEN \".$lng1.\" AND \".$lng2;\n\n if (!is_null($conditions))\n {\n $query = $query.$conditions;\n }\n\n $query = $query.\" HAVING distance<\".$distance.\" ORDER BY distance\";\n if (!is_null($number) && $number > 0)\n {\n $query = $query.\" LIMIT \".$number;\n }\n\n return $query;\n}", "public function scopeNearBy($query, $distance = 10)\n {\n return $query->select(\\DB::raw(' * FROM (SELECT *, (((acos(sin(('.$this->latitude.'*pi()/180)) * sin((`latitude`*pi()/180))+cos(('.$this->latitude.'*pi()/180)) *cos((`latitude`*pi()/180)) * cos((('.$this->longitude.'-`longitude`)*pi()/180))))*180/pi())*60*1.1515*1.609344) as distance'))\n ->from(\\DB::raw('`site_locations`)myTable '))\n ->where('distance', '<=', $distance);\n\n }", "public function setDistance($var)\n {\n GPBUtil::checkDouble($var);\n $this->distance = $var;\n $this->has_distance = true;\n\n return $this;\n }", "public function addCondition($where)\n {\n $this->query->andWhere($where);\n }", "protected function getGeneralWhereClause() {}", "public function addWhere() {\n\t\tif (!empty($this->config['where'])) {\n\t\t\t$where = $this->modx->fromJson($this->config['where']);\n\t\t\t$where = $this->replaceTVCondition($where);\n\t\t\t$this->query->where($where);\n\n\t\t\t$condition = array();\n\t\t\tforeach ($where as $k => $v) {\n\t\t\t\tif (is_array($v)) {$condition[] = $k.'('.implode(',',$v).')';}\n\t\t\t\telse {$condition[] = $k.'='.$v;}\n\t\t\t}\n\t\t\t$this->addTime('Added where condition: <b>' .implode(', ',$condition).'</b>');\n\t\t}\n\t\tif (!empty($this->config['having'])) {\n\t\t\t$having = $this->modx->fromJson($this->config['having']);\n\t\t\t$having = $this->replaceTVCondition($having);\n\t\t\t$this->query->having($having);\n\n\t\t\t$condition = array();\n\t\t\tforeach ($having as $k => $v) {\n\t\t\t\tif (is_array($v)) {$condition[] = $k.'('.implode(',',$v).')';}\n\t\t\t\telse {$condition[] = $k.'='.$v;}\n\t\t\t}\n\t\t\t$this->addTime('Added having condition: <b>' .implode(', ',$condition).'</b>');\n\t\t}\n\t}", "function directory_search_filter_nearby($where){\r\n\tglobal $wpdb,$wp_query,$current_cityinfo;\r\n\t$search = str_replace(' ','',sanitize_text_field($_REQUEST['location']));\r\n\tif($search){\r\n\t\tif(is_ssl()){ $http = \"https://\"; }else{ $http =\"http://\"; }\r\n\t\t$arg=array('method' => 'POST',\r\n\t\t\t 'timeout' => 45,\r\n\t\t\t 'redirection' => 5,\r\n\t\t\t 'httpversion' => '1.0',\r\n\t\t\t 'blocking' => true,\r\n\t\t\t 'user-agent' => 'WordPress/'. $wp_version .'; '. home_url(),\r\n\t\t\t 'cookies' => array()\r\n\t\t);\r\n\t\t/* Get the google map data from search address*/\r\n\t\t$response = wp_remote_get($http.'maps.google.com/maps/api/geocode/json?address='.$search.'&sensor=false',$arg );\t\t\r\n\t\t$output=json_decode($response['body']);\r\n\t\tif(!is_wp_error( $response ) ) {\r\n\t\t\tif(isset($output->results[0]->geometry->location->lat))\r\n\t\t\t\t$lat = $output->results[0]->geometry->location->lat;\r\n\t\t\tif(isset($output->results[0]->geometry->location->lng))\r\n\t\t\t\t$long = $output->results[0]->geometry->location->lng;\r\n\t\t}\r\n\t\t$miles = sanitize_text_field($_REQUEST['radius']);\r\n\t\t$saddress = sanitize_text_field($_REQUEST['location']);\r\n\r\n\t\tif(isset($_REQUEST['radius_type']) && $_REQUEST['radius_type']== strtolower('Kilometer')){\r\n\t\t\t$miles = sanitize_text_field($_REQUEST['radius']) / 0.621;\r\n\t\t}else{\r\n\t\t\t$miles = sanitize_text_field($_REQUEST['radius']);\r\n\t\t}\r\n\t\t$tbl_postcodes = $wpdb->prefix . \"postcodes\";\r\n\t\tif($saddress && !isset($_REQUEST['radius'])){\r\n\t\t\t$where .= \" AND ($wpdb->posts.ID in (select pm.post_id from $wpdb->postmeta pm where pm.meta_key like 'address' and pm.meta_value like \\\"%$saddress%\\\") )\";\r\n\t\t}elseif($saddress && (isset($_REQUEST['radius']) && $_REQUEST['radius']=='')){\r\n\t\t\t$where .= \" AND ($wpdb->posts.ID in (select pm.post_id from $wpdb->postmeta pm where pm.meta_key like 'address' and pm.meta_value like \\\"%$saddress%\\\") )\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tif($saddress=='' && !empty($current_cityinfo)){\r\n\t\t$lat=$current_cityinfo['lat'];\r\n\t\t$long=$current_cityinfo['lng'];\r\n\t}\r\n\tif(!empty($_REQUEST['post_type']) )\r\n\t{\r\n\t\t$post_type1='';\t\t\r\n\t\tif(count($_REQUEST['post_type']) >1){\r\n\t\t\t$post_type = implode(\",\",sanitize_text_field($_REQUEST['post_type']));\r\n\t\t}else{\r\n\t\t\t$post_type = sanitize_text_field($_REQUEST['post_type']);\r\n\t\t}\r\n\t\t$post_type_array = explode(\",\",$post_type);\r\n\t\t$sep = \",\";\r\n\t\tfor($i=0;$i<count($post_type_array);$i++)\r\n\t\t{\r\n\t\t\tif($i == (count($post_type_array) - 1)){\r\n\t\t\t\t$sep = \"\";\r\n\t\t\t}\r\n\t\t\tif(isset($post_type_array[$i]))\r\n\t\t\t$post_type1 .= \"'\".$post_type_array[$i].\"'\".$sep;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif($lat!='' && $long!='' && (isset($_REQUEST['radius']) && $_REQUEST['radius']!='')){\r\n\t\tif (function_exists('icl_register_string')) {\r\n\t\t\tif($lat !='' && $long !=''){\r\n\t\t\t\t$where .= \" AND ($wpdb->posts.ID in (SELECT post_id FROM $tbl_postcodes WHERE $tbl_postcodes.post_type in (\".$post_type1.\") AND truncate((degrees(acos( sin(radians(`latitude`)) * sin( radians('\".$lat.\"')) + cos(radians(`latitude`)) * cos( radians('\".$lat.\"')) * cos( radians(`longitude` - '\".$long.\"') ) ) ) * 69.09),1) <= \".$miles.\" ORDER BY truncate((degrees(acos( sin(radians(`latitude`)) * sin( radians('\".$lat.\"')) + cos(radians(`latitude`)) * cos( radians('\".$lat.\"')) * cos( radians(`longitude` - '\".$long.\"') ) ) ) * 69.09),1) ASC))\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif($lat !='' && $long !=''){\r\n\t\t\t\t$where .= \" AND ($wpdb->posts.ID in (SELECT post_id FROM $tbl_postcodes WHERE $tbl_postcodes.post_type in (\".$post_type1.\") AND truncate((degrees(acos( sin(radians(`latitude`)) * sin( radians('\".$lat.\"')) + cos(radians(`latitude`)) * cos( radians('\".$lat.\"')) * cos( radians(`longitude` - '\".$long.\"') ) ) ) * 69.09),1) <= \".$miles.\" ORDER BY truncate((degrees(acos( sin(radians(`latitude`)) * sin( radians('\".$lat.\"')) + cos(radians(`latitude`)) * cos( radians('\".$lat.\"')) * cos( radians(`longitude` - '\".$long.\"') ) ) ) * 69.09),1) ASC))\";\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tif(is_plugin_active('Tevolution-LocationManager/location-manager.php') && $current_cityinfo['city_id']!='')\r\n\t\t{\r\n\t\t\t$where .= \" AND $wpdb->posts.ID in (select pm.post_id from $wpdb->postmeta pm where pm.meta_key ='post_city_id' and FIND_IN_SET( \".$current_cityinfo['city_id'].\", pm.meta_value ))\";\r\n\t\t}\r\n\t}\r\n\r\n\t$tquery = tmpl_get_search_term_query(get_query_var('s'),'c.name');\r\n\tif(!empty($tquery)){\r\n\r\n\t\tif(isset($_SESSION['post_city_id']) && $_SESSION['post_city_id']!=''){\r\n\t\t\tif($saddress!=''){\r\n\t\t\t\t$cats = $wpdb->get_col(\"select tr.object_id from $wpdb->terms c,$wpdb->term_taxonomy tt,$wpdb->term_relationships tr,$wpdb->posts p, $wpdb->postmeta pm,$wpdb->postmeta pm1 where ( {$tquery } ) and c.term_id=tt.term_id and tt.term_taxonomy_id=tr.term_taxonomy_id and tr.object_id=p.ID and p.post_status = 'publish' and p.post_type IN ('\".str_replace(\",\",\"','\",$post_type).\"') and p.ID=pm.post_id AND p.ID=pm1.post_id and pm.meta_key ='post_city_id' and FIND_IN_SET( \".$_SESSION['post_city_id'].\", pm.meta_value ) AND pm1.meta_key='address' AND pm1.meta_value like \\\"%$saddress%\\\" group by p.ID\");\r\n\t\t\t}else{\r\n\t\t\t\t$cats = $wpdb->get_col(\"select tr.object_id from $wpdb->terms c,$wpdb->term_taxonomy tt,$wpdb->term_relationships tr,$wpdb->posts p, $wpdb->postmeta pm where ( {$tquery } ) and c.term_id=tt.term_id and tt.term_taxonomy_id=tr.term_taxonomy_id and tr.object_id=p.ID and p.post_status = 'publish' and p.post_type IN ('\".str_replace(\",\",\"','\",$post_type).\"') and p.ID=pm.post_id and pm.meta_key ='post_city_id' and FIND_IN_SET( \".$_SESSION['post_city_id'].\", pm.meta_value ) group by p.ID\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif($saddress!=''){\r\n\t\t\t\t$cats = $wpdb->get_col(\"select tr.object_id from $wpdb->terms c,$wpdb->term_taxonomy tt,$wpdb->term_relationships tr,$wpdb->posts p, $wpdb->postmeta pm where ( {$tquery } ) and c.term_id=tt.term_id and tt.term_taxonomy_id=tr.term_taxonomy_id and tr.object_id=p.ID and p.post_status = 'publish' and p.post_type IN ('\".str_replace(\",\",\"','\",$post_type).\"') and p.ID=pm.post_id AND pm.meta_key='address' AND pm.meta_value like \\\"%$saddress%\\\" group by p.ID\");\r\n\t\t\t}else{\r\n\t\t\t\t$cats = $wpdb->get_col(\"select tr.object_id from $wpdb->terms c,$wpdb->term_taxonomy tt,$wpdb->term_relationships tr,$wpdb->posts p where ( {$tquery } ) and c.term_id=tt.term_id and tt.term_taxonomy_id=tr.term_taxonomy_id and tr.object_id=p.ID and p.post_status = 'publish' and p.post_type IN ('\".str_replace(\",\",\"','\",$post_type).\"') group by p.ID\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t/*Added tagwise search*/\r\n\tif(!empty($cats))\r\n\t\t$srch_arr = implode(',',$cats);\r\n\tif($srch_arr !='')\r\n\t $where .= \" OR ($wpdb->posts.ID in ($srch_arr))\";\r\n\treturn $where;\r\n}", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "private function getDistrictWhereClausePart() {\n\t\tif ($this->filterFormData['district'] == 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn ' AND ' . REALTY_TABLE_OBJECTS . '.district = ' .\n\t\t\t$this->filterFormData['district'];\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a dsid regex to the rule.
function addDsidRegex($regex) { $this->setValue('dsidregexs', $regex); }
[ "function removeDsidRegex($regex) {\n $this->removeValues('dsidregexs', $regex);\n }", "function content_model_viewer_add_datastream_dsid_rule_validate(array $form, array &$form_state) {\n $add = $form['fieldset']['rows']['add'];\n if (empty($add['dsid']['#value'])) {\n form_error($add['dsid'], t('field is required.'));\n }\n elseif ($add['type']['#value'] == CONTENT_MODEL_VIEWER_DATASTREAM_DSID_RULE_TYPE_REGEX) {\n content_model_viewer_regex_validate($add['dsid'], $form_state);\n }\n}", "protected function configure_session_id_Regex() {\n $bitsPerCharacter = (int)ini_get('session.sid_bits_per_character');\n $SIDLength = (int)ini_get('session.sid_length');\n\n if (($bits = $SIDLength * $bitsPerCharacter) < 160) {\n // Add as many more characters as necessary to reach at least 160 bits\n $SIDLength += (int)ceil((160 % $bits) / $bitsPerCharacter);\n ini_set('session.sid_length', (string)$SIDLength);\n }\n\n switch ($bitsPerCharacter) {\n case 4:\n $this->session_id_regex = '[0-9a-f]';\n break;\n\n case 5:\n $this->session_id_regex = '[0-9a-v]';\n break;\n\n case 6:\n $this->session_id_regex = '[0-9a-zA-Z,-]';\n break;\n }\n\n $this->session_id_regex .= '{'.$SIDLength.'}';\n }", "public function addMacro($id, $regex) {\n\t\t$this->macro_keys[] = '(:'. $id .')';\n\t\t$this->macro_vals[] = '('. $regex .')'; // force it to be a subpattern\n\t}", "function addRegexpToSqlite() {\n\n // Use deterministic mode if PHP version >= 7.1.4\n if ( defined( 'SQLITE3_DETERMINISTIC' ) ) {\n\n $this->db->createFunction(\n 'PREG_MATCH',\n function ( string $regexp, string $string ) : bool {\n return preg_match( '/' . $regexp . '/i', $string ) === 1;\n },\n 2,\n SQLITE3_DETERMINISTIC\n );\n \n } else {\n\n $this->db->createFunction(\n 'PREG_MATCH',\n function ( string $regexp, string $string ) : bool {\n return preg_match( '/' . $regexp . '/i', $string ) === 1;\n },\n 2\n );\n \n }\n \n }", "public function add_rule($regex, $query, $after = 'bottom')\n {\n }", "function addRegex($node, $regex_info) {\n\t$regex = $node->addChild('regex', '');\n\tforeach ($regex_info as $nodename=>$val) {\n\t\t$regex->addChild($nodename, $val);\n\t}\n\treturn $regex;\n}", "public function add_rule($regex, $query, $after = 'bottom')\n {\n }", "public function regex();", "abstract protected function addRule($rule);", "public function setRegex($regex) {\r\n $this->regex = $regex;\r\n }", "public function setDatabaseRegex($regex) \n { \n $this->database_regex = $regex;\n }", "public function setCustomRegex(string $regex): void\n {\n $this->customRegex = $regex;\n }", "public function addDNSRules()\n {\n $this->checkServer();\n\n $rules = $this->callApi('get', '/server/'.$this->server.'/firewall_rule')['data']->firewall_rules->firewall_rule;\n\n $toDelete = [];\n\n foreach ($rules as $rule) {\n if ($rule->source_address_start == '94.237.127.9' || $rule->source_address_start == '94.237.40.9'\n || $rule->source_address_start == '2a04:3540:53::1' || $rule->source_address_start == '2a04:3544:53::1') {\n $toDelete[] = $rule->position;\n }\n }\n\n rsort($toDelete);\n foreach ($toDelete as $pos) {\n $response = $this->callApi('delete', '/server/'.$this->server.'/firewall_rule/'.$pos);\n }\n\n $protocols = ['tcp', 'udp'];\n foreach ($protocols as $protocol) {\n $body = [\n 'firewall_rule' => [\n 'protocol' => $protocol,\n 'direction' => 'in',\n 'action' => 'accept',\n 'family' => 'IPv4',\n 'source_port_start' => 53,\n 'source_port_end' => 53,\n 'source_address_start' => '94.237.127.9',\n 'source_address_end' => '94.237.127.9',\n 'comment' => 'Automatic rule',\n ],\n ];\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n $body['firewall_rule']['source_address_start'] = $body['firewall_rule']['source_address_end'] = '94.237.40.9';\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n $body['firewall_rule']['family'] = 'IPv6';\n $body['firewall_rule']['source_address_start'] = $body['firewall_rule']['source_address_end'] = '2a04:3540:53::1';\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n $body['firewall_rule']['source_address_start'] = $body['firewall_rule']['source_address_end'] = '2a04:3544:53::1';\n $response = $this->callApi('post', '/server/'.$this->server.'/firewall_rule', $body);\n }\n\n return $response;\n }", "private function makeRegex()\n\t{\n\t\tif (is_array($this->pattern_search)) {\n\t\t\tforeach($this->pattern_search as $type=>$values) {\n\t\t\t\tif (is_array($this->pattern_search[$type])) {\n\t\t\t\t\tforeach($this->pattern_search[$type] as $key=>$val) {\n\t\t\t\t\t\t$regex = $val;\n\t\t\t\t\t\t$regex = $this->appendSearchPath($regex);\n\t\t\t\t\t\t$regex = $this->cleanRegex($regex);\n\t\t\t\t\t\tif (isset($this->rewrite_code[$type]) && isset($this->rewrite_replace[$type])) {\n\t\t\t\t\t\t\t$regex = str_replace($this->rewrite_code[$type], $this->rewrite_replace[$type], $regex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//$regex = $this->appendDirPath($regex,$type);\n\t\t\t\t\t\t$regex = $this->wrapQuotes($regex);\n\t\t\t\t\t\t$this->patterns_regex[$type][$key] = \"#\".$regex.\"#s\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function add_rewrite_rule($regex, $query, $after = 'bottom')\n {\n }", "function addDsid($dsid) {\n $this->setValue('dsids', $dsid);\n }", "private function makeRegex()\n\t{\n\t\tif (is_array($this->pattern_search)) {\n\t\t\tforeach($this->pattern_search as $type=>$values) {\n\t\t\t\tif (is_array($this->pattern_search[$type])) {\n\t\t\t\t\tforeach($this->pattern_search[$type] as $key=>$val) {\n\t\t\t\t\t\t$regex = $val;\n\t\t\t\t\t\t$regex = $this->cleanRegex($regex);\n\t\t\t\t\t\tif (isset($this->rewrite_code[$type]) && isset($this->rewrite_replace[$type])) {\n\t\t\t\t\t\t\t$regex = str_replace($this->rewrite_code[$type], $this->rewrite_replace[$type], $regex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->patterns_regex[$type][$key] = \"/^\".$regex.\"$/\";\t// This REGEX will make finding exact match rather than subpatterns.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setPattern( $regex ) {\n\t\t$this->pattern = $regex;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the file entries per page.
public function setFileEntriesPerPage($fileEntriesPerPage) { if (intval($this->fileEntriesPerPage) !== intval($fileEntriesPerPage)) { $this->fileEntriesPerPage = intval($fileEntriesPerPage); } }
[ "protected function setPagesPerImport() {\n\t\tif (!empty($this->config['pages_per_import'])) {\n\t\t\t$this->pages_per_import = $this->config['pages_per_import'];\n\t\t} else {\n\t\t\t$this->pages_per_import = 7;\n\t\t}\n\t}", "function setPagePerPage($page, $perPage);", "function setNumberOfPages(){\n $this->pages = ceil($this->getTotal()/$this->getPerPage());\n }", "function add_admin_per_page(): void {\n $set = Config::current()->set(\"admin_per_page\", 25, true);\n\n if ($set === false)\n error(\n __(\"Error\"),\n __(\"Could not write the configuration file.\")\n );\n }", "function submissions_per_page() {\n $option = 'per_page';\n $args_rates = array(\n 'label' => __('Number of items per page:', $this->prefix),\n 'default' => 20,\n 'option' => 'fm_submissions_per_page'\n );\n add_screen_option( $option, $args_rates );\n }", "public function updatingPerPage(): void\n {\n $this->resetPage();\n }", "public static function update_entries_per_page( $per_page ){\n\t\tupdate_option( '_caldera_forms_entry_perpage', absint( $per_page ) );\n\t\treturn self::entries_per_page();\n\t}", "protected function setPageSize(){\n $this->data['size'] = isset($this->data['size'] ) ? (int)$this->data['size'] : $this->default_size; \n }", "protected function setTotalPages()\n {\n $this->totalPages = (int) ceil($this->items / $this->itemsPerPage);\n }", "protected function _setNrOfArtPerPage()\n {\n $myConfig = $this->getConfig();\n\n //setting default values to avoid possible errors showing article list\n $iNrofCatArticles = $myConfig->getConfigParam('iNrofCatArticles');\n $iCel_DefaultPageSize = (int) $myConfig->getConfigParam('iCel_DefaultPageSize');\n $iNrofCatArticles = ( $iNrofCatArticles ) ? $iNrofCatArticles : $iCel_DefaultPageSize;\n\n // checking if all needed data is set\n switch ($this->getListDisplayType()) {\n case 'grid':\n $aNrofCatArticles = $myConfig->getConfigParam('aNrofCatArticlesInGrid');\n break;\n case 'line':\n case 'infogrid':\n default:\n $aNrofCatArticles = $myConfig->getConfigParam('aNrofCatArticles');\n }\n\n $aNrofCatArticles = isset($aNrofCatArticles[0]) ? $aNrofCatArticles : array($iNrofCatArticles);\n $myConfig->setConfigParam('aNrofCatArticles', $aNrofCatArticles);\n\n $iNrofCatArticles = $this->_setViewConfigWithArtPerPage($myConfig, $aNrofCatArticles);\n\n //setting number of articles per page to config value\n $myConfig->setConfigParam('iNrofCatArticles', $iNrofCatArticles);\n }", "public function set_posts_per_page(int $number) {\n\t\t$this->posts_per_page = $number;\n\t}", "static function per_page(){\n\t\treturn Config::apply_filters('indexer_per_page', 10);\n\t}", "function MyMod_Paging_NItemsPerPage_Set()\n {\n $val=$this->CGI_VarValue($this->ModuleName.\"_NItemsPerPage\");;\n if (!empty($val) && preg_match('/^\\d+$/',$val))\n {\n $this->NItemsPerPage=$val;\n }\n }", "private function changePageSize() {\n\t\t$size = $this->ask('Please indicate how manu items per page (number)');\n\t\tif (is_numeric($size)) {\n\t\t\t$this->page['size'] = $size;\n\t\t\t$this->load();\n\t\t} else {\n\t\t\t$this->error(\"Value is required or invalid type\");\n\t\t\t$this->changePageSize();\n\t\t}\n\t}", "function linksperpage($amount){\r\n\t\t$this->linksperpage = $amount;\r\n\t}", "function bigcity_items_per_page(){\n\tupdate_user_option( get_current_user_id(), 'edit_post_per_page', 100 );\n\tupdate_user_option( get_current_user_id(), 'edit_page_per_page', 100 );\n}", "public function screen_option() {\r\n\t\t$option = 'per_page';\r\n\t\t$args = [\r\n\t\t\t'label' => 'Files',\r\n\t\t\t'default' => 5,\r\n\t\t\t'option' => 'file_per_page'\r\n\t\t];\r\n\r\n\t\tadd_screen_option( $option, $args );\r\n\t\t\r\n\t}", "public function perPage()\n {\n }", "protected function _updatePageSize() {\n $url = $this->url;\n if (array_key_exists('next_collection_link', $this->data)) {\n $url = $this->data['next_collection_link'];\n\n } elseif (array_key_exists('prev_collection_link', $this->data)) {\n $url = $this->data['prev_collection_link'];\n }\n\n # scan querystring for ws_size\n $url_parts = parse_url($url);\n\n # we have a query string\n if (array_key_exists('query', $url_parts)) {\n parse_str($url_parts['query'], $params);\n\n # we have a ws_size\n if (array_key_exists('ws_size', $params)) {\n\n # set pageSize\n $this->pageSize = $params['ws_size'];\n return;\n }\n }\n\n # we dont have one, just count the # of entries\n $this->pageSize = count($this->data['entries']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
============================ STATIC FUNCTIONS ============================ Load and get a SteamUser object from the provided data.
public static function loadSteamUser(array $steamData) : SteamUser { $steamID = $steamData['steamID']; $username = $steamData['username']; $gameList = $steamData['gameList']; return new SteamUser($steamID, $username, $gameList); }
[ "function loadUser($login, $mail)\r\n{\r\n $userobj = new WP_User();\r\n $user = $userobj->get_data_by('login', $login);\r\n $user = new WP_User($user->ID); // Attempt to load up the user with that ID\r\n openam_debug('loadUser: user object: ' . print_r($user, true));\r\n\r\n if (0 == $user->ID) { // User did not exist\r\n $userdata = array(\r\n 'user_email' => $mail,\r\n 'user_login' => $login,\r\n );\r\n $new_user_id = wp_insert_user($userdata); // A new user has been created\r\n // Load the new user info\r\n $user = new WP_User($new_user_id);\r\n }\r\n openam_debug('loadUser: WP_User loaded: ' . print_r($user, true));\r\n\r\n return $user;\r\n}", "function loadUser($login,$mail) {\n $userobj = new WP_User();\n $user = $userobj->get_data_by( 'login', $login );\n openam_debug(\"loadUser: user object: \" . print_r($user, TRUE));\n $user = new WP_User($user->ID); // Attempt to load up the user with that ID\n \n if( $user->ID == 0 ) { // User did not exist\n $userdata = array( 'user_email' => $mail,\n 'user_login' => $login\n );\n $new_user_id = wp_insert_user( $userdata ); // A new user has been created\n // Load the new user info\n $user = new WP_User ($new_user_id);\n } \n openam_debug(\"loadUser: WP_User loaded: \" . print_r($user, TRUE));\n return $user;\n}", "public function __loadUser()\n {\n\t$facebook = $this->fb;\n\t$this->user = $facebook->api(\"/me\", \"GET\");\n\t$this->userid = $facebook->getUser();\n\treturn;\n }", "protected function firstOrCreate(SteamData $data)\n {\n return User::firstOrCreate([\n 'steam_id' => $data->getSteamId(),\n ], [\n 'name' => $data->getPersonaName(),\n 'avatar' => $data->getAvatarFull(),\n 'avatar_small' => $data->getAvatar(),\n 'avatar_medium' => $data->getAvatarMedium(),\n 'player_level' => $data->getPlayerLevel(),\n 'api_token' => Str::random(80),\n 'api_token_created_at' => now(),\n // ...and other what you need\n ]);\n }", "public function decodeUser($data)\n {\n $user = new Paysera_WalletApi_Entity_User();\n\n $this->setProperty($user, 'id', $data['id']);\n if (isset($data['email'])) {\n $this->setProperty($user, 'email', $data['email']);\n }\n if (isset($data['phone'])) {\n $this->setProperty($user, 'phone', $data['phone']);\n }\n if (isset($data['display_name'])) {\n $this->setProperty($user, 'displayName', $data['display_name']);\n }\n if (isset($data['dob'])) {\n $this->setProperty($user, 'dob', $data['dob']);\n }\n if (isset($data['gender'])) {\n $this->setProperty($user, 'gender', $data['gender']);\n }\n if (isset($data['address'])) {\n $this->setProperty($user, 'address', $this->decodeAddress($data['address']));\n }\n if (isset($data['identity'])) {\n $this->setProperty($user, 'identity', $this->decodeIdentity($data['identity']));\n }\n if (isset($data['wallets'])) {\n $this->setProperty($user, 'wallets', $data['wallets']);\n }\n if (isset($data['type'])) {\n $this->setProperty($user, 'type', $data['type']);\n }\n if (isset($data['company_code'])) {\n $this->setProperty($user, 'companyCode', $data['company_code']);\n }\n if (isset($data['identification_level'])) {\n $this->setProperty($user, 'identificationLevel', $data['identification_level']);\n }\n if (isset($data['locale'])) {\n $this->setProperty($user, 'locale', $data['locale']);\n }\n if (isset($data['pep'])) {\n $peps = [];\n foreach ($data['pep'] as $pep) {\n $peps[] = $this->decodePep($pep);\n }\n $this->setProperty($user, 'politicallyExposedPersons', $peps);\n }\n\n return $user;\n }", "function loadUserById($id);", "public function loadRemoteUserInfo()\n {\n $userInfo = @json_decode($this->util->file_get_contents_curl('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=' . $this->config['key'] . '&steamids=' . $this->steamId), true)['response']['players'][0];\n $this->db->prepare('INSERT INTO `steamAPIUsage` SET `module` = 1');\n $this->db->execute();\n\n if (!$userInfo) {\n throw new Exception('The steam servers failed to respond to the user info request, probably due to heavy load.');\n }\n $this->logger->addEntry('Grabbed userdata from steam servers.');\n\n $this->personaName = $userInfo['personaname'];\n $this->personaState = $userInfo['personastate'];\n $this->profileState = $userInfo['communityvisibilitystate'];\n $this->profileUrl = substr($userInfo['profileurl'], 26);\n $this->avatarHash = substr($userInfo['avatar'], -44, -4);\n if (isset($userInfo['gameextrainfo'])) {\n $this->gameName = $userInfo['gameextrainfo'];\n } else {\n $this->gameName = '';\n }\n $this->cacheUser();\n }", "protected function loadUser()\n {\n $sixreps = new Sixreps(Yii::app()->params['api_host']);\n\n try {\n list($body, $info) = $sixreps->get('/users/me', array(\n 'access_token' => Yii::app()->user->user_token,\n ));\n }\n catch (Exception $e) {}\n\n $this->_model = $body;\n\n return $this->_model;\n }", "protected function findOrNewUser($info)\n {\n $user = User::where('steam_id', $info->steamID64)->first();\n\n if (!is_null($user)) {\n return $user;\n }\n\n $user = new User;\n $user->personaname = $info->personaname;\n $user->profileurl = $info->profileurl;\n $user->avatar_full = $info->avatarfull;\n $user->avatar = $info->avatar;\n $user->avatar_medium = $info->avatarmedium;\n $user->steam_id = $info->steamID64;\n $user->provider = 'steam';\n $user->status = 1;\n $user->save();\n return $user; \n }", "public static function getInitUser() {\r\n\t\tglobal $DB;\r\n\r\n\t\t$initUser = new SsoUser();\r\n\r\n\t\t$initUser->id = SSO_DB_USER;\r\n\t\t$initUser->name = SSO_DB_USER;\r\n\t\t$initUser->state = SsoUser::STATE_ENABLED;\r\n\r\n\t\t$q = Dual::query();\r\n\t\t$q->select(SqlExpr::_PASSWORD(SSO_DB_PASS)->privateBinds(), 'pass');\r\n\t\t$initUser->password = \\salt\\first($DB->execQuery($q)->data)->pass;\r\n\r\n\t\t$q = SsoAuthMethod::query();\r\n\t\t$q->selectField('id');\r\n\t\t$q->whereAnd('type', '=', SsoAuthMethod::TYPE_LOCAL);\r\n\t\t$auth = \\salt\\first($DB->execQuery($q, new Pagination(0, 1))->data);\r\n\t\tif ($auth !== NULL) {\r\n\t\t\t$initUser->auth = $auth->id;\r\n\t\t}\r\n\r\n\t\t$initUser->admin = TRUE;\r\n\t\t$initUser->last_login = time();\r\n\r\n\t\treturn $initUser;\r\n\t}", "private function loadUser() {\n if (isset(self::$_CONFIG['components']['User'])) {\n //if the custom user component is set\n //then set the user of CT as that user component\n $userType = self::$_CONFIG['components']['User'];\n require BASE_PATH . '/protected/components/' . $userType . '.php';\n session_start();\n if(!isset($_SESSION['user'])){\n $_SESSION['user'] = serialize(new $userType());\n }\n } else {\n //else use CT default User component\n return new CTUser();\n }\n }", "public function getRocksUser() {\n\t\tif( ! $this->token ) {\n\t\t\tthrow new Exception( \"No token\" );\n\t\t}\n\t\ttry {\n\t\t\t$result = $this->callGet( rocksOauth::URL_USERINFO );\n\t\t\tif( $result->{'status'} === \"unauthorized\" ) {\n\t\t\t\tthrow new Exception( $result->{'message'} );\n\t\t\t} else {\n\t\t\t\treturn new ROCKS_USER( $result );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function retrieveUserFromCookie(){\n\t\tif(!Cookie::exists(self::LOGIN_COOKIE_KEY)) return NULL;\n\t\t\n\t\ttry{\n\t\t\tlist($username, $data) = array_pad(explode('|', Encryption::decrypt(base64_decode(Cookie::get(self::LOGIN_COOKIE_KEY))), 2), 2, null);\n\t\t\tlist($id, $security, $userInfo) = array_pad(explode('|', Encryption::decrypt($data), 3), 3, null);\n\t\t\t\n\t\t\t$userInfo = json_decode($userInfo);\n\t\t\t$user = new StdAuthedUser($id, $username, $userInfo);\n\t\t\t\n\t\t\tif($security !== $this->cookieHash($user)){\n\t\t\t\t$user = NULL;\n\t\t\t}\n\t\t} catch(\\Exception $e){\n\t\t\t$user = NULL;\n\t\t}\n\t\t\n\t\treturn $user;\n\t}", "private function loadUser() {\r\n $dbLayer = DBLayer::getInstance();\r\n\r\n $this->userData = null;\r\n\r\n // Load the user details\r\n $data = $dbLayer->executeQuery('users.select_user_by_id', array(':user_id' => $this->userId));\r\n\r\n if ($data) {\r\n $this->userData = $data[0];\r\n }\r\n }", "function loadUSR()\n{\n\t// find user\n\t$usr = User::selectBySessionId();\n\tif(isset($usr))\n\t{\n\t\t// don't send id, password and session to client\n\t\tunset($usr->usr_id);\n\t\tunset($usr->usr_password);\n\t\tunset($usr->usr_sessionid);\n\t\tunset($usr->usr_regip);\n\t\tunset($usr->usr_fbid);\n\t\t\n\t\tConfigManager::getInstance()->logDebug('User '.$usr->toJSON().' loaded');\n\t\treturn $usr->toJSON();\n\t}\n\telse\n\t{\n\t\treturn json_encode('SESSION_ERROR');\n\t}\n}", "public static function load($id)\n {\n $mysqli = new \\mysqli(Config::$db_host, Config::$db_user, Config::$db_pass, Config::$db_name);\n\n $stmt = $mysqli->prepare(\"SELECT id, email, first_name, last_name, password FROM users WHERE id=?\");\n $stmt->bind_param(\"i\", $id);\n $stmt->bind_result($lId, $lEmail, $lFirstName, $lLastName, $lPassword);\n $stmt->execute();\n\n if ($stmt->fetch()) {\n $user = new User($lEmail, $lFirstName, $lLastName, $lPassword);\n $user->id = $lId;\n $user->exists = true;\n $user->loaded_password = $user->password;\n return $user;\n } else {\n return null;\n }\n }", "private function userInfo()\n {\n $method = in_array(Config::get('steam-login.method'), ['api', 'xml']) ? Config::get('steam-login.method') : 'xml';\n\n switch ($method) {\n case 'api':\n $data = json_decode(SteamLogin::curl(sprintf(self::STEAM_PLAYER_API, Config::get('steam-login.api_key'), $this->steamid)));\n $data = isset($data->response->players[0]) ? $data->response->players[0] : [];\n\n $length = count((array) $data);\n\n if ($length > 0) {\n $this->name = $data->personaname;\n $this->realName = !empty($data->realname) ? $data->realname : null;\n $this->playerState = $data->personastate != 0 ? 'Online' : 'Offline';\n $this->privacyState = ($data->communityvisibilitystate == 1 || $data->communityvisibilitystate == 2) ? 'Private' : 'Public';\n $this->stateMessage = isset(self::$personastates[$data->personastate]) ? self::$personastates[$data->personastate] : $data->personastate;\n $this->visibilityState = $data->communityvisibilitystate;\n $this->avatarSmall = $data->avatar;\n $this->avatarMedium = $data->avatarmedium;\n $this->avatarLarge = $data->avatarfull;\n $this->joined = isset($data->timecreated) ? $data->timecreated : null;\n }\n break;\n case 'xml':\n $data = simplexml_load_string(SteamLogin::curl(sprintf(self::STEAM_PROFILE.'/?xml=1', $this->steamid)), 'SimpleXMLElement', LIBXML_NOCDATA);\n\n if ($data !== false && !isset($data->error)) {\n $this->name = (string) $data->steamID;\n $this->realName = !empty($data->realName) ? $data->realName : null;\n $this->playerState = ucfirst($data->onlineState);\n $this->privacyState = ($data->privacyState == 'friendsonly' || $data->privacyState == 'private') ? 'Private' : 'Public';\n $this->stateMessage = (string) $data->stateMessage;\n $this->visibilityState = (int) $data->visibilityState;\n $this->avatarSmall = (string) $data->avatarIcon;\n $this->avatarMedium = (string) $data->avatarMedium;\n $this->avatarLarge = (string) $data->avatarFull;\n $this->joined = isset($data->memberSince) ? strtotime($data->memberSince) : null;\n } else {\n if (env('APP_DEBUG')) {\n throw new Exception('No XML data: '.(isset($data['error']) ? $data['error'] : 'please look into this'));\n }\n }\n break;\n default:\n break;\n }\n }", "protected function _populateUserObject($userData) {\n\n if (!empty($userData)) {\n $user = new Model_Core_Agent_User();\n\n $email = new Model_Core_EmailAddress();\n $email->emailAddress = $userData->email;\n\n $copyMailTo = new Model_Core_EmailAddress();\n $copyMailTo->emailAddress = $userData->copymailto;\n\n $user->name = $userData->realname;\n $user->id = $userData->agentid;\n $user->agentSchemeNumber = $userData->agentschemeno;\n $user->username = $userData->username;\n $user->password = $userData->password;\n // TODO: Shouldn't be hardcoded nor '' (none) in future:\n $user->passwordEncryptionScheme = '';\n $user->passwordEncryptionSalt = '';\n $user->email = $email;\n $user->copyMailTo = $copyMailTo;\n $user->lastLoginDate = ($userData->LASTLOGINDATE != '0000-00-00') ? new Zend_Date($userData->LASTLOGINDATE) : new Zend_Date();\n $user->role = $this->_translateRoleFromLegacyDb($userData->level);\n $user->resources = $this->_translateResourcesFromLegacyDb($userData);\n $user->enableExternalNews = ($userData->enableExternalNews == 'yes') ? true : false;\n $user->securityQuestionId = $userData->agentSecurityQuestionID;\n $user->securityAnswer = $userData->agentSecurityQuestionAnswer;\n $user->status = $this->_translateStatusFromLegacyDb($userData->STATUS);\n\n $returnVal = $user;\n } else {\n $returnVal = null;\n }\n\n return $returnVal;\n }", "function getUserObject($id){\n\t\t$userObject = new User();\n\t\t$data = new FacebookData();\n\t\t$user = $data->getUserJSONArray($id);\n\t\t\n\t\t$id = $user->id;\t\n\t\t$name=$user->name;\t\n\t\t$first_name = $user->first_name;\n\t\t$last_name = $user->last_name;\n\t\t$link = $user->link;\n\t\t\n\t\t$userObject->id = $id;\n\t\t$userObject->name = $name;\n\t\t$userObject->first_name = $first_name;\n\t\t$userObject->last_name = $last_name;\n\t\t$userObject->link = $link;\n\t\t\n\t\treturn $userObject;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion que se encarga de trar los datos almacenados en los premios, en la tabla premios, dichos pemios son solo los que estan disponibles para la obtencion no los que ya tiene dispoinible le usuario para canjearlos
public function obtenerPremios(){ //Se prepara el query $stmt = Conexion::conectar()->prepare("SELECT * FROM premios"); //se ejecuta $stmt->execute(); $r = array(); //Se trane todos los ddatos $r = $stmt->FetchAll(); //y finalmente se pasan al controlador para ponerlos en la vista return $r; }
[ "public function obtenerMisPremios(){\n\n //Se declara un arreglo para recibir todos los datos de la tabla\n $datosMisPremios = array();\n\n //Se llena el arreglo con los datos obtenidos por la funcion del modelo obtenerMisPremios()\n $datosMisPremios = Datos::obtenerMisPremios();\n\n //Se retornan a la vista que es la pagina de \"mis premios\"\n return $datosMisPremios;\n\n }", "public function listarPremios(){\r\n $stmt = $this->db->query(\"select * from Premio, Premio_Entrega_Pincho, Pincho where codigoPremio=Premio_codigoPremio and Pincho_idPincho=idPincho ORDER BY codigoPremio\");\r\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }", "function adicionaPremiacoesCampeonato($premiosUsuario){\n\t\t$this->premiacoesCampeonato[] = $premiosUsuario;\n\t}", "function dameUsuariosFabricaToro(){\n $consultaSql = \"select * from usuarios where activo=1 and id_tipo=1 or id_almacen=2\";\n $this->setConsulta($consultaSql);\n $this->ejecutarConsulta();\n return $this->getResultados();\n }", "public function luzTechoAlumnosEncender( ) {\n $this->techo_alumnos_on = 1;\n $this->actualizarNivelesTecho();\n$this->enviarIntensidadTechoAlumnos();\n $this->enviarEstadoTechoAlumnos();\n// $this->dibujarPantalla();\n }", "public function clearPremios()\n\t{\n\t\t$this->collPremios = null; // important to set this to NULL since that means it is uninitialized\n\t}", "private function setDadosOnu() {\n $this->dados = array_map('strip_tags', $this->dados);\n $this->dados = array_map('strtoupper', $this->dados);\n $this->dados['onu_mac'] = str_replace(':', '', $this->dados['onu_mac']);\n }", "public function cambia_datos_usuario() {\n\t\t$usuario = $this -> ssouva -> login();\n\t\t$datos[\"usuario\"] = $usuario;\n\n\t\t// Cosas de sesiones y si es admin o no\n\t\tif ($this -> admin_model -> es_admin($usuario)>0) {\n\t\t\t$idu = $this -> input -> post(\"idu\");\n\t\t\t$nombre = $this -> input -> post(\"nombre\");\n\t\t\t$apellidos = $this -> input -> post(\"apellidos\");\n\t\t\t$login = $this -> input -> post(\"login\");\n\t\t\t$password = $this -> input -> post(\"password\");\n\t\t\t$direccion = $this -> input -> post(\"direccion\");\n\t\t\t$tlf = $this -> input -> post(\"tlf\");\n\t\t\t$email = $this -> input -> post(\"email\");\n\t\t\t$verificado = $this -> input -> post(\"verificado\");\n\n\t\t\t$this -> usuarios_model -> updatea_user($idu, $nombre, $apellidos, $login, $password, $direccion, $tlf, $email, $verificado);\n\t\t\t// Y recargamos los datos\n\t\t\t$datos[\"denuncias\"] = $this -> comentarios_model -> hay_denuncias();\n\t\t\t$datos[\"usuarios_no\"] = $this -> usuarios_model -> usuarios_no_activados();\n\t\t\t$datos[\"pisos_no\"] = $this -> pisos_model -> mostar_pisos_no_validados();\n\t\t\t$this -> load -> view(\"doc/index\", $datos);\n\t\t}\n\t}", "function PCO_ConsultarColumnas($tabla,$ConexionAlterna=\"\",$MotorAlterno=\"\",$BaseDatosAlterna=\"\")\n\t{\n\t\tglobal $MULTILANG_ErrorTiempoEjecucion;\n\t\t//Determina si se debe usar la conexion global del sistema o una especifica de usuario\n\t\tif($ConexionAlterna==\"\")\n\t\t {\n\t\t\t global $ConexionPDO;\n \t\t\tglobal $MotorBD;\n \t\t\tglobal $BaseDatos;\n\t\t }\n\t\telse\n\t\t {\n\t\t\t $ConexionPDO=$ConexionAlterna;\n \t\t\t$MotorBD=$MotorAlterno;\n \t\t\t$BaseDatos=$BaseDatosAlterna;\n\t\t }\n\n\t\t//Busca los campos dependiendo del motor de BD configurado actualmente\n\t\tif ($MotorBD==\"mysql\" || $MotorBD==\"sqlsrv\" || $MotorBD==\"mssql\" || $MotorBD==\"ibm\" || $MotorBD==\"dblib\" || $MotorBD==\"odbc\" || $MotorBD==\"oracle\" || $MotorBD==\"ifmx\" || $MotorBD==\"fbd\")\n\t\t\t{\n\t\t\t\t$columna=0;\n\t\t\t\t$resultado=PCO_EjecutarSQL(\"DESCRIBE $tabla \",\"\",$ConexionPDO,1);\n\t\t\t\t//echo $resultado;\n\t\t\t\t//Evalua si se retorno 1 (error) por la funcion para saber si sigue o no\n\t\t\t\t//if($resultado!=\"1\")\n\t\t\t\t\t{\n\t\t\t\t\t\twhile($registro = $resultado->fetch())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nombre\"] = $registro[\"Field\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"tipo\"] = $registro[\"Type\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nulo\"] = $registro[\"Null\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"llave\"] = $registro[\"Key\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"predefinido\"] = $registro[\"Default\"];\n\t\t\t\t\t\t\t\t$columnas[$columna][\"extras\"] = $registro[\"Extra\"];\n\t\t\t\t\t\t\t\t$columna++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t/*else\n\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nombre\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"tipo\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nulo\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"llave\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"predefinido\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columnas[$columna][\"extras\"] = \"ERROR: Tabla no conectada\";\n\t\t\t\t\t\t\t\t$columna++;\n\t\t\t\t\t}*/\n\t\t\t}\n\n\t\tif ($MotorBD==\"pgsql\")\n\t\t\t{\n\t\t\t\t$columna=0;\n\t\t\t\t$resultado=PCO_EjecutarSQL(\"SELECT * from INFORMATION_SCHEMA.COLUMNS where table_name = ? \",\"$tabla\",$ConexionPDO,1);\n\t\t\t\twhile($registro = $resultado->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\t$columnas[$columna][\"nombre\"] = $registro[\"column_name\"];\n\t\t\t\t\t\t$columnas[$columna][\"tipo\"] = $registro[\"data_type\"];\n\t\t\t\t\t\t$columnas[$columna][\"nulo\"] = $registro[\"is_nullable\"];\n\t\t\t\t\t\t$columnas[$columna][\"llave\"] = \"\";\n\t\t\t\t\t\t$columnas[$columna][\"predefinido\"] = $registro[\"column_default\"];\n\t\t\t\t\t\t$columnas[$columna][\"extras\"] = $registro[\"udt_name\"];\n\t\t\t\t\t\t$columna++;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\tif ($MotorBD==\"sqlite\")\n\t\t\t{\n\t\t\t\t$columna=0;\n\t\t\t\t$resultado=PCO_EjecutarSQL(\"SELECT * FROM sqlite_master WHERE type='table' AND name=? \",\"$tabla\",$ConexionPDO,1);\n\t\t\t\t$registro = $resultado->fetch();\n\t\t\t\t//Toma los campos encontrados en el SQL de la tabla, los separa y los depura para devolver valores\n\t\t\t\t$campos=explode(\",\",$registro[\"sql\"]);\n\t\t\t\tfor($i=0;$i<count($campos);$i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$campos[$i]=trim($campos[$i]); // Elimina espacios al comienzo y final\n\t\t\t\t\t\t$campos[$i]=str_replace(\" \",\" \",$campos[$i]); //Elimina espacios dobles\n\t\t\t\t\t\tif ($i==0) $campos[$i]=str_replace(\"CREATE TABLE $tabla (\",\"\",$campos[$i]); //Elimina instruccion create del primer campo\n\t\t\t\t\t\tif ($i==count($campos)-1) $campos[$i]=str_replace(\"))\",\")\",$campos[$i]); //Elimina ultimos parentesis\n\t\t\t\t\t\t//echo $i.\" valor:\".$campos[$i].\"<hr>\"; // Usado para depuracion en tiempo de desarrollo\n\t\t\t\t\t\t$analisis_campo=explode(\" \",$campos[$i]);\n\t\t\t\t\t\t$columnas[$columna][\"nombre\"] = $analisis_campo[0];\n\t\t\t\t\t\t$columnas[$columna][\"tipo\"] = $analisis_campo[1];\n\t\t\t\t\t\t$palabra_siguiente=2;\n\t\t\t\t\t\tif (trim(strtoupper($analisis_campo[$palabra_siguiente]))==\"PRIMARY\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"llave\"] = $analisis_campo[$palabra_siguiente];\n\t\t\t\t\t\t\t\t$palabra_siguiente+=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (trim(strtoupper($analisis_campo[$palabra_siguiente]))==\"NOT\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"nulo\"] = $analisis_campo[$palabra_siguiente].\" \".$analisis_campo[$palabra_siguiente+1];\n\t\t\t\t\t\t\t\t$palabra_siguiente+=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tif (trim(strtoupper($analisis_campo[$palabra_siguiente]))==\"DEFAULT\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$columnas[$columna][\"predefinido\"] = $analisis_campo[$palabra_siguiente+1];\n\t\t\t\t\t\t\t\t$palabra_siguiente+=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$columnas[$columna][\"extras\"] = $registro[\"\"];\n\t\t\t\t\t\t$columna++;\n\t\t\t\t\t}\n\t\t\t}\n\n\n\t\t//Retorna el arreglo asociativo\n\t\treturn $columnas;\n\n\n\t\t/*//Forma 1 (General solo nombres)\n\t\t$resultado=PCO_EjecutarSQL(\"SELECT * FROM \".$tabla);\n\t\t$columnas = array();\n\t\tforeach($resultado->fetch(PDO::FETCH_ASSOC) as $key=>$val)\n\t\t\t{\n\t\t\t\t$columnas[][\"nombre\"] = $key;\n\t\t\t}\n\t\treturn $columnas;*/\n\n\t\t/*//Forma 2\n\t\t$resultado=PCO_EjecutarSQL(\"SELECT * FROM \".$tabla);\n\t\t$columnas = array();\n\t\tfor ($i = 0; $i < $resultado->columnCount(); $i++)\n\t\t\t{\n\t\t\t\t$col = $resultado->getColumnMeta($i);\n\t\t\t\t$columnas[] = $col['name'];\n\t\t\t}\n\t\treturn $columnas;*/\n\t}", "protected function imprimirCabecera()\n {\n $this->tabla->setHeaderContents(0, 0, 'Fecha');\n $this->tabla->setHeaderContents(0, 1, 'Descripción');\n $this->tabla->setHeaderContents(0, 2, 'Acción');\n $this->tabla->setRowAttributes(0, $this->clase, false);\n }", "function colunasTabela($codigo_estat_conexao,$nome_esquema,$nome_tabela,$tipo=\"\",$tipotratamento=\"=\"){\n $colunas = array();\n $res = $this->execSQLDB($codigo_estat_conexao,\"SELECT column_name as coluna,udt_name, data_type FROM information_schema.columns where table_schema = '$nome_esquema' and table_name = '$nome_tabela'\");\n if($tipo != \"\"){\n $res = $this->execSQLDB($codigo_estat_conexao,\"SELECT column_name as coluna,udt_name, data_type FROM information_schema.columns where table_schema = '$nome_esquema' and udt_name $tipotratamento '$tipo' and table_name = '$nome_tabela'\");\n }\n foreach($res as $c){\n $colunas[] = $c[\"coluna\"];\n }\n return $colunas;\n }", "public static function setUsuarios(){\n\t\t$conn = new Read;\n\t\t$conn->ExeRead('usuarios');\n\t\t$conn->getRowCount();\n\t\t$dado=$conn->getRowCount();\n\t\treturn $dado;\n\t}", "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $imagen = $this->Imagenes($this->PrimaryKey,12);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = \"SELECT L.clientetercerizado,\".$imagen.\",L.nombre,\".$editar.\",\".$eliminar.\" FROM \".$this->Table.\" L where estado='A'\";\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 5, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "public static function amigosConectados() {\n global $sql, $sesion_usuarioSesion, $textos, $configuracion;\n\n $tablas = array(\n \"c\" => \"contactos\",\n \"uc\" => \"usuarios_conectados\",\n \"u\" => \"usuarios\",\n \"p\" => \"personas\",\n \"i\" => \"imagenes\"\n );\n\n $columnas = array(\n \"id_contacto1\" => \"c.id_usuario_solicitante\",\n \"id_contacto2\" => \"c.id_usuario_solicitado\",\n \"estado\" => \"c.estado\",\n \"id_usuario\" => \"uc.id_usuario\",\n \"visible\" => \"uc.visible\",\n \"sobrenombre\" => \"u.sobrenombre\",\n \"usuario\" => \"u.usuario\",\n \"imagen\" => \"i.ruta\"\n );\n\n $condicion = \"(c.id_usuario_solicitante = \" . $sesion_usuarioSesion->id . \" AND c.id_usuario_solicitado = uc.id_usuario AND c.estado = '1' AND uc.id_usuario = u.id AND u.id_persona = p.id AND p.id_imagen = i.id AND uc.visible = '1') OR (c.id_usuario_solicitado = \" . $sesion_usuarioSesion->id . \" AND c.id_usuario_solicitante = uc.id_usuario AND c.estado = '1' AND uc.id_usuario = u.id AND u.id_persona = p.id AND p.id_imagen = i.id AND uc.visible = '1')\";\n\n //$sql->depurar = true;\n $consulta = $sql->seleccionar($tablas, $columnas, $condicion);\n if ($sql->filasDevueltas) {\n while ($contacto = $sql->filaEnObjeto($consulta)) {\n $contacto->foto = $configuracion[\"SERVIDOR\"][\"media\"] . $configuracion[\"RUTAS\"][\"imagenesMiniaturas\"] . \"/\" . $contacto->imagen;\n $lista[] = $contacto;\n }\n\n foreach ($lista as $elemento) {\n $item = HTML::enlace(HTML::imagen($elemento->foto, \"flotanteIzquierda margenDerecha miniaturaListaChat\"), '/users/' . $elemento->usuario);\n $opciones = array(\"onClick\" => \"javascript:chatWith('\" . $elemento->usuario . \"')\");\n $item .= HTML::enlace(HTML::frase($elemento->sobrenombre, \"claseUsuariosConectados margenSuperior\", \"usuarioChat_\" . $elemento->usuario), \"javascript:void(0)\", 'margenSuperior', \"\", $opciones);\n $listaContactos[] = $item;\n }\n\n $listaContactos = HTML::lista($listaContactos, \"listaVertical listaConIconos bordeSuperiorLista\", \"\", \"\");\n $codigo = HTML::contenedor($listaContactos, \"contenedorChat\");\n\n return $codigo;\n } else {\n return $textos->id(\"NO_HAY_CONTACTOS_CONECTADOS\");\n }\n }", "function todosCreditos($cambio){\n\t$conexion=conectarse();\n\t// Estado del credito seleccionado\n\t$estado=str_replace(\"where Estado=\",\"\", $cambio);\n\n\t// Consulta para ejecutarla en la base de datos\n\t$consulta=\"SELECT t1.id_credito,t2.Nombre,t1.Fecha_limite, t1.FechaPagado, t1.Monto, t1.Estado ,t1.doc_credito FROM `tblcredito` as t1 \n\t\t\t\tinner join tbltipocredito as t2 on t1.id_tipoCredito=t2.id_tipoCredito\n\t\t\t\t$cambio\n\t\t\t\torder by Fecha_limite desc\";\n //Ejecutar consulta\n\t$ejecutar_consulta= $conexion->query(utf8_decode($consulta));\n\n\t//Colocar valor por default para la fila\n\t$fila=\"<tr>\";\n\n\t//Obtener todos los datos generados por la consulta\n\n\twhile ($registro = $ejecutar_consulta-> fetch_assoc()) {\n\t\t$fechaLimite=date(\"d/m/Y\", strtotime($registro[\"Fecha_limite\"]));\n\t\t$fechaPago=($registro[\"FechaPagado\"]!=\"\")?date(\"d/m/Y\", strtotime($registro[\"FechaPagado\"])): \"\";\n\t\t$Doc=($registro[\"doc_credito\"]!=\"\")? \"<a href=\\\"\".$registro[\"doc_credito\"].\"\\\" target=\\\"_blank\\\" >Doc</a>\" : \"\";\n\t\t// Validar la fila para aplicar estilos\n\t\tif($fila==\"<tr>\"){\n\t\t\t// Mostrar fila en la tabla\n\t\techo $fila;\n\t\t$fila=\"<tr class=\\\"fila2\\\">\";\n\t\t}else{\t\n\t\techo $fila;\n\t\t$fila=\"<tr>\";\n\t\t}\n\n\t\t//Verificar el estado para aplicarle un link, solo si el credito esta por pagar o vencido.\n\t\tif($estado==\"'por pagar'\" or $estado==\"'vencido'\")\n\t\t$link=\" <td><a href=\\\"?ac=ConfirmarPago&id=\".$registro[\"id_credito\"].\"\\\">\".$registro[\"Nombre\"].\"</a></td>\";\n\t\telse\n\t\t$link=\"<td>\".$registro[\"Nombre\"].\"</td>\";\n\n\t\t//Mostrar toda la tabla\n\t\techo $link.\n \"<td>\".$fechaLimite.\"</td>\n <td>\".$fechaPago.\"</td>\n <td>\".$registro[\"Monto\"].\"</td>\n <td>\".$registro[\"Estado\"].\"</td>\n <td>\".$Doc.\"</td>\n </tr>\";\n\t}\n\t$conexion->close();\n}", "public function luzTechoAlumnosApagar( ) {\n $this->techo_alumnos_on = 0;\n $this->actualizarNivelesTecho();\n$this->enviarIntensidadTechoAlumnos();\n $this->enviarEstadoTechoAlumnos();\n// $this->dibujarPantalla();\n }", "public function privilegiosTabla($usuario=null)\n\t{\n\t\t\tif(is_null($usuario))\n\t\t\t{\n\t\t\t\t$usuario=$this->usuariodb;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$usuario='0x'.bin2hex($usuario);\n\t\t\t}\n\n\n\n\t\t\t$privTab=array();\n\t\t\t$link = $this->prepararLink($this->linkYcolumnas);\t\t\t\n\t\t\t$link= $link[0].$this->filtroForWaf('UnHEx(HeX((select/**/CoNCaT(0x2a7c3e,count(*),0x3c7c2a)/**/from/**/(select/**/table_schema/**/from/**/information_schema.schema_privileges/**/where/**/grantee='.$usuario.'/**/group/**/by/**/table_schema)/**/as/**/alias)))').$link[1];\n\n\t\t\t$this->curl($link,null,0,null,0);\n\n\n\n\t\t\tif(preg_match('#\\*\\|\\>(.*?)\\<\\|\\*#', $this->exe_curl(),$columna))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$colum=$columna[1];\n\n\t\t\t\tfor ($i=0; $i < $colum ; $i++)\n\t\t\t\t{\n\t\t\t\t\t$link = $this->prepararLink($this->linkYcolumnas);\n\t\t\t\t\t $link= $link[0].$this->filtroForWaf('UnHEx(HeX((select/**/CoNCaT(0x2a7c3e,table_schema,0x2d,group_CoNCaT(privilege_type),0x3c7c2a)/**/from/**/information_schema.schema_privileges/**/where/**/grantee='.$usuario.'/**/group/**/by/**/table_schema/**/limit/**/'.$i.',1)))').$link[1];\n\t\t\t\t\t \n\t\t\t\t\t$this->curl($link,null,0,null,0);\n\n\t\t\t\t\tif(preg_match('#\\*\\|\\>(.*?)\\<\\|\\*#', $this->exe_curl(),$columna))\n\t\t\t\t\t{\n\t\t\t\t\t\t$privTab[]=explode(\"-\", $columna[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\n\t\t\treturn $privTab;\n\n\t}", "function PCO_CamposRealesInforme($informe)\n\t{\n\t\tglobal $ConexionPDO,$ArchivoCORE,$TablasCore;\n\t\tglobal $ListaCamposSinID_informe,$ListaCamposSinID_informe_campos,$ListaCamposSinID_informe_tablas;\n\n\t\t// Busca datos del informe\n if ($informe!=\"\")\n {\n \t\t$consulta_informe=PCO_EjecutarSQL(\"SELECT id,\".$ListaCamposSinID_informe.\" FROM \".$TablasCore.\"informe WHERE id=? \",\"$informe\");\n \t\t$registro_informe=$consulta_informe->fetch();\n\n \t\tif ($registro_informe[\"conexion_origen_datos\"]!=\"\")\n \t\t global ${$registro_informe[\"conexion_origen_datos\"]};\n }\n\n\t\t\t//Busca los CAMPOS definidos para el informe y sus TABLAS correspondientes\n\t\t\t$ListaCampos_NombreCompleto=array();\t//Nombre completo del campo\n\t\t\t$ListaCampos_NombreSimple=array();\t\t//Lado izquierdo solamente cuando se cuenta con Alias\n\t\t\t$ListaTablas_NombreSimple=array();\t\t//Nombre de la tabla de donde sale el campo\n\t\t\t$ListaCampos_PermitirEdicion=array();\t//Guarda los estados de edicion en linea para el campo\n\t\t\t$consulta_campos=PCO_EjecutarSQL(\"SELECT id,\".$ListaCamposSinID_informe_campos.\" FROM \".$TablasCore.\"informe_campos WHERE informe=? ORDER BY peso,id\",\"$informe\");\n\t\t\twhile ($registro_campos = $consulta_campos->fetch())\n\t\t\t\t{\n\t\t\t\t\t//Si tiene alias definido lo agrega\n\t\t\t\t\t$posfijo_campo=\"\";\n\t\t\t\t\tif ($registro_campos[\"valor_alias\"]!=\"\") $posfijo_campo=\" as \".$registro_campos[\"valor_alias\"];\n\t\t\t\t\t$nombre_campo=$registro_campos[\"valor_campo\"].$posfijo_campo;\n\n\t\t\t\t\t//Agrega el campo a la lista de nombres completos\n\t\t\t\t\t$ListaCampos_NombreCompleto[]=$nombre_campo;\n\n\t\t\t\t\t//Agrega el estado de edicion o no para el campo\n\t\t\t\t\t$ListaCampos_PermitirEdicion[]=$registro_campos[\"editable\"];\n\n\t\t\t\t\t//Establece el nombre del campo simple (el real en base de datos)\n\t\t\t\t\t\t//Elimina la posibilidad de un alias \" as \" tomando la primera parte solamente\n\t\t\t\t\t\t$PartesListaCampos_NombreCompleto=explode(\" as \",$nombre_campo);\n\t\t\t\t\t\t$nombre_campo_simple=$PartesListaCampos_NombreCompleto[0];\n\t\t\t\t\t\t//Elimina la posibilidad de un punto \" . \" indicando la tabla\n\t\t\t\t\t\tif (strpos($nombre_campo_simple,\".\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$PartesListaCampos_NombreCompleto=explode(\".\",$nombre_campo_simple);\n\t\t\t\t\t\t\t\t$nombre_campo_simple=$PartesListaCampos_NombreCompleto[1];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t//Agrega el campo a la lista de nombres simples\n\t\t\t\t\t$ListaCampos_NombreSimple[]=$nombre_campo_simple;\n\n\t\t\t\t\t//Determina la tabla a la que pertenece el campo\n\t\t\t\t\t//Se verifica inicialmente si el campo ya indica la tabla para evitar ambiguedades en consultas de varias tablas\n\t\t\t\t\t$PartesListaCampos_NombreCompleto=explode(\" as \",$nombre_campo);\n\t\t\t\t\t$nombre_campo_simple=$PartesListaCampos_NombreCompleto[0];\n\t\t\t\t\t//Si el campo tiene puntos indica la tabla, sino la buscamos\n\t\t\t\t\tif (strpos($nombre_campo_simple,\".\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$PartesListaCampos_NombreCompleto=explode(\".\",$nombre_campo_simple);\n\t\t\t\t\t\t\t$nombre_tabla_simple=$PartesListaCampos_NombreCompleto[0];\n\t\t\t\t\t\t\t$ListaTablas_NombreSimple[]=$nombre_tabla_simple;\n\t\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$nombre_tabla_simple=\"\";\n\t\t\t\t\t\t\t//Busca en las TABLAS definidas para el informe\n\t\t\t\t\t\t\t$consulta_tablas=PCO_EjecutarSQL(\"SELECT id,\".$ListaCamposSinID_informe_tablas.\" FROM \".$TablasCore.\"informe_tablas WHERE informe=? \",\"$informe\");\n\t\t\t\t\t\t\twhile ($registro_tablas = $consulta_tablas->fetch())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tabla_actual=$registro_tablas[\"valor_tabla\"];\n\t\t\t\t\t\t\t\t\t//Si la tabla tiene alias lo ignora\n\t\t\t\t\t\t\t\t\tif (strpos($tabla_actual,\" as \"))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$PartesTablaActual=explode(\" as \",$tabla_actual);\n\t\t\t\t\t\t\t\t\t\t\t$tabla_actual=$PartesTablaActual[0];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//Si no se ha encontrado la tabla entra a comparar frente a la actual\n\t\t\t\t\t\t\t\t\tif ($nombre_tabla_simple==\"\")\n\t\t\t\t\t\t\t\t\t\t{\n //Si el informe usa una conexion externa usa su configuracion\n if($registro_informe[\"conexion_origen_datos\"]!=\"\")\n {\n \t\t\t\t\t\tif (@PCO_ExisteCampoTabla($nombre_campo_simple,$tabla_actual,${$registro_informe[\"conexion_origen_datos\"]},$registro_informe[\"motorbd\"],$registro_informe[\"basedatos\"]))\n \t\t\t\t\t\t\t$nombre_tabla_simple=$tabla_actual;\n }\n else\n {\n \t\t\t\t\t\tif (PCO_ExisteCampoTabla($nombre_campo_simple,$tabla_actual))\n \t\t\t\t\t\t\t$nombre_tabla_simple=$tabla_actual;\n }\n\t\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$ListaTablas_NombreSimple[]=$nombre_tabla_simple;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t@$Resultados[]=array(\"ListaCampos_NombreCompleto\" => $ListaCampos_NombreCompleto, \"ListaCampos_NombreSimple\"=>$ListaCampos_NombreSimple\t,\"ListaTablas_NombreSimple\" => $ListaTablas_NombreSimple, \"ListaCampos_PermitirEdicion\" => $ListaCampos_PermitirEdicion);\n\t\treturn $Resultados;\n\t}", "function bajarReputacionUsuario($matricula){\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor which will instantiate a new object pulled from database given a User ID If user does not exist in database, creates returns a template User object with UserID as given id and rest of attributes the default blank values Takes User ID and a database Connection object
public static function createFromID($conn, $userID) { // set static database connection $dbc = $conn->getdbc(); // sql to pull data if it exists $sql_getUserFromdb = "SELECT * FROM users where userID = '$userID'"; // if query is able to be run if ($result = $dbc->query($sql_getUserFromdb)) { // sql to count number of results $sql_count = "SELECT COUNT(*) FROM users where userID = '$userID'"; $resultCount = $dbc->query($sql_count); $number_of_rows = $resultCount->fetchColumn(); //return $number_of_rows; if ($number_of_rows == 1) { $row = $result->fetch(); $instance = new self($conn); $instance->setUserID($row['userID']); $instance->setFirstName($row['firstname']); $instance->setLastName($row['lastname']); $instance->setEmail($row['email']); $instance->setTitle($row['title']); $instance->setPassword($row['password']); return $instance; // if no results AKA no user in database with that UserID, create new blank user object with input userID and default blank attributes } else { $instance = new self($conn); $instance->setUserID($userID); return $instance; } } }
[ "static function create() {\n $numargs = func_num_args();\n if($numargs < 3 || $numargs > 7) return false;\n $args = func_get_args();\n\n $u = new User;\n\n // required values\n $u->id = (integer) $args[0];\n $u->firstName = (string) $args[1];\n $u->lastName = (string) $args[2];\n\n // not required values\n $u->email = isset($args[3]) ? $args[3] : '';\n $u->department = isset($args[4]) ? $args[4] : '';\n $u->contact = isset($args[5]) ? $args[5] : '';\n $u->isAdmin = isset($args[6]) ? $args[6] : false;\n\n return $u;\n }", "function __construct($parms = null)\n {\n global $debug;\n global $warn;\n global $msg;\n global $connection;\n global $userid;\n\n if (self::$hashsalt == '')\n {\n global $dsn;\n if (isset($dsn) && isset($dsn['hashsalt']))\n self::$hashsalt = $dsn['hashsalt'];\n }\n $needInsert = true;\n\n if (is_null($connection))\n throw new Exception(\"User::__construct: connection is null\");\n\n // support old-style index parameter\n if (is_string($parms))\n {\n if ($parms == 'new')\n $parms = array('id' => 0);\n else\n $parms = array('username' => $parms);\n }\n else\n if ((is_int($parms) || ctype_digit($parms)) && $parms >= 0)\n $parms = array('id' => $parms);\n else\n if (is_null($parms))\n $parms = array('id' => 0);\n\n if ($debug)\n $warn .= \"<p>User::__construct(\" . print_r($parms, true) .\n \")</p>\\n\";\n\n if (is_array($parms))\n { // associative array\n if (count($parms) >= count(self::$initRow))\n { // complete row from database\n $dbrow = $parms;\n $needInsert = false;\n } // complete row from datase\n else\n { // key and optional other parms\n $dbrow = self::$initRow;\n $keyname = null;\n $sqlparms = array();\n foreach($parms as $name => $value)\n { // search for unique key field\n $fieldLc = strtolower($name);\n if (array_key_exists($fieldLc, self::$translate))\n $fieldLc = self::$translate[$fieldLc];\n switch($fieldLc)\n { // act on specific parameter\n case 'id':\n { // record index\n if (is_string($value))\n { // look for an integer in the value\n $result = preg_match('/\\d+/',\n $value,\n $matches);\n if ($result == 1)\n $value = $matches[0];\n else\n { // invalid value\n $this->msg .= \"User::__construct: \" .\n \"parameter error: ID='$value'\";\n $value = 0;\n } // invalid value\n } // look for an integer in the value\n $keyname = 'id';\n $sqlParms['id'] = $value;\n break 2; // exit loop\n } // record index\n\n case 'username':\n {\n $keyname = 'username';\n $sqlParms['id'] = trim($value);\n break 2; // exit loop\n } // user name\n\n case 'email':\n {\n $keyname = 'email';\n $sqlParms['id'] = trim($value);\n break 2; // exit loop\n } // email address\n\n case 'persistence':\n {\n $keyname = 'persistence';\n $sqlParms['id'] = trim($value);\n break 2; // exit loop\n } // session persistence identifier\n } // switch on field name\n } // search for unique key field\n\n if (!is_null($keyname))\n { // found a unique keyfield\n // construct the query of the user table\n $query = \"SELECT * FROM Users WHERE $keyname=:id\";\n\n // query the database\n $stmt = $connection->prepare($query);\n $queryText = debugPrepQuery($query, $sqlParms);\n if ($stmt->execute($sqlParms))\n { // success\n if ($debug)\n $warn .= \"<p>User::__construct: \" . __LINE__ .\n \" $queryText</p>\";\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n if (is_array($result))\n { // found matching record\n $dbrow = $result;\n parent::__construct($dbrow,\n 'Users');\n $needInsert = false;\n } // found matching record\n else\n { // no matching record\n $dbrow = self::$initRow;\n if ($keyname != null)\n $dbrow[$keyname] = $sqlParms['id'];\n $needInsert = true;\n } // no matching record\n } // success\n else\n { // error performing query\n $this->msg .= \"User::__construct: \" .\n \"SQL error: query='$queryText', error '\" .\n print_r($stmt->errorInfo(),true).\"'\";\n } // error performing query\n } // found a unique keyfield\n\n // check for initialization of fields\n $parmString = '';\n foreach($parms as $name => $value)\n { // loop through all parameters\n $parmString .= \"$name='$value',\";\n $fieldLc = strtolower($name);\n if (is_string($value))\n $value = trim($value);\n switch($fieldLc)\n { // act on specific parameter\n case 'id':\n { // record index: already handled\n break;\n } // record index\n\n case 'username':\n {\n break;\n } // user name\n\n case 'email':\n { // email address\n break;\n } // email address\n\n case 'persistence':\n { // set only through chkPassword\n break;\n } // set only through chkPassword\n\n case 'password':\n { // interpret as external text password\n $dbrow['password'] = null;\n $hash =\n hash('sha512', trim($value) . self::$hashsalt);\n if ($needInsert)\n { // creating new instance\n $sha = $hash;\n $dbrow['shapassword'] = $sha;\n } // creating new instance\n else\n { // password must match existing\n $sha = $dbrow['shapassword'];\n if (strlen($sha) == 0)\n {\n $sha = $hash;\n $dbrow['shapassword'] = $sha;\n }\n } // password must match existing\n break;\n } // interpret as external text password\n\n case 'cellphone':\n { // initialize string field\n $dbrow[$fieldLc] = $value;\n break;\n } // initialize string field\n\n case 'options':\n case 'confirmid':\n { // initialize integer fields\n $dbrow[$fieldLc] = intval($value);\n break;\n } // initialize integer fields\n\n case 'auth':\n { // initialize authorization string\n $value = strtolower($value);\n $dbrow[$fieldLc] = $value;\n if ($value == 'pending')\n $dbrow['confirmid'] = time();\n else\n $dbrow['confirmid'] = null;\n break;\n } // initialize authorization string\n\n case 'usemail':\n { // initialize pseudo field\n if (is_int($value))\n {\n if ($value)\n $value = $dbrow['options'] |\n OPT_USEMAIL_ON;\n $dbrow['options'] = $value;\n } // update existing record\n break;\n } // initialize pseudo field\n\n case 'shapassword':\n { // set only through setPassword\n break;\n } // set only through setPassword\n\n } // act on specific parameter\n } // loop through all parameters\n\n if ($needInsert)\n { // ensure both email and username set\n if ($dbrow['email'] == '')\n if (filter_var($dbrow['username'], FILTER_VALIDATE_EMAIL))\n $dbrow['email'] = $dbrow['username'];\n if ($dbrow['username'] == '')\n $dbrow['username'] = $dbrow['email'];\n } // ensure both email and username set\n } // key and optional other parms\n } // associative array\n else\n { // unexpected parameter type\n throw new Exception('User::__construct: called with ' .\n gettype($parms));\n } // unexpected parameter type\n\n // invoke constructor of base class\n if ($needInsert)\n {\n if ($dbrow['auth'] == 'pending')\n $dbrow['confirmid'] = time();\n // check for duplicate email\n $query = \"SELECT * FROM Users WHERE `EMail`=:email\";\n $sqlParms = array('email' => $dbrow['email']);\n $stmt = $connection->prepare($query);\n $queryText = debugPrepQuery($query, $sqlParms);\n if ($stmt->execute($sqlParms))\n { // success\n if ($debug)\n $warn .= \"<p>User::__construct: \" . __LINE__ .\n \" $queryText</p>\";\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n if (is_array($result))\n { // found matching record\n $this->msg .= \"New email value '$value' duplicates an existing user \" . $result['username'] . '. ';\n } // found matching record\n } // success\n else\n $warn .= \"<p>User::__construct: \" . __LINE__ .\n \" query='$queryText' failed \" .\n print_r($stmt->errorInfo(), true) . \"</p>\\n\";\n } // inserting\n\n parent::__construct($dbrow,\n 'Users');\n $this->needInsert = $needInsert;\n\n // diagnostic output if debug is set\n $this->dump('User Record constructed:');\n\n // report any errors detected in constructor to user\n $msg .= $this->msg;\n }", "protected function dummyUser()\n\t{\n\t\t$attributes = array(\n\t\t\t'id' => 123,\n\t\t\t'username' => 'chuckles',\n\t\t\t'password' => \\Hash::make('SuperSecret'),\n\t\t\t'name' => 'Dummy User',\n\t\t);\n\t\treturn new GenericUser($attributes);\n\t}", "private function create() {\n\t\t\t$dbh->SPDO::getInstance();\n\t\t\t$stmt = $dbh->prepare( \"insert into user(username, password, \n\t\t\t\tfirstName, lastName, email, picture) values (:username,\n\t\t\t\tsha1(:password), :firstName, :lastName, :picture);\" );\n\t\t\t$stmt->execute( array(\n\t\t\t\t\"username\" => $this->_username,\n\t\t\t\t\"password\" => $this->_password,\n\t\t\t\t\"firstName\" => $this->_firstName,\n\t\t\t\t\"lastName\" => $this->_lastName,\n\t\t\t\t\"picture\" => $this->_picture\n\t\t\t) );\n\t\t\t$stmt->closeCursor();\n\t\t\t$this->_id = $dbh->lastInsertId();\n\t\t}", "protected function dummyUser()\n {\n $attributes = array(\n 'id' => 123,\n 'username' => 'chuckles',\n 'password' => \\Hash::make('SuperSecret'),\n 'name' => 'Dummy User',\n );\n return new GenericUser($attributes);\n }", "public function __construct($uid=0) {\n\t\t# Set Table\n\t\t$this->table\t\t\t\t\t\t\t\t\t\t\t\t\t= \"users\";\n\t\t\n\t\t# Initialize UID from Parameter\n\t\t$this->uid\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $uid;\n\t\tif ($this->uid) {\n\t\t\t$this->load();\n\t\t}\n\t}", "static function create($userid, $password=NULL, $cert=NULL, $key=NULL) {\n\t\tif (!is_null($password)) {\n\t\t\t$hash = hash_password($password);\n\t\t\tlgi_mysql_query(\"INSERT INTO %t(users) SET `name`='%%', `passwd_hash`='%%'\", $userid, $hash);\n\t\t} else {\n\t\t\tlgi_mysql_query(\"INSERT INTO %t(users) SET `name`='%%'\", $userid);\n\t\t}\n\t\t$o = new LGIUser($userid);\n\t\tif ($cert && $key) $o->set_certkey($cert, $key);\n\t\treturn $o;\n\t}", "public function get_object()\r\n {\r\n $user = new StdClass();\r\n\r\n $user->id = NULL;\r\n $user->username = NULL;\r\n $user->email = NULL;\r\n $user->group = NULL;\r\n $user->is_active = 1;\r\n\r\n return $user;\r\n }", "protected function createUser()\n {\n $aResponse = $this->getResponse();\n $oUser = new User;\n if (!$oUser->getCustomerIdByPayoneUserId($aResponse['userid'])) {\n $sCustomerId = \\Context::getContext()->cart->id_customer;\n $oUser->setCustomerId($sCustomerId);\n $oUser->setPayoneUserId($aResponse['userid']);\n $oUser->save();\n }\n }", "public static function createFromUserIdentifier($id): self\n {\n return new self($id);\n }", "private function construct($row){ \n $obj = new user(); napravili smo novu instancu user entiteta\n $obj->userId = $row[\"userId\"]; take the value from the row and assign that value to the entity property \n $obj->username = $row[\"username\"];\n $obj->password = \"\";\n return $obj;\n }", "public static function findOrCreateUser()\n\t{\n\t\t$Session = \\Phalcon\\DI::getDefault()->getSession();\n\t\tif ($Session->has('id'))\n\t\t{\n\t\t\treturn UserModel::findFirst($Session->get('id'));\n\t\t}\n\n\t\t$User = new UserModel();\n\t\t$User->save([\n\t\t\t'sess' => $Session->getId(),\n\t\t 'balance' => 0\n\t\t]);\n\n\t\t$Session->set('id', $User->id);\n\n\t\treturn $User;\n\t}", "protected function _createNewUser()\n\t{\n\t\t$this->_loadUsersTable();\n\t\t$userId = $this->_users->createRow()->save();\n\t\t// Reload the user to get default values set by the storage mechanism.\n\t\t$userInfo = $this->_users->findUser($userId);\n\t\t$this->_setInfo($userInfo);\n\t\tAcl_Factory::addDefaultPrivileges(array(\n\t\t\t\t\t\t\t\t\t\t\tAcl_Db_Table_Privileges::getColumnName('userId') => $userId),\n\t\t\t\t\t\t\t\t\t\t\tself::$_defaultPrivilegeCategories);\n\t\treturn $userId;\n\t}", "function __construct() {\r\n\t\t/* store id of logged in user */\r\n\t\t$this->ID = parent::id();\r\n\t\t/* store the current user meta */\r\n\t\t$this->meta = parent::meta();\r\n\t}", "public static function getUser(int $id = null) {\n\n $CI = get_instance();\n $CI->load->model(\"UserModel\", false);\n\n // Attempt using cache (performance optimization)\n if ($id && $user = XCMS_Cache::get(\"user.\" . $id)) {\n return $user;\n }\n\n $user = new UserModel();\n if (is_null($id) || $user->load($id)) {\n\n XCMS_Cache::set(\"user.\" . $id, $user);\n return $user;\n\n }\n\n return null;\n\n }", "protected function generateUser()\n {\n if (isset($_SESSION['LoggedInUser']))\n {\n if ($_SESSION['LoggedInUser'] === 'master')\n {\n return $this->userAdmin();\n }\n\n return $this->modelFromId('user', $_SESSION['LoggedInUser']);\n }\n\n if (!is_null(self::$hLoginData['user']))\n {\n if (isset($this->hConfig['master']) && !empty($this->hConfig['master']['User']) && self::$hLoginData['user'] === $this->hConfig['master']['User'] && !empty($this->hConfig['master']['Password']) && self::$hLoginData['pass'] === $this->hConfig['master']['Password'])\n {\n $_SESSION['LoggedInUser'] = 'master';\n return $this->userAdmin();\n }\n\n $oUser = $this->userByEmail(self::$hLoginData['user']);\n $oUser->authenticate(self::$hLoginData['pass']);\n $_SESSION['LoggedInUser'] = $oUser->id;\n return $oUser;\n }\n\n return $this->modelFactory('user');\n }", "protected function createUser() {\n\t\t$this->u_key = null;\n\t\t$this->u_key = $this->u_obj->create();\n\t}", "private static function __create($userinfo, SQLiteDB $db) {\n // parse $userinfo into a format able to be fed straight into the database\n $db_userinfo = self::parseUserInfo($userinfo, $db);\n\n // carrier requires cid to be looked up in database\n static $carrier_col = 'cid';\n static $carrier_sql =\n '(SELECT cid FROM carriors WHERE carrior_name=:carrior_name)';\n $carrier_bind = array('carrior_name'=>$userinfo['carrier']);\n\n // build the SQL query to use to create the user\n $create_sql = 'INSERT INTO users (';\n // add column names\n foreach ($db_userinfo as $col=>$value)\n $create_sql .= $col.', ';\n $create_sql .= $carrier_col.', ';\n // remove trailing comma and space\n $create_sql = substr($create_sql, 0, -2);\n // add column values\n $create_sql .= ') VALUES (';\n foreach ($db_userinfo as $col=>$value)\n $create_sql .= ':'.$col.', ';\n $create_sql .= $carrier_sql.', ';\n // remove trailing comma and space\n $create_sql = substr($create_sql, 0, -2);\n $create_sql .= ');';\n\n // prepare the SQL statement\n $create_stmt = $db->pdo->prepare($create_sql);\n\n // bind column values\n foreach (array_merge($db_userinfo, $carrier_bind) as $col=>$value)\n $create_stmt->bindValue(':'.$col, $value);\n \n // execute the SQL statement\n $create_stmt->execute();\n\n // XXX there is probably a better way to do this\n return SQLiteUser::find('username', $userinfo['username'], $db);\n }", "protected function construct($obj) {\n return new Model_RestaurantUser((isset($obj->id_restaurant)) ? $obj->id_restaurant : -1, \n (isset($obj->name_restaurant)) ? $obj->name_restaurant : '', \n (isset($obj->id_user)) ? $obj->id_user : -1, \n (isset($obj->name_user)) ? $obj->name_user : '', \n (isset($obj->is_check)) ? $obj->is_check : -1);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for showTransactionFees Show Transaction Fees.
public function testShowTransactionFees() { // TODO: implement $this->markTestIncomplete('Not implemented'); }
[ "private function fee_list(){\n $results = $this->dt->fee_list();\n echo $results;\n }", "public function getFees()\n {\n return $this->fees;\n }", "public function testTaxableFees()\n {\n $this->app['config']->set('laracart.fees_taxable', true);\n $this->laracart->addFee('test_2', 1, true, ['tax' => 0.07]);\n\n $this->assertEquals(1, $this->laracart->feeSubTotal(false));\n\n $this->assertEquals('0.07', $this->laracart->taxTotal(false));\n }", "public function getFees() {\n return $this->fees;\n }", "public function getFees()\n\t{\n\t\treturn $this->fees;\n\t}", "public function onFeesSet() {\n }", "public function event_get_showfees($e_id)\n\t{\n\t\t$this->format_params(array('e_id' => $e_id));\n\t\treturn $this->call('eventarc.event.getshowfees');\n\t}", "function displayTransactionFromFactory(BlockchainEventFactory $factory ){\n\n //we are going to load display only 25 transaction per factory\n $transactions = $factory->populateLocal(25,0,'DESC'); //limit 25 offset 0 and DESC order (from last to first)\n $tableHTML = '' ;\n $fullLine = '';\n\n foreach ($transactions as $transaction){\n\n /** @var \\CsCannon\\Blockchains\\BlockchainEvent $transaction */\n $lineHtml = buildTd($transaction->getBlockchainName()[0]);\n $lineHtml .= buildTd($transaction->getTxId());\n $lineHtml .= buildTd($transaction->getSourceAddress()->getAddress());\n $lineHtml .= buildTd($transaction->getDestinationAddress()->getAddress());\n $lineHtml .= buildTd($transaction->getBlockchainContract()->getId());\n\n $fullLine .= buildTr($lineHtml);\n\n }\n\n echoHTMLTable($fullLine);\n\n\n }", "public function FinancialStatement() {\n $Sunrise = new Sunrise;\n $FeeDisplay = $Sunrise->Mini('form-areas/custom/FamilyFees', '..', []);\n echo ($FeeDisplay);\n }", "public function testGetMyFeesEstimateForSKU()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getExtraFees();", "public function index()\n\t{\n\t\t$testfees = Testfee::where('clinic_id', Auth::user()->clinic_id)->get();\n\n\t\treturn View::make('testfees.index', compact('testfees'));\n\t}", "public function testGetMyFeesEstimateForASIN()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testAddFee()\n {\n $this->addFee('testFeeOne');\n\n $fee = $this->laracart->getFee('testFeeOne');\n\n $this->assertEquals('$10.00', $fee->getAmount());\n $this->assertEquals(10, $fee->getAmount(false));\n }", "public function show($id)\n\t{\n\t\t$testfee = Testfee::findOrFail($id);\n\n\t\treturn View::make('testfees.show', compact('testfee'));\n\t}", "public function printFee()\n {\n $decimals = log10(1 / Converter::getDenomination($this->currency));\n echo number_format($this->getFee(), $decimals, '.', '') . \"\\n\";\n }", "public function getAdminFees() {\n try {\n $sql = '\n SELECT * \n FROM equipment_fee\n ';\n $results = $this->conn->query($sql);\n\n $fees = array();\n foreach ($results as $row) {\n $fee = self::ExtractEquipmentFeeFromRow($row, true);\n $fees[] = $fee;\n }\n \n return $fees;\n } catch (\\Exception $e) {\n $this->logger->error(\"Failed to get fees for admin: \" . $e->getMessage());\n return false;\n }\n }", "public function getFeeData()\n {\n $fees = $this->getMultifees();\n // \"Select Fee\" block should be displayed only if there was a hidden fees inside\n $availableFeeCount = $fees->count(AbstractCollection::COUNT_HIDDEN_FEE);\n\n $fee = $this->checkoutSession->getQuote()->getMageworxProductFee();\n $feeFormatted = strip_tags($this->priceCurrency->convertAndFormat($fee));\n $details = $this->helperFee->getQuoteDetailsMultifees();\n\n $result = [];\n $result['is_enable'] = $this->getIsEnable() ? (bool)$availableFeeCount : false;\n $result['is_display_title'] = ($result['is_enable'] == false) ? false : $this->getIsDisplayTitle();\n $result['fee'] = $feeFormatted;\n $result['url'] = $this->getUrl('multifees/checkout/productFee');\n $result['is_valid'] = !isset($details['is_valid']) ? true : $details['is_valid'];\n $result['applyOnClick'] = $this->helperData->isApplyOnClick();\n\n return $result;\n }", "public function fees_list()\n {\n $query = $this->db->order_by('low', 'ASC')->get('fees');\n return ($query->num_rows() > 0) ? $query->result_array() : FALSE;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for customers to add product in comparison.
public function addCompareProduct() { $productId = request()->get('productId'); $customerId = auth()->guard('customer')->user()->id; $compareProduct = $this->compareProductsRepository->findOneByField([ 'customer_id' => $customerId, 'product_flat_id' => $productId, ]); if (! $compareProduct) { // insert new row $productFlatRepository = app('\Webkul\Product\Models\ProductFlat'); $productFlat = $productFlatRepository ->where('product_id', $productId) ->get() ->first(); if ($productFlat) { $productId = $productFlat->id; $this->compareProductsRepository->create([ 'customer_id' => $customerId, 'product_flat_id' => $productId, ]); } return response()->json([ 'status' => 'success', 'message' => trans('velocity::app.customer.compare.added'), 'label' => trans('velocity::app.shop.general.alert.success'), ], 201); } else { return response()->json([ 'status' => 'success', 'label' => trans('velocity::app.shop.general.alert.success'), 'message' => trans('velocity::app.customer.compare.already_added'), ], 200); } }
[ "public static function addCustomerCompareProduct($id_customer, $id_product)\n\t{\n\t\t return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'compare_product` (`id_product`, `id_customer`, `date_add`, `date_upd`) VALUES ('.(int)($id_product).', '.(int)($id_customer).', NOW(), NOW())');\n\t}", "public function addCompare() {\n\n\t\t$productId = $this->input->post('id');\n\t\t\n\t\t/* Details of product */\n\t\t$details = $this->product->productDetails($productId);\n\n\t\t/* Name of array */\n\t\t$nameSession = 'id-'.$productId;\n\n\t\t/* Remove the other information */\n\t\tunset($details['status']);\n\t\tunset($details['created_at']);\n\t\tunset($details['updated_by']);\n\t\tunset($details['updated_at']);\n\t\t$itemDetails = array( $nameSession => $details );\n\n\t\t$oldSession = $this->session->userdata('compare_components');\n\t\tif ($oldSession) $itemDetails = $oldSession + $itemDetails ;\n\n\t\t/* Save session */\n\t\t$this->session->set_userdata('compare_components' , $itemDetails);\n\n\t\t/* Add product id in session for disabling the 'add to compare' button */\n\t\t$oldIdSession = $this->session->userdata('compareId_components');\n\t\t$oldIdSession != NULL ? array_push( $oldIdSession, $productId) : $oldIdSession = array($productId);\n\t\t\n\t\t/* Save session */\n\t\t$this->session->set_userdata('compareId_components' , $oldIdSession);\n\t}", "public function addOrderProducts() {\n \n }", "public function addProduct()\r\n {\r\n }", "public function addAdditionalProductAfterLogin(Varien_Event_Observer $obs)\n {\n /**\n * Check the validity of this customer for the gift product validity\n */\n \tif(!$this->_isValidForGift()){\n \treturn;\n }\n \n $isActive = Mage::getStoreConfig('posixtech_options/posixtech_ncp/active');\n $configProductID = Mage::getStoreConfig('posixtech_options/posixtech_ncp/product_id');\n \n if($isActive) {\n $cartObj = Mage::getSingleton('checkout/cart');\n if($cartObj->getItemsCount() == 0) {\n return;\n }\n \n $duplicateProductCounter = 0;\n foreach ($cartObj->getItems() as $cartItem) {\n if($configProductID==$cartItem->getProductId()) {\n $duplicateProductCounter++;\n }\n }\n \n if($duplicateProductCounter>=1) {\n return;\n }\n \n $quoteObj = Mage::getSingleton('checkout/session')->getQuote();\n $productModel=Mage::getModel('catalog/product');\n $productObj=$productModel->load($configProductID);\n $params = array();\n if($productObj->getTypeId() == 'simple') {\n $params['qty'] = 1;\n } else {\n $links = Mage::getModel('downloadable/product_type')->getLinks($productObj);\n $linkId = 0;\n foreach ($links as $link) {\n $linkId = $link->getId();\n }\n\n $params['product'] = $configProductID;\n $params['qty'] = 1;\n $params['links'] = array($linkId);\n }\n\n $request = new Varien_Object();\n $request->setData($params);\n \n\t \t$quoteObj->addProduct($productObj , $request);\n $quoteObj->save();\n \n $cartItems = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $duplicateProductCounter = 0;\n foreach ($cartItems as $cartItem) {\n $cartItem = ( $cartItem->getParentItem() ? $cartItem->getParentItem() : $cartItem );\n if($configProductID==$cartItem->getProductId()) {\n $configProductTitle = Mage::getStoreConfig('posixtech_options/posixtech_ncp/product_title');\n $infoRequest = unserialize($cartItem->getOptionByCode('info_buyRequest')->getValue());\n $price = 0;\n $cartItem->setCustomPrice($price);\n $cartItem->setQty(1);\n $cartItem->setOriginalCustomPrice($price);\n $infoRequest['option'] = serialize(array(\n 'label' => 'Free Gift',\n 'value' => $configProductTitle\n ));\t\t\t\t\t\t\n $cartItem->getOptionByCode('info_buyRequest')->setValue(serialize($infoRequest));\n $_options = array(\n 1 => array(\n 'label' => 'Free Gift',\n 'value' => $configProductTitle,\n 'print_value' => $configProductTitle,\n 'option_type' => 'text',\n 'custom_view' => true\n )\n );\n $options = array(\n 'code' => 'additional_options',\n 'value' => serialize($_options)\n );\n $cartItem->addOption($options);\n }\n }\n \n return;\n }\n }", "function basel_add_to_compare_btn() {\n\t\tglobal $product;\n\t\techo '<div class=\"basel-compare-btn product-compare-button\"><a class=\"button\" href=\"' . esc_url( basel_get_compare_page_url() ) . '\" data-added-text=\"' . esc_html__( 'Compare products', 'basel' ) . '\" data-id=\"' . esc_attr( $product->get_id() ) . '\">' . esc_html_x( 'Compare', 'add_button', 'basel' ) . '</a></div>';\n\t}", "public function add_compare()\n\t{\n\n\t\t\t$product_id=$this->input->get(\"product_id\");\n\t\t\t$type=$this->input->get(\"type\");\n\t\t\t$cate_detail = $this->products->get_category_details($product_id);\n\t\t\t$product_cat=$product_cat_name=\"\";\n\t\t\tif(count($cate_detail)){\n\t\t\t\t$product_cat = $cate_detail[0]->category_id;\n\t\t\t\t$product_cat_name = $cate_detail[0]->category_name;\n\t\t\t\t$product_title = $cate_detail[0]->deal_title;\n\t\t\t}\n\n\t\t\t$action=$this->input->get(\"act\");\n\t\t\t$compare_cat = $this->session->get(\"product_compare_cat\");\n\t\t\tempty($compare_cat)?$this->session->set(\"product_compare_cat\",$product_cat):\"\";\n\n\t\t\t$compare_cat = $this->session->get(\"product_compare_cat\");\n\t\t\tif($compare_cat==$product_cat){\n\n\t\t\tif(((int)$product_id > 0) && is_string($action)){\n\t\t\t\t$compare = $this->session->get(\"product_compare\");\n\t\t\t\t$ses_compare = !empty($compare)?$compare:array();\n\t\t\t\t$link = \"<a href='\".PATH.\"product-compare.html' title='\".$this->Lang['PRODUCT_COMPARE'].\"'> \".$this->Lang['PRODUCT_COMPARE'].\" </a>\";\n\t\t\t\t\n\t\t\t\tif(!in_array($product_id,$ses_compare) && (is_string($action) && $action=='true')){\n\t\t\t\t$arraycount = count($ses_compare);\n\t\t\t\t$link = $this->Lang['PRODUCT_COMPARE'];\n\t\t\t\tif($arraycount > 0){\n\t\t\t\t$link = \"<a href='\".PATH.\"product-compare.html' title='\".$this->Lang['PRODUCT_COMPARE'].\"'> \".$this->Lang['PRODUCT_COMPARE'].\" </a>\";\n\t\t\t\t}\n\t\t\t\t\tif(count($ses_compare) < 4){\n\t\t\t\t\t\t$ses_compare[]+=$product_id;\n\t\t\t\t\t\t$this->session->set(\"product_compare\",$ses_compare);\n\t\t\t\t\t\techo $this->Lang['PRD_CMP_ADD'].$product_title.$this->Lang['TXT_FOR'].$link.$arraycount;\n\t\t\t\t\t\t//echo \"1\";\n\t\t\t\t\t\texit;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tarray_shift($ses_compare);\n\t\t\t\t\t\t$ses_compare[]+=$product_id;\n\t\t\t\t\t\t$this->session->set(\"product_compare\",$ses_compare);\n\t\t\t\t\t\techo $this->Lang['PRD_CMP_ADD'].$product_title.$this->Lang['TXT_FOR'].$link.$arraycount;\n\t\t\t\t\t\t//echo \"1\";\n\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t}else if((is_string($action) && $action=='false')){\n\t\t\t\t\t$key = array_search($product_id, $ses_compare);\n\t\t\t\t\t$arraycount = count($ses_compare)-2;\n\t\t\t\t\tif (false !== $key) {\n\t\t\t\t\t\tunset($ses_compare[$key]);\n\t\t\t\t\t}\n\t\t\t\t\t$this->session->set(\"product_compare\",$ses_compare);\n\t\t\t\t\techo $this->Lang['REV_COMPARE'].$arraycount;\n\t\t\t\t\texit;\n\t\t\t\t}else{\n\t\t\t\t\techo ($type=='detail')?$this->Lang['PRD_CMP_ALREADY_ADD']:$this->Lang['REV_COMPARE'];\n\t\t\t\t\texit;\n\t\t\t\t\t//echo $this->Lang['REV_COMPARE'];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\techo $this->Lang['ERR_PRD_CMP'];\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t\telse{\n\n\t\t\t//echo $link = $this->Lang['U_CANT_COMP'].\" \".$product_cat_name.$this->Lang['ABV_ITMS'].\" . <a href='\".PATH.\"products/remove_compare/?product_id=d' title='\".$this->Lang['PRODUCT_COMPARE'].\"'> (\".$this->Lang['CLR_COMP_ITMS'].\") </a>\";\n\t\t\techo $link = $this->Lang['U_CANT_COMP'].\" \".$product_cat_name.$this->Lang['ABV_ITMS'].\" . <a href='\".PATH.\"product-compare.html' title='\".$this->Lang['PRODUCT_COMPARE'].\"'> (\".$this->Lang['CLR_COMP_ITMS'].\") </a>\";\n\t\t}\n\t\t\texit;\n\n\t}", "public function addtoCompare($update=false) {\r\n $product_id = $this->input->post('products');\r\n if(!$product_id) exit();\r\n if(is_array($product_id)) {\r\n if($update) $this->compare = null;\r\n foreach ($product_id as $id) {\r\n if(!in_array($id,$this->compare)) $this->compare[] = $id;\r\n }\r\n $this->saveCompare($this->compare);\r\n $response['debug']['thiscompare'] = $this->compare;\r\n } else if(!in_array($product_id,$this->compare)) {\r\n $this->compare[] = $product_id;\r\n }\r\n\r\n $this->saveCompare(); // save list products to session compare\r\n\r\n $response['status'] = 1;\r\n $response['number'] = count($this->getCompare());\r\n return $this->outputJson($response);\r\n }", "public function testUpdateCustomerGroupProduct()\n {\n }", "function cpa_add_visitproduct_to_cart() {\n\t \n\t\tif(get_option('cpa_checkvisit') == 1) {\n\n\t \tif ( ! is_admin() && !is_cart() && !is_checkout() ) {\n\t \t\n\t \t$product_id = get_option('cpa_visit'); // Product Id of the free product which will get added to cart\n\t \t$found \t= false;\n\t \t\n\t \t//check if product already in cart\n\t \tif ( sizeof( WC()->cart->get_cart() ) > 0 ) {\n\n\t \tforeach ( WC()->cart->get_cart() as $cart_item_key => $values ) {\n\t \t$_product = $values['data'];\n\n\t \tif ( $_product->get_id() == $product_id )\n\t \t$found = true;\n\t \t}\n\n\t \t// if product not found, add it\n\t \tif ( ! $found )\n\t \tWC()->cart->add_to_cart( $product_id );\n\t \t}\n\t \t\n\t \telse{\n\t \t // if no products in cart, add it\n\t \tWC()->cart->add_to_cart( $product_id );\n\t \t}\n\t \t\t}\t \n\t\t}\n\t}", "function addCustomerAndOrder( $cust,$viacart,$hardtrial) {\n\t\t global $operations, $_SESSION;\n $operation = $operations['CustomerAddOrderAdd'];\n \t $logObj=new ViaException();\n\t\t $viacart= $this->setRefSourceCode($viacart, false) ;\n\t\ttry {\n\t\t\t$custIdent=$this->getCustIdent();\n\t\t\t// add new record of customer as well as his order\n\t\t\t$custOrderDetails=$this->viaObj->CustomerAddOrderAdd(array('custIdent'=>$custIdent,'cust'=>$cust,'cart'=>$viacart));\n\t\t\t$this->customerIdVia=$custOrderDetails->CustomerAddOrderAddResult->customer->loginInfo->customerIdVia;\n\t\t\t$this->customerLogin=$custOrderDetails->CustomerAddOrderAddResult->customer->loginInfo->login;\n\t\t\t$this->email=$custOrderDetails->CustomerAddOrderAddResult->customer->loginInfo->login;\n\t\t\t$this->loginId=$custOrderDetails->CustomerAddOrderAddResult->customer->loginInfo->loginId;\n\t\t\t/* Added by Aswini start */\n\t\t\t$this->nameFirst= $custOrderDetails->CustomerAddOrderAddResult->customer->nameFirst;\n\t\t\t$this->nameLast= $custOrderDetails->CustomerAddOrderAddResult->customer->nameLast;\n\t\t\t/* Added by Aswini end */\n\t\t\tset_sess_vars('firstname',$this->nameFirst);\n\t\t\tset_sess_vars('lastname',$this->nameLast);\n\t\t\tif($hardtrial){ //set for hardtrial\n\t\t\t\tset_sess_vars('email',$this->customerLogin);\n\t\t\t\tset_sess_vars('viaid',$this->customerIdVia);\n }else{ // set for softtrial\n\t\t\t\tset_sess_vars('via_inactive_id',$this->customerIdVia);\n\t\t\t}\n\t\t\t/* Added by deepika 5/12/2009 */\n\t\t$products = $custOrderDetails->CustomerAddOrderAddResult->orders;\n\t\t\t\t\t\t//set user orderItmType = PRODUCT info in session\n\n\t\t\t\t\t\t$productsArr=array();\n\t\t\t\t\t\tif(count($products)>1){\n\t\t\t\t\t\t\tforeach($products as $key => $value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$productsArr[$value->orderItemType][$value->typeSpecificId]=array('orderNumber'=>$value->orderNumber,'orderItemSeq'=>$value->orderItemSeq,'orderClassId'=>$value->orderClassId,'orderCodeId'=>$value->orderCodeId,'sourceCodeId'=>$value->sourceCodeId,'typeSpecificId'=>$value->typeSpecificId,'startDate'=>$value->startDate,'expireDate'=>$value->expireDate,'billDate'=>$value->billDate,'description'=>$value->description,'price'=>$value->price,'auto_renew'=>$paymentRenew[$value->auto_renew],'subscriptionId'=>$value->subscriptionId,'orderItemType'=>$value->orderItemType,'n_issues_left'=>$value->n_issues_left);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}elseif(count($products)==1){\n\t\t\t\t\t\t\t//echo $products->typeSpecificId;\n\t\t\t\t\t\t\t$productsArr[$products->orderItemType][$products->typeSpecificId]=array('orderNumber'=>$products->orderNumber,'orderItemSeq'=>$products->orderItemSeq,'orderClassId'=>$products->orderClassId,'orderCodeId'=>$products->orderCodeId,'sourceCodeId'=>$products->sourceCodeId,'typeSpecificId'=>$products->typeSpecificId,'startDate'=>$products->startDate,'expireDate'=>$products->expireDate,'billDate'=>$products->billDate,'description'=>$products->description,'price'=>$products->price,'auto_renew'=>$paymentRenew[$products->auto_renew],'subscriptionId'=>$products->subscriptionId,'orderItemType'=>$products->orderItemType,'n_issues_left'=>$products->n_issues_left);\n\t\t\t\t\t\t}\n\n\t\t\t\t\tif($hardtrial){\n\t\t\t\t\t\tset_sess_vars(\"products\",$productsArr);\n\t\t\t\t\t}\n\n\t\t\t/*ends by deepika*/\n\t\t\t// Maintain the transaction log\n\t\t\t$logObj->viaLogTransaction($operation,$this->viaObj->__getLastRequest(),$this->viaObj->__getLastResponse(),$this->customerLogin,$this->customerIdVia);\n\n\t\t\t/*send soft trial activation email to activate account of softtrials*/\n\t\t\tif((!$hardtrial || $hardtrial=\"\")&&($this->customerIdVia)){\n\t\t\t\t$ViaEmail= new ViaEmail();\n\t\t\t\t$ViaEmail->sendSoftTrialActivationEmail($this->nameFirst,$this->customerIdVia,$this->customerLogin);\n }\n\n\t\t\treturn true;\n\t\t}// end of try block\n\t\tcatch (Exception $exception ) {\n\t\t\ttry\n\t\t\t{\n\t\t\t\tthrow new ViaException($exception->faultstring,119);\n\t\t\t}\n\t\t\tcatch(ViaException $ee)\n\t\t\t{\n\t\t\t\t$viaRequest=$this->viaObj->__getLastRequest();\n\t\t\t\t$getExactError = $ee->parseapierrors($ee,$operations['CustomerAddOrderAdd'],$viaRequest);\n\t\t\t\treturn $getExactError;\n\t\t\t}\n\t\t}\n\t}", "public static function addCompareProduct($idCompare, $idProduct) {\n\n // Check if compare row exists\n $idCompare = Db::getInstance(_EPH_USE_SQL_SLAVE_)->getValue(\n (new DbQuery())\n ->select('`id_compare`')\n ->from('compare')\n ->where('`id_compare` = ' . (int) $idCompare)\n );\n\n if (!$idCompare) {\n $idCustomer = false;\n\n if (Context::getContext()->customer) {\n $idCustomer = Context::getContext()->customer->id;\n }\n\n $sql = Db::getInstance()->insert(\n 'compare',\n [\n 'id_compare' => ['type' => 'sql', 'value' => 'NULL'],\n 'id_customer' => (int) $idCustomer,\n ],\n true\n );\n\n if ($sql) {\n $idCompare = Db::getInstance(_EPH_USE_SQL_SLAVE_)->getValue(\n (new DbQuery())\n ->select('MAX(`id_compare`)')\n ->from('compare')\n );\n Context::getContext()->cookie->id_compare = $idCompare;\n }\n\n }\n\n return Db::getInstance()->insert(\n 'compare_product',\n [\n 'id_compare' => (int) $idCompare,\n 'id_product' => (int) $idProduct,\n 'date_add' => ['type' => 'sql', 'value' => 'NOW()'],\n 'date_upd' => ['type' => 'sql', 'value' => 'NOW()'],\n ]\n );\n }", "function testAddProductToCartLoggedInCustomer() {\n\t \n\t $productA = $this->objFromFixture('Product', 'productA');\n\n\t $this->logInAs('admin');\n\t $productA->doPublish();\n\t $this->logOut();\n\t \n\t $this->logInAs($this->objFromFixture('Customer', 'buyer'));\n\t $buyer = $this->objFromFixture('Customer', 'buyer');\n\t $loggedInAs = $this->session()->get('loggedInAs');\n\t $this->assertEquals($buyer->ID, $loggedInAs);\n\t \n\t $member = Customer::currentUser();\n\t $this->assertEquals(true, $member->inGroup('customers'));\n\n\t $productALink = $productA->Link();\n\t $this->get(Director::makeRelative($productALink)); \n\t $this->submitForm('AddToCartForm_AddToCartForm', null, array(\n\t 'Quantity' => 1\n\t ));\n\t \n\t $order = CartControllerExtension::get_current_order();\n\t $this->assertEquals(1, $order->Items()->Count());\n\t}", "public function saveCustomerProducts($customerProduct){\n $this->db->insert(\"customer_products\", $customerProduct);\n }", "public function testUpdateSupplierProduct()\n {\n }", "public function addProduct(Product $product) : any;", "function ciniki_customers_upgradeToProducts(&$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 // Make sure only sysadmin can run\n //\n if( ($ciniki['session']['user']['perms']&0x01) == 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.539', 'msg'=>'Unauthorized'));\n }\n\n //\n // Load the products\n //\n $strsql = \"SELECT id, name \"\n . \"FROM ciniki_customer_products \"\n . \"WHERE 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.customers', array(\n array('container'=>'products', 'fname'=>'id', 'fields'=>array('id', 'name'),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.540', 'msg'=>'Unable to load products', 'err'=>$rc['err']));\n }\n $products = isset($rc['products']) ? $rc['products'] : array();\n\n if( count($products) == 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.544', 'msg'=>'No products specified'));\n }\n\n $individual_id = 0;\n $student_id = 0;\n $family_id = 0;\n $complimentary_id = 0;\n $reciprocal_id = 0;\n foreach($products as $product) {\n if( preg_match('/Individual/', $product['name']) ) {\n $individual_id = $product['id'];\n }\n if( preg_match('/Student/', $product['name']) ) {\n $student_id = $product['id'];\n }\n if( preg_match('/Family/', $product['name']) ) {\n $family_id = $product['id'];\n }\n if( preg_match('/Complimentary/', $product['name']) ) {\n $complimentary_id = $product['id'];\n }\n if( preg_match('/Reciprocal/', $product['name']) ) {\n $reciprocal_id = $product['id'];\n }\n }\n \n //\n // Load the members\n //\n $strsql = \"SELECT customers.id, \"\n . \"customers.display_name, \"\n . \"customers.member_status, \"\n . \"customers.member_lastpaid, \"\n . \"customers.member_expires, \"\n . \"customers.membership_length, \"\n . \"customers.membership_type, \"\n . \"customers.date_added, \"\n . \"purchases.id AS purchase_id, \"\n . \"purchases.product_id, \"\n . \"purchases.start_date, \"\n . \"purchases.end_date \"\n . \"FROM ciniki_customers AS customers \"\n . \"LEFT JOIN ciniki_customer_product_purchases AS purchases ON (\"\n . \"customers.id = purchases.customer_id \"\n . \"AND purchases.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"WHERE customers.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND customers.membership_type > 0 \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.customers', array(\n array('container'=>'members', 'fname'=>'id', \n 'fields'=>array('id', 'display_name', 'member_status', 'member_lastpaid', 'member_expires', 'membership_length', \n 'membership_type', 'date_added'),\n ),\n array('container'=>'purchases', 'fname'=>'purchase_id', \n 'fields'=>array('id'=>'purchase_id', 'product_id', 'start_date', 'end_date'),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.541', 'msg'=>'Unable to load members', 'err'=>$rc['err']));\n }\n $members = isset($rc['members']) ? $rc['members'] : array();\n\n //\n // Create the purchases\n //\n foreach($members as $member) {\n if( isset($member['purchases']) ) {\n continue;\n }\n $product = array(\n 'product_id' => $individual_id,\n 'customer_id' => $member['id'],\n 'flags' => 0,\n 'purchase_date' => $member['member_lastpaid'],\n 'invoice_id' => 0,\n 'start_date' => $member['member_lastpaid'],\n 'end_date' => $member['member_expires'],\n 'stripe_customer_id' => '',\n 'stripe_subscription_id' => '',\n );\n if( $member['membership_type'] == 20 && $student_id > 0 ) {\n $product['product_id'] = $student_id;\n }\n if( $member['membership_type'] == 40 && $family_id > 0 ) {\n $product['product_id'] = $family_id;\n }\n if( $member['membership_type'] == 110 && $complimentary_id > 0 ) {\n $product['product_id'] = $complimentary_id;\n }\n if( $member['membership_type'] == 150 && $reciprocal_id > 0 ) {\n $product['product_id'] = $reciprocal_id;\n }\n if( $member['member_lastpaid'] == '0000-00-00' ) {\n $product['purchase_date'] = $member['date_added'];\n }\n if( $member['member_expires'] != '0000-00-00' ) {\n $dt = new DateTime($member['member_expires']);\n $dt->sub(new DateInterval('P1Y'));\n $product['start_date'] = $dt->format('Y-m-d');\n }\n \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.customers.product_purchase', $product, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.542', 'msg'=>'Unable to add the product_purchase', 'err'=>$rc['err']));\n }\n }\n\n return array('stat'=>'ok');\n}", "function testAddProductToCartChangePrice() {\n\t \n\t $productA = $this->objFromFixture('Product', 'productA');\n\n\t $this->logInAs('admin');\n\t $productA->doPublish();\n\t $this->logOut();\n\t \n\t $productALink = $productA->Link();\n\t $this->get(Director::makeRelative($productALink)); \n\t $this->submitForm('AddToCartForm_AddToCartForm', null, array(\n\t 'Quantity' => 1\n\t ));\n\t \n\t $order = CartControllerExtension::get_current_order();\n\t $items = $order->Items();\n\t $firstItem = $items->First();\n\t $firstProduct = clone $productA;\n\t \n\t $this->assertEquals(1, $order->Items()->Count());\n\t $this->assertEquals($productA->Amount->getAmount(), $firstItem->Amount->getAmount());\n\t $this->assertEquals($productA->Amount->getCurrency(), $firstItem->Amount->getCurrency());\n\t \n\t $newAmount = new Money();\n\t $newAmount->setAmount(72.34);\n\t $newAmount->setCurrency('NZD');\n\t \n\t $this->logInAs('admin');\n\t $productA->Amount->setValue($newAmount); \n\t $productA->doPublish();\n\t $this->logOut();\n\t \n\t $productALink = $productA->Link();\n\t $this->get(Director::makeRelative($productALink)); \n\t $this->submitForm('AddToCartForm_AddToCartForm', null, array(\n\t 'Quantity' => 1\n\t ));\n\t \n\t $order = CartControllerExtension::get_current_order();\n\t $items = $order->Items();\n\n\t $firstItem = $items->First();\n\t $secondItem = $items->Last();\n\n\t $this->assertEquals(2, $order->Items()->Count());\n\t \n\t $this->assertEquals($firstProduct->Amount->getAmount(), $firstItem->Amount->getAmount());\n\t $this->assertEquals($firstProduct->Amount->getCurrency(), $firstItem->Amount->getCurrency());\n\t \n\t $this->assertEquals($newAmount->getAmount(), $secondItem->Amount->getAmount());\n\t $this->assertEquals($newAmount->getCurrency(), $secondItem->Amount->getCurrency());\n\t}", "public function product_duplicate($product)\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Purchase links for upgrades URL to purchase this app
function si_purchase_link( $url = '', $campaign = 'free' ) { echo si_get_purchase_link( $url, $campaign ); }
[ "function getUpgradeURL ()\r\n\t{\r\n\t\treturn str_replace('http://', 'https://', CloudNCo::config()->get('accountURL') ) . 'checkout/upgrade' ;\r\n\t}", "private function get_upsell_link()\n {\n }", "function add_upgrade_link( $links ) {\n $mylinks = array(\n '<a target=\"_blank\" style=\"color:#3db634;\" href=\"https://wpsvg.com/?utm_source=plugin-list&utm_medium=upgrade-link&utm_campaign=plugin-list&utm_content=action-link\">Upgrade</a>',\n );\n\n return array_merge( $links, $mylinks );\n }", "public static function link() {\n return 'http://www.sagepay.co.uk/support/online-shoppers/about-sage-pay';\n }", "function hrb_get_credits_purchase_url() {\n\treturn get_permalink( HRB_Credits_Purchase::get_id() );\n}", "public static function get_purchase_url() {\n $currency = get_option( 'laterpay_currency' );\n $price = 0; // switching to a timepass is free\n\n $client_options = LaterPay_Helper_Config::get_php_client_options();\n $client = new LaterPay_Client(\n $client_options['cp_key'],\n $client_options['api_key'],\n $client_options['api_root'],\n $client_options['web_root'],\n $client_options['token_name']\n );\n\n $subscription_data = LaterPay_Migrator_Helper_Subscription::get_user_subscription_data();\n $time_pass_id = LaterPay_Migrator_Helper_Subscription::get_time_pass_id( $subscription_data );\n $time_pass = LaterPay_Helper_TimePass::get_time_pass_by_id( $time_pass_id );\n\n if ( ! $time_pass || ! $subscription_data ) {\n return false;\n }\n\n $expiry_time = LaterPay_Migrator_Helper_Subscription::get_expiry_time( $subscription_data );\n\n // prepare purchase URL\n $url_params = array(\n 'tpid' => LaterPay_Helper_TimePass::get_tokenized_time_pass_id( $time_pass['pass_id'] ),\n 'subp' => true,\n );\n\n // parameters for LaterPay purchase form\n $params = array(\n 'article_id' => LaterPay_Helper_TimePass::get_tokenized_time_pass_id( $time_pass['pass_id'] ),\n 'pricing' => $currency . ( $price * 100 ),\n 'expiry' => $expiry_time,\n 'url' => home_url() . '?' . $client->sign_and_encode( $url_params, home_url() ),\n 'title' => __( 'Free Switching Time Pass' , 'laterpay-migrator' ),\n );\n\n return $client->get_add_url( $params );\n }", "function eddwp_get_edd_all_access_upgrade_link() {\n\n\t// get a license key from the user (we don't care which one gets upgraded)\n\t$license_args = array(\n\t\t'posts_per_page' => 1,\n\t\t'post_type' => 'edd_license',\n\t\t'post_status' => 'publish',\n\t\t'fields' => 'ids',\n\t\t'meta_query' => array(\n\t\t\t'relation' => 'AND',\n\t\t\tarray(\n\t\t\t\t'key' => '_edd_sl_user_id',\n\t\t\t\t'value' => get_current_user_id(),\n\t\t\t\t'compare' => '='\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => '_edd_sl_status',\n\t\t\t\t'value' => 'expired',\n\t\t\t\t'compare' => '!='\n\t\t\t),\n\t\t),\n\t);\n\t$license_keys = get_posts( $license_args );\n\n\t// bail if there are no licenses\n\tif ( empty( $license_keys ) ) {\n\t\treturn false;\n\t}\n\n\t// get the ID of the license key\n\t$license_id = $license_keys[0];\n\n\t// build the upgrade link using the license ID and the upgrade ID (set in Custom Functions)\n\t$url = edd_sl_get_license_upgrade_url( $license_id, eddwp_get_all_access_pass_id() );\n\n\treturn $url;\n}", "public static function getUpgradeLicenseUrl() { }", "public function upgrade_to_pro() {\n\n\t\techo '<div>';\n\t\t\t/* translators: %s: link */\n\t\t\techo '<p><i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Analytics feature', 'cartflows' ), '<a href=\"https://cartflows.com/\" target=\"_blank\">', '</a>' ) . '</i></p>';\n\t\t\techo '<p><a target=\"_blank\" href=\"https://cartflows.com/\" class=\"button button-primary\">' . esc_html__( 'Get Pro', 'cartflows' ) . '</a></p>';\n\t\techo '</div>';\n\n\t}", "private function ___goToVendor() {\n \n $_sURL = AmazonAutoLinks_Registry::PLUGIN_URI;\n $_oOption = AmazonAutoLinks_Option::getInstance();\n $_isAffiliateID = $_oOption->get( 'miunosoft_affiliate', 'affiliate_id' );\n if ( strlen( $_isAffiliateID ) ) {\n $_sURL = add_query_arg(\n array(\n 'ref' => $_isAffiliateID,\n ),\n AmazonAutoLinks_Registry::STORE_URI_PRO\n );\n }\n \n exit( wp_redirect( $_sURL ) );\n }", "public function getAllKeysPurchaseURL()\n {\n if (!$this->allKeysPurchaseURL) {\n $this->getExpiredKeys();\n }\n\n return 1 < count($this->getExpiredKeys()) ? $this->allKeysPurchaseURL : null;\n }", "private function subscriptions_url() {\n return '/' . parent::getAppId() . '/subscriptions';\n }", "public function actionBuySubscription()\n {\n return $this->redirect(['subscription/index', 'lang' => Yii::$app->language], 301);\n }", "public function notify_url(){\n\n\t\t$om_options = &$GLOBALS['WS_PLUGIN__']['optimizemember']['o'];\n\n\t\t$auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : '';\n\t\t$secret_auth = defined( 'SECURE_AUTH_KEY' ) ? SECURE_AUTH_KEY : '';\n\t\t$hash = md5( $auth_key . home_url() . get_bloginfo( 'admin_email' ) . $secret_auth );\n\n\t\t$om_payment_notification_urls = &$om_options['payment_notification_urls'];\n\t\t$affwp_payment_notify_url = home_url( '/?optimizemember_affiliatewp_notify=payment&amount=%%amount%%&txn_id=%%txn_id%%&item_name=%%item_name%%&&ip=%%user_ip%%&user_id=%%user_id%%&item_number=%%item_number%%&payer_email=%%payer_email%%&affiliate_id=%%cv1%%&secret=' . $hash );\n\n\t\t// Add AffiliateWP payment notification URL to the list dynamically.\n\t\tif( stripos( $om_payment_notification_urls, $affwp_payment_notify_url ) === FALSE ){\n\n\t\t\t$om_payment_notification_urls .= \"\\n\" . $affwp_payment_notify_url;\n\n\t\t}\n\n\t\t$om_page_sale_notification_urls = &$om_options['sp_sale_notification_urls'];\n\t\t$affwp_page_sale_notify_url = home_url( '/?optimizemember_affiliatewp_notify=payment&amount=%%amount%%&txn_id=%%txn_id%%&item_name=%%item_name%%&&ip=%%user_ip%%&user_id=%%user_id%%&item_number=%%item_number%%&payer_email=%%payer_email%%&affiliate_id=%%cv1%%&secret=' . $hash );\n\n\t\t// Add AffiliateWP payment notification URL to the list dynamically.\n\t\tif( stripos( $om_page_sale_notification_urls, $affwp_page_sale_notify_url ) === FALSE ){\n\n\t\t\t$om_page_sale_notification_urls .= \"\\n\" . $affwp_page_sale_notify_url;\n\n\t\t}\n\n\t\t$om_ref_rev_notification_urls = &$om_options['ref_rev_notification_urls'];\n\t\t$affwp_refund_notify_url = home_url( '/?optimizemember_affiliatewp_notify=refund&txn_id=%%parent_txn_id%%&secret=' . $hash );\n\n\t\t// Add AffiliateWP refund notification URL notification URL to the list dynamically.\n\t\tif( stripos( $om_ref_rev_notification_urls, $affwp_refund_notify_url ) === FALSE ){\n\n\t\t\t$om_ref_rev_notification_urls .= \"\\n\". $affwp_refund_notify_url;\n\n\t\t}\n\n\t\t$om_page_ref_rev_notification_urls = &$om_options['sp_ref_rev_notification_urls'];\n\t\t$affwp_page_refund_notify_url = home_url( '/?optimizemember_affiliatewp_notify=refund&txn_id=%%parent_txn_id%%&secret=' . $hash );\n\n\t\t// Add AffiliateWP refund notification URL notification URL to the list dynamically.\n\t\tif( stripos( $om_page_ref_rev_notification_urls, $affwp_page_refund_notify_url ) === FALSE ){\n\n\t\t\t$om_page_ref_rev_notification_urls .= \"\\n\". $affwp_page_refund_notify_url;\n\n\t\t}\n\n\t}", "public function getPurchaseUrl()\n {\n return (string)$this->_xml->purchase_url;\n }", "protected function getRenewUrl() {\n return $this->getUrl('subscribenow/productsubscribers/renew', ['subscription_id' => $this->subscriptionId]);\n }", "public static function get_in_app_purchase_url_params()\n {\n }", "function add_urls() {\n $this->add_index_url();\n\n $products_query = $this->get_products_query();\n while ($product = tep_db_fetch_array($products_query)) {\n $this->add_product_url($product);\n }\n }", "function get_renewal_link() {\n\n\t\t// If a renewal link was passed in the config, use that\n\t\tif ( '' != $this->renew_url ) {\n\t\t\treturn $this->renew_url;\n\t\t}\n\n\t\t// If download_id was passed in the config, a renewal link can be constructed\n\t\t$license_key = trim( get_option( $this->theme_slug . '_license_key', false ) );\n\t\tif ( '' != $this->download_id && $license_key ) {\n\t\t\t$url = esc_url( $this->remote_api_url );\n\t\t\t$url .= '/checkout/?edd_license_key=' . $license_key . '&download_id=' . $this->download_id;\n\t\t\treturn $url;\n\t\t}\n\n\t\t// Otherwise return the remote_api_url\n\t\treturn $this->remote_api_url;\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end if( !( function_exists( 'repair_status_checker' ) ) ) e.g.[drawer title='title' swaptitle='alternate title for open drawer' alt='hover tag' notitle='"true" if no hover element desired' id='uniqueid' tag='' trigclass='triggerclass' targtag='' targclass='targetcontentclass' rel='groupforelementsonlyoneopenatatime' expanded='"true" to expand on page load' startwrap='' endwrap='' color='orange' alignment='left'] custom shortcode for collapsomatic elements, requires collapseomatic plugin. This modifies shortcode to pass correct elements and content to Visual Composer
function drawer( $atts, $content = null ) { // New function parameter $content is added! extract( shortcode_atts( array( 'title' => 'Click Here', 'swaptitle' => 'Click Here to Hide', 'alt' => '', 'notitle' => '', 'id' => 'id'.$ran, 'tag' => $options['tag'], 'trigclass' => '', 'trigpos' => $options['trigpos'], 'targtag' => $options['targtag'], 'targclass' => '', 'targpos' => $options['targpos'], 'rel' => '', 'expanded' => '', 'excerpt' => '', 'excerptpos' => 'below-trigger', 'excerpttag' => 'div', 'excerptclass' => '', 'swapexcerpt' => false, 'findme' => '', 'offset' => $options['offset'], 'scrollonclose' => '', 'startwrap' => '', 'endwrap' => '', 'elwraptag' => $options['wraptag'], 'elwrapclass' => $options['wrapclass'], 'cookiename' => '', 'color' => 'none', 'alignment' => 'left', 'findme' => 'auto' ), $atts ) ); $content = wpb_js_remove_wpautop( $content ); // fix unclosed/unwanted paragraph tags in $content $showonload = "none"; if( $expanded == "true" ) { $trigclass .= ' colomat-close'; $showonload = "block"; } //end if( $expanded == "true" ) return " <div class='section ${color} dsection'> <div class='drawer'> <a id='find-${id}' name='' alt='0'> </a> <span id='${id}' class='collapseomatic find-me ${alignment} " . $trigclass . "' title='${title}'>${title}</span> <span id='swap-${id}' style='display:none;'>${swaptitle}</span> <div id='target-${id}' class='collapseomatic_content' style='display:".$showonload.";'> ${content} </div> </div> </div>"; }
[ "function on_shortcode_if_not_status ($atts, $content)\n{\n if (!if_status ($atts)) {\n return do_shortcode ($content);\n }\n return '';\n}", "function on_shortcode_if_status ($atts, $content)\n{\n if (if_status ($atts)) {\n return do_shortcode ($content);\n }\n return '';\n}", "function monsterinsights_maybe_handle_legacy_shortcodes() {\n\n\tif ( ! shortcode_exists( 'gadwp_useroptout' ) ) {\n\t\tadd_shortcode( 'gadwp_useroptout', '__return_empty_string' );\n\t}\n\n}", "function JAY__shortcode__jmemberwing ($atts, $content=\"\")\r\n{\r\n extract (shortcode_atts (\r\n array(\r\n 'conditions' => '?', // Stuff in between {{{...}}} brackets. Ex: \"gold\" or \"gold|silver\"\r\n ),\r\n $atts));\r\n\r\n\r\n $content = JAY__fix_content ($content); // Fix bug (</p>...content...<p>) introduced by wpautop + 'add_shortcode' + condition where content is surrounded by empty lines.\r\n\r\n $condition_is_true = FALSE;\r\n $mwx_installed = TRUE;\r\n\r\n if (function_exists ('MWX__UserCanAccessArticle'))\r\n {\r\n // first parameter: article/page ID. -1 => current article, second parameter: user_id. -1 => currently logged on user. Third parameter: premium marker string (stuff inside {{{...}}} brackets)\r\n $access_info = MWX__UserCanAccessArticle (-1, -1, $conditions, FALSE);\r\n if ($access_info)\r\n {\r\n if ($access_info['immediate_access'])\r\n {\r\n // current visitor can access article protected with {{{gold:5d|platinum}}} premium marker immediately\r\n $condition_is_true = TRUE;\r\n }\r\n else\r\n {\r\n // Note: this will only work for MemberWing-X TSI Edition. Other editions will always return '0'.\r\n // current visitor can access article protected with {{{gold:5d|platinum}}} premium marker in ' . $access_info['in_seconds'] . ' seconds'\r\n $condition_is_true = FALSE;\r\n }\r\n }\r\n else\r\n {\r\n // current visitor does not have access to article protected with {{{gold:5d|platinum}}} premium marker\r\n $condition_is_true = FALSE;\r\n }\r\n }\r\n else\r\n {\r\n $condition_is_true = FALSE;\r\n $mwx_installed = FALSE;\r\n }\r\n\r\n $content_arr = explode ('[j-else/]', $content);\r\n if (!isset($content_arr[1]))\r\n $content_arr[1] = '';\r\n\r\n $final_content = '';\r\n\r\n // action = \"allow\"\r\n if ($condition_is_true)\r\n {\r\n $final_content = $content_arr[0];\r\n }\r\n else\r\n {\r\n $final_content = $content_arr[1];\r\n if (!$mwx_installed)\r\n {\r\n $final_content .= '<h3 align=\"center\"><span style=\"color:red;\">Warning:</span> <a href=\"http://www.memberwing.com/\">MemberWing-X</a> is not installed</h3>';\r\n }\r\n }\r\n\r\n $final_content = JAY__strip_p_tags ($final_content); // Strip <p> tags around content\r\n\r\n return JAY__do_shortcode ($final_content);\r\n}", "function wpst_job_descriptions_sc_handler($atts)\n{\n require_once('jobs.class.php') ;\n\n $c = container() ;\n\n // Parse the shortcode\n \n\textract(shortcode_atts(array(\n 'inactive' => 'n'\n\t), $atts)) ;\n\n // If the meetid is missing then we have a\n // problem and can't do anything meaningful.\n\n // Set up the job descriptions report\n\n $jobdescriptions = new SwimTeamJobDescriptionsInfoTable('Job Descriptions', '100%') ;\n\n if (strtolower(substr($inactive, 0, 1)) == 'y')\n $jobdescriptions->setShowInactive(true) ;\n\n $jobdescriptions->constructSwimTeamJobDescriptionsInfoTable() ;\n\n $c->add(html_br(), $jobdescriptions, html_br(2)) ;\n\n\treturn $c->render() ;\n}", "function appthemes_add_contentwarning_quicktag() {\n if (wp_script_is('quicktags')){\n ?>\n <script type=\"text/javascript\">\n QTags.addButton( 'trigger_warning', 'trigger_warning', '[trigger_warning = 'none']', '', 'tw', 'Content Warning', 201 );\n QTags.addButton( 'content_warning', 'content_warning', '[content_warning = 'none']', '', 'cw', 'Content Warning', 201 );\n </script>\n <?php\n }\n}", "function new_vala_category_sponsors_list_sc_($atts, $content = null ) {\nglobal $__newvalaobj;\n$nv_region_id = $__newvalaobj->getRegionID();\n extract( shortcode_atts( array( \n 'title' => ''\n ), $atts ) );\n\n $output='';\n \n //$catSponsors = new_vala_getcategorysponsorlistbyregion_($nv_region_id,$title);\n $catSponsors = new_vala_getcategorieswithsponsorslistbyregion_($nv_region_id,$title);\n $output = new_vala_category_sponsors_shortcode_($catSponsors,$title);\n\n return $output;\n}", "public function the_title_filter( $title, $id = null ) {\r\n\r\nif (has_shortcode( $title, 'lh_personalised_content' )){\r\n\r\n$title = do_shortcode($title);\r\n\r\n}\r\n\r\nreturn $title;\r\n}", "function shortcode_accommodations( $atts ) {\n\t\textract( shortcode_atts( array(\n\t\t\t'title' => '',\n\t\t\t'type' => 'latest',\n\t\t\t'style' => 'style1',\n\t\t\t'count' => 10,\n\t\t\t'count_per_row' => 4,\n\t\t\t'city' => '',\n\t\t\t'country' => '',\n\t\t\t'acc_type' => '',\n\t\t\t'post_ids' => '',\n\t\t\t'slide' => 'true',\n\t\t\t'before_list' => '',\n\t\t\t'after_list' => '',\n\t\t\t'before_item' => '',\n\t\t\t'after_item' => '',\n\t\t\t'show_badge' => '',\n\t\t\t'animation_type' => '',\n\t\t\t'animation_duration' => '',\n\t\t\t'animation_delay' => '',\n\t\t\t'item_width' => '270',\n\t\t\t'item_margin' => '30',\n\t\t), $atts) );\n\t\tif ( $slide == 'no' || $slide == 'false' ) { $slide = 'false'; }\n\t\tif ( $type == 'hot' && empty( $show_badge ) ) $show_badge = true;\n\t\tif ( $show_badge == 'no' || $show_badge == 'false' ) { $show_badge = false; }\n\t\t$styles = array( 'style1', 'style2', 'style3', 'style4' );\n\t\t$types = array( 'latest', 'featured', 'popular', 'hot', 'selected' );\n\t\tif ( ! in_array( $style, $styles ) ) $style = 'style1';\n\t\tif ( ! in_array( $type, $types ) ) $type = 'latest';\n\t\t$post_ids = explode( ',', $post_ids );\n\t\t$acc_type = ( ! empty( $acc_type ) ) ? explode( ',', $acc_type ) : array();\n\t\t$count = is_numeric( $count )?$count:10;\n\t\t$count_per_row = is_numeric( $count_per_row )?$count_per_row:4;\n\t\t$item_width = is_numeric( $item_width ) ? $item_width : 270;\n\t\t$item_margin = is_numeric( $item_margin ) ? $item_margin : 270;\n\n\t\t$def_before_list = '';\n\t\t$def_after_list = '';\n\t\t$def_before_item = '';\n\t\t$def_after_item = '';\n\n\t\tif ( $style == 'style4' ) {\n\t\t\t$def_before_list = '<div class=\"listing-style4\">';\n\t\t\t$def_after_list = '</div>';\n\t\t} elseif ( $style == 'style3' ) {\n\t\t\t$def_before_list = '<div class=\"listing-style3 hotel\">';\n\t\t\t$def_after_list = '</div>';\n\t\t} else {\n\t\t\tif ( $slide == 'false' ) {\n\t\t\t\t$def_before_list = '<div class=\"row hotel image-box listing-' . esc_attr( $style ) . '\">';\n\t\t\t\t$def_after_list = '</div>';\n\t\t\t\tif ( ( 2 == $count_per_row ) ) {\n\t\t\t\t\t$def_before_list = '<div class=\"row hotel image-box listing-' . esc_attr( $style ) . '\">';\n\t\t\t\t\t$def_before_item = \"<div class='col-sm-6'>\";\n\t\t\t\t\t$def_after_item = \"</div>\";\n\t\t\t\t} elseif ( 3 == $count_per_row ) {\n\t\t\t\t\t$def_before_list = '<div class=\"row hotel image-box listing-' . esc_attr( $style ) . '\">';\n\t\t\t\t\t$def_before_item = \"<div class='col-sm-4'>\";\n\t\t\t\t\t$def_after_item = \"</div>\";\n\t\t\t\t} else {\n\t\t\t\t\t$def_before_list = '<div class=\"row hotel image-box listing-' . esc_attr( $style ) . '\">';\n\t\t\t\t\t$def_before_item = \"<div class='col-sm-6 col-sms-6 col-md-3'>\";\n\t\t\t\t\t$def_after_item = \"</div>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$def_before_list = '<div class=\"block image-carousel style2 flexslider\" data-animation=\"slide\" data-item-width=\"' . esc_attr( $item_width ) . '\" data-item-margin=\"' . esc_attr( $item_margin ) . '\"><ul class=\"slides hotel image-box listing-' . esc_attr( $style ) . '\">';\n\t\t\t\t$def_after_list = '</ul></div>';\n\t\t\t\t$def_before_item = '<li>';\n\t\t\t\t$def_after_item = '</li>';\n\t\t\t}\n\t\t}\n\t\tif ( empty( $before_list ) ) $before_list = $def_before_list;\n\t\tif ( empty( $after_list ) ) $after_list = $def_after_list;\n\t\tif ( empty( $before_item ) ) $before_item = $def_before_item;\n\t\tif ( empty( $after_item ) ) $after_item = $def_after_item;\n\n\t\t$accs = array();\n\t\tif ( $type == 'selected' ) {\n\t\t\t$accs = trav_acc_get_accs_from_id( $post_ids );\n\t\t} elseif ( $type == 'hot' ) {\n\t\t\t$accs = trav_acc_get_hot_accs( $count, $country, $city, $acc_type );\n\t\t} else {\n\t\t\t$accs = trav_acc_get_special_accs( $type, $count, array(), $country, $city, $acc_type );\n\t\t}\n\n\t\tob_start();\n\t\tif ( ! empty( $title ) ) { echo '<h2>' . esc_html( $title ) . '</h2>'; }\n\t\techo ( $before_list );\n\t\t$i = 0;\n\t\tforeach ( $accs as $acc ) {\n\t\t\t$animation = '';\n\t\t\tif ( ! empty( $animation_type ) ) { $animation .= ' class=\"animated\" data-animation-type=\"' . esc_attr( $animation_type ) . '\" data-animation-duration=\"' . esc_attr( $animation_duration ) . '\" data-animation-delay=\"' . esc_attr( $animation_delay * $i ) . '\" '; }\n\t\t\ttrav_acc_get_acc_list_sigle( $acc->ID, $style, $before_item, $after_item, $show_badge, $animation );\n\t\t\t$i++;\n\t\t}\n\t\techo ( $after_list );\n\n\t\t$output = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $output;\n\t}", "function new_vala_category_sponsors_list_sc($atts, $content = null ) {\nglobal $__newvalaobj;\n$nv_region_id = $__newvalaobj->getRegionID();\n extract( shortcode_atts( array( \n 'title' => ''\n ), $atts ) );\n\n $output='';\n\n $sponsors = new_vala_getcontractsbyregion($nv_region_id);\n $catData = new_vala_getcategoriesbyregion($nv_region_id);\n\n $output = new_vala_category_sponsors_shortcode( array( 'sponsors'=>$sponsors['all'], 'categories' =>$catData['all'] ), $title );\n\n return $output;\n}", "function render_open_table($atts ) {\n $a = shortcode_atts( array(\n 'style' => 'widget',\n 'rid' => false,\n ), $atts );\n $ot_rid = $a['rid'];\n $ot_style = $a['style'];\n\n // Inject recommended GA snippet\n if (!$ot_rid) {\n return \"<!-- g11-open-table: Missing required attribute 'rid'-->\";\n } else if ($ot_style == 'widget') {\n\n include_once(\"open-table-widget.php\");\n return g11_open_table_widget($ot_rid);\n\n } else if ($ot_style == 'button') {\n\n include_once(\"open-table-button.php\");\n return g11_open_table_button($ot_rid);\n\n } else if ($ot_style == 'link') {\n\n include_once(\"open-table-link.php\");\n return g11_open_table_link($ot_rid);\n\n } else {\n return \"<!-- g11-open-table: Unrecognized style '$ot_style'' -->\";\n }\n\n // Can include link if we want...\n // Replace here\n\n}", "function webform_shortcode($atts, $content = null) \n{\n // Attributes\n $atts = shortcode_atts(array('form' => 'join-now'), $atts, 'webform');\n\n // HTML\n if (is_user_logged_in()) {\n\n $html = '<div class=\"shortcodeBox\">Please logout to view the form.</div>';\n\n } elseif(!empty($atts['form']) && in_array($atts['form'], array('join-now', 'discovery-session', 'meet-with-coach'))) {\n\n $html = '<div id=\"webform\" data-form=\"' . $atts['form'] . '\" data-nonce=\"' . wp_create_nonce('webform-script-nonce') . '\" data-ajaxurl=\"' . admin_url('admin-ajax.php') . '\"></div>'; \n\n } else {\n\n $html = '<div class=\"shortcodeBox\">Please verify webform form attibute is one of the following and spelled correctly: join-now, discovery-session or meet-with-coach. e.g. &#91;webform form=\"join-now\"&#93;</div>';\n\n }\n\n // Return\n return $html;\n}", "function hg_infotext( $atts, $content = null ) {\n extract(shortcode_atts(array(\n \"style\" => '',\n \"title\" => ''\n ), $atts));\n //fix shortcode\n $content = wpautop(do_shortcode($content));\n $content = fixshortcode($content);\n $content = preg_replace('#<br \\/>#', \"\",trim($content));\n $content = preg_replace('#<p>#', \"\",trim($content));\n $content = preg_replace('#<\\/p>#', \"\",trim($content));\n $html = '<h3 class=\"m_title\" style=\"'.$style.'\">'.$title.'</h3>';\n if($content) $html .= '<p>'.$content.'</p>';\n\n return $html;\n}", "function school_zone_banner_description_selective_refresh(){\r\n $banner_description = get_theme_mod( 'school_zone_banner_description', __( 'Maecenas perspiciatis eleifend mollitia esse etiam rem harum? Sunt incididunt, sollicitudin earum anim quidem laoreet nibh, facilisis eiusmod!', 'school-zone' ) );\r\n\r\n if( ! empty( $banner_description ) ){\r\n return $banner_description;\r\n }\r\n\r\n return false;\r\n}", "public function shortcode($atts, $content)\n {\n /*\n * Cache busting\n */\n if (function_exists('wp_using_ext_object_cache')) {\n $extCache = wp_using_ext_object_cache();\n if (true === $extCache) {\n wp_using_ext_object_cache(false);\n }\n }\n\n // Decode encoded chars\n $atts = op_urldecode($atts);\n\n $uidOpBox = 'optbox_' . md5(serialize($atts) . $content . (int)defined('OP_LIVEEDITOR') . get_option('op_form_privacy_privacy_checkbox_text') . get_option('op_form_privacy_newsletter_checkbox_text'));\n\n if (false === $cached = get_transient('el_' . $uidOpBox)) {\n $oldAtts = $atts;\n $atts = shortcode_atts(array(\n 'integration_type' => 'custom',\n 'email_address' => '',\n 'redirect_url' => '',\n 'style' => '1',\n 'action' => '',\n 'disable_name' => 'N',\n 'method' => 'post',\n 'submit' => '',\n 'email_field' => '',\n 'email_default' => '',\n 'email_order' => 0,\n 'name_field' => '',\n 'name_default' => '',\n 'name_order' => 0,\n 'top_color' => '',\n 'thank_you_page' => '',\n 'already_subscribed_url' => '',\n 'action_page' => '',\n 'list' => '',\n 'width' => '',\n 'margin_top' => '',\n 'margin_right' => '',\n 'margin_bottom' => '',\n 'margin_left' => '',\n 'alignment' => 'center',\n 'button_below' => 'N',\n 'gotowebinar' => null,\n 'double_optin' => 'N',\n 'signup_form_id' => '',\n 'welcome_email' => 'N',\n 'form_id' => null,\n 'opm_integration' => 'N',\n 'opm_level' => 0,\n 'opm_packages' => '',\n ), $atts);\n extract($atts);\n\n $redirect_url = str_replace(\"&#038;\", \"&\", $redirect_url);\n\n $data = array(\n 'content' => array(\n 'headline' => '',\n 'paragraph' => '',\n 'privacy' => '',\n ),\n 'fields' => array(),\n 'submit_button' => '',\n 'hidden_str' => '',\n 'extra_fields' => array(),\n 'top_color' => $top_color,\n 'width' => $width,\n 'margin_top' => $margin_top,\n 'margin_right' => $margin_right,\n 'margin_bottom' => $margin_bottom,\n 'margin_left' => $margin_left,\n 'box_alignment' => $alignment,\n 'shortcodes' => array(),\n );\n\n $mc = preg_match_all('/'.op_shortcode_regex('optin_box_hidden|optin_box_field|optin_box_button').'/s',$content,$matches);\n $buttons = 0;\n if($mc > 0){\n for($i=0;$i<$mc;$i++){\n switch($matches[2][$i]){\n case 'optin_box_hidden':\n $data['hidden_str'] .= op_clean_shortcode_content($matches[5][$i]);\n break;\n case 'optin_box_field':\n $field = shortcode_atts(array(\n 'name' => '',\n ), shortcode_parse_atts($matches[3][$i]));\n if($field['name'] != ''){\n $data['content'][$field['name']] = op_clean_shortcode_content($matches[5][$i]);\n if($field['name'] == 'paragraph'){\n $data['content'][$field['name']] = wpautop(op_texturize(base64_decode($data['content'][$field['name']])));\n }\n }\n break;\n case 'optin_box_button':\n $button_atts = shortcode_parse_atts($matches[3][$i]);\n $button_atts['element_type'] = 'button';\n $button_content = $matches[5][$i];\n $type = op_get_var($button_atts,'type',1);\n if ($type == '0') {\n $uid = md5('btn_0_' . $button_content);\n if (false === $buttonMarkup = get_transient('el_' . $uid)) {\n $buttonMarkup = op_sl_parse('button_0', $button_content);\n /*\n * Save only when there is some content returned\n */\n if (is_string($buttonMarkup) && 0 === strpos($buttonMarkup, '##')) {\n $buttonMarkup = substr($buttonMarkup, 2);\n } elseif (!empty($buttonMarkup)) {\n set_transient('el_' . $uid, $buttonMarkup, OP_SL_ELEMENT_CACHE_LIFETIME);\n }\n }\n $data['submit_button'] = $buttonMarkup;\n } else if ($type == '1') {\n $buttonShortcode = '[button_1';\n foreach ($button_atts as $attribute => $value) {\n $buttonShortcode .= ' ' . $attribute . '=\"' . $value .'\"';\n }\n $buttonShortcode .= ']' . $button_content . '[/button_1]';\n $data['submit_button'] = '%%_custom_button_%%';\n $data['shortcodes']['custom_button'] = $buttonShortcode;\n } else {\n $func = 'button_'.$type;\n $data['submit_button'] = call_user_func_array(array('OptimizePress_Default_Assets',$func),array($button_atts,$button_content));\n }\n /*\n * Used on some templates as \"textual link\"\n */\n if (op_get_var($button_atts, 'button_below') === 'Y') {\n $data['link_button'] = '<button type=\"submit\" class=\"default-link\">'.$button_content.'</button>';\n } else {\n $data['link_button'] = '';\n }\n break;\n }\n }\n }\n\n $has_name = true;\n if ($integration_type === 'email') {\n $has_name = false;\n }\n\n if (!$has_name) {\n $atts['action'] = '%%redirect_url%%';\n $atts['method'] = 'post';\n }\n $atts['op_current_url'] = '%%redirect_url%%';\n $atts['data'] = $data;\n $atts['no_name_styles'] = array('1','4','5','6','9','10');\n $atts['site_url_process_optin_form'] = get_bloginfo('url') . '/process-optin-form/';\n $atts['atts'] = $oldAtts;\n $atts['has_name'] = $has_name;\n\n $returnedData = op_sl_parse('optin_box', $atts);\n if (false === is_array($returnedData) && empty($returnedData)) {\n return;\n }\n extract($returnedData);\n\n if (!isset($required_fields)) {\n $required_fields = array();\n }\n\n if (!isset($hidden_fields)) {\n $hidden_fields = array();\n }\n\n $required = ' required=\"required\"';\n\n /*\n * We need this check to remove required attribute (it was firing in feature box element)\n */\n if (defined('OP_LIVEEDITOR')) {\n $required = '';\n }\n\n $replacement_fields = array();\n foreach($extra_fields as $name => $value){\n $requiredField = in_array($name, $required_fields) ? $required : '';\n if (in_array($name, $hidden_fields)) {\n $data['extra_fields'][$name] = '<input type=\"hidden\" name=\"' . $name . '\" value=\"%%_' . $name . '_%%\" />';\n $data['shortcodes'][$name] = rawurldecode($value);\n } else {\n $data['extra_fields'][$name] = '<div class=\"text-box\"><input type=\"text\"' . $requiredField . ' name=\"'.$name.'\" placeholder=\"'.$value.'\" value=\"%%' . $name . '%%\" /></div>';\n $replacement_fields[] = $name;\n }\n }\n\n if(!$has_name){\n $fields['email']['name'] = 'email';\n $has_name_field && $fields['name']['name'] = 'name';\n $hidden = array(\n 'email_to' => $email_address,\n 'redirect_url' => $redirect_url,\n 'extra_fields' => $extra_fields,\n 'fields' => $fields\n );\n $data['hidden_str'] .= '<input type=\"hidden\" name=\"op_optin_form_data\" value=\"'.op_attr(base64_encode(json_encode($hidden))).'\" /><input type=\"hidden\" name=\"op_optin_form\" value=\"Y\" />';\n }\n\n $data['hidden_str'] = empty($data['hidden_str']) ? '' : '<div style=\"display:none\">'.$data['hidden_str'].'</div>';\n\n foreach($fields as $name => $info){\n $input_container_start_html = ($style!=12 && $style!=15 && $style!=19 && $style!=20 && $style!=21 && $style!=22 && $style!=23 && $style!=24 ? '<div class=\"text-box '.$name.'\">' : '');\n $input_container_end_html = ($style!=12 && $style!=15 && $style!=19 && $style!=20 && $style!=21 && $style!=22 && $style!=23 && $style!=24 ? '</div>' : '');\n $requiredField = in_array($name . '_field', $required_fields) ? $required : '';\n if ($name === 'email') {\n $data['fields'][$name.'_field'] = $input_container_start_html.'<input type=\"email\"' . $requiredField . ' name=\"'.$info['name'].'\"'.($info['text']==''?'':' placeholder=\"'.$info['text'].'\"').' value=\"%%' . $info['name'] . '%%\" />'.$input_container_end_html;\n } else {\n $data['fields'][$name.'_field'] = $input_container_start_html.'<input type=\"text\"' . $requiredField . ' name=\"'.$info['name'].'\"'.($info['text']==''?'':' placeholder=\"'.$info['text'].'\"').' value=\"%%' . $info['name'] . '%%\" />'.$input_container_end_html;\n }\n $replacement_fields[] = $info['name'];\n }\n\n if (!isset($data['extra_fields']) || !is_array($data['extra_fields'])) {\n $data['extra_fields'] = array();\n }\n\n if (isset($order)) {\n $data['order'] = $order;\n }\n\n _op_tpl('clear');\n $template = _op_tpl('_load_file', OPPP_BASE_DIR . 'templates/elements/optin_box/style_' . $style . '.php', $data, true);\n\n $cached = array(\n 'template' => $template,\n 'replacement_fields' => $replacement_fields,\n 'shortcodes' => isset($data['shortcodes']) ? $data['shortcodes'] : null,\n );\n\n /*\n * Cache busting needed again because of child elements\n */\n if (function_exists('wp_using_ext_object_cache')) {\n wp_using_ext_object_cache(false);\n }\n set_transient('el_' . $uidOpBox, $cached, OP_SL_ELEMENT_CACHE_LIFETIME);\n }\n\n /*\n * Loading validation script\n */\n op_validation_script();\n\n /*\n * Replace variables (prefixed and suffixed with %%)\n */\n if (is_array($cached)) {\n $html = str_replace('%%redirect_url%%', op_current_url(), $cached['template']);\n if (isset($cached['shortcodes']) && is_array($cached['shortcodes']) && count($cached['shortcodes']) > 0) {\n foreach ($cached['shortcodes'] as $key => $value) {\n $html = str_replace('%%_' . $key . '_%%', do_shortcode($value), $html);\n }\n\n }\n foreach ($cached['replacement_fields'] as $field) {\n $html = str_replace('%%' . $field . '%%', getOptinUrlValue($field), $html);\n }\n } else {\n $html = str_replace('%%redirect_url%%', op_current_url(), $cached);\n }\n\n /*\n * Fix optin nonce\n */\n $nonce = wp_nonce_field('op_optin', 'op_optin_nonce', true, false);\n $html = str_replace('</form>', $nonce . '</form>', $html);\n\n /*\n * Cache busting\n */\n if (function_exists('wp_using_ext_object_cache')) {\n wp_using_ext_object_cache($extCache);\n }\n\n return $html;\n }", "function ag_head_elements() {\n\tif(get_option('ag_disable_rclick')) {\n\t\t?>\n <style type=\"text/css\">\n\t\t.ag_gallery_wrap *, .ag_galleria_slider_wrap *, #lcl_wrapper * {\n\t\t\t-webkit-touch-callout: none; \n\t\t\t-webkit-user-select: none;\n\t\t}\n\t\t</style>\n <?php\t\n\t}\n}", "static public function wpp_feps_info( $atts = '' ) {\n global $wp_query;\n \n $args = shortcode_atts( array(\n 'before' => '',\n 'after' => '',\n 'title' => '',\n ), $atts );\n extract( $args );\n \n //* STEP 1. Go through conditions and set vars */\n \n if( !isset( $wp_query->wpp_feps_edit_page ) || $wp_query->wpp_feps_edit_page !== true ) {\n return null;\n }\n \n //** Determine if the current post is property */\n $post = get_post( $_REQUEST[ 'feps' ] );\n if( empty( $post ) || $post->post_type != \"property\" ) {\n return null;\n }\n \n //** Determine if the current post belongs to FEPS */\n $form = self::get_form_by_post( $post->ID );\n if( !$form ) {\n return null;\n }\n\n $expired_time = get_post_meta( $post->ID, FEPS_META_EXPIRED, true );\n $expired_time = !empty( $expired_time ) ? WPP_F::nice_time( $expired_time, array('format'=>'date') ) : __( 'Not set', ud_get_wpp_feps()->domain );\n $sponsored = !empty( $form[ 'feps_credits' ] ) && $form[ 'feps_credits' ] == 'true' ? true : false;\n $plan = get_post_meta( $post->ID, FEPS_META_PLAN, true );\n \n //* STEP 2. Render Menu */\n \n ob_start();\n\n echo $before;\n\n ?>\n <div class=\"wpp_feps_property_info wpp_shortcode_feps_info wpp_shortcode wpp_shortcode_feps_menu wpp_feps_user_menu\">\n <?php if( !empty( $title ) ) : ?>\n <h5><?php echo $title; ?></h5>\n <?php endif; ?>\n <ul>\n <li>\n <span class=\"title\"><?php _e(\"Title\", ud_get_wpp_feps()->domain); ?></span><span class=\"doubledot\">:</span>\n <span class=\"value\"><?php echo $post->post_title; ?></span>\n </li>\n <li>\n <span class=\"title\"><?php _e(\"Status\", ud_get_wpp_feps()->domain); ?></span><span class=\"doubledot\">:</span>\n <span class=\"value\"><?php echo WPP_F::clear_post_status( $post->post_status ); ?></span>\n </li>\n <?php if( !empty( $expired_time ) ): ?>\n <li>\n <span class=\"title\"><?php _e(\"Expired\", ud_get_wpp_feps()->domain); ?></span><span class=\"doubledot\">:</span>\n <span class=\"value\"><?php echo $expired_time; ?></span>\n </li>\n <?php endif; ?>\n <?php if( !empty( $plan ) && is_array( $plan ) ) : ?>\n <li>\n <span class=\"title\"><?php _e(\"Subscription Plan\", ud_get_wpp_feps()->domain); ?></span><span class=\"doubledot\">:</span>\n <span class=\"value\"><?php echo $plan[ 'name' ]; ?></span>\n </li>\n <li>\n <span class=\"title\"><?php _e(\"Paid\", ud_get_wpp_feps()->domain); ?></span><span class=\"doubledot\">:</span>\n <span class=\"value\"><?php printf( __( '%01.2f credits', ud_get_wpp_feps()->domain ), $plan[ 'price' ] ); ?></span>\n </li>\n <li>\n <span class=\"title\"><?php _e(\"Plan Details\", ud_get_wpp_feps()->domain); ?></span><span class=\"doubledot\">:</span><br/>\n <span><?php _e(\"Duration\", ud_get_wpp_feps()->domain); ?></span><span class=\"doubledot\">:</span>\n <span class=\"value\"><?php printf( '%d %s', $plan['duration']['value'], _n( $plan['duration']['interval'], $plan['duration']['interval'].'s', $plan['duration']['value'], ud_get_wpp_feps()->domain ) ); ?></span><br/>\n <span><?php _e(\"Images Limit\", ud_get_wpp_feps()->domain); ?></span><span class=\"doubledot\">:</span>\n <span class=\"value\"><?php echo ( !empty( $plan['images_limit'] ) ? $plan['images_limit'] : '1' ); ?></span>\n </li>\n <?php elseif ( $sponsored ): ?>\n <li>\n <span class=\"title\"><?php _e(\"Subscription Plan\", ud_get_wpp_feps()->domain); ?></span><span class=\"doubledot\">:</span>\n <span class=\"value\"><?php _e( 'Not Paid Yet', ud_get_wpp_feps()->domain ); ?></span>\n </li>\n <?php endif; ?>\n </ul>\n </div>\n <?php\n\n echo $after;\n $content = ob_get_clean();\n return $content;\n }", "function banner_shortcode($atts)\n\t\t{\n\t\t\t$banner_title = $module_animation = $banner_desc = $banner_icon = $banner_image = $banner_link = $banner_link_text = $banner_style = $banner_bg_color = $banner_title_font_size = $banner_title_letter_spacing = $banner_desc_letter_spacing = $el_class = $animation = $icon_disp = $link_opts = $banner_title_location = $banner_title_style_inline = $banner_desc_style_inline = '';\n\t\t\textract(shortcode_atts( array(\n\t\t\t\t'module_animation' => '',\n\t\t\t\t'banner_title' => '',\n\t\t\t\t'banner_desc' => '',\n\t\t\t\t'banner_title_location' => 'center',\n\t\t\t\t'icon_disp' => 'none',\n\t\t\t\t'banner_icon' => '',\n\t\t\t\t'banner_image' => '',\n\t\t\t\t'banner_height'=>'',\n\t\t\t\t'banner_height_val'=>'',\n\t\t\t\t'link_opts' => 'none',\n\t\t\t\t'banner_link' => '',\n\t\t\t\t'banner_link_text' => '',\n\t\t\t\t'banner_style' => 'style01',\n\t\t\t\t'banner_bg_color' => 'transparent',\n\t\t\t\t'banner_opacity' => 'opaque',\n\t\t\t\t'el_class' =>'',\n\t\t\t\t'animation' => '',\n\t\t\t\t'banner_title_font_family' => '',\n\t\t\t\t'banner_title_style' => '',\n\t\t\t\t'banner_title_font_size' => '',\n\t\t\t\t'banner_title_letter_spacing' => '',\n\t\t\t\t'banner_desc_font_family' => '',\n\t\t\t\t'banner_desc_style' => '',\n\t\t\t\t'banner_desc_font_size' => '',\n\t\t\t\t'banner_desc_letter_spacing' => ''\n\t\t\t),$atts));\n\t\t\t$output = $icon = $style = $target = '';\n\t\t\t//$banner_style = 'style01';\n\t\t\t\n\t\t\tif($banner_title_font_family != '')\n\t\t\t{\n\t\t\t\t$bfamily = get_ultimate_font_family($banner_title_font_family);\n\t\t\t\t$banner_title_style_inline = 'font-family:\\''.esc_attr($bfamily).'\\';';\n\t\t\t}\n\t\t\t$banner_title_style_inline .= get_ultimate_font_style($banner_title_style);\n\t\t\tif($banner_title_font_size != '')\n\t\t\t\t$banner_title_style_inline .= 'font-size:'.esc_attr($banner_title_font_size).'px;';\n\t\t\tif($banner_title_letter_spacing != '')\n\t\t\t\t$banner_title_style_inline .= 'letter-spacing:'.esc_attr($banner_title_letter_spacing).'px;';\n\t\t\tif($banner_bg_color != '')\n\t\t\t\t$banner_title_style_inline .= 'background:'.esc_attr($banner_bg_color).';';\n\t\t\t\t\n\t\t\tif($banner_desc_font_family != '')\n\t\t\t{\n\t\t\t\t$bdfamily = get_ultimate_font_family($banner_desc_font_family);\n\t\t\t\t$banner_desc_style_inline = 'font-family:\\''.esc_attr($bdfamily).'\\';';\n\t\t\t}\n\t\t\t$banner_desc_style .= get_ultimate_font_style($banner_desc_style);\n\t\t\tif($banner_desc_font_size != '')\n\t\t\t\t$banner_desc_style_inline .= 'font-size:'.esc_attr($banner_desc_font_size).'px;';\n\t\t\tif($banner_desc_letter_spacing != '')\n\t\t\t\t$banner_desc_style_inline .= 'letter-spacing:'.esc_attr($banner_desc_letter_spacing).'px;';\n\t\t\t\n\t\t\t//enqueue google font\n\t\t\t$args = array(\n\t\t\t\t$banner_title_font_family, $banner_desc_font_family\n\t\t\t);\n\t\t\tenquque_ultimate_google_fonts($args);\n\t\t\t\n\n\t\t\tif($banner_icon !== '')\n\t\t\t\t$icon = '<i class=\"'.esc_attr($banner_icon).'\"></i>';\n\t\t\t$img = wp_get_attachment_image_src( $banner_image, 'large');\n\t\t\t$href = vc_build_link($banner_link);\n\t\t\tif(isset($href['target']) && $href['target'] != ''){\n\t\t\t\t$target = 'target=\"'.esc_attr(preg_replace('/\\s+/', '', $href['target'])).'\"';\n\t\t\t}\n\n\t\t\t$animate = $animation_data = '';\n\n\t\t\tif ( ! ( $module_animation == '' ) ) {\n\t\t\t\t$animate = ' cr-animate-gen';\n\t\t\t\t$animation_data = 'data-animate-type = \"' . esc_attr($module_animation) . '\" ';\n\t\t\t}\n\n\t\t\t$banner_top_style='';\n\t\t\tif($banner_height!='' && $banner_height_val!=''){\n\t\t\t\t$banner_top_style = 'height:'.esc_attr($banner_height_val).'px;';\n\t\t\t}\n\t\t\t$output .= \"\\n\".'<div class=\"banner-block '.esc_attr($banner_height).' banner-'.esc_attr($banner_style).' '.esc_attr($el_class).' '.esc_attr($animate).'\" style=\"'.$banner_top_style.'\" '.$animation_data.'>';\n\t\t\t$output .= \"\\n\\t\".'<img src=\"'.esc_attr($img[0]).'\" alt=\"'.esc_attr($banner_title).'\">';\n\t\t\tif($banner_title !== ''){\n\t\t\t\t$output .= \"\\n\\t\".'<div class=\"block-title title-'.esc_attr($banner_title_location).' bb-top-title\" style=\"'.$banner_title_style_inline.'\">'.$banner_title;\n\t\t\t\tif($icon_disp == \"with_heading\" || $icon_disp == \"both\")\n\t\t\t\t\t$output .= $icon;\n\t\t\t\t$output .= '</div>';\n\t\t\t}\n\t\t\t$output .= \"\\n\\t\".'<div class=\"mask '.esc_attr($banner_opacity).'-background\">';\n\t\t\tif($icon_disp == \"with_description\" || $icon_disp == \"both\"){\n\t\t\t\tif($banner_icon !== ''){\n\t\t\t\t\t$output .= \"\\n\\t\\t\".'<div class=\"bb-back-icon\">'.$icon.'</div>';\n\t\t\t\t\t$output .= \"\\n\\t\\t\".'<p>'.$banner_desc.'</p>';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$output .= \"\\n\\t\\t\".'<p class=\"bb-description\" style=\"'.$banner_desc_style_inline.'\">'.$banner_desc.'</p>';\n\t\t\t}\n\t\t\tif($link_opts == \"more\")\n\t\t\t\t$output .= \"\\n\\t\\t\".'<a class=\"bb-link\" href=\"'.esc_url($href['url']).'\" '.$target.'>'.$banner_link_text.'</a>';\n\t\t\t$output .= \"\\n\\t\".'</div>';\n\t\t\t$output .= \"\\n\".'</div>';\n\t\t\tif($link_opts == \"box\"){\n\t\t\t\t$banner_with_link = '<a class=\"bb-link\" href=\"'.esc_url($href['url']).'\" '.$target.'>'.$output.'</a>';\n\t\t\t\treturn $banner_with_link;\n\t\t\t} else {\n\t\t\t\treturn $output;\n\t\t\t}\n\t\t}", "function air_alert_shortcode($atts,$content=NULL) {\n\textract( shortcode_atts( array(\n\t\t'type'=>'white',\n\t), $atts) );\n\tif(!in_array($type,array('white','green','red','blue','yellow')))\n\t\t$type = 'white';\n\t$output = '<div class=\"alert '.$type.'\">'.$content.'</div>';\n\treturn $output;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uploads a chunk of file and returns the upload id and offset representing the number of bytes transferred so far. The first chunk will be uploaded without setting an upload_id. The default offset for the first chunk is 0. After each chunk has been uploaded, the server returns a new offset.
private function uploadChunk($params = array()) { $httpMethod = 'PUT'; $urlBase = 'https://api-content.dropbox.com/1/chunked_upload'; $urlParams = ''; if ($params['uploadId'] != null && $params['offset'] != 0) { $urlParams = '?upload_id=' . $params['uploadId'] . '&offset=' . $params['offset']; } $requestHeaders = array('Authorization: ' . $this->getAccessToken(), 'Content-Type: application'); $requestContent = $params['chunkOfFile']; $params = array('httpMethod' => $httpMethod, 'urlBase' => $urlBase . $urlParams, 'headers' => $requestHeaders, 'content' => $requestContent); $response = $this->sendRequest($params); if (!$response->isOk()) { throw new UploadFailedException($response->getStatusCode(), $response->getReasonPhrase( ), $response->getContent()); } else { $content = json_decode($response->getContent(), true); $uploadId = $content['upload_id']; $offset = $content['offset']; return array('uploadId' => $uploadId, 'offset' => $offset); } }
[ "private function pack_chunk() {\n\t\t$Err = new ChunkUploadError;\n\n\t\t$index = $chunk = $chunk_path = null;\n\t\textract($this->chunk_data);\n\n\t\t# truncate or append\n\t\t$fhn = @fopen($tempname, ($index === 0 ? 'wb' : 'ab'));\n\t\tif (false === $fhn) {\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\tself::$logger->error(\n\t\t\t\t\"Chupload: cannot open temp file: '$tempname'.\");\n\t\t\treturn $Err::EDIO_WRITE_FAIL;\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t}\n\t\tif (!flock($fhn, LOCK_EX | LOCK_NB)) {\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\tself::$logger->error(\n\t\t\t\t\"Chupload: temporary file busy: '$tempname'.\");\n\t\t\treturn $Err::EDIO_BUSY;\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t}\n\t\t# write to temp blob\n\t\tfwrite($fhn, $chunk);\n\t\t# append index\n\t\tif ($index < $max_chunk && $max_chunk >= 1)\n\t\t\tfwrite($fhn, pack('v', $index));\n\t\tfclose($fhn);\n\t\t# remove chunk\n\t\t$this->unlink($chunk_path);\n\n\t\treturn 0;\n\t}", "public function uploadChunk($nextChunk = true) {\n\t\tif($nextChunk) {\n\t\t\t$this->chunk = fread($this->handle, $this->chunkSizeBytes);\n\t\t}\n\t\t$this->status = $this->media->nextChunk($this->chunk);\n\t\t$this->updateProgressBar();\n\t}", "public function chunked_upload($caller, $file, $cloudpath, $logname, $chunk_size, $uploaded_size, $singletons = false) {\n\n\t\t$fullpath = $this->backups_dir_location().'/'.$file;\n\t\t$orig_file_size = filesize($fullpath);\n\t\t\n\t\tif ($uploaded_size >= $orig_file_size && !method_exists($caller, 'chunked_upload_finish')) return true;\n\n\t\t$chunks = floor($orig_file_size / $chunk_size);\n\t\t// There will be a remnant unless the file size was exactly on a chunk boundary\n\t\tif ($orig_file_size % $chunk_size > 0) $chunks++;\n\n\t\t$this->log(\"$logname upload: $file (chunks: $chunks, of size: $chunk_size) -> $cloudpath ($uploaded_size)\");\n\n\t\tif (0 == $chunks) {\n\t\t\treturn 1;\n\t\t} elseif ($chunks < 2 && !$singletons) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// We have multiple chunks\n\t\tif ($uploaded_size < $orig_file_size) {\n\t\t\t\n\t\t\tif (false == ($fp = @fopen($fullpath, 'rb'))) {// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t\t\t$this->log(\"$logname: failed to open file: $fullpath\");\n\t\t\t\t$this->log(\"$file: \".sprintf(__('%s Error: Failed to open local file', 'updraftplus'), $logname), 'error');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$upload_start = 0;\n\t\t\t$upload_end = -1;\n\t\t\t$chunk_index = 1;\n\t\t\t// The file size minus one equals the byte offset of the final byte\n\t\t\t$upload_end = min($chunk_size - 1, $orig_file_size - 1);\n\t\t\t$errors_on_this_chunk = 0;\n\t\t\t\n\t\t\twhile ($upload_start < $orig_file_size) {\n\t\t\t\n\t\t\t\t// Don't forget the +1; otherwise the last byte is omitted\n\t\t\t\t$upload_size = $upload_end - $upload_start + 1;\n\n\t\t\t\tfseek($fp, $upload_start);\n\n\t\t\t\t/*\n\t\t\t\t* Valid return values for $uploaded are many, as the possibilities have grown over time.\n\t\t\t\t* This could be cleaned up; but, it works, and it's not hugely complex.\n\t\t\t\t*\n\t\t\t\t* WP_Error : an error occured. The only permissible codes are: reduce_chunk_size (only on the first chunk), try_again\n\t\t\t\t* (bool)true : What was requested was done\n\t\t\t\t* (int)1 : What was requested was done, but do not log anything\n\t\t\t\t* (bool)false : There was an error\n\t\t\t\t* (Object) : Properties:\n\t\t\t\t* (bool)log: (bool) - if absent, defaults to true\n\t\t\t\t* (int)new_chunk_size: advisory amount for the chunk size for future chunks\n\t\t\t\t* NOT IMPLEMENTED: (int)bytes_uploaded: Actual number of bytes uploaded (needs to be positive - o/w, should return an error instead)\n\t\t\t\t* N.B. Consumers should consult $fp and $upload_start to get data; they should not re-calculate from $chunk_index, which is not an indicator of file position.\n\t\t\t\t*/\n\t\t\t\t$uploaded = $caller->chunked_upload($file, $fp, $chunk_index, $upload_size, $upload_start, $upload_end, $orig_file_size);\n\n\t\t\t\t// Try again? (Just once - added in 1.12.6 (can make more sophisticated if there is a need))\n\t\t\t\tif (is_wp_error($uploaded) && 'try_again' == $uploaded->get_error_code()) {\n\t\t\t\t\t// Arbitrary wait\n\t\t\t\t\tsleep(3);\n\t\t\t\t\t$this->log(\"Re-trying after wait (to allow apparent inconsistency to clear)\");\n\t\t\t\t\t$uploaded = $caller->chunked_upload($file, $fp, $chunk_index, $upload_size, $upload_start, $upload_end, $orig_file_size);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// This is the only other supported case of a WP_Error - otherwise, a boolean must be returned\n\t\t\t\t// Note that this is only allowed on the first chunk. The caller is responsible to remember its chunk size if it uses this facility.\n\t\t\t\tif (1 == $chunk_index && is_wp_error($uploaded) && 'reduce_chunk_size' == $uploaded->get_error_code() && false != ($new_chunk_size = $uploaded->get_error_data()) && is_numeric($new_chunk_size)) {\n\t\t\t\t\t$this->log(\"Re-trying with new chunk size: \".$new_chunk_size);\n\t\t\t\t\treturn $this->chunked_upload($caller, $file, $cloudpath, $logname, $new_chunk_size, $uploaded_size, $singletons);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$uploaded_amount = $chunk_size;\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t// Not using this approach for now. Instead, going to allow the consumers to increase the next chunk size\n\t\t\t\tif (is_object($uploaded) && isset($uploaded->bytes_uploaded)) {\n\t\t\t\t\tif (!$uploaded->bytes_uploaded) {\n\t\t\t\t\t\t$uploaded = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$uploaded_amount = $uploaded->bytes_uploaded;\n\t\t\t\t\t\t$uploaded = (!isset($uploaded->log) || $uploaded->log) ? true : 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tif (is_object($uploaded) && isset($uploaded->new_chunk_size)) {\n\t\t\t\t\tif ($uploaded->new_chunk_size >= 1048576) $new_chunk_size = $uploaded->new_chunk_size;\n\t\t\t\t\t$uploaded = (!isset($uploaded->log) || $uploaded->log) ? true : 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// The joys of WP/PHP: is_wp_error() is not false-y.\n\t\t\t\tif ($uploaded && !is_wp_error($uploaded)) {\n\t\t\t\t\t$perc = round(100*($upload_end + 1)/max($orig_file_size, 1), 1);\n\t\t\t\t\t// Consumers use a return value of (int)1 (rather than (bool)true) to suppress logging\n\t\t\t\t\t$log_it = (1 === $uploaded) ? false : true;\n\t\t\t\t\t$this->record_uploaded_chunk($perc, $chunk_index, $fullpath, $log_it);\n\t\t\t\t\t\n\t\t\t\t\t// $uploaded_bytes = $upload_end + 1;\n\t\t\t\t\t\n\t\t\t\t\t// If there was an error, then we re-try the same chunk; we don't move on to the next one. Otherwise, we would need more code to handle potential 'intermediate' failed chunks (in case PHP dies before this method eventually returns false, and thus the intermediate chunk failure never gets detected)\n\t\t\t\t\t$chunk_index++;\n\t\t\t\t\t$errors_on_this_chunk = 0;\n\t\t\t\t\t$upload_start = $upload_end + 1;\n\t\t\t\t\t$upload_end += isset($new_chunk_size) ? $uploaded_amount + $new_chunk_size - $chunk_size : $uploaded_amount;\n\t\t\t\t\t$upload_end = min($upload_end, $orig_file_size - 1);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t$errors_on_this_chunk++;\n\t\t\t\t\t\n\t\t\t\t\t// Either $uploaded is false-y, or is a WP_Error\n\t\t\t\t\tif (is_wp_error($uploaded)) {\n\t\t\t\t\t\t$this->log(\"$logname: Chunk upload ($chunk_index) failed (\".$uploaded->get_error_code().'): '.$uploaded->get_error_message());\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->log(\"$logname: Chunk upload ($chunk_index) failed\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($errors_on_this_chunk >= 3) {\n\t\t\t\t\t\t@fclose($fp);// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t@fclose($fp);// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\n\t\t}\n\n\t\t// All chunks are uploaded - now combine the chunks\n\t\t$ret = true;\n\t\t\n\t\t// The action calls here exist to aid debugging\n\t\tif (method_exists($caller, 'chunked_upload_finish')) {\n\t\t\tdo_action('updraftplus_pre_chunked_upload_finish', $file, $caller);\n\t\t\t$ret = $caller->chunked_upload_finish($file);\n\t\t\tif (!$ret) {\n\t\t\t\t$this->log(\"$logname - failed to re-assemble chunks\");\n\t\t\t\t$this->log(sprintf(__('%s error - failed to re-assemble chunks', 'updraftplus'), $logname), 'error');\n\t\t\t}\n\t\t\tdo_action('updraftplus_post_chunked_upload_finish', $file, $caller, $ret);\n\t\t}\n\t\t\n\t\tif ($ret) {\n\t\t\t// We allow chunked_upload_finish to return (int)1 to indicate that it took care of any logging.\n\t\t\tif (true === $ret) $this->log(\"$logname upload: success\");\n\t\t\t$ret = true;\n\t\t\t// UpdraftPlus_RemoteStorage_Addons_Base calls this itself\n\t\t\tif (!is_a($caller, 'UpdraftPlus_RemoteStorage_Addons_Base_v2')) $this->uploaded_file($file);\n\t\t}\n\n\t\treturn $ret;\n\n\t}", "function getFileChunk() {\n $request = $this->_controler->request;\n\n if ($request->exist('item_id')) {\n $item_id = $request->get('item_id');\n $item_factory = $this->_getItemFactory();\n $item = $item_factory->getItemFromDb($item_id);\n if ($item !== null) {\n $itemType = $item_factory->getItemTypeForItem($item);\n if($itemType == PLUGIN_DOCMAN_ITEM_TYPE_FILE || $itemType == PLUGIN_DOCMAN_ITEM_TYPE_EMBEDDEDFILE) {\n if ($request->exist('version_number')) {\n $version_factory = $this->_getVersionFactory();\n $version = $version_factory->getSpecificVersion($item, $request->get('version_number'));\n } else {\n $version = $item->getCurrentVersion();\n }\n if ($version) {\n if (file_exists($version->getPath())) {\n if ($request->exist('chunk_offset') && $request->exist('chunk_size')) {\n $contents = file_get_contents($version->getPath(),NULL, NULL, $request->get('chunk_offset'), $request->get('chunk_size'));\n $this->_controler->_viewParams['action_result'] = base64_encode($contents);\n }\n }\n } else {\n $this->_controler->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_version_not_exist'));\n }\n } else {\n $this->_controler->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_not_a_file'));\n }\n } else {\n $this->_controler->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_filenotfound'));\n }\n } else {\n $this->_controler->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_item_id_missing'));\n }\n }", "function _saveUpload_processChunking(&$uploadInfo, $workingDir, $fieldSchema, $skipUploadSecurityCheck) {\r\n \r\n // prepare return values\r\n $errors = '';\r\n $mainUploadWorkingPath = '';\r\n \r\n // plupload sets $uploadInfo['name'] to \"blob\", the real (client-desired) filename is in $_REQUEST['name']\r\n $uploadInfo['name'] = @$_REQUEST['name'];\r\n \r\n // check to make sure file passes \"is_uploaded_file\" (unless we're skipping that check)\r\n if (!$skipUploadSecurityCheck && !is_uploaded_file($uploadInfo['tmp_name'])) {\r\n return \"Error saving '\" . htmlencode($uploadInfo['name']) . \"', file wasn't uploaded properly.<br>\\n\";\r\n }\r\n \r\n // determine if we are processing the first or last chunk\r\n $chunkTotal = @$_REQUEST['chunks'];\r\n $chunkIndex = @$_REQUEST['chunk'];\r\n $isFirstChunk = ($chunkIndex == 0);\r\n $isLastChunk = ($chunkIndex == $chunkTotal - 1);\r\n \r\n // first chunk of upload should create a file in processing/\r\n if ($isFirstChunk) {\r\n \r\n // promote temp file\r\n $mainUploadWorkingPath = _saveUpload_moveTempUploadFile($uploadInfo['tmp_name'], $workingDir, $skipUploadSecurityCheck);\r\n \r\n // store $mainUploadWorkingPath in session (since future calls to _saveUpload_chooseUniqueNumberedFilename would generate a new, unique filename) and stop processing the upload for now...\r\n $_SESSION['uploadChunks'][$uploadInfo['name']]['mainUploadWorkingPath'] = $mainUploadWorkingPath;\r\n \r\n // done for now, we need to wait for more chunk(s)\r\n }\r\n \r\n // subsequent chunks should append to the target file\r\n else {\r\n \r\n // load saveAsFilenameAndPath from session (saved when the first chunk was processed)\r\n $mainUploadWorkingPath = @$_SESSION['uploadChunks'][$uploadInfo['name']]['mainUploadWorkingPath'];\r\n if (!$mainUploadWorkingPath) { return [\"Chunked uploading failed -- session problem?\", $isLastChunk, $mainUploadWorkingPath]; }\r\n \r\n // append subsequent chunk\r\n $errors = _saveUpload_appendChunk($mainUploadWorkingPath, $uploadInfo, $fieldSchema);\r\n if ($errors) {\r\n @unlink($mainUploadWorkingPath);\r\n unset($_SESSION['uploadChunks'][$uploadInfo['name']]);\r\n return [\"Chunked uploading failed -- \" . $error, $isLastChunk, $mainUploadWorkingPath];\r\n }\r\n \r\n // if this is the last chunk, clean up the session...\r\n if ($isLastChunk) {\r\n unset($_SESSION['uploadChunks'][$uploadInfo['name']]);\r\n }\r\n \r\n }\r\n \r\n return [$errors, $isLastChunk, $mainUploadWorkingPath];\r\n}", "protected function handleChunkedUpload(UploadedFile $file, ResponseInterface $response, Request $request): void\n {\n /** @var ChunkManagerInterface $chunkManager */\n $chunkManager = $this->container->get('oneup_uploader.chunk_manager');\n\n // get information about this chunked request\n [$last, $uuid, $index, $orig] = $this->parseChunkedRequest($request);\n $chunk = $chunkManager->addChunk($uuid, $index, $file, $orig);\n\n if (null !== $chunk) {\n $this->dispatchChunkEvents($chunk, $response, $request, $last);\n }\n\n if ($chunkManager->getLoadDistribution()) {\n $chunks = $chunkManager->getChunks($uuid);\n $assembled = $chunkManager->assembleChunks($chunks, true, $last);\n\n if (null === $chunk) {\n $this->dispatchChunkEvents($assembled, $response, $request, $last);\n }\n } else {\n $chunks = $chunkManager->getChunks($uuid);\n $assembled = $chunkManager->assembleChunks($chunks, true, true);\n }\n\n // if all chunks collected and stored, proceed\n // with reassembling the parts\n if ($last) {\n $path = $assembled->getPath();\n $this->handleUpload($assembled, $response, $request);\n\n $chunkManager->cleanup($path);\n }\n }", "public function addChunk(string $uuid, int $index, UploadedFile $chunk, string $original);", "function getCurrentChunkNumber();", "protected function uploadCachedMultipart()\n {\n switch ($this->mode) {\n case S3Storage::MODE_UPLOAD:\n throw new StorageException(\n 'onChunk called in upload mode - file already uploaded',\n StorageException::S3_EXTRA_CALL\n );\n break;\n case S3Storage::MODE_UNKNOWN:\n $this->initializeMultipart();\n break;\n }\n if (count($this->cache) > 0) {\n $partNumber = count($this->parts) + 1;\n $this->logger->debug(sprintf('Sending part %d', $partNumber));\n $res = $this->s3->uploadPart([\n 'Bucket' => $this->bucket,\n 'Key' => $this->filename,\n 'Body' => implode('', $this->cache),\n 'PartNumber' => $partNumber,\n 'UploadId' => $this->uploadId\n ]);\n $this->parts[] = [\n 'ETag' => $res['ETag'],\n 'PartNumber' => $partNumber\n ];\n $this->cache = [];\n }\n }", "public function addChunk($uuid, $index, UploadedFile $chunk, $original);", "public function getUploadId() { return (int)$this->upload_id; }", "public function insertChunk() {\r\n\r\n $mStart = $this->currentOffset;\r\n $mNumRows = count($this->rows);\r\n $mEnd = ($mStart + $this->chunkSize) > $mNumRows ? $mNumRows : $mStart + $this->chunkSize;\r\n\r\n $mSql = array();\r\n for ($mRowNum = $mStart; $mRowNum < $mEnd; $mRowNum++) {\r\n $mRow = $this->rows[$mRowNum];\r\n\r\n $mFieldValues = array();\r\n $mFieldNames = array();\r\n\r\n foreach ($mRow as $mFieldNameIndex => $mField) {\r\n $mFieldNames[] = $this->fields[$mFieldNameIndex];\r\n if ($this->dbconn !== null) {\r\n $mFieldValues[] = sprintf(\"'%s'\",\r\n mysqli_escape_string($this->dbconn,\r\n $mField));\r\n } else {\r\n $mFieldValues[] = sprintf(\"'%s'\",\r\n addslashes($mField));\r\n }\r\n }\r\n\r\n $mSql[] = sprintf(\"INSERT INTO %s (%s) VALUES (%s);\",\r\n $this->tmpName,\r\n implode(\", \",\r\n $mFieldNames),\r\n implode(\", \",\r\n $mFieldValues));\r\n $this->currentOffset++;\r\n }\r\n\r\n if (count($mSql) === 0) {\r\n return false;\r\n } else {\r\n return $this->dbExec($mSql);\r\n }\r\n }", "public function uploadPart($bucket_name, $object_name, $file_name,\r\n $offset, $part_size, $upload_id, $part_number, $options = array()) {\r\n\r\n if ($part_number < 1 || $part_number > MAX_PARTS) {\r\n throw new baidubce_exception_BceIllegalArgumentException(\"Invalid part number.\");\r\n }\r\n\r\n // Only the last part's size can less than MIN_PART_SIZE, but\r\n // we don't know the total part count, so we have no way to do this check.\r\n if ($part_size >= MAX_PART_SIZE) {\r\n throw new baidubce_exception_BceIllegalArgumentException(\r\n sprintf(\"Invalid size, the maximum part size is %d\", MAX_PART_SIZE));\r\n }\r\n\r\n list($headers, $params) = $this->checkOptions($options);\r\n $params['partnumber'] = $part_number;\r\n $params['uploadId'] = $upload_id;\r\n\r\n if (!isset($headers['Content-Type'])) {\r\n $headers['Content-Type'] = baidubce_util_Coder::guessMimeType($file_name);\r\n }\r\n\r\n $file_size = filesize($file_name);\r\n $fp = fopen($file_name, 'rb');\r\n\r\n try {\r\n $response = $this->putObjectFromHandle($bucket_name, $object_name, $fp, $file_size,\r\n $offset, $part_size, $headers, $params);\r\n fclose($fp);\r\n\r\n return $response;\r\n }\r\n catch(Exception $ex) {\r\n fclose($fp);\r\n throw $ex;\r\n }\r\n }", "private function insertChunksFromFile($handle, $record, &$md5)\n {\n $written = 0;\n $offset = 0;\n $i = 0;\n\n $fileId = $record['_id'];\n $chunkSize = $record['chunkSize'];\n\n $hash = hash_init('md5');\n\n rewind($handle);\n while (! feof($handle)) {\n $data = stream_get_contents($handle, $chunkSize);\n hash_update($hash, $data);\n $this->insertChunk($fileId, $data, $i++);\n $written += strlen($data);\n $offset += $chunkSize;\n }\n\n $md5 = hash_final($hash);\n\n return $written;\n }", "function transfer_chunk( $fp ) {\n\t\t$state_data = $state_data = $this->migration_state_manager->set_post_data();\n\t\t$this->migration_state_manager->set_post_data();\n\n\t\tif ( in_array( $state_data['intent'], array( 'savefile', 'find_replace', 'import' ) ) || 'backup' == $state_data['stage'] ) {\n\n\t\t\tif ( 'find_replace' === $state_data['stage'] ) {\n\t\t\t\t$this->process_chunk( $this->query_buffer );\n\t\t\t} else {\n\t\t\t\t$this->filesystem->close( $fp );\n\t\t\t}\n\n\t\t\t$result = array(\n\t\t\t\t'current_row' => $this->row_tracker,\n\t\t\t\t'primary_keys' => serialize( $this->primary_keys ),\n\t\t\t);\n\n\t\t\tif ( $state_data['intent'] == 'savefile' && $state_data['last_table'] == '1' ) {\n\t\t\t\t$result['dump_filename'] = $state_data['dump_filename'];\n\t\t\t\t$result['dump_path'] = $state_data['dump_path'];\n\t\t\t}\n\n\t\t\t$result = $this->http->end_ajax( json_encode( $result ) );\n\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ( $state_data['intent'] == 'pull' ) {\n\t\t\t$result = $this->http->end_ajax( $this->row_tracker . ',' . serialize( $this->primary_keys ) );\n\n\t\t\treturn $result;\n\t\t}\n\n\t\t$chunk_gzipped = '0';\n\t\tif ( isset( $state_data['gzip'] ) && $state_data['gzip'] == '1' && Util::gzip() ) {\n\t\t\t$this->current_chunk = gzcompress( $this->current_chunk );\n\t\t\t$chunk_gzipped = '1';\n\t\t}\n\n\t\t$data = array(\n\t\t\t'action' => 'wpmdb_process_chunk',\n\t\t\t'remote_state_id' => $state_data['remote_state_id'],\n\t\t\t'table' => $state_data['table'],\n\t\t\t'chunk_gzipped' => $chunk_gzipped,\n\t\t\t'chunk' => $this->current_chunk,\n\t\t\t// NEEDS TO BE the last element in this array because of adding it back into the array in ajax_process_chunk()\n\t\t);\n\n\t\t$data['sig'] = $this->http_helper->create_signature( $data, $state_data['key'] );\n\n\t\t$ajax_url = $this->util->ajax_url();\n\t\t$response = $this->remote_post->post( $ajax_url, $data, __FUNCTION__ );\n\n\t\tob_start();\n\t\t$this->util->display_errors();\n\t\t$maybe_errors = trim( ob_get_clean() );\n\n\t\tif ( false === empty( $maybe_errors ) ) {\n\t\t\t$maybe_errors = array( 'wpmdb_error' => 1, 'body' => $maybe_errors );\n\t\t\t$result = $this->http->end_ajax( json_encode( $maybe_errors ) );\n\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ( '1' !== $response ) {\n\t\t\t$decoded_response = json_decode( $response, 1 );\n\t\t\tif ( $decoded_response && isset( $decoded_response['wpmdb_error'] ) && isset( $decoded_response['body'] ) ) {\n\t\t\t\t// $response is already json_encoded wpmdb_error object\n\t\t\t\t$this->error_log->log_error( 'transfer_chunk received error response: ' . $decoded_response['body'] );\n\n\t\t\t\treturn $this->http->end_ajax( $response );\n\t\t\t}\n\t\t\t$return = array( 'wpmdb_error' => 1, 'body' => $response );\n\n\t\t\treturn $this->http->end_ajax( json_encode( $return ) );\n\t\t}\n\n\t\t$result = $this->http->end_ajax( json_encode(\n\t\t\tarray(\n\t\t\t\t'current_row' => $this->row_tracker,\n\t\t\t\t'primary_keys' => serialize( $this->primary_keys ),\n\t\t\t)\n\t\t) );\n\n\t\treturn $result;\n\t}", "public function putChunk($chunk);", "public function process(NgFileChunk $chunk)\n {\n $this->prepareDirectories();\n $this->validateChunk($chunk);\n $this->finished = false;\n $this->currentChunk = $chunk;\n\n $filePath = $this->getFilePath($chunk->fileId);\n $destPath = $this->getUploadPath();\n\n // Read Uploaded chunk and Append to temporal file\n $this->readAndAppendChunk($filePath);\n\n // Check if file upload has been completed\n $this->moveWhenFinished($filePath, $destPath, $chunk->totalSize);\n }", "protected function getCurrentChunkNumber()\n {\n return $this->request->input('flowChunkNumber');\n }", "public function chunk(Request $request)\n {\n $chunk = (int)$request->input('chunk', 0);\n $chunks = (int)$request->input('chunks', 0);\n $isVoice = $request->input('voice');\n\n if ($isVoice){\n $fileName = $request->input('Filename', '');\n $fileKey = 'recording';\n }else {\n $fileName = $request->input('name', '');\n $fileKey = 'file';\n }\n\n $ext = pathinfo($fileName, PATHINFO_EXTENSION);\n $fileName = 'kacana__product_'.md5($fileName);\n\n $return = array(\n 'ok' => 0,\n 'jsonrpc' => '2.0',\n 'message' => '',\n 'id' => 'id',\n 'name' => ''\n );\n\n try {\n $contentType = $this->getContentType();\n $targetDir = PRODUCT_IMAGE;\n\n $filePath = $targetDir . $fileName;\n $finalFileName = $fileName.'.'.$ext;\n $partFilePath = $filePath.'.'.'part';\n $finalFilePath = $filePath.'.'.$ext;\n\n $this->cleanUploadDir($targetDir,$partFilePath);\n $this->setExecutionTime();\n $this->setHeaders();\n\n // Handle non multipart uploads older WebKit versions didn't support multipart in HTML5\n if (strpos($contentType, \"multipart\") !== false)\n {\n if (isset($_FILES[$fileKey]['tmp_name']) && is_uploaded_file($_FILES[$fileKey]['tmp_name']))\n {\n // Open temp file\n $out = fopen($partFilePath, $chunk == 0 ? \"wb\" : \"ab\");\n if ($out)\n {\n // Read binary input stream and append it to temp file\n $in = fopen($_FILES[$fileKey]['tmp_name'], \"rb\");\n\n if ($in)\n {\n while ($buff = fread($in, 4096))\n fwrite($out, $buff);\n }\n else\n throw new Exception('Failed to open input stream');\n\n fclose($in);\n fclose($out);\n @unlink($_FILES[$fileKey]['tmp_name']);\n }\n else\n throw new Exception('Failed to open output stream');\n }\n else\n throw new Exception('Failed to move uploaded file');\n }\n else\n {\n // Open temp file\n $out = fopen($partFilePath, $chunk == 0 ? \"wb\" : \"ab\");\n if ($out)\n {\n // Read binary input stream and append it to temp file\n $in = fopen(\"php://input\", \"rb\");\n\n if ($in)\n {\n while ($buff = fread($in, 4096))\n fwrite($out, $buff);\n }\n else\n throw new Exception('Failed to open input stream');\n\n fclose($in);\n fclose($out);\n }\n else\n throw new Exception('Failed to open output stream');\n }\n\n if (!$chunks || $chunk == $chunks - 1) {\n $type = $request->input('type');\n $isOverlay = false;\n if ($type == 'overlay') {\n $isOverlay = true;\n }\n // Strip the temp .part suffix off\n rename($partFilePath, $finalFilePath);\n $imagePath = '/'.$filePath.'.'.$ext;\n// $this->optimizeImage($imagePath);\n\n $return['name'] = $imagePath;\n $return['ok'] = 1;\n }\n\n } catch (Exception $e) {\n // @codeCoverageIgnoreStart\n $return['message'] = $e->getMessage();\n // @codeCoverageIgnoreEnd\n }\n return response()->json($return);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns array with Ranged weapon haste value
private function GetCharacterRangedHaste() { $player_stats = array(); $rating = $this->SetRating(); $rangedSkillID = Mangos::getSkillFromItemID($this->GetDataField(PLAYER_VISIBLE_ITEM_18_ENTRYID)); if($rangedSkillID == SKILL_UNARMED) { $player_stats['value'] = '0'; $player_stats['hasteRating'] = '0'; $player_stats['hastePercent'] = '0'; } else { $player_stats['value'] = round(Utils::getFloatValue($this->GetDataField(UNIT_FIELD_RANGEDATTACKTIME),2)/1000, 2); $player_stats['hasteRating'] = round($this->GetDataField(PLAYER_FIELD_COMBAT_RATING_1+18)); $player_stats['hastePercent'] = round($player_stats['hasteRating']/ Utils::GetRatingCoefficient($rating, 19), 2); } unset($rating); unset($rangedSkillID); return $player_stats; }
[ "private function GetCharacterOffHandMeleeHaste() {\n return array('hastePercent' => 0, 'hasteRating' => 0, 'value' => 0);\n }", "private function GetCharacterRangedDamage() {\n $tmp_stats = array();\n $rangedSkillID = Mangos::getSkillFromItemID($this->GetDataField(PLAYER_VISIBLE_ITEM_18_ENTRYID));\n \n if($rangedSkillID == SKILL_UNARMED) {\n $tmp_stats['min'] = 0;\n $tmp_stats['max'] = 0;\n $tmp_stats['speed'] = 0;\n $tmp_stats['dps'] = 0;\n }\n else {\n $tmp_stats['min'] = Utils::getFloatValue($this->GetDataField(UNIT_FIELD_MINRANGEDDAMAGE), 0);\n $tmp_stats['max'] = Utils::getFloatValue($this->GetDataField(UNIT_FIELD_MAXRANGEDDAMAGE), 0);\n $tmp_stats['speed'] = round( Utils::getFloatValue($this->GetDataField(UNIT_FIELD_RANGEDATTACKTIME), 2)/1000, 2);\n $tmp_stats['ranged_dps'] = ($tmp_stats['min'] + $tmp_stats['max']) * 0.5;\n if($tmp_stats['speed'] < 0.1) {\n $tmp_stats['speed'] = 0.1;\n }\n $tmp_stats['dps'] = round((max($tmp_stats['ranged_dps'], 1) / $tmp_stats['speed']));\n }\n \n $player_stats = array(\n 'speed' => $tmp_stats['speed'],\n 'min' => $tmp_stats['min'],\n 'max' => $tmp_stats['max'],\n 'dps' => $tmp_stats['dps'],\n 'percent' => '0.00'\n );\n \n unset($tmp_stats);\n unset($rangedSkillID);\n return $player_stats;\n }", "public function getRangeProfitLoss(): array\n {\n $inputs = request();\n\n $outgoingBtcs = OutgoingBtc::orderBy('released_date', 'desc')\n ->where('released_date', '>=', $inputs->start)\n ->where('released_date', '<=', $inputs->end)\n ->select(['released_date', 'profit', 'category'])\n ->get();\n\n $profit = [];\n $loss = [];\n\n foreach ($outgoingBtcs as $outgoingBtc) {\n if ($outgoingBtc['profit'] < 0) {\n if ($outgoingBtc['category'] === 1) {\n $loss[] = $outgoingBtc['profit'] * -1;\n }\n } else {\n $profit[] = $outgoingBtc['profit'];\n }\n }\n\n $profit = array_sum($profit);\n $loss = array_sum($loss);\n\n return [$profit, $loss];\n }", "function data_range () {\n\t\t$range = array();\n\t\t\n\t\t$count = count($this->datapoints);\n\t\t\n\t\tfor ($i=1; $i < $count; $i++) {\n\t\t\t$x = $this->datapoints[$i] - $this->datapoints[$i-1];\n\n\t\t\t// Make range an unsigned number\n\t\t\tif ($x < 0) {\n\t\t\t\t$x = $x - ($x * 2);\n\t\t\t}\n\t\t\n\t\t\t$this->range[] = $x;\n\t\t}\n\t}", "private function GetCharacterSpellBonusDamage() {\n $tmp_stats = array();\n $holySchool = SPELL_SCHOOL_HOLY;\n $minModifier = Utils::GetSpellBonusDamage($holySchool, $this->guid, $this->db);\n \n for ($i=1;$i<7;$i++) {\n $bonusDamage[$i] = Utils::GetSpellBonusDamage($i, $this->guid, $this->db);\n $minModifier = min($minModifier, $bonusDamage);\n }\n $tmp_stats['holy'] = round($bonusDamage[1]);\n $tmp_stats['fire'] = round($bonusDamage[2]);\n $tmp_stats['nature'] = round($bonusDamage[3]);\n $tmp_stats['frost'] = round($bonusDamage[4]);\n $tmp_stats['shadow'] = round($bonusDamage[5]);\n $tmp_stats['arcane'] = round($bonusDamage[6]);\n $tmp_stats['attack'] = -1;\n $tmp_stats['damage'] = -1;\n if($this->class == CLASS_HUNTER || $this->class == CLASS_WARLOCK) {\n $shadow = Utils::GetSpellBonusDamage(5, $this->guid, $this->db);\n $fire = Utils::GetSpellBonusDamage(2, $this->guid, $this->db);\n $tmp_stats['attack'] = Utils::ComputePetBonus(6, max($shadow, $fire), $this->class);\n $tmp_stats['damage'] = Utils::ComputePetBonus(5, max($shadow, $fire), $this->class);\n }\n $tmp_stats['fromType'] = null;\n return $tmp_stats;\n }", "public function getAbvRange();", "public function range(): array;", "function range_array()\n {\n return self::_range_array($this->list);\n }", "public function getIrhpPermitStockRanges()\n {\n return $this->irhpPermitStockRanges;\n }", "function get_RH_max()\n{\n\treturn array(100.0,\"00:00\");\n}", "public function ranges()\n {\n return [];\n }", "public static function getRange() : array {\n\n\t\t\treturn static::$range;\n\t\t}", "function get_ability_data($a, $p){\r\n\t$array = initialize_dmg_arrays();\r\n\t$con = connect_to_server();\r\n\t\r\n\t$sql = \"SELECT * FROM `abilities` WHERE `id` = '$a'\";\r\n\t$result = mysqli_query($con, $sql);\r\n\t\r\n\t\r\n\tif($result){\r\n\t\t$data = mysqli_fetch_array($result);\r\n\t\t$atk = $data['attack'];\r\n\t\t$def = $data['defense'];\r\n\t\t$req = $data['power_req'];\r\n\t\t$useage = $data['useage'];\r\n\t\t$scale = scale_to_power($p, $req); //some abilities don't grant full effect at <40% power\r\n\t\t\r\n\t\t//parse data, add to return array\r\n\t\tif($atk){\r\n\t\t\t$atk = explode(\":\", $atk); //array of (icon,#) pairs\r\n\t\t\tforeach($atk as $att){\r\n\t\t\t\t$att = explode(\",\", $att); //mini array [icon,#]\r\n\t\t\t\t$icon = $att[0];\r\n\t\t\t\t$num = $att[1];\r\n\t\t\t\tif(substr($num, 0, 1) == \"(\"){ //indicates variable icon amount\r\n\t\t\t\t\t$num = str_replace(\"(\", '', $num);\r\n\t\t\t\t\t$num = str_replace(\")\", '', $num);\r\n\t\t\t\t\t$num = explode(\";\", $num);\r\n\t\t\t\t\t$num = roll_for_icons($num[0], $num[1], $num[2], $num[3], $num[4]);\r\n\t\t\t\t}\r\n\t\t\t\t$array[0][$icon] += $num;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($def){\r\n\t\t\t$def = explode(\":\", $def);\r\n\t\t\tforeach($def as $d){\r\n\t\t\t\t$d = explode(\",\", $d);\r\n\t\t\t\t$icon = $d[0];\r\n\t\t\t\t$num = $d[1];\r\n\t\t\t\t//vector means variable icons\r\n\t\t\t\t//roll for icon amt\r\n\t\t\t\tif(substr($num, 0, 1) == \"(\"){\r\n\t\t\t\t\t$num = str_replace(\"(\", '', $num);\r\n\t\t\t\t\t$num = str_replace(\")\", '', $num);\r\n\t\t\t\t\t$num = explode(\";\", $num);\r\n\t\t\t\t\t$num = roll_for_icons($num[0], $num[1], $num[2], $num[3], $num[4]);\r\n\t\t\t\t}\r\n\t\t\t\t$array[1][$icon] += $num;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t$array[] = array('scale' => $scale);\r\n\t$array[] = array('useage' => $useage);\r\n\treturn $array;\r\n}", "public function applyDamage(){\n\t\treturn $this->getRandomApplyingDamageValue($this->minDmg, $this->maxDmg);\n\t}", "public function getDamage();", "public function getIrhpPermitRanges()\n {\n return $this->irhpPermitRanges;\n }", "private function findStatUnder500(): array\n {\n $tired = array_filter($this->starters, function ($value) {\n return $value < 500;\n });\n asort($tired);\n return $tired;\n }", "public function highs(): array\n {\n return array_map(function ($candle) {\n return $candle->high();\n }, $this->items);\n }", "public function ranges(): array\n {\n return $this->ranges ?? [];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Terminates a search for a given PID
public function TerminateSearch($pid) { ZLog::Write(LOGLEVEL_DEBUG, sprintf("KopanoBackend->TerminateSearch(): terminating search for pid %d", $pid)); if (!isset($this->store) || $this->store === false) { ZLog::Write(LOGLEVEL_WARN, sprintf("The store is not available. It is not possible to remove search folder with pid %d", $pid)); return false; } $storeProps = mapi_getprops($this->store, array(PR_STORE_SUPPORT_MASK, PR_FINDER_ENTRYID)); if (($storeProps[PR_STORE_SUPPORT_MASK] & STORE_SEARCH_OK) != STORE_SEARCH_OK) { ZLog::Write(LOGLEVEL_WARN, "Store doesn't support search folders. Public store doesn't have FINDER_ROOT folder"); return false; } $finderfolder = mapi_msgstore_openentry($this->store, $storeProps[PR_FINDER_ENTRYID]); if(mapi_last_hresult() != NOERROR) { ZLog::Write(LOGLEVEL_WARN, sprintf("Unable to open search folder (0x%X)", mapi_last_hresult())); return false; } $hierarchytable = mapi_folder_gethierarchytable($finderfolder); mapi_table_restrict($hierarchytable, array(RES_CONTENT, array( FUZZYLEVEL => FL_PREFIX, ULPROPTAG => PR_DISPLAY_NAME, VALUE => array(PR_DISPLAY_NAME=>"Z-Push Search Folder ".$pid) ) ), TBL_BATCH); $folders = mapi_table_queryallrows($hierarchytable, array(PR_ENTRYID, PR_DISPLAY_NAME, PR_LAST_MODIFICATION_TIME)); foreach($folders as $folder) { mapi_folder_deletefolder($finderfolder, $folder[PR_ENTRYID]); } return true; }
[ "public function TerminateSearch($pid) {\n return true;\n }", "public function stop($pid = null) {\n\t\ttry {\n\t\t\t$this->int($pid);\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function consumersTerminate($pid) {\n $childpid = $this->getChildProcess($pid);\n if ($this->checkProcess($pid)) {\n exec(\"kill -9 $childpid\");\n }\n }", "public function endSearch()\n\t{\n\t\t$this->data['search_thread_id']\t\t= 0;\n\t\t$this->data['search_thread_time']\t= 0;\n\t}", "function killProcess(string $id) : void;", "public function killChild()\n {\n if (!$this->child) {\n $this->log(LogLevel::DEBUG, 'No child to kill.');\n\n return;\n }\n\n $this->log(LogLevel::INFO, sprintf('Killing child at %s', $this->child));\n\n if (exec('ps -o pid -p ' . $this->child, $output, $returnCode) && $returnCode != 1) {\n $this->log(LogLevel::DEBUG, sprintf('Child %s found, killing.', $this->child));\n\n posix_kill($this->child, SIGKILL);\n $this->child = null;\n } else {\n $this->log(LogLevel::INFO, sprintf('Child %s not found, stopping.', $this->child));\n\n $this->shutdown();\n }\n }", "protected function checkForClosed()\n {\n $childPid = pcntl_waitpid( - 1, $status, WNOHANG );\n if ($childPid > 1) {\n /*echo $childPid.' exited with status = '.$status.\"\\n\";*/\n\n foreach ($this->PIDs as $serviceName => $running) {\n foreach ($running as $domain => $r_pid) {\n if ($r_pid == $childPid) {\n unset( $this->PIDs[$serviceName][$domain] );\n\n /*echo \"removed: \".$r_pid.\"\\n\";\n print_r($this->PIDs);\n echo \"\\n\";*/\n }\n }\n }\n }\n }", "function proc_kill($pid) {\n\tif (stripos(php_uname('s'), 'win') > -1) {\n\t\texec(\"tasklist /svc /fi \\\"PID eq $pid\\\"\", $output, $returnVal);\n\t\tif (count($output) > 1) {\n\t\t\t$e = exec(\"taskkill /F /T /PID $pid\", $output, $returnVal);\n\t\t}\n\t} else {\n\t\t$e = exec(\"kill -9 $pid\", $output, $returnVal);\n\t}\n\treturn $returnVal;\n}", "public function terminate()\n {\n if (function_exists('posix_kill')) {\n posix_kill($this->pid, 15);\n } elseif (PHP_OS === 'WINNT') {\n exec('taskkill /PID '.escapeshellarg($this->pid));\n } else {\n exec('kill -15 '.escapeshellarg($this->pid));\n }\n }", "function kill()\n\t{\n\t\tif (isset($this->process)) {\n\t\t\treturn $this->process->stop();\n\t\t}\n\t\t$exec = TwitchHelper::exec([\"kill\", $this->getPid()]);\n\t\t$this->clear();\n\t\treturn $exec;\n\t}", "public function kill(): void {\n\t\t$this->terminate();\n\t}", "public function stopQuery() {\n\t}", "public function stopQuery();", "public function killChild(): void\n {\n if (!isset($this->child)) {\n $this->log([\n 'message' => 'No child to kill.',\n 'data' => [\n 'type' => 'kill',\n 'child' => null,\n ],\n ], LogLevel::DEBUG);\n\n return;\n }\n\n exec(\"ps -p $this->child\", $output, $returnCode);\n\n if ($returnCode === 0) {\n $this->log([\n 'message' => \"Killing child at $this->child\",\n 'data' => [\n 'type' => 'kill',\n 'child' => $this->child,\n ],\n ], LogLevel::DEBUG);\n\n posix_kill($this->child, $this->childSignal);\n\n if ($this->childSignal === SIGKILL) {\n $this->child = null;\n } else {\n $this->childSignal = SIGKILL;\n pcntl_alarm($this->gracefulDelayTwo);\n }\n } else {\n $this->log([\n 'message' => \"Child $this->child not found, restarting.\",\n 'data' => [\n 'type' => 'kill',\n 'child' => $this->child,\n ],\n ], LogLevel::ERROR);\n\n $this->shutdown();\n }\n }", "function killProcess($pid)\n\t{\n\t\tif (! is_int($pid))\n\t\t{\n\t\t\tthrow new Exception (\"PID must be an integer\");\n\t\t}\n\n\t\treturn `taskkill /F /PID $pid `;\n\t}", "public function kill() {\n if ( $this->isRunning() ) {\n posix_kill( $this->id, SIGKILL );\n pcntl_waitpid( $this->id, $this->status, WNOHANG );\n }\n $this->closeStreams();\n }", "protected function endProcess() {\n $this->statusHandler->SetStatus(StatusHandler::STOPPED, FALSE);\n $this->statusHandler->logStatus('ok', 'The @drush-cmd daemon has stopped.');\n }", "public function stopQuery(): void;", "public function stop()\n\t{\n\t\t$this->droppidfile();\n\t\t$this->log->debug(\"Quitting...\");\n\t\texit(0);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the base table name.
public function getBaseTable() { return $this->baseTable; }
[ "function table_name()\n\t{\n\t\treturn( \"t_base\" );\n\t}", "public function getBaseTable()\n\t{\n\t\treturn $this->base_table;\n\t}", "public function get_table_name() {\n\t\treturn $this->get_table_prefix() . $this->table_name;\n\t}", "public function get_table_name() {\n\t\treturn $this->table_prefix . self::TABLE_NAME;\n\t}", "protected function getBaseTable()\n {\n return $this->getDataObject($this->getList())->baseTable();\n }", "public function get_table_name()\n {\n }", "protected function getTableName() {\n return Variable::tableName();\n }", "static function get_table_name()\r\n {\r\n return Utilities :: get_classname_from_namespace(self :: CLASS_NAME, true);\r\n }", "public static function getTableName()\n {\n return self::getDatabaseName() . '.' . self::NAME;\n }", "public static function getTableName(): string\n {\n return ((new static)->getTable());\n }", "final function _get_table_name()\n\t{\n\t\treturn $this->table_name;\n\t}", "public static function get_table_name() : string {\n global $wpdb;\n return $wpdb->prefix . self::TABLE_NAME;\n }", "function getFullTableName () {return $this->db->getPrefix () . $this->getTableName ();}", "public function getFQTableName()\n {\n return static::FQ_TABLE_NAME;\n }", "protected function getTableName(): string\n {\n return (new $this->model)->getTable();\n }", "public function getTableName ()\n {\n return $this->getDbTable()->info('name');\n }", "protected static function getTableName() {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->prefix . static::$tableName;\n\t}", "public function getFullTableName() {\n return $this->db->getTable() . (!empty($this->db->getAlias()) ? ' AS ' . $this->db->getAlias() : '');\n }", "protected static function table_name(): mixed\n\t{\n\t\treturn self::$query->table_name;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets instances id by its name
public function getIdByName(string $name);
[ "public function getId()\n {\n return $this->attributes[self::INSTANCE_ID];\n }", "public function get_instance_id()\n {\n }", "static public function find_instanceid($contextname) {\n try {\n $contexthandler = self::factory($contextname);\n $instanceid = $contexthandler->get_instanceid_from_currentcontext();\n } catch (\\moodle_exception $e) {\n debugging('Exception detected when using metadata filter: ' . $e->getMessage(), DEBUG_NORMAL, $e->getTrace());\n $instanceid = false;\n }\n return $instanceid;\n }", "public function getInstanceId()\n {\n return $this->instance_id;\n }", "function getInstanceId() {\n return $this->instance_id;\n }", "public function getInstanceId()\n {\n return $this->instanceId;\n }", "protected function instance_id() {\n\t\treturn sanitize_title( implode( '_', array_filter( array(\n\t\t\t$this->module(),\n\t\t\t$this->unique(),\n\t\t\t$this->get_id(),\n\t\t) ) ) );\n\t}", "public static function get(string $name): IdStorage {\n if (!isset(self::$instances[$name])) {\n static::$instances[$name] = new static();\n }\n return static::$instances[$name];\n }", "abstract public function get_instanceid_from_currentcontext();", "public function getNameId();", "public function getIdValue($name) {\n\t\treturn $name . '_' . $this->getUid();\n }", "public function getInstanceName()\n {\n return $this->instance_name;\n }", "private function getSiteId( $name ) {\n $site = SiteFactory::instance($name);\n return $site->getId();\n }", "public function getBeehiveId($name)\n {\n $query = 'SELECT id FROM beehive WHERE name = ?';\n $paramType = 's';\n $paramValue = array(\n $name\n );\n $beeId = $this->ds->select($query, $paramType, $paramValue);\n $id = $beeId[0];\n return $id['id'];\n }", "public function getImageId()\n {\n return $this->attributes[self::INSTANCE_IMAGEID];\n }", "private function _fetch_tag_id($name)\n\t{\n\t\treturn $this->ee->db->where('name', $name)->get('taggable_tags')->row('id');\n\t}", "public function getID() {\n\t\treturn \\Anemo\\ID::getInstance();\n\t}", "function getInstanceTypeId() {\n\t\treturn $this->instanceType->id;\n\t}", "public static function getIDByName($name) {\n global $app;\n $groups = MySBGroupHelper::load();\n foreach($groups as $group) {\n if($group->name==$name) return $group->id;\n }\n $app->LOG('MySBGroupHelper::getIDByName() : group '.$name.'not found !!!');\n return '';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
access token expires in an hour, reconnect function revokes it using refresh token refresh token lasts 101 days, after that it is necessary to click he QUICKBOOKS CONNECT button and reauthorize tokens are saved in db and in instance and new DataService is instantiated after a successful reconnect
public function reconnect(){ $ks = Yii::$app->keyStorage; // if refresh_token is not set, it means the app never connected to quickbooks if (!$this->refreshToken){ throw new Exception('Refresh token not set. You need to click CONNECT QUICKBOOKS button'); } // discovery document $discoveryDocument = json_decode(file_get_contents($this->discoveryDocumentUrl), true); // ready the params, just for readability // the URL for reconnect POST, from discovery document $tokenEndPointUrl = $discoveryDocument['token_endpoint']; // according to the dcos, this param is always refresh_token for reconnect $grantType = 'refresh_token'; // POST and wait for JSON response $curl = curl_init(); $header = [ 'Accept: application/json', 'Authorization: Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret), 'Content-Type: application/x-www-form-urlencoded', 'Cache-Control: no-cache' ]; curl_setopt_array($curl, [ CURLOPT_POST => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $tokenEndPointUrl, CURLOPT_POSTFIELDS => http_build_query([ 'grant_type' => $grantType, 'refresh_token' => $this->refreshToken ]), CURLOPT_HTTPHEADER => $header ]); $result = curl_exec($curl); // check for errors, just in case if ($curl_error = curl_error($curl)) { throw new Exception($curl_error); } else { $result = json_decode($result, true); } curl_close($curl); // if reponse JSON contains "error" key, it means token is either expired or never set if (isset($result['error'])){ throw new Exception($result['error'] . '. Need to click CONNECT QUICKBOOKS button'); } // save the received tokens in key_storage_item and in the instance $this->accessToken = $result['access_token']; $ks->set('quickbooks.access-token', $this->accessToken); $ks->set('quickbooks.access-token-expires-in', $result['expires_in']); $this->refreshToken = $result['refresh_token']; $ks->set('quickbooks.refresh-token', $this->refreshToken); $ks->set('quickbooks.refresh-token-expires-in', $result['x_refresh_token_expires_in']); $this->dataServiceInit(); }
[ "public function reconnect(){\n $ks = Yii::$app->keyStorage;\n\n // if refresh_token is not set, it means the app never connected to quickbooks\n if (!$this->refreshToken){\n $ks->set('quickbooks.need-connect', \"\");\n throw new Exception(self::NEED_TO_CLICK_QUICKBOOKS_CONNECT_MESSAGE);\n }\n\n // discovery document\n $discoveryDocument = json_decode(file_get_contents($this->discoveryDocumentUrl), true);\n\n // ready the params, just for readability\n\n // the URL for reconnect POST, from discovery document\n $tokenEndPointUrl = $discoveryDocument['token_endpoint'];\n\n // according to the dcos, this param is always refresh_token for reconnect\n $grantType = 'refresh_token';\n\n // POST and wait for JSON response\n $curl = curl_init();\n $header = [\n 'Accept: application/json',\n 'Authorization: Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret),\n 'Content-Type: application/x-www-form-urlencoded',\n 'Cache-Control: no-cache'\n ];\n curl_setopt_array($curl, [\n CURLOPT_POST => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $tokenEndPointUrl,\n CURLOPT_POSTFIELDS => http_build_query([\n 'grant_type' => $grantType,\n 'refresh_token' => $this->refreshToken\n ]),\n CURLOPT_HTTPHEADER => $header\n ]);\n $result = curl_exec($curl);\n // check for errors, just in case\n if ($curl_error = curl_error($curl)) {\n throw new Exception($curl_error);\n } else {\n $result = json_decode($result, true);\n }\n curl_close($curl);\n // if reponse JSON contains \"error\" key, it means token is either expired or never set\n if (isset($result['error'])){\n $ks->set('quickbooks.need-connect', \"true\");\n throw new Exception(self::NEED_TO_CLICK_QUICKBOOKS_CONNECT_MESSAGE);\n }\n\n // save the received tokens in key_storage_item and in the instance\n $this->accessToken = $result['access_token'];\n $ks->set('quickbooks.access-token', $this->accessToken);\n $ks->set('quickbooks.access-token-expires-in', $result['expires_in']);\n $this->refreshToken = $result['refresh_token'];\n $ks->set('quickbooks.refresh-token', $this->refreshToken);\n $ks->set('quickbooks.refresh-token-expires-in', $result['x_refresh_token_expires_in']);\n\n // quickbooks connected, no need to display that message\n $ks->set('quickbooks.need-connect', \"\");\n\n $this->dataServiceInit();\n }", "private function refreshToken()\n {\n try {\n $tokens = $this->getLastToken();\n\n // Create a new GuzzleHTTP Client and define scopes\n $client = new Client();\n\n // Use the authorization code to fetch an access token\n $tokenQuery = array(\n \"grant_type\" => \"refresh_token\",\n \"refresh_token\" => $tokens[\"refresh_token\"]\n );\n\n $tokenUrl = $this->token_url.\"?\".http_build_query($tokenQuery);\n $response = $client->post(\n $tokenUrl, \n [\n 'auth' => [$this->client_id, $this->client_secret],\n 'curl' => array(CURLOPT_SSL_VERIFYPEER => false),\n 'verify' => false\n ]\n );\n\n // Insert in DB the new access token of Aweber\n $body = $response->getBody();\n $creds = json_decode($body, true);\n\n $qry = \"INSERT INTO tokens (access_token, refresh_token, token_type) VALUES (?, ?, ?);\";\n $this->_execQuery($qry, array($creds['access_token'], $creds['refresh_token'], $creds['token_type']));\n } catch (ClientException $e) {\n $response = $e->getResponse();\n error_log($response->getBody()->getContents());\n }\n }", "abstract protected function refreshAccessToken();", "private function refreshToken() {\n\n $body = array(\"refresh\" => $this->authtokens[\"refresh\"]); \n $ch = curl_init($this->endpoints[\"refresh\"]);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Otherwise reponse=1\n curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7); //Timeout after 7 seconds\n curl_setopt($ch, CURLINFO_HEADER_OUT, false);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);\n\n $result = curl_exec($ch);\n $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n if ($statusCode != 200) {\n $this->logError(sprintf(\"Unable to refresh auth token %s:\\n%s\\n\", $statusCode, $result));\n } else {\n $respObj = json_decode($result);\n if ($respObj->access != null) {\n $this->authtokens[\"access\"] = $respObj->access;\n }\n }\n }", "function oAuthRefreshToken() {\n\t\t\t$r = json_decode(BigTree::cURL($this->TokenURL,array(\n\t\t\t\t\"client_id\" => $this->Settings[\"key\"],\n\t\t\t\t\"client_secret\" => $this->Settings[\"secret\"],\n\t\t\t\t\"refresh_token\" => $this->Settings[\"refresh_token\"],\n\t\t\t\t\"grant_type\" => \"refresh_token\"\n\t\t\t)));\n\t\t\tif ($r->access_token) {\n\t\t\t\t$this->Settings[\"token\"] = $r->access_token;\n\t\t\t\t$this->Settings[\"expires\"] = strtotime(\"+\".$r->expires_in.\" seconds\");\n\t\t\t}\n\t\t}", "public function refreshAccessToken()\n {\n return ;\n }", "public function refresh_token() {\n $info = array(\n 'refresh_token' => $this->api_config['refresh_token'],\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->api_config['client_id'],\n 'client_secret' => $this->api_config['client_secret']\n );\n\n // Get returned CURL request\n $request = $this->make_request(self::OAUTH2_TOKEN_URI, 'POST', 'normal', $info);\n\n if( isset($request->access_token) ) {\n // Push the new token into the api_config\n $this->api_config['access_token'] = $request->access_token;\n\n // Push the new token into the settings\n $this->token['access_token'] = $request->access_token;\n\n if( $this->provider_id === 0 ) {\n $this->update_gcal_option('ga_appointments_gcal_token', $this->token );\n } else {\n $this->update_gcal_option('ga_provider_gcal_token', $this->token );\n }\n\n // Return the token\n return $request;\n } else {\n return false;\n }\n }", "function refresh_token() {\n\n $custom_data = validate_token(REFRESH_SECRET_KEY);\n\n if (!$custom_data) {\n echo_response(true, \"Invalid token or request\");\n return;\n }\n\n $authService = new AuthService();\n echo_response(true, ($authService->generate_tokens($custom_data, true)));\n}", "private function refreshToken() {\n for ($i = 0; $i < $this->MAX_ATTEMPTS; $i++) {\n $opt = $this->retrieveToken();\n if ($opt instanceof Some) {\n $raw = $opt->get();\n $obj = new \\stdClass();\n $obj->token = $raw->access_token;\n $obj->type = $raw->token_type;\n\n $this->accessToken = Option::fromValue($obj);\n // -1 second is used as a safety buffer\n $this->expiresAt = ($raw->expires_in - 1) + time();\n return;\n }\n }\n $this->accessToken = None::create();\n $this->expiresAt = -1;\n $this->sendMailWarning('The token could be not retrieved before max attempts were reached');\n }", "public function test_refreshExpiredAccessToken() {\n // todo: pass a raw token object with a few seconds until expiry, wait, and check if refresh happens.\n }", "public function refresh_token() {\n\t\t$refresh_token = $this->get_refresh_token();\n\t\tif ( empty( $refresh_token ) ) {\n\t\t\t$this->delete_token();\n\t\t\t$this->user_options->set( self::OPTION_ERROR_CODE, 'refresh_token_not_exist' );\n\t\t\treturn;\n\t\t}\n\n\t\t// Stop if google_client not initialized yet.\n\t\tif ( ! $this->google_client instanceof Google_Site_Kit_Client ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t$token_response = $this->google_client->fetchAccessTokenWithRefreshToken( $refresh_token );\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$this->handle_fetch_token_exception( $e );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isset( $token_response['access_token'] ) ) {\n\t\t\t$this->user_options->set( self::OPTION_ERROR_CODE, 'access_token_not_received' );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->set_access_token(\n\t\t\t$token_response['access_token'],\n\t\t\tisset( $token_response['expires_in'] ) ? $token_response['expires_in'] : '',\n\t\t\tisset( $token_response['created'] ) ? $token_response['created'] : 0\n\t\t);\n\t}", "function refresh_token()\n {\n $url = self::API_ROOT_URL . \"/oauth/token\";\n\n $headers = array();\n $headers[] = 'Host: api.cronofy.com';\n $headers[] = 'Content-Type: application/json; charset=utf-8';\n\n $postfields = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'grant_type' => 'refresh_token',\n 'refresh_token' => $this->refresh_token\n );\n\n $result = $this->http_post($url, $postfields, $headers);\n\n $tokens = json_decode($result);\n if (!empty($tokens->access_token)) {\n $this->access_token = $tokens->access_token;\n $this->refresh_token = $tokens->refresh_token;\n return true;\n } else {\n return $tokens->error;\n }\n }", "private function refreshToken()\n {\n syslog(LOG_DEBUG, \"Monzo: Refreshing Token\");\n $data = array(\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'refresh_token' => $this->refreshToken\n );\n $jsonResponse = $this->getJson('/oauth2/token', $data, false);\n if (isset($jsonResponse['access_token']) && isset($jsonResponse['refresh_token']))\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validating\");\n $this->refreshToken = $jsonResponse['refresh_token'];\n $this->bearerToken = $jsonResponse['access_token'];\n if ($this->validateTokens())\n {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, validated and stored\");\n $this->storeTokens($this->bearerToken, $this->refreshToken);\n return true;\n }else {\n syslog(LOG_DEBUG, \"Monzo: Token refreshed, but failed to validate\");\n return false;\n }\n }\n else\n {\n syslog(LOG_ERR, \"Monzo: Not able to refresh token\");\n throw new Exception('Monzo Not able to refresh token');\n return false;\n }\n }", "public function oauth_reconnect() {\n\n\t\ttry {\n\n\t\t\tif ( '1.0' === $this->get_oauth_version() ) {\n\t\t\t\t$response = $this->get_api()->oauth_reconnect();\n\t\t\t} else {\n\t\t\t\t$response = $this->get_api()->refresh_oauth_tokens();\n\t\t\t}\n\n\t\t\t$this->store_oauth_data( $response );\n\n\t\t\treturn true;\n\n\t\t} catch ( Framework\\SV_WC_API_Exception $e ) {\n\n\t\t\t$this->get_plugin()->log( 'Could not reconnect. ' . $e->getMessage(), $this->get_id() );\n\n\t\t\treturn false;\n\t\t}\n\t}", "public function refreshApiToken();", "protected function revalidate_token() {\n $params = \"grant_type=refresh_token\" .\n \"&client_id=\" . urlencode( $this->consumer_key ) .\n \"&client_secret=\" . urlencode( $this->consumer_secret ) .\n \"&refresh_token=\" . urlencode( $this->refresh_token );\n\n $url = $this->login_uri . \"/services/oauth2/token\";\n $response = $this->get_response( $url, false, \"post\", $params );\n if ( !isset( $response[\"access_token\"] ) || empty( $response[\"access_token\"] )\n || !isset( $response[\"instance_url\"] ) || empty( $response[\"instance_url\"] ) ) {\n return false;\n }\n\n $this->access_token = $response[\"access_token\"];\n $this->instance_url = $response[\"instance_url\"];\n\n $this->save_access_token( $this->access_token );\n update_option( \"woocommerce_nwsi_instance_url\", $this->instance_url );\n\n return true;\n }", "public function reauthenticate()\n {\n // Authenticate with the Ethos API using the API key / secret / refresh token\n $this->_authenticate();\n // Build an HTTP client that uses the JWT / session token\n $this->_buildClient();\n }", "protected function renewAccessToken()\n {\n // set some params\n $formParams = [\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->apiClientId,\n 'client_secret' => $this->apiSecret,\n 'refresh_token' => $this->credentials->refresh_token,\n ];\n\n // run the query\n $auth = $this->oauthRequest($formParams);\n\n // set refreshed flag to true, we can't refresh again...\n $auth->created_at = time();\n $auth->refreshed = true;\n\n // use the response vars as the new creds\n $this->credentials = $auth;\n\n return $this;\n }", "private function refresh_auth_token_on_login() {\n\t\t// Bail if the user is not authenticated at all yet.\n\t\tif ( ! $this->is_authenticated() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$auth_client = $this->get_oauth_client();\n\n\t\t// Initiates Google Client object.\n\t\t$auth_client->get_client();\n\n\t\t// Refresh auth token.\n\t\t$auth_client->refresh_token();\n\n\t\t// If 'invalid_grant' error, disconnect the account.\n\t\tif ( 'invalid_grant' === $this->user_options->get( Clients\\OAuth_Client::OPTION_ERROR_CODE ) ) {\n\t\t\t$this->disconnect();\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the blue print collection
public function getBlueprints() { return $this->blueprints; }
[ "public function getBlueprintCollection(): BlueprintCollection\n {\n return $this->blueprintCollection;\n }", "public function getBlueprints() {\n\t\t$return = array();\n\t\tforeach ($this->blueprints as $key => $value) {\n\t\t\t$return[$key] = $value;\n\t\t}\n\t\treturn $return;\n\t}", "public function get_blueprints() {\n\n\t\t$containers = array();\n\n\t\tforeach ( $this->_blueprints as $key => $blueprint ) {\n\t\t\tif ( isset( $blueprint['type'] ) && $blueprint['type'] == $this->_type ) {\n\n\t\t\t\t$containers[ $key ] = $blueprint;\n\t\t\t}\n\t\t} // end foreach\n\n\t\treturn $containers;\n\t}", "public function blueprint()\n {\n return $this->morphOne(Blueprint::class, 'blueprintable');\n }", "public function blueprints()\n {\n return $this->hasMany('Blueprint', 'milestone_id', 'milestone_id');\n }", "public function getBerries(): Collection\n {\n return $this->berries;\n }", "public function getCollection()\n {\n return $this->getToolbar()->getCollection();\n }", "public function getLoadedProductCollection()\n {\n return $this->_getGiveawayCollection();\n }", "public static function blueprints($value=null) {\n if($value!==null) {\n self::$_directoryBlueprints=$value;\n }\n return self::$_directoryBlueprints;\n }", "public function getBlueprint() {\n return $this->blueprint;\n }", "private function _getPrinters()\n {\n $connector = Mage::helper('scgooglecloudprint/connector');\n $printers = $connector->search();\n return (!empty($printers)) ? $printers : array();\n }", "public function getCollection()\n\t{\n\t\t// the layout for how the resulting collection should look\n\t\t$tree = $this->fetchTree();\n\t\t\n\t\t/*\n\t\t * TODO: Ideally, we could have a class like \"OLPBlackbox_CollectionParser\"\n\t\t * that could take an array or something and parse it into a collection\n\t\t * tree. However, at this point, as nebulous as the requirements are for\n\t\t * this gforge ticket, I'm just going to do it all in this class.\n\t\t */\n\t\t\n\t\t// translate the array into a collection\n\t\treturn $this->parseTree($tree);\n\t}", "public function getReleaseCollectionReferenceList()\n {\n return $this->releaseCollectionReferenceList;\n }", "protected function _getCollection()\n {\n return Mage::getResourceModel('zygnis_customerfeedback/customerfeedback_collection');\n }", "public function getCollections() ;", "public function getLoadedProductCollection() {\n\t\t$categories = $this->getCategoryCollection();\n\t\tif($categories[\"items\"] > 0){\n\t\t\treturn $categories[\"collection\"];\n\t\t}else{\n\t\t\treturn $this->getProducts();\n\t\t}\n }", "public static function collection() {\n return Db::getInstance()->__get(self::$collection);\n }", "public function getPrinters(){\n\t\treturn $this->get(\"/printer\");\n\t}", "public static function colors(): Collection;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pages_sort Sorts an array of page items by short_title field.
protected function pages_sort(&$list) { if ( empty($list) || is_array($list) === false ) { return $list; } $list = $this->model->sort_alpha($list); foreach ($list as &$item) { if ( ! empty($item['subpages']) ) { $item['subpages'] = $this->pages_sort($item['subpages']); } } return $list; }
[ "public function sortByTitle( )\n {\n usort( $this->pages, function( $a, $b ) {\n /** @var Page $a */\n /** @var Page $b */\n return strcmp( $a->getTitle( ), $b->getTitle( ) );\n } );\n }", "public function sortSearchPages($search_pages);", "protected function sortPages()\n {\n // sort pages\n $order = strtolower($this->getConfig('pages_order'));\n $orderBy = strtolower($this->getConfig('pages_order_by'));\n\n if (($orderBy !== 'alpha') && ($orderBy !== 'date') && ($orderBy !== 'meta')) {\n return;\n }\n\n $alphaSortClosure = function ($a, $b) use ($order) {\n if (!empty($a['hidden']) xor !empty($b['hidden'])) {\n return (!empty($a['hidden']) - !empty($b['hidden'])) * (($order === 'desc') ? -1 : 1);\n }\n\n $aSortKey = (basename($a['id']) === 'index') ? dirname($a['id']) : $a['id'];\n $bSortKey = (basename($b['id']) === 'index') ? dirname($b['id']) : $b['id'];\n\n $cmp = strcmp($aSortKey, $bSortKey);\n return $cmp * (($order === 'desc') ? -1 : 1);\n };\n\n if ($orderBy === 'meta') {\n // sort by arbitrary meta value\n $orderByMeta = $this->getConfig('pages_order_by_meta');\n uasort($this->pages, function ($a, $b) use ($alphaSortClosure, $order, $orderByMeta) {\n $aSortValue = isset($a['meta'][$orderByMeta]) ? $a['meta'][$orderByMeta] : null;\n $aSortValueNull = ($aSortValue === null);\n\n $bSortValue = isset($b['meta'][$orderByMeta]) ? $b['meta'][$orderByMeta] : null;\n $bSortValueNull = ($bSortValue === null);\n\n $cmp = 0;\n if ($aSortValueNull || $bSortValueNull) {\n $cmp = ($aSortValueNull - $bSortValueNull);\n } elseif ($aSortValue != $bSortValue) {\n $cmp = ($aSortValue > $bSortValue) ? 1 : -1;\n }\n\n if ($cmp === 0) {\n // never assume equality; fallback to alphabetical order\n return $alphaSortClosure($a, $b);\n }\n\n return $cmp * (($order === 'desc') ? -1 : 1);\n });\n } elseif ($orderBy === 'date') {\n // sort by date\n uasort($this->pages, function ($a, $b) use ($alphaSortClosure, $order) {\n if (!empty($a['hidden']) xor !empty($b['hidden'])) {\n return $alphaSortClosure($a, $b);\n }\n\n if (!$a['time'] || !$b['time']) {\n $cmp = (!$a['time'] - !$b['time']);\n } else {\n $cmp = ($b['time'] - $a['time']);\n }\n\n if ($cmp === 0) {\n // never assume equality; fallback to alphabetical order\n return $alphaSortClosure($a, $b);\n }\n\n return $cmp * (($order === 'desc') ? 1 : -1);\n });\n } else {\n // sort alphabetically\n uasort($this->pages, $alphaSortClosure);\n }\n }", "protected function reorderPages() {\n usort($this->pages, function ($a, $b) {\n\n if (is_null($a['navigation_order']) && is_null($b['navigation_order'])) {\n return $a['title'] < $b['title'] ? -1 : 1;\n }\n if (is_null($a['navigation_order'])) {\n return 1;\n }\n if (is_null($b['navigation_order'])) {\n return -1;\n }\n if ($a['navigation_order'] == $b['navigation_order']) {\n return 0;\n }\n\n return (intval($a['navigation_order']) < intval($b['navigation_order'])) ? -1 : 1;\n });\n }", "public function sortPages() : void\n {\n uasort($this->pages, function (Page $firstElement, Page $secondElement) {\n return (int)$firstElement->getImgCount() <=> (int)$secondElement->getImgCount();\n });\n }", "protected function _sort()\n {\n if ($this->_dirtyIndex) {\n $newIndex = [];\n $index = 0;\n\n foreach ($this->_pages as $hash => $page) {\n $order = $page->getOrder();\n if ($order === null) {\n $newIndex[$hash] = $index;\n $index++;\n } else {\n $newIndex[$hash] = $order;\n }\n }\n\n asort($newIndex);\n $this->_index = $newIndex;\n $this->_dirtyIndex = false;\n }\n }", "private function sort(): void\n {\n if (!$this->dirtyIndex) {\n return;\n }\n\n $newIndex = [];\n $index = 0;\n\n foreach ($this->pages as $hash => $page) {\n $order = $page->getOrder();\n\n if (null === $order) {\n $newIndex[$hash] = $index;\n ++$index;\n } else {\n $newIndex[$hash] = $order;\n }\n }\n\n asort($newIndex);\n\n $this->index = $newIndex;\n $this->dirtyIndex = false;\n }", "protected function _sort() {}", "private function sortItems()\n {\n usort($this->items, function ($a, $b) {\n if ($a['sortOrder'] == $b['sortOrder']) {\n return 0;\n } else {\n if ($a['sortOrder'] < $b['sortOrder']) {\n return -1;\n } else {\n return 1;\n }\n }\n });\n }", "public function sortLinks()\n {\n usort(\n $this->links,\n function ($a, $b) {\n return strcmp($a->getText(), $b->getText());\n }\n );\n }", "public function sort() {\n sort($this->items, SORT_STRING);\n }", "public function asort () {}", "function fusion_apply_ui_sort_by_title($a, $b) {\n return strcasecmp($a['title'], $b['title']);\n}", "protected function listing_sorter_customise_sorts(array &$sorts){}", "public function sort();", "protected function _sortByArray($array) {}", "protected function sortItems()\n {\n usort($this->items, static function ($a, $b) {\n if ($a->weight === $b->weight) {\n return $a->title <=> $b->title;\n }\n\n return $a->weight <=> $b->weight;\n });\n }", "function languagelesson_sort_by_ordering($lessonid) {\n global $DB;\n \n $pages = $DB->get_records('languagelesson_pages', array('lessonid'=>$lessonid));\n\n // Make sure they are in order by field ordering.\n $order = array();\n foreach ($pages as $key => $obj) {\n $order[$key] = $obj->ordering;\n }\n array_multisort($order, SORT_ASC, $pages);\n \n $pagecount = count($pages);\n $keys = array_keys($pages);\n \n $i = array_shift($keys);\n $last = array_pop($keys);\n \n $prev = $pages[$i];\n $prev->prevpageid = 0;\n $prev->nextpageid = $pages[$i += 1];\n $DB->update_record('languagelesson_pages', $prev);\n \n while ($i < $pagecount) {\n $thispage = $pages[$i];\n $thispage->prevpageid = $prev->id;\n if (!$pages[$i += 1]) {\n $thispage->nextpageid = 0;\n $DB->update_record('languagelesson_pages', $thispage);\n break;\n } else {\n $thispage->nextpageid = $i;\n }\n $DB->update_record($thispage);\n $prev = $thispage;\n }\n \n }", "public function sort_articles() {\r\n\t\t\t//sort($articleList);\r\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
input condition tree: [ combinedcondition => [ aggregation => any conditions => [ condition1 => [ attribute => field1 ] condition2 => [ attribute => field2 ] ] ] ] in case when condition2 is not mappable the result must be next: [ combinedcondition => [ aggregation => any conditions => [] ] ]
public function testConditionV1() { $field1 = 'field-1'; $field2 = 'field-2'; $simpleCondition1 = $this->getMockForSimpleCondition($field1); $simpleCondition2 = $this->getMockForSimpleCondition($field2); $inputCondition = $this->getMockForCombinedCondition( [ $simpleCondition1, $simpleCondition2 ], 'any' ); $validResult = $this->getMockForCombinedCondition([], 'any'); $this->customConditionProcessorBuilderMock ->method('hasProcessorForField') ->will( $this->returnValueMap( [ [$field1, true], [$field2, false], ] ) ); $this->eavConfigMock ->method('getAttribute') ->willReturn(null); $result = $this->mappableConditionProcessor->rebuildConditionsTree($inputCondition); $this->assertEquals($validResult, $result); }
[ "public function buildConditions(): ?string {\n\n $groups = [];\n foreach ($this->where as $group) {\n if (!empty($group['conditions'])) {\n $conditions = '';\n foreach ($group['conditions'] as $clause) {\n $conditions .= $this->translateCondition($clause['field'], $clause['value'], $clause['operator']);\n }\n if (count($group['conditions']) > 1) {\n $groups[] = '(' . self::LDAP_FILTER_OPERATORS[$group['type']] . $conditions . ')';\n }\n else {\n $groups[] = $conditions;\n }\n }\n }\n\n if (count($groups) > 1) {\n $output = '(' . self::LDAP_FILTER_OPERATORS[$this->groupOperator] . implode('', $groups) . ')';\n }\n else {\n $output = array_pop($groups);\n }\n\n return $output;\n }", "function parse_conditions($arr)\n{\n\t$conditions = [];\n\tforeach ($arr as $key => $value)\n\t{\n\t\tif($key==\"or\")\n\t\t\tarray_push($conditions,parse_conditions_or($value) );\n\t\telse\n\t\t\tarray_push($conditions, \"`$key`=\".json_encode($value));\n\t}\n\treturn implode(\" AND \", $conditions);\n}", "public function orConditionGroup();", "private function splitConditions($condition) {\n $condition = trim($condition);\n\n $conditions = array();\n\n $nestedLevel = 0;\n $condIndex = -1;\n\n $isOrBlock = false;\n\n $prevCh = null;\n\n foreach (str_split($condition) as $key => $ch) {\n if ($ch === \"(\" && !Condition::isEscapedInRegex($condition, $key)) {\n $nestedLevel++;\n\n if ($nestedLevel === 1) {\n // each '(' (except the first one) on first level must be preceded by '|'\n if ($key > 0) {\n if ($condition[$key - 1] !== \"|\") {\n return null;\n } else {\n $isOrBlock = true;\n }\n }\n\n $condIndex++;\n $conditions[] = \"\";\n }\n }\n\n if ($nestedLevel > 0) {\n $conditions[$condIndex] .= $ch;\n }\n\n if ($ch === \")\" && !Condition::isEscapedInRegex($condition, $key)) {\n $nestedLevel--;\n }\n }\n\n if ($nestedLevel !== 0) {\n return null;\n }\n\n return array($conditions, $isOrBlock);\n }", "public function transformAdvanceFilter($conditions)\n\t{\n\t\tif (\\is_string($conditions)) {\n\t\t\t$conditions = \\App\\Json::decode($conditions);\n\t\t}\n\t\t$conditionResult = [];\n\t\tif (!empty($conditions)) {\n\t\t\tforeach ($conditions as $index => $condition) {\n\t\t\t\t$columns = $condition['columns'];\n\t\t\t\tif (!empty($columns) && \\is_array($columns)) {\n\t\t\t\t\tforeach ($columns as $column) {\n\t\t\t\t\t\t$conditionResult[] = ['fieldname' => $column['columnname'], 'operation' => $column['comparator'],\n\t\t\t\t\t\t\t'value' => $column['value'], 'valuetype' => $column['valuetype'] ?? '', 'joincondition' => $column['column_condition'],\n\t\t\t\t\t\t\t'groupjoin' => $condition['condition'] ?? '', 'groupid' => 1 === $index ? 0 : 1, ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $conditionResult;\n\t}", "public function providesMultipleConditionsOnSameField(): array\n {\n return [\n 'default' => [\n 'default',\n 'year[gt]=2020&year[lt]=2051'\n ],\n 'json api' => [\n 'json_api',\n 'filter[year][gt]=2020&filter[year][lt]=2051'\n ],\n 'odata' => [\n 'odata',\n '$filter=year gt 2020 and year lt 2051'\n ],\n ];\n }", "function transformToNewAdvancedFilter() {\n\t\t$standardFilter = $this->transformStandardFilter();\n\t\t$advancedFilter = $this->getSelectedAdvancedFilter();\n\t\t$allGroupColumns = $anyGroupColumns = array();\n\t\tforeach($advancedFilter as $index=>$group) {\n\t\t\t$columns = $group['columns'];\n\t\t\t$and = $or = 0;\n\t\t\t$block = $group['condition'];\n\t\t\tif(count($columns) != 1) {\n\t\t\t\tforeach($columns as $column) {\n\t\t\t\t\tif($column['column_condition'] == 'and') {\n\t\t\t\t\t\t++$and;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t++$or;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($and == count($columns)-1 && count($columns) != 1) {\n\t\t\t\t\t$allGroupColumns = array_merge($allGroupColumns, $group['columns']);\n\t\t\t\t} else {\n\t\t\t\t\t$anyGroupColumns = array_merge($anyGroupColumns, $group['columns']);\n\t\t\t\t}\n\t\t\t} else if($block == 'and' || $index == 1) {\n\t\t\t\t$allGroupColumns = array_merge($allGroupColumns, $group['columns']);\n\t\t\t} else {\n\t\t\t\t$anyGroupColumns = array_merge($anyGroupColumns, $group['columns']);\n\t\t\t}\n\t\t}\n\t\tif($standardFilter) {\n\t\t\t$allGroupColumns = array_merge($allGroupColumns,$standardFilter);\n\t\t}\n\t\t$transformedAdvancedCondition = array();\n\t\t$transformedAdvancedCondition[1] = array('columns' => $allGroupColumns, 'condition' => 'and');\n\t\t$transformedAdvancedCondition[2] = array('columns' => $anyGroupColumns, 'condition' => '');\n\n\t\treturn $transformedAdvancedCondition;\n\t}", "public function testQueryWithNestedConditionTwoDimensional()\n {\n }", "private function parseCondition($trigger_cond)\n {\n $pos = strpos($trigger_cond, \"(\");\n\n /**\n * If brackets are at the beginning of the condition then split on first\n * && after them. If there are no && then split on the first ||.\n */\n if ($pos === 0)\n {\n for($i = 0; $i < strlen($trigger_cond); $i++)\n {\n if ($trigger_cond[$i] == \"(\")\n {\n $opening_brackets[] = $i;\n }\n else if ($trigger_cond[$i] == \")\")\n {\n array_pop($opening_brackets);\n if (empty($opening_brackets))\n {\n $closing_offset = $i;\n break;\n }\n }\n $closing_offset = -1;\n }\n\n if ($closing_offset == strlen($trigger_cond) - 1)\n {\n $left_cond = substr($trigger_cond, 1);\n $left_cond = substr($left_cond, 0, -1);\n\n return [\n \"left_branch\" => $left_cond, \n \"operand\" => \"\", \n \"right_branch\" => \"\"\n ];\n }\n else\n {\n $remainder = substr($trigger_cond, $closing_offset+2);\n }\n }\n else if ($pos > 0)\n {\n $remainder = substr($trigger_cond, 0, $pos);\n }\n else if ($pos === FALSE)\n {\n $remainder = $trigger_cond;\n }\n\n $left_cond = \"\";\n $operator = \"\";\n $right_cond = \"\";\n\n if (preg_match(\"/\\s*(&&)/\", $remainder, $operators, PREG_OFFSET_CAPTURE) === 1 || \n preg_match(\"/\\s*(\\|\\|)/\", $remainder, $operators, PREG_OFFSET_CAPTURE) === 1)\n {\n $relational_offset = $operators[0][1];\n $operator = $operators[0][0];\n\n if ($pos > 0 || $pos === FALSE)\n {\n $offset = $relational_offset + 1;\n }\n else if ($pos === 0)\n {\n $offset = $closing_offset + $relational_offset + 2;\n }\n\n $left_cond = trim(substr($trigger_cond, 0, $offset));\n $right_cond = trim(substr($trigger_cond, $offset + strlen($operator)));\n $operator = trim($operator);\n\n return [\n \"left_branch\" => $left_cond, \n \"operand\" => $operator, \n \"right_branch\" => $right_cond\n ];\n }\n else\n {\n return false;\n }\n }", "private function makeNestedConditions($source)\n {\n\n $nested = '1 == 1 ';\n\n foreach ($source as $key => $val) {\n\n $nested .= $val['relation'] . ' $this->calculateCondition(\"' . $val['id'] . '\") ';\n\n if (isset($val['children'])) {\n $nested .= \" AND ( \" . $this->makeNestedConditions($val['children']) . \")\";\n }\n\n\n }\n\n $nested .= ' ';\n\n return preg_replace(\"[1 == 1 AND|1 == 1 OR|1 == 1 ]\",\"\",$nested);\n\n }", "abstract public function getNestedSubCondition(Condition $condition);", "private function buildConditionals($element, $elements) {\n $nid = $element['nid'];\n $cid = $element['cid'];\n $extra = unserialize($element['extra']);\n // Checkboxes : ':input[name=\"add_more_locations_24[yes]\"]':\n $query = $this->select('webform_conditional', 'wc');\n $query->innerJoin('webform_conditional_actions', 'wca', 'wca.nid=wc.nid AND wca.rgid=wc.rgid');\n $query->innerJoin('webform_conditional_rules', 'wcr', 'wcr.nid=wca.nid AND wcr.rgid=wca.rgid');\n $query->fields('wc', [\n 'nid',\n 'rgid',\n 'andor',\n 'weight',\n ])\n ->fields('wca', [\n 'aid',\n 'target_type',\n 'target',\n 'invert',\n 'action',\n 'argument',\n ])\n ->fields('wcr', [\n 'rid',\n 'source_type',\n 'source',\n 'operator',\n 'value',\n ]);\n $conditions = $query->condition('wc.nid', $nid)->condition('wca.target', $cid)->execute();\n $states = [];\n if (!empty($conditions)) {\n foreach ($conditions as $condition) {\n // Element states.\n switch ($condition['action']) {\n case 'show':\n $element_state = $condition['invert'] ? 'invisible' : 'visible';\n break;\n\n case 'require':\n $element_state = $condition['invert'] ? 'optional' : 'required';\n break;\n\n case 'set':\n // Nothing found in D8 :(.\n break;\n }\n // Condition states.\n $operator_value = $condition['value'];\n $depedent = $elements[$condition['source']];\n $depedent_extra = unserialize($depedent['extra']);\n $depedent_extra['items'] = explode(\"\\n\", $depedent_extra['items']);\n\n\n switch ($condition['operator']) {\n case 'equal':\n $element_condition = ['value' => $operator_value];\n if ($depedent['type'] == 'select' && !$depedent_extra['aslist'] && $depedent_extra['multiple']) {\n $element_condition = ['checked' => TRUE];\n }\n\n break;\n\n case 'not_equal':\n // There is no handler for this in D8 so we do the reverse.\n $element_state = $condition['invert'] ? 'visible' : 'invisible';\n $element_condition = ['value' => $operator_value];\n // Specially handle the checkboxes.\n if ($depedent['type'] == 'select' && !$depedent_extra['aslist'] && $depedent_extra['multiple']) {\n $element_condition = ['checked' => TRUE];\n }\n\n break;\n\n case 'less_than':\n case 'less_than_equal':\n case 'greater_than':\n case 'greater_than_equal':\n // Nothing in D8 to handle these.\n break;\n\n case 'empty':\n if ($operator_value == 'checked') {\n $element_condition = ['unchecked' => TRUE];\n }\n else {\n $element_condition = ['empty' => TRUE];\n }\n break;\n\n case 'not_empty':\n if ($operator_value == 'checked') {\n $element_condition = ['checked' => TRUE];\n }\n else {\n $element_condition = ['filled' => FALSE];\n }\n break;\n }\n\n if (!$depedent_extra['aslist'] && $depedent_extra['multiple'] && is_array($depedent_extra['items']) && count($depedent_extra['items']) > 1) {\n $depedent['form_key'] = $depedent['form_key'] . \"[$operator_value]\";\n }\n elseif (!$depedent_extra['aslist'] && !$depedent_extra['multiple'] && is_array($depedent_extra['items']) && count($depedent_extra['items']) == 1) {\n $depedent['form_key'] = $depedent['form_key'] . \"[$operator_value]\";\n }\n\n $states[$element_state][] = [':input[name=\"' . $depedent['form_key'] . '\"]' => $element_condition];\n }\n if (empty($states)) {\n return FALSE;\n }\n return $states;\n }\n else {\n return FALSE;\n }\n }", "function parseConditions($conditions) {\n\n $ATOMS_PER_CONDITION = 3; // e.g. \"ModuleID = 15\" has 3 (ModuleID, =, and 15)\n $parser = new PHPSQLParser();\n\n $fields = array();\n $params = array();\n \n foreach ($conditions as $c) {\n $sql = \"WHERE \" . $c;\n $p = $parser->parse($sql);\n $atoms = $p[\"WHERE\"];\n \n // if a condition doesn't have the expected number of atoms,\n // it may have been hijacked by a SQL injection\n if (count($atoms) != $ATOMS_PER_CONDITION) {\n return FALSE;\n }\n \n $field = \"\";\n \n $operatorFound = FALSE;\n foreach ($atoms as $a) {\n switch($a[\"expr_type\"]) { \n \n case \"colref\":\n $field .= $a[\"base_expr\"] . \" \";\n break;\n \n case \"operator\":\n $field .= $a[\"base_expr\"] . \" \";\n $operatorFound = TRUE;\n break;\n \n case \"const\":\n $field .= \"? \";\n // trim quotes from constant to prevent double-quoted strings\n $params[] = trim($a[\"base_expr\"], '\"\\'');\n break;\n \n case \"in-list\":\n $qs = array_fill(0, count($a[\"sub_tree\"]), \"?\");\n $field .= \"(\" . implode(\",\", $qs) . \")\";\n foreach ($a[\"sub_tree\"] as $c) {\n if ($c[\"expr_type\"] != \"const\") {\n return FALSE;\n }\n $params[] = trim($c[\"base_expr\"], '\"\\'');\n }\n break;\n \n default:\n return FALSE;\n }\n }\n \n if (!$operatorFound) {\n return FALSE;\n }\n \n $fields[] = $field;\n }\n \n return array(\"fields\" => $fields, \"params\" => $params);\n}", "public function conditionGroupFactory($conjunction = 'AND');", "public function build_condition($where = 'where') {\n $has_condition = FALSE;\n $has_arguments = FALSE;\n $has_filter = FALSE;\n\n $main_group = db_and();\n $filter_group = $this->group_operator == 'OR' ? db_or() : db_and();\n\n foreach ($this->$where as $group => $info) {\n\n if (!empty($info['conditions'])) {\n $sub_group = $info['type'] == 'OR' ? db_or() : db_and();\n foreach ($info['conditions'] as $key => $clause) {\n // DBTNG doesn't support to add the same subquery twice to the main\n // query and the count query, so clone the subquery to have two\n // instances of the same object. - http://drupal.org/node/1112854\n if (is_object($clause['value']) && $clause['value'] instanceof SelectQuery) {\n $clause['value'] = clone $clause['value'];\n }\n if ($clause['operator'] == 'formula') {\n $has_condition = TRUE;\n $sub_group->where($clause['field'], $clause['value']);\n }\n else {\n $has_condition = TRUE;\n $sub_group->condition($clause['field'], $clause['value'], $clause['operator']);\n }\n }\n\n // Add the item to the filter group.\n if ($group != 0) {\n $has_filter = TRUE;\n $filter_group->condition($sub_group);\n }\n else {\n $has_arguments = TRUE;\n $main_group->condition($sub_group);\n }\n }\n }\n\n if ($has_filter) {\n $main_group->condition($filter_group);\n }\n\n if (!$has_arguments && $has_condition) {\n return $filter_group;\n }\n if ($has_arguments && $has_condition) {\n return $main_group;\n }\n }", "protected function buildQueryConditions() {\n\t\tif(empty($this->condition)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$conditionString = null;\n\t\tforeach($this->condition as $condition) {\n\t\t\t$conditionString .= (!empty($conditionString) ? ' '.$condition[1].' ' : null).$condition[0];\n\t\t}\n\n\t\treturn $conditionString;\n\t}", "function getFilterClause($filter_json) {\n global $m;\n\n $filter_sql = \"\";\n $filter = json_decode($filter_json, TRUE);\n foreach ($filter as $filter_item) {\n $field = $m[\"ro\"]->escape_string($filter_item[\"field\"]);\n if (strstr($field, \"`\") == FALSE) {\n $field = \"`$field`\";\n }\n if ( $filter_item[\"type\"] == \"string\" ) {\n $value = $m[\"ro\"]->escape_string( $filter_item[\"value\"] );\n $filter_sql .= \" AND $field LIKE '%$value%'\";\n } elseif ( $filter_item[\"type\"] == \"list\" ) {\n $filter_sql .= \" AND $field IN (\";\n $comma = \"\";\n foreach ($filter_item[\"value\"] as $value_item ) {\n $value_item = $m[\"ro\"]->escape_string( $value_item );\n $filter_sql .= \"$comma '$value_item'\";\n $comma = \",\";\n }\n $filter_sql .= \")\";\n\n } elseif ( $filter_item[\"type\"] == \"datetime\" ) {\n switch ( $filter_item[\"comparison\"] ) {\n case \"gt\": $op = \">\"; break;\n case \"lt\": $op = \"<\"; break;\n case \"eq\": $op = \"=\"; break;\n }\n $value = $m[\"ro\"]->escape_string( $filter_item[\"value\"] );\n $filter_sql .= \" AND $field $op '$value'\";\n }\n }\n return $filter_sql;\n}", "public function getSuperflatWhereConditionArray(): ?array;", "function parse_condition_tag($convoArr, $element, $parentName, $level)\n {\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Parsing a CONDITION tag.', 2);\n global $error_response;\n $response = array();\n $attrName = $element['name'];\n $attributes = (array)$element->attributes();\n $attributesArray = (isset($attributes['@attributes'])) ? $attributes['@attributes'] : array();\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Element attributes:' . print_r($attributesArray, true), 4);\n $attribute_count = count($attributesArray);\n runDebug(__FILE__, __FUNCTION__, __LINE__, \"Element attribute count = $attribute_count\", 4);\n if ($attribute_count == 0) // Bare condition tag\n {\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Parsing a CONDITION tag with no attributes. XML = ' . $element->asXML(), 4);\n $liNamePath = 'li[@name]';\n $condition_xPath = '';\n $exclude = array();\n $choices = $element->xpath($liNamePath);\n foreach ($choices as $choice)\n {\n $choice_name = (string)$choice['name'];\n if (in_array($choice_name, $exclude)) continue;\n $exclude[] = $choice_name;\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Client properties = ' . print_r($convoArr['client_properties'], true), 4);\n $choice_value = get_client_property($convoArr, $choice_name);\n $condition_xPath .= \"li[@name=\\\"$choice_name\\\"][@value=\\\"$choice_value\\\"]|\";\n }\n $condition_xPath .= 'li[not(@*)]';\n runDebug(__FILE__, __FUNCTION__, __LINE__, \"xpath search = $condition_xPath\", 4);\n $pick_search = $element->xpath($condition_xPath);\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Pick array = ' . print_r($pick_search, true), 4);\n $pick_count = count($pick_search);\n runDebug(__FILE__, __FUNCTION__, __LINE__, \"Pick count = $pick_count.\", 4);\n $pick = $pick_search[0];\n }\n elseif (array_key_exists('value', $attributesArray) or array_key_exists('contains', $attributesArray) or array_key_exists('exists', $attributesArray)) // condition tag with either VALUE, CONTAINS or EXISTS attributes\n {\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Parsing a CONDITION tag with 2 attributes.', 4);\n $condition_name = (string)$element['name'];\n $test_value = get_client_property($convoArr, $condition_name);\n switch (true)\n {\n case (isset($element['value'])):\n $condition_value = (string)$element['value'];\n break;\n case (isset($element['value'])):\n $condition_value = (string)$element['value'];\n break;\n case (isset($element['value'])):\n $condition_value = (string)$element['value'];\n break;\n default:\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Something went wrong with parsing the CONDITION tag. Returning the error response.', 1);\n return $error_response;\n }\n $pick = ($condition_value == $test_value) ? $element : '';\n }\n elseif (array_key_exists('name', $attributesArray)) // this ~SHOULD~ just trigger if the NAME value is present, and ~NOT~ NAME and (VALUE|CONTAINS|EXISTS)\n {\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Parsing a CONDITION tag with only the NAME attribute.', 4);\n $condition_name = (string)$element['name'];\n $test_value = get_client_property($convoArr, $condition_name);\n $path = \"li[@value=\\\"$test_value\\\"]|li[not(@*)]\";\n runDebug(__FILE__, __FUNCTION__, __LINE__, \"search string = $path\", 4);\n $choice = $element->xpath($path);\n $pick = $choice[0];\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'Found a match. Pick = ' . print_r($pick, true), 4);\n }\n else // nothing matches\n {\n runDebug(__FILE__, __FUNCTION__, __LINE__, 'No matches found. Returning default error response. this is probably because of poorly written AIML code.', 1);\n return $error_response;\n }\n $children = (is_object($pick)) ? $pick->children() : null;\n if (!empty ($children))\n {\n foreach ($children as $child)\n {\n $response[] = parseTemplateRecursive($convoArr, $child, $level + 1);\n }\n runDebug(__FILE__, __FUNCTION__, __LINE__, \"Response = \" . print_r($response, true), 4);\n }\n else\n {\n $response[] = (string) $pick;\n }\n $response_string = implode_recursive(' ', $response, __FILE__, __FUNCTION__, __LINE__);\n return $response_string;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Autolink Function : transform every word of more than $limit characters in internal link
public function everylink(string $text, int $limit): string { $regex = '~([\w-_éêèùïüîçà]{' . $limit . ',})(?![^<]*>|[^<>]*<\/)~'; $text = preg_replace_callback($regex, function ($matches) { return '<a href="' . idclean($matches[1]) . '">' . $matches[1] . '</a>'; }, $text); return $text; }
[ "function rcms_prc_link_short($matches){\n\tif(mb_strlen($matches[2])>25){\n\t\treturn ' <a href=\"http://' . $matches[2] . '\" target=\"_blank\">' . mb_substr($matches[2], 0, 11) . '...' . mb_substr($matches[2], -11) . '</a>';\n\t} else return ' <a href=\"http://' . $matches[2] . '\" target=\"_blank\">' . $matches[2] . '</a>';\n}", "function friendly($text, $max_words=10){\r\n\t\t$url = $this->word_limit($text, $max_words);\r\n\t\t$url = preg_replace('/[^a-z0-9\\s]/i', '', $url);\r\n\t\t$url = preg_replace('/\\s+/i', '-', $url); //Can also use a plus here\r\n\t\treturn $url;\r\n\t}", "public function generateShortlink(): void {\n $shortlink = \"\";\n $titleWordArray = explode(\" \", $this->title);\n\n // get first 5 words and hyphenate\n if(count($titleWordArray) < 5) {\n foreach($titleWordArray as $word) {\n $shortlinkWord = preg_replace(\"/[^A-Za-z0-9 ]/\", '', $word);\n $shortlink .= strtolower($shortlinkWord) . \"-\";\n }\n } else {\n for($i = 0; $i < 5; $i++) {\n $shortlinkWord = preg_replace(\"/[^A-Za-z0-9 ]/\", '', $titleWordArray[$i]);\n $shortlink .= strtolower($shortlinkWord) . \"-\";\n }\n }\n // remove illegal characters\n $shortlink = htmlspecialchars(substr($shortlink, 0, -1));\n\n // trim to 30\n if (strlen($shortlink) > 30) {\n $shortlink = substr($shortlink, 0, 30);\n }\n\n $this->shortlink = $shortlink;\n }", "function put_links($text) {\r\n return preg_replace('#[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]#', '<a href=\"\\0\" rel=\"nofollow\">\\0</a>', $text);\r\n}", "function _shortenURL(&$ret){\n\t $links = explode('<a', $ret);\n\t $countlinks = count($links);\n\t for ($i = 0; $i < $countlinks; $i++){\n\t\t\t$link = $links[$i];\t\t\t\n\t\t\t$link = (preg_match('#(.*)(href=\")#is', $link)) ? '<a' . $link : $link;\n\t\n\t\t\t$begin = strpos($link, '>') + 1;\n\t\t\t$end = strpos($link, '<', $begin);\n\t\t\t$length = $end - $begin;\n\t\t\t$urlname = substr($link, $begin, $length);\n\n\t\t\t$chunked = (strlen($urlname) > 50 && preg_match('#^(http://|ftp://|www\\.)#is', $urlname)) ? substr_replace($urlname, '...', 30, -10) : $urlname;\n\t\t\t$ret = str_replace('>' . $urlname . '<', '>' . $chunked . '<', $ret); \n\t\n\t }\n\t}", "function substitueURLs($myText,$substitute=\"Link...\",$urlPrefix=\"http\")\r\n{\r\n $retVal = $myText;\r\n $amEnde = false;\r\n $tempMarker = \"|+++++|\";\r\n $durchlauf = 1;\r\n\r\n // echo_pre(string_char_codes($myText));\r\n\r\n while ((!$amEnde)&&($durchlauf<9999))\r\n {\r\n // URLS UMSETZEN IN WEB LINK ICONS\r\n $urlFound = getURL($retVal,$urlPrefix);\r\n\r\n if ($urlFound)\r\n {\r\n // IN RUECKGABE DEN LINKSUBSTITUTE EINBAUEN UND SUBSTITUTE UNKENNTLICH MACHEN IN DIESEM TEIL\r\n // DAMIT DIESER NICHT MEHR REPLACED WIRD, GILT AUCH FUER SUBSTITUTE DER EIN BILD MIT HTTP TAG SEIN KANN\r\n $retVal = str_replace($urlFound,\"<a href='\".\r\n str_replace($urlPrefix,$tempMarker,$urlFound).\"' target=_blank>\".\r\n str_replace($urlPrefix,$tempMarker,$substitute).\"</a>\",$retVal);\r\n }\r\n else\r\n $amEnde = true;\r\n\r\n $durchlauf++;\r\n }\r\n\r\n return str_replace($tempMarker,$urlPrefix,$retVal);\r\n}", "function custom_more_link( $link, $link_text ) {\n return str_replace( $link_text, 'Read More...', $link);\n}", "function wrapLongWords($text,$maxLength) {\r\n\t$wordWrap = \"&shy;\"; //this character will be used for breaking long words.\r\n\t\r\n if (strtolower(_CHARSET) == 'utf-8') {\r\n $bUsingUtf = true; //test, if utf-8 is used. \r\n } else {\r\n $bUsingUtf = false; \r\n }\r\n \r\n $wordStart = 0; // character position, where current word started\r\n $wordLength = 0; // length of word (we need this value separated, becouse text can be in utf-8)\r\n $lastCopy = 0; //points to the first character, which isn't copied to result yet\r\n\r\n\t//go through whole text\r\n for ($i = 0; $i < strlen($text);$i++) {\r\n\t\t \r\n\t\t//handles utf-8 coded string\r\n if ($bUsingUtf && (($value = ord($text{$i})) > 127)){\r\n if($value >= 192 && $value <= 223)\r\n $i++;\r\n elseif($value >= 224 && $value <= 239)\r\n $i = $i + 2;\r\n elseif($value >= 240 && $value <= 247)\r\n $i = $i + 3;\r\n }\r\n\t\t\r\n\t\t//don't wrap link!\r\n\t\tif (($text{$i} == '<') && ($text{$i+1} == 'a')) { \r\n\t\t\t$endLink = strpos($text,'>',$i);\r\n\t\t\t$i = $endLink;\r\n\t\t\t$wordStart = $i+1;\r\n\t\t\t$wordLength = 0;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t\r\n\t\t//end of link\r\n\t\tif (($text{$i} == '<') && ($text{$i+1} == '/') && ($text{$i+2} == 'a') ) {//end of link\r\n\t\t\t$i = $i + 3;\r\n\t\t\t$wordStart = $i+1;\r\n\t\t\t$wordlLength = 0;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t\r\n\t\t//here starts new word\r\n if (($text{$i} == ' ') || ($text{$i} == '-') || ($text{$i} == \"\\n\")) {\r\n $wordStart = $i + 1;\r\n $wordLength = 0;\r\n }\r\n \r\n\t\t//word is too long -> insert wordwrap character\r\n\t\tif ($wordLength >= $maxLength - 1) { \r\n $newText .= substr($text,$lastCopy ,$i - $lastCopy + 1).$wordWrap;\r\n $wordStart = $i + 1;\r\n $lastCopy = $i + 1;\r\n $wordLength = 0;\r\n }\r\n $wordLength++;\r\n }\r\n\t\r\n $newText .= substr($text,$lastCopy);\r\n \r\n\treturn $newText;\r\n }", "public static function trim_link($link, $limit = 50)\n {\n if ($limit > 39) {\n // we test the limit that it's at least 39 characters,\n // otherwise our presentation will look awkward!\n // figure out the total length of the link title\n if (strlen($link) > $limit) {\n // edit the link\n // we also return the last 10 characters of the long\n // URL i.e. the '-10' value in the line below\n $link = substr($link, 0, ($limit / 2)) . '...' . substr($link, -10);\n }\n }\n\n // return the processed string\n return $link;\n }", "function remove_more_jump_link($link) { \n$offset = strpos($link, '#more-');\nif ($offset) {\n$end = strpos($link, '\"',$offset);\n}\nif ($end) {\n$link = substr_replace($link, '', $offset, $end-$offset);\n}\nreturn $link;\n}", "function the_content_limit( $max_char, $more_link_text = 'read more', $stripteaser = 0, $more_file = '', $more_link_trailer = '...', $displayLink = TRUE, $newLink = '' ) {\n $content = get_the_content( $more_link_text, $stripteaser, $more_file );\n $content = apply_filters( 'the_content', $content );\n $content = str_replace( ']]>', ']]&gt;', $content );\n $content = strip_tags( $content );\n\n //adjust the content if it is too long and there is no \"p\" get variable\n if( ( strlen( $_GET['p'] ) <= 0 ) && ( strlen( $content ) > $max_char ) ){\n $espacio = strpos( $content, \" \", $max_char );\n $content = substr( $content, 0, $espacio );\n $content .= $more_link_trailer;\n }\n\n if($displayLink == FALSE) {\n if( $newLink != '' ){\n $content .= ' <a href=\"' . $newLink . '\">' . $more_link_text . '</a>';\n } else {\n $content .= ' <a href=\"' . get_permalink() . '\">' . $more_link_text . '</a>';\n }\n }\n\n echo '<p>' . $content . '</p>';\n}", "function autolink($text, $target=NULL, $nofollow=true){\n\n\t\t // grab anything that looks like a URL...\n\t\t $urls = General::__autolink_find_URLS($text);\n\n\t\t if(!empty($urls)){ // i.e. there were some URLS found in the text{\n\t\t array_walk($urls, array('General', '__autolink_create_html_tags'), array('target'=>$target, 'nofollow'=>$nofollow));\n\t\t $text = strtr($text, $urls);\n\t\t }\n\n\t\t return $text;\n\t\t}", "function hys_urlfriendly($string, $maxLength = 49) { hys_url_friendly($string, $maxLength); }", "function link_keywords($string) {\n $keyword_lst = explode('|', $string);\n $count = 0;\n $result = \"\";\n foreach ($keyword_lst as $keyword) {\n if (trim($keyword) != \"\") {\n $link = str_replace(\" \",\"+\",$keyword);\n $item = \"<a href=\\\"keyword/$link\\\">$keyword</a>\";\n if ($count == 0) {\n $result = $result.$item;\n } else {\n $result = $result.\"; \".$item;\n }\n $count = $count + 1;\n }\n }\n return $result;\n}", "protected function _link ()\r\n {\r\n if ($this->complete_text_url)\r\n {\r\n return \" [<a class=\\\"complete-text-link\\\" href=\\\"$this->complete_text_url\\\">More</a>]\";\r\n }\r\n \r\n return '';\r\n }", "function remove_more_jump_link($link) { \n\t$offset = strpos($link, '#more-');\n\tif ($offset) {\n\t\t$end = strpos($link, '\"',$offset);\n\t}\n\tif ($end) {\n\t\t$link = substr_replace($link, '', $offset, $end-$offset);\n\t}\n\treturn $link;\n}", "function modify_attachment_link($markup) {\r\n return preg_replace('/^<a([^>]+)>(.*)$/', '<a\\\\1 target=\"_blank\">\\\\2', $markup);\r\n}", "function novolearn_content_more_link( $link ) {\n\t$link = preg_replace( '|#more-[0-9]+|', '', $link );\n\n\treturn '<p class=\"more-link-wrap\">' . $link . '</p>';\n}", "function link_souce($text){\n\n if(post::isValidURL($text)){\n $text = '<a href=\"'.$text.'\">'.$text.'</a>';\n } \n return $text;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ This is to clear an exam of all candidates.
public static function clearCandidates($exam_id) { $ret = DB::table('pivots')->where('exam_id', '=', $exam_id)->delete(); return $ret; }
[ "public function clearAnswers()\n {\n $this->emissions = null;\n $this->cabotage = null;\n $this->trips = null;\n $this->internationalJourneys = null;\n $this->sectors = null;\n $this->updatePermitsRequired(null);\n $this->resetCountrys();\n $this->resetCheckAnswersAndDeclaration();\n }", "public function clearAnswers()\n {\n $this->collAnswers = null; // important to set this to NULL since that means it is uninitialized\n }", "public function clearIdeaabuses()\n\t{\n\t\t$this->collIdeaabuses = null; // important to set this to NULL since that means it is uninitialized\n\t}", "function clear_questions($exam_id){\n\t$data = array();\n\t$result = mysql_query(\"SELECT * FROM `mock_exam_questions` WHERE `quiz_id` = '$exam_id'\");\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t $data [] = $row;\n\t}\n\tforeach($data as $d){\n\t\tclear_answers($d['question_id']);\n\t}\n\t$id = (int)$exam_id;\n\t// Delete the question to update\n\tmysql_query(\"DELETE FROM `mock_exam_questions` WHERE `quiz_id` = '$id'\");\n}", "public static function clear(){\n self::$answers = [];\n }", "public function clearReportAnswers()\n {\n $this->collReportAnswers = null; // important to set this to NULL since that means it is uninitialized\n }", "public function clearFtesalaryadvances()\n {\n $this->collFtesalaryadvances = null; // important to set this to NULL since that means it is uninitialized\n }", "public function reset()\n {\n for( $i = 1; $i <= 9; $i++ )\n {\n $this->candidates[ $i ] = true;\n }\n }", "public function clearAportacions()\n {\n $this->collAportacions = null; // important to set this to NULL since that means it is uninitialized\n }", "function resetAnswers() {\n\t\tunset($this->_answers);\n\t\t$this->_answers = array();\n\t}", "private function ClearSolution()\n {\n $this->FXValues = array();\n $this->FYValues = array();\n }", "private function clearSolution() {\n\t$this->FXValues\t\t\t=\tarray();\n\t$this->FYValues\t\t\t=\tarray();\n\t}", "public function resetQuestions(): void\n {\n\n $questions = Question::where('user_answer','!=',null)->get();\n\n foreach($questions as $question){\n $question->update(['user_answer'=>null]);\n\n }\n\n $this->info(\"Question has been reset successfully!\");\n\n $this->mainMenu();\n }", "public function clearPesquisaHabilitadas()\n\t{\n\t\t$this->collPesquisaHabilitadas = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clearCheckInformations()\n\t{\n\t\t$this->collCheckInformations = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clearAllSavedCards(){\r\n foreach($this->getCards() as $card) {\r\n $card->delete();\r\n }\r\n }", "protected function remove_from_all_courses()\n {\n global $DB;\n $DB->delete_records('block_bcgt_course_qual', array( \n 'bcgtqualificationid'=>$this->id));\n }", "public function clearStudentSuggestions()\n\t{\n\t\t$this->collStudentSuggestions = null; // important to set this to NULL since that means it is uninitialized\n\t}", "function clearGapAnswers() \n\t{\n\t\tforeach ($this->gaps as $gap_index => $gap)\n\t\t{\n\t\t\t$this->gaps[$gap_index]->clearItems();\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts a bool to a 'yes' or 'no'.
function masvideos_bool_to_string( $bool ) { if ( ! is_bool( $bool ) ) { $bool = masvideos_string_to_bool( $bool ); } return true === $bool ? 'yes' : 'no'; }
[ "function boolToWord($bool){\nif ($bool === true) {\n $bool = 'Yes';\n} else $bool = 'No';\n\nreturn $bool;\n}", "function boolToWord($bool){\n if($bool == true){\n return \"Yes\";\n }else{\n return \"No\";\n }\n }", "public function toYesNo( $bool ){\r\n\t\tif($bool) \r\n\t\t\treturn __('Yes', 'connections');\r\n\t\telse \r\n\t\t\treturn __('No', 'connections');\r\n\t}", "function bool_to_str($val)\r\n{\r\n if ($val == TRUE)\r\n {\r\n return \"Si\";\r\n } \r\n else \r\n {\r\n return \"No\";\r\n }\r\n}", "function convBooleanValue($value)\n{\n\tif ($value == 0) return 'No';\n\treturn 'Yes';\n}", "function BooleanYesNo($bolYes)\n\t{\n\t\tif ($bolYes)\n\t\t{\n\t\t\treturn \"Yes\";\n\t\t}\n\t\t\n\t\treturn \"No\";\n\t}", "public static function boolToString($bool)\n\t{\n\t\tif ($bool)\n\t\t\treturn Dictionary::translate('lang_yes', true);\n\t\treturn Dictionary::translate('lang_no', true);\n\t}", "function yesNo($in) {\n return ($in == 1 || $in == true) ? 'yes' : 'no';\n }", "function bool2str($bool) {\n\tif($bool ===false)\n\t\treturn 'false';\n\telse\n\t\treturn 'true';\n}", "public static function booleanToString(bool|int|string $value): string\n {\n return (bool)$value ? trans('Yes') : trans('No');\n }", "private function getBoolean($boolean) { return ($boolean ? 'true' : 'false'); }", "function str_to_bool( $value ) {\n\t\tif ( $value == 'yes' || $value == 'true' || $value === true )\n\t\t\treturn true;\n\t\treturn false;\n\t}", "function bool2check($booleanvalue){\r\n\tif($booleanvalue){\r\n\t\treturn \"checked\";\r\n\t}else{\r\n\t\treturn \"\";\r\n\t}\r\n}", "function resmap_toBool($string) {\n switch (strtolower($string)) {\n case 'yes':\n $string = 'true';\n break;\n case 'no':\n $string = 'false';\n break;\n default:\n $string = 'false';\n break;\n }\n return $string;\n}", "function convert(): bool\n {\n if (!is_string($this->value)) {\n $this->result = $this->value;\n }\n else {\n switch (strtolower($this->value)) {\n case '1':\n case 'true':\n case 'on':\n case 'yes':\n case 'y':\n $this->result = true;\n default:\n $this->result = false;\n }\n }\n\n return $this->result;\n }", "function ynbool($yn)\r\n{\r\n\t$yn = strtolower($yn);\r\n\tif($yn == 'yes' || $yn == 'y') return 1;\r\n\tif($yn == 'no' || $yn == 'n') return 0;\r\n\treturn 'NULL';\r\n}", "function getBoolean($val) {\n if ($val == \"Yes\")\n return true;\n else\n return false;\n}", "public function yesNo()\n {\n $yesNo = $this->value;\n\n if (is_string($yesNo)) {\n $yesNo = preg_replace('`[^a-zA-Z0-9]`', '', strtolower(trim((string) $yesNo)));\n }\n\n if (strval(intval($yesNo)) == $yesNo && $yesNo != 0) {\n $yesNo = true;\n }\n\n if (in_array($yesNo, array('y', 'ye', 'yes', '1', 1, true, 'true'), true)) {\n return 'Yes';\n } else {\n return 'No';\n }\n }", "function coerce_bool($input, $extra_strings = array()){\n\tif(!$input) return false;\n\tif(is_numeric($input)) return !!floatval($input);\n\tif(is_string($input)) return !in_array(strtolower($input), array_merge(array('false', 'no', 'off', 'disabled', 'disable', 'never', 'nah'), $extra_strings));\n\treturn !!$input;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the principalId The identifier of the principal whose membership or ownership assignment is granted through PIM for groups. Required.
public function setPrincipalId($val) { $this->_propDict["principalId"] = $val; return $this; }
[ "public function setPrincipalId($principalId)\n {\n $this->principalId = $principalId;\n return $this;\n }", "public function setPrincipalId(?string $value): void {\n $this->getBackingStore()->set('principalId', $value);\n }", "public function setPrincipal(PrincipalInterface $principal);", "public function filterByPrincipalId($principalId = null, $comparison = null)\n {\n if (is_array($principalId)) {\n $useMinMax = false;\n if (isset($principalId['min'])) {\n $this->addUsingAlias(GroupmembersTableMap::COL_PRINCIPAL_ID, $principalId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($principalId['max'])) {\n $this->addUsingAlias(GroupmembersTableMap::COL_PRINCIPAL_ID, $principalId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GroupmembersTableMap::COL_PRINCIPAL_ID, $principalId, $comparison);\n }", "public function setServicePrincipalId($val)\n {\n $this->_propDict[\"servicePrincipalId\"] = $val;\n return $this;\n }", "public function setServicePrincipalId(?string $value): void {\n $this->getBackingStore()->set('servicePrincipalId', $value);\n }", "public function getByPrincipalId($principalId)\n {\n $path = new ServiceOperationPath(\"getByPrincipalId\",array(\n $principalId\n ),$this->getResourcePath());\n $roleAssignment = new RoleAssignment($this->getContext(),$path);\n $this->addChild($roleAssignment);\n return $roleAssignment;\n }", "public function setIdLinhaPrincipal($id_linha_principal)\n {\n $this->id_linha_principal = $id_linha_principal;\n\n return $this;\n }", "public function setPrincipal($principal)\n {\n $this->principal = $principal;\n\n return $this;\n }", "public function setServicePrincipalObjectId(?string $value): void {\n $this->getBackingStore()->set('servicePrincipalObjectId', $value);\n }", "public function setPrincipal($val)\n {\n $this->_propDict[\"principal\"] = $val;\n return $this;\n }", "public function setIdGroup($idGroup){\n $this->idGroup = $idGroup;\n\n }", "public function setPrimaryGroup($groupID)\n {\n $exists = self::getSubObjectIDs(\n 'ImageAssociation',\n array(\n 'imageID' => $this->get('id'),\n 'storagegroupID' => $groupID\n ),\n 'storagegroupID'\n );\n if (count($exists) < 1) {\n self::getClass('ImageAssociation')\n ->set('imageID', $this->get('id'))\n ->set('storagegroupID', $groupID)\n ->save();\n }\n /**\n * Unset all current groups to non-primary\n */\n self::getClass('ImageAssociationManager')\n ->update(\n array(\n 'imageID' => $this->get('id'),\n 'storagegroupID' => $this->get('storagegroups')\n ),\n '',\n array('primary' => 0)\n );\n /**\n * Set the passed group as primary\n */\n self::getClass('ImageAssociationManager')\n ->update(\n array(\n 'imageID' => $this->get('id'),\n 'storagegroupID' => $groupID\n ),\n '',\n array('primary' => 1)\n );\n }", "public function setIdentities($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Hyperledger\\Fabric\\Protos\\MSP\\MSPPrincipal::class);\n $this->identities = $arr;\n\n return $this;\n }", "public function setPrincipalOrganizationId(?string $value): void {\n $this->getBackingStore()->set('principalOrganizationId', $value);\n }", "function setApprovalNoticeId($approvalNoticeId) {\r\n\t\tif (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');\r\n\t\treturn $this->setId($approvalNoticeId);\r\n\t}", "public function setProviderId($providerId);", "public function setOwnerId($id)\n {\n $this->owner_id = (int)$id;\n }", "function setAccountGroupID( $id ) \n {\n $this->setValueByFieldName( 'accountgroup_id', $id );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funciton to Update JP_CHRISTIAN Table
private function updateJP_CHRISTIAN($iProfileID,$paramArray=array()) { try{ return $this->objProfileChristianStore->update($iProfileID,$paramArray); } catch (Exception $ex) { jsCacheWrapperException::logThis($ex); return false; } }
[ "function updateVisits($firstname, $lastname, $year){\n //connect to your database. Type in your username, password and the DB path\n $conn=oci_connect('mcai','coen174', 'dbserver.engr.scu.edu/db11g');\n if(!$conn) {\n print \"<br> connection failed:\";\n exit;\n }\n\n //locate row that holds the user \n //sets visit to the old value of visits + 1\n $queryString = \"UPDATE SCU_ALUM Set visits = ((SELECT visits FROM SCU_ALUM\n Where firstname = :firstname and lastname = :lastname and grad_year = :year)+1)\n Where firstname = :firstname and lastname = :lastname and grad_year = :year\";\n\n //prepares connection to pass in the variables and execute the above update\n $query = oci_parse($conn, $queryString);\n //binds php variable to a variable the oracle database can hold and read\n oci_bind_by_name($query, ':firstname', $firstname);\n oci_bind_by_name($query, ':lastname', $lastname);\n oci_bind_by_name($query, ':year', $year);\n // Execute the query\n $res = oci_execute($query);\n if (!$res) {\n $e = oci_error($query);\n echo $e['message'];\n }\n\n oci_free_statement($query);\n OCILogoff($conn);\n}", "function update_jns_perawatan($kd_jenis_prw,$params)\n {\n $this->db->where('kd_jenis_prw',$kd_jenis_prw);\n return $this->db->update('jns_perawatan',$params);\n }", "function SQPRcanc() {\n $problem_id = $_POST['problem_id'];\n $this->dm->init('T_SQA_DFCT', 'PROBLEM_ID');\n $keys = \"PROBLEM_ID = '\" . $problem_id . \"'\";\n $SQPR = $this->dm->sqpr_number();\n\n $data = array(\n 'SQPR_NUM' => NULL\n );\n\n $this->dm->update($data, $keys);\n $data['problem_id']=$problem_id;\n echo '1';\n }", "public function update(array $ric, array $newRow);", "function update_feature_val($,$params)\n {\n $this->db->where('',$);\n return $this->db->update('feature_val',$params);\n }", "function update() {\n\n\t \t$sql = \"UPDATE evs_database.evs_key_component \n\t \t\t\tSET\tkcp_key_component_detail_en=?, kcp_key_component_detail_th=?, kcp_cpn_id=? \n\t \t\t\tWHERE kcp_id=?\";\n\t\t\n\t\t$this->db->query($sql, array( $this->kcp_key_component_detail_en, $this->kcp_key_component_detail_th, $this->kcp_cpn_id, $this->kcp_id));\n\t\t\n\t }", "public function capex_gen_update($qcs_id,$capex_gen_up){\n\t\t\t\t\t\t$this->db->where('ftgs_qcs_id', $qcs_id);\n\t\t\t\t\t\t$this->db->update('ftgs_qcs_master',$capex_gen_up);\n\t\t\t\t\t}", "function updateSxbparkLastName($last_name,$citation_number)\r\n{\r\n\t$query=\"UPDATE SXBPARK\r\n\t\t\tSET SXBPARK_LAST_NAME = '$last_name'\r\n\t\t\tWHERE SXBPARK_CITATION_NUMBER = '$citation_number'\";\r\n\t$row=$this->_ADOdb->Execute($query);\r\n\t\t\treturn true;\t\t\t\r\n\treturn false;\r\n}", "function update_r1097() {\n\n\t$r = q(\"select hubloc_id, hubloc_addr from hubloc where hubloc_addr like '%%/%%'\");\n\tif($r) {\n\t\tforeach($r as $rr) {\n\t\t\tq(\"update hubloc set hubloc_addr = '%s' where hubloc_id = %d limit 1\",\n\t\t\t\tdbesc(substr($rr['hubloc_addr'],0,strpos($rr['hubloc_addr'],'/'))),\n\t\t\t\tintval($rr['hubloc_id'])\n\t\t\t);\n\t\t}\n\t}\n\treturn UPDATE_SUCCESS;\n\t\n}", "public function updateClinicInfo($p_clinic){ \n\n $stmt = $this->adapter->conn->prepare(\"UPDATE CLINIC SET \".\n \"clinic_name = ?, \" . \n \"clinic_addr = ?, \" .\n \"post_code = ?, \" .\n \"latitude = ?, \" .\n \"longtitude = ?, \" .\n \"province = ?, \" .\n \"city = ?, \" .\n \"email = ?, \" .\n \"website = ?, \" .\n \"contact_person = ?, \".\n \"active = ?, \" .\n \"expiration = ?, \" .\n \"WHERE clinic_id = ?;\");\n\n $stmt->bindParam(1,$p_clinic->getClinicName());\n $stmt->bindParam(2,$p_clinic->getClinicAddress());\n $stmt->bindParam(3,$p_clinic->getPostCode());\n $stmt->bindParam(4,$p_clinic->getLatitude());\n $stmt->bindParam(5,$p_clinic->getLongtitude());\n $stmt->bindParam(6,$p_clinic->getProvince());\n $stmt->bindParam(7,$p_clinic->getCity());\n $stmt->bindParam(8,$p_clinic->getEmail());\n $stmt->bindParam(9,$p_clinic->getWebsite());\n $stmt->bindParam(10,$p_clinic->getContactPerson());\n $stmt->bindParam(11,$p_clinic->getActiveStatus());\n $stmt->bindParam(12,$p_clinic->getExpirationDate());\n $stmt->bindParam(13,$p_clinic->getClinicId());\n $result=null;\n try{\n $result = $this->adapter->executeUpdatePrepared($stmt);\n }catch(PDOException $e){\n return false;\n }\n if($result > 0) {\n return true;\n }\n\n return false;\n\n }", "function ucroo_upgrade_157() {\n $sql = array(\"UPDATE `ucroo_category` SET `category_name` = 'Interest/Hobby' WHERE `ucroo_category`.`id` = 12;\");\n return $sql;\n}", "function saveFromCuti($conn,$r_key){\t\n\t\t\t//select cuti yang sudah disetujui\n\t\t\t$rowv = $conn->GetRow(\"select c.*,m.jeniscuti\n\t\t\t\t\tfrom \".self::table('pe_rwtcuti').\" c\n\t\t\t\t\tleft join \".self::table('ms_cuti').\" m on m.idjeniscuti = c.idjeniscuti\n\t\t\t\t\twhere c.nourutcuti = '$r_key'\");\n\t\t\t\n\t\t\t//hapus absensi dulu, utk membersihkan cuti di absensi\n\t\t\t$conn->Execute(\"delete from \".self::table('pe_presensidet').\" where nourutcuti = '$r_key' and kodeabsensi = 'C' and jamdatang is null and jampulang is null\");\n\t\t\t$rsdet = $conn->Execute(\"select tglpresensi,kodeabsensi,jamdatang from \".self::table('pe_presensidet').\" where nourutcuti = '$r_key'\");\n\t\t\twhile($rowdet = $rsdet->FetchRow()){\n\t\t\t\tif(empty($rowdet['jamdatang']))\n\t\t\t\t\t$conn->Execute(\"update \".self::table('pe_presensidet').\" set kodeabsensi = 'A' where idpegawai = \".$rowv['idpegawai'].\" and tglpresensi = '\".$rowdet['tglpresensi'].\"'\");\n\t\t\t}\n\t\t\t$conn->Execute(\"update \".self::table('pe_presensidet').\" set nourutcuti = null where nourutcuti = '$r_key'\");\n\t\t\t\n\t\t\t//bila disetujui, maka insert ke presensi\n\t\t\tif($rowv['statususulan'] == 'S'){\n\t\t\t\t$rsd = $conn->Execute(\"select * from \".self::table('pe_rwtcutidet').\" where nourutcuti = '$r_key' and ischange is null\");\n\t\t\t\t\n\t\t\t\twhile($rowd = $rsd->FetchRow()){\n\t\t\t\t\t$mulai=strtotime($rowd['tglmulai']);\n\t\t\t\t\t$selesai=strtotime($rowd['tglselesai']);\n\t\t\t\t\t\n\t\t\t\t\t$artgl=array();\n\t\t\t\t\t$i=0;\t\t\n\t\t\t\t\twhile($mulai<=$selesai){\n\t\t\t\t\t\t$nefektif=date(\"w\",$mulai);\n\t\t\t\t\t\t$tgl = date(\"Y-m-d\",$mulai);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//pengecekan shift\n\t\t\t\t\t\t$shift = mCuti::isJadwalShift($conn,$rowv['idpegawai'],$tgl);\n\t\t\t\t\t\tif($shift == 3){\n\t\t\t\t\t\t\tif($nefektif != 0 and $nefektif != 6)\n\t\t\t\t\t\t\t\t$artgl[$i++] = date('Y-m-d',$mulai);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($shift == 1){\n\t\t\t\t\t\t\t$artgl[$i++] = date('Y-m-d',$mulai);\n\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$mulai+=86400;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//cek liburan\n\t\t\t\t\t$libur = $conn->Execute(\"select cast(tgllibur as date) as tgllibur from \".self::table('ms_liburdetail').\" \n\t\t\t\t\t\twhere tgllibur between '\".$rowd['tglmulai'].\"' and '\".$rowd['tglselesai'].\"' and \n\t\t\t\t\t\tdatepart(dw,tgllibur) <> '1' and datepart(dw,tgllibur) <> '7'\");\n\n\t\t\t\t\twhile($rowl = $libur->FetchRow()){\n\t\t\t\t\t\t//pengecekan shift\n\t\t\t\t\t\t$shift = mCuti::isJadwalShift($conn,$rowv['idpegawai'],$rowl['tgllibur']);\n\t\t\t\t\t\tif(($shift == 1 or $shift == 3) and in_array($rowl['tgllibur'],$artgl)){\n\t\t\t\t\t\t\t$key = array_search($rowl['tgllibur'], $artgl);\n\t\t\t\t\t\t\tunset($artgl[$key]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t//insert ke absensi\t\n\t\t\t\t\tif(count($artgl)>0){\t\t\t\t\n\t\t\t\t\t\tforeach($artgl as $keys=>$val){\n\t\t\t\t\t\t\t$recabs = array();\n\t\t\t\t\t\t\t$recabs['idpegawai'] = $rowv['idpegawai'];\n\t\t\t\t\t\t\t$recabs['nourutcuti'] = $r_key;\n\t\t\t\t\t\t\t$recabs['tglpresensi'] = $val;\n\t\t\t\t\t\t\t$recabs['kodeabsensi'] = 'C';\n\t\t\t\t\t\t\t$recabs['tglpemasukan'] = date('Y-m-d');\n\t\t\t\t\t\t\t$recabs['keterangan'] = 'Cuti '.$rowv['jeniscuti'].($rowv['keterangan'] != '' ? ' ('.$rowv['keterangan'].')' : '');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$isexist = $conn->GetOne(\"select 1 from \".self::table('pe_presensidet').\" where idpegawai = '\".$rowv['idpegawai'].\"' and tglpresensi = '$val'\");\n\t\t\t\t\t\t\tif(empty($isexist))\n\t\t\t\t\t\t\t\tQuery::recInsert($conn,$recabs,self::table('pe_presensidet'));\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tQuery::recUpdate($conn,$recabs,self::table('pe_presensidet'),\"idpegawai = '\".$rowv['idpegawai'].\"' and tglpresensi = '$val'\");\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\t\n\t\t\treturn self::saveStatus($conn);\n\t\t}", "function updateGoldcardDatabaseTable()\n{\n $db = \\JFactory::getDBO();\n $today = date(\"Y-m-d\");\n $member_id = trim($_SESSION['member_id']);\n $gold_card_date=$today;\n $return_to_work_date = trim(validatedDate($_POST['return_to_work_date']));\n $new_position = trim($_POST['new_position']);\n $emp_name = trim($_POST['emp_name']);\n $emp_city = trim($_POST['emp_city']);\n $status = trim($_POST['status']);\n $joblead_id = trim($_POST['joblead']);\n $alumni_event_contact = trim($_POST['alumni_event_contact']);\n $gc_comments = trim($_POST['gc_comments']);\n $gc_testimonials = trim($_POST['gc_testimonials']);\n\n // Create a new query object for inserting a record to eu_gold_cards.\n $query = $db->getQuery(true);\n\n // Prepare for insert\n // Insert columns.\n $columns = array(\n 'member_id',\n 'gold_card_date',\n 'return_to_work_date',\n 'new_position',\n 'emp_name',\n 'emp_city',\n 'joblead_id',\n 'alumni_event_contact',\n 'gc_comments',\n 'gc_testimonials');\n\n // Prepare insert values.\n $values = array( \n $db->quote($member_id),\n $db->quote($gold_card_date),\n $db->quote($return_to_work_date),\n $db->quote($new_position),\n $db->quote($emp_name),\n $db->quote($emp_city),\n $db->quote($joblead_id),\n $db->quote($alumni_event_contact),\n $db->quote($gc_comments),\n $db->quote($gc_testimonials));\n\n // Prepare the insert query.\n $query\n ->insert($db->quoteName('eu_gold_cards'))\n ->columns($db->quoteName($columns))\n ->values(implode(',', $values));\n\n // Set the query using our newly populated query object and execute it.\n $db->setQuery($query);\n $db->query();\n \n return;\n}", "function updateCrs($crsID, $code, $title, $Credits, $description){\n\n global $db;\n\n $query = \"UPDATE `courses` \n SET `crs_code`=:newCode,`crs_title`=:newTitle,`crs_credits`=:newCredits, `crs_description`=:newDes\n WHERE `crs_ID`=:newID\";\n $statement = $db->prepare($query);\n $statement->bindParam(':newID', $crsID);\n $statement->bindParam(':newCode', $code);\n $statement->bindParam(':newTitle', $title);\n $statement->bindParam(':newCredits', $Credits);\n $statement->bindParam(':newDes', $description);\n $statement->execute();\n}", "function assignPointsPronostic( $pronostic , $points ){\n\t\t$db = Configuration::getConcursoDB();\n\t\t\n\t\t$tablePredicts = $db->nameQuote('#__zpredicts');\n\t\t\n\t\t\n\t\t$query = \" UPDATE\n\t \t\t\t\t$tablePredicts as zpredicts\n\t \t\t SET\n\t \t\t \t points_earned = $points\n\t WHERE\n\t \tid = $pronostic\n\t \";\n\t \t\t\t\t\n\t \t//echo $query;\n\t $db->setQuery( $query );\n\t\t$result = $db->query( );\n\t\treturn $result ;\n\t}", "function update_compra($compra_id,$params)\r\n {\r\n $this->db->where('compra_id',$compra_id);\r\n return $this->db->update('compra',$params);\r\n }", "public function updateRES1()\r\n {\r\n\r\n }", "public function update() {\n $db = PDOConnection::getInstance();\n $stmt = $db->prepare(\"UPDATE concurso SET idC=?, nombreC=?, basesC=?, ciudadC=?, fechaInicioC=?, fechaFinalC=?, fechaFinalistasC=?, premioC=?, patrocinadorC=?\");\n $stmt->execute(array($this->idC, $this->nombreC, $this->basesC, $this->ciudadC, $this->fechaInicioC, $this->fechaFinalC, $this->fechaFinalistasC, $this->premioC, $this->patrocinadorC));\n }", "function update_ktmtestquery($field_values, $tbl_names, $where_condition)\n{\n\tif($_SESSION['dbassign'] == '') {\n\t\tinclude(\"config.php\");\n\t}\n\telseif($_SESSION['ktmtest_username1'] != '' and $_SESSION['ktmtest_password1'] != '' and $_SESSION['ktmtest_host_db1'] != '') {\n\t\t$ktmtest_connect_db = oci_connect($_SESSION['ktmtest_username1'], $_SESSION['ktmtest_password1'], $_SESSION['ktmtest_host_db1'], 'AL32UTF8');\n\t}\n\t\n\ttry{\n\t\t$key_value = array_keys($field_values);\n\t\t$org_value = array_values($field_values);\n\t\t$key_values = array_keys($field_values);\n\t\t$org_values = array_values($field_values);\n\t\t\n\t\tfor($ii = 0; $ii < count($field_values); $ii++) {\n\t\t\t$kyvl .= $key_values[$ii].\" = '\". $org_values[$ii].\"', \";\t\t\n\t\t}\n\t\t$kyvl = rtrim($kyvl, \", \");\n\t\t\n\t\t$sql_update = \"UPDATE \".$tbl_names.\" SET \".$kyvl.\" WHERE \".$where_condition;\n\t\t$res_update = oci_parse($ktmtest_connect_db,$sql_update);\n\t\tfor($ij = 0; $ij < count($field_values); $ij++) {\n\t\t\toci_bind_by_name($res_update, $key_value[$ij], $org_value[$ij]);\n\t\t}\n\t\t$res_update=oci_execute($res_update);\n\t\t\n\t\tif($res_update) {\n\t\t\treturn '1';\n\t\t}\n\t\telse {\n\t\t\treturn '0';\n\t\t}\n\t}\n\tcatch(Exception $e) {\n\t\techo 'Message: ' .$e->getMessage();\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO: Implement postTypeCategory() method.
public function postTypeCategory() { return ProductCat::class; }
[ "public static function post_type(){}", "public function category_post_types() {\n\n\t\tglobal $wp_taxonomies;\n\n\t\t$wp_taxonomies['category']->object_type = array( 'post', 'page' );\n\t}", "private function getPostCategory()\n\t{\n\t\t$default_category=$this->pluginOptions['default_category'];\n\n\t\t$this->categoriesStringToArray();\n\n\t\t$categories=$this->feed_item->categories;\n\n\t\t$this->feed_item->category=$default_category;\n\n\t\tif(count($categories)==0&&count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t$this->feed_item->category='';\n\t\t\t//\n\t\t}\n\t\telse if(count($categories)==0)\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tif($k=='')\n\t\t\t\t{\n\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t//\n\t\t}\n\t\t/* */\n\t\telse\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tforeach($categories as $cat)\n\t\t\t\t{\n\t\t\t\t\tif($cat==$k||$k=='')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\t}\n\t\t\t\t\tif($cat==$k)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function kapee_template_loop_post_category() {\n\t\tget_template_part( 'template-parts/post-loop/category' );\t\t\n\t}", "public function createPostTypes()\n {\n }", "function post_type(){\n //create_post_type(array('name'=>'apps', 'title'=>'Apps', 'taxonomies'=>array('do-apps'), 'supports'=>array('title','editor','thumbnail','excerpt','custom-fields'), 'hasCategories'=>false));\n //create_post_type(array('name'=>'books', 'title'=>'Books', 'taxonomies'=>array('do-books'), 'supports'=>array('title','editor','thumbnail','excerpt','custom-fields'), 'hasCategories'=>false));\n //create_post_type(array('name'=>'music', 'title'=>'Music', 'taxonomies'=>array('do-music'), 'supports'=>array('title','editor','thumbnail','excerpt','custom-fields'), 'hasCategories'=>false));\n //create_post_type(array('name'=>'products', 'title'=>'Products', 'taxonomies'=>array('do-products'), 'supports'=>array('title','editor','thumbnail','excerpt','custom-fields'), 'hasCategories'=>false));\n //create_post_type(array('name'=>'charity', 'title'=>'Charity', 'taxonomies'=>array('do-charity'), 'supports'=>array('title','editor','thumbnail','excerpt','custom-fields'), 'hasCategories'=>false));\n}", "public function create_post_types() {\n }", "function hc_create_custom_post_types_cat() {\n global $hc_all_custom_post_types;\n hc_load_taxonomies($hc_all_custom_post_types);\n flush_rewrite_rules();\n}", "public function custom_post_type() {\r\n\t\tMainWP_Custom_Post_Type::instance()->action();\r\n\t}", "function register_cpt_scenario() {\n $labels = array(\n 'name' => _x('Scenarios','scenarios'),\n 'singular_name' => _x('Scenario','scenario'),\n 'all_items' => ('All Scenarios'),\n 'add_new_item' => ('Add New Scenario'),\n 'edit_item' => ('Edit Scenario'),\n 'search_items' => ('Search Scenarios'),\n 'view_item' => ('View Scenario'),\n );\n\n $args = array(\n 'label' => __('Scenarios', 'scenarios'),\n 'labels' => $labels,\n 'public' => true,\n 'taxonomies' => array('category'),\n );\n\n register_post_type('scenario',$args);\n}", "private function addPostInCategories($postType){\n $totalInserted = 0;\n $categories = \\App\\Models\\Category::all()->where('postTypeID', $postType->postTypeID);;\n\n if ($categories) {\n $this->writeOutput(\"Creating posts in post type '\".$postType->name.\"'\",'comment');\n\n foreach ($categories as $category) {\n $this->writeOutput(\" -- Creating \".$this->postsPerCategory.\" posts in category '\".$category->title.\"'\",'comment');\n\n for ($i = 1; $i <= $this->postsPerCategory; $i++) {\n $totalInserted++;\n $this->createPost($postType, $this->mediaList, $category, $this->tagsList);\n }\n }\n }else{\n $this->writeOutput('Post type \"'.$postType->name.'\" does not have any category!','comment');\n }\n\n return $totalInserted;\n }", "public function post_type() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'Ordenes de compra'),\n\t\t\t'singular_name' => __( 'Orden de compra' ),\n\t\t\t'add_new' => __('Añadir nueva', 'composition'),\n\t\t\t'add_new_item' => __('Añadir nueva Orden de compra'),\n\t\t\t'edit_item' => __('Edit Orden de compra'),\n\t\t\t'new_item' => __('New Orden de compra'),\n\t\t\t'view_item' => __('View Orden de compra'),\n\t\t\t'search_items' => __('Search Orden de compra Items'),\n\t\t\t'not_found' => __('No se encontraron Ordenes de compra'),\n\t\t\t'not_found_in_trash' => __('No se encontraron Ordenes de compra en la Papelera'),\n\t\t\t'parent_item_colon' => ''\n\t\t );\n\n\t\t $args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'query_var' => true,\n\t 'has_archive' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => false,\n\t\t 'show_ui' => true,\n\t\t // 'show_in_menu' => 'edit.php?post_type=shop_order',\n\t\t\t'menu_position' => 56,\n\t\t\t'menu_icon' => 'dashicons-clipboard',\n\t\t\t'rewrite' => array('slug' => __( $this->post_type )),\n\t\t\t'supports' => array('title', 'thumbnail', 'comments', 'revisions') //,'editor'\n\t\t );\n\n\t\t register_post_type(__( $this->post_type ), $args);\n\t}", "function publish_post() {\n if ( isset( $_GET['fb_post_publish'] ) ) {\n $my_post = array(\n 'ID' => $_GET['fb_post_publish'],\n 'post_status' => 'publish',\n );\n //update the custom post type with this category and append it, since as a draft it has not category.\n //publish the post\n wp_update_post($my_post);\n }\n if ( isset( $_GET['fb_send_mail'] ) ) {\n $this->send_mail();\n }\n }", "function register_post_type(){\n\t\tadd_action( 'init', array(&$this,'init_register_post_type') );\n\t}", "private function getPostCategoryTaxonomy($postType){\n\t\t\n\t\tif(isset(self::$arrPostTypeTaxCache[$postType]))\n\t\t\treturn(self::$arrPostTypeTaxCache[$postType]);\n\t\t\n\t\t$taxonomy = \"category\";\n\t\t\n\t\tif($postType == \"post\" || $postType == \"page\")\n\t\t\treturn($taxonomy);\n\t\t\t\n\t\t$arrTax = UniteFunctionsWPUC::getPostTypeTaxomonies($postType);\n\t\t\t\n\t\tif(!empty($arrTax))\n\t\t\t$taxonomy = UniteFunctionsUC::getFirstNotEmptyKey($arrTax);\n\t\t\n\t\tself::$arrPostTypeTaxCache[$postType] = $taxonomy;\n\t\t\n\t\treturn($taxonomy);\n\t}", "function wxr_post_taxonomy() {\n $post = get_post();\n\n $taxonomies = get_object_taxonomies($post->post_type);\n if (empty($taxonomies))\n return;\n $terms = wp_get_object_terms($post->ID, $taxonomies);\n\n foreach ((array) $terms as $term) {\n echo \"\\t\\t<category domain=\\\"{$term->taxonomy}\\\" nicename=\\\"{$term->slug}\\\">\" . $this->wxr_cdata($term->name) . \"</category>\\n\";\n }\n }", "function yumm_post_type()\r\n{\r\n\t// crerate new taxonomy for the recipe category\r\n register_taxonomy('recipe-category', 'recipe', array(\r\n 'label' => 'Categories',\r\n 'singular_name' => 'Category',\r\n 'public' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'hierarchical' => true,\r\n ));\r\n \r\n\t// Set up arguments for recipe post type\r\n $args = array(\r\n 'labels' => array(\r\n 'name' => __('Recipes'),\r\n 'singular_name' => __('Recipe'),\r\n ),\r\n 'public' => true,\r\n 'has_archive' => true,\r\n 'exclude_from_search' => false,\r\n 'publicly_queryable' => true,\r\n 'taxonomies' => array(\r\n 'recipe-category',\r\n ),\r\n 'show_in_rest' => true,\r\n 'show_in_menu' => true,\r\n 'menu_position' => 5,\r\n 'capability_type' => 'post',\r\n 'supports' => array(\r\n 'title',\r\n 'editor',\r\n 'author',\r\n 'thumbnail',\r\n 'custom-fields',\r\n ),\r\n );\r\n \r\n \r\n // Check to see if comments are enabled for recipes; if enabled allow comments\r\n $comments_setting = get_option( 'yumm_recipe_comments');\r\n if ($comments_setting == \"1\") {\r\n \tarray_push($args['supports'], 'comments');\r\n }\r\n \r\n // register recipe post type\r\n register_post_type('recipe', $args);\r\n}", "function settings_post_types_option() {\n\t\tglobal $edit_flow;\n\t\t$edit_flow->settings->helper_option_custom_post_type( $this->module );\n\t}", "function jeg_post_type_page_builder()\r\r\n{\r\r\n $args =\r\r\n array(\r\r\n 'labels' \t=>\r\r\n array(\r\r\n 'name' \t\t\t\t=> 'Cat Builder',\r\r\n 'singular_name' \t=> 'Cat Builder',\r\r\n 'add_new'\t\t\t=> 'New Cat Builder',\r\r\n 'add_new_item' \t\t=> 'New Cat Builder',\r\r\n 'edit_item' \t\t=> 'Edit Cat Builder Entry',\r\r\n 'new_item' \t\t\t=> 'New Cat Builder Entry',\r\r\n 'view_item' \t\t=> 'View Cat Builder',\r\r\n 'search_items' \t\t=> 'Search Cat Builder Items',\r\r\n 'not_found' \t\t=> 'No Cat Builder items found',\r\r\n 'not_found_in_trash'=> 'No Cat Builder items found in Trash',\r\r\n 'parent_item_colon' => ''\r\r\n ),\r\r\n 'description'\t\t\t=> 'Category Builder Post type',\r\r\n 'public' \t\t\t\t=> false,\r\r\n 'show_ui' \t\t\t\t=> true,\r\r\n 'menu_icon'\t\t\t\t=> JMAGZ_PLUGIN_URL . '/assets/img/builder.png',\r\r\n 'menu_position'\t\t\t=> 6,\r\r\n 'capability_type' \t\t=> 'post',\r\r\n 'hierarchical' \t\t\t=> true,\r\r\n 'supports' \t\t\t\t=> array('title', 'editor')\r\r\n );\r\r\n\r\r\n register_post_type( 'cat_builder', $args);\r\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decrypt $data with $secret
public static function decrypt(string $data, string $secret='', string $algorithm='AES-256-CBC');
[ "public function decrypt($data);", "abstract public function decrypt($data);", "private function decryptFeedData($data)\n {\n $helper = FoxyHelper::create();\n return \\rc4crypt::decrypt($helper->config()->get('secret'), $data);\n }", "public function decrypt(array $data);", "public function decrypt();", "function decrypt_contents($data,$prkey){}", "function openssl_private_decrypt ($data, &$decrypted, $key, $padding = null) {}", "static function decrypt($key, $data) {\n \tif (strlen($key) < AESCipher::$CIPHER_KEY_LEN) {\n $key = str_pad(\"$key\", AESCipher::$CIPHER_KEY_LEN, \"0\"); //0 pad to len 16\n } else if (strlen($key) > AESCipher::$CIPHER_KEY_LEN) {\n $key = substr($key, 0, AESCipher::$CIPHER_KEY_LEN); //truncate to 16 bytes\n }\n\n $parts = explode(':', $data); //Separate Encrypted data from iv.\n $decryptedData = openssl_decrypt(base64_decode($parts[0]), AESCipher::$OPENSSL_CIPHER_NAME, $key, OPENSSL_RAW_DATA, base64_decode($parts[1]));\n\n return $decryptedData;\n }", "public function decrypt($data, Key $key);", "public function decrypt($password, $options, $data);", "public static function aes256Decrypt($key, $data) {}", "function openssl_public_decrypt ($data, &$decrypted, $key, $padding = null) {}", "protected function _decrypt() {}", "function decryptSimple($data) {\n\t\t$result = '';\n\t\t$data=base64_decode(str_replace(array('-', '_'),array('+', '/'),$data));\n\t\tfor($i=0; $i<strlen($data); $i++) {\n\t\t\t$char = substr($data, $i, 1);\n\t\t\t$keychar = substr($this->encPassword, ($i % strlen($this->encPassword))-1, 1);\n\t\t\t$char = chr(ord($char)-ord($keychar));\n\t\t\t$result.=$char;\n\t\t}\n\t\treturn $result;\n\t}", "function decrypt_secret($enc_user_secret) {\n// this is an example using AES-256 encryption\n// requires php Mcrypt library, see http://php.net/manual/en/book.mcrypt.php\n $ciphertext_combo = base64_decode($enc_user_secret);\n $iv = substr($ciphertext_combo, 0, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC));\n $ciphertext = substr($ciphertext_combo, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC));\n return mcrypt_decrypt(\n MCRYPT_RIJNDAEL_128, pack('H*', CW_SECRET_ENC_KEY), $ciphertext, MCRYPT_MODE_CBC, $iv\n );\n}", "function dec_id ($data) {\n\treturn openssl_decrypt(base64_decode($data), OPENSSL_CIPHER_METHOD, SITE_KEY_SECRET, 0, substr(session('login_token'), 0,OPENSSL_CIPHER_IV_LEN));\n}", "public function decrypt_parameters($data){\t\n\t\t$parameters = trim(\n\t\t\tmcrypt_decrypt(\n\t\t\t\tMCRYPT_RIJNDAEL_256,\n\t\t\t\tKohana::config('image.crypt_pass'),\n\t\t\t\tbase64_decode($data),\n\t\t\t\tMCRYPT_MODE_ECB,\n\t\t\t\tmcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)\n\t\t\t)\n\t\t);\n\t\t\t\n\t\tif($parameters && !empty($parameters) && self::is_serialized($parameters)){\n\t\t\treturn unserialize($parameters);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function decrypt($cipherText, $secretKey);", "public function legacyDecrypt($data,$key=null,$cipher='des')\n\t{\n\t\tif (!$key)\n\t\t{\n\t\t\t$key=Yii::app()->getGlobalState(self::STATE_ENCRYPTION_KEY);\n\t\t\tif(!$key)\n\t\t\t\tthrow new CException(Yii::t('yii','No encryption key specified.'));\n\t\t\t$key = md5($key);\n\t\t}\n\n\t\tif(extension_loaded('mcrypt'))\n\t\t{\n\t\t\tif(is_array($cipher))\n\t\t\t\t$module=@call_user_func_array('mcrypt_module_open',$cipher);\n\t\t\telse\n\t\t\t\t$module=@mcrypt_module_open($cipher,'', MCRYPT_MODE_CBC,'');\n\n\t\t\tif($module===false)\n\t\t\t\tthrow new CException(Yii::t('yii','Failed to initialize the mcrypt module.'));\n\t\t}\n\t\telse\n\t\t\tthrow new CException(Yii::t('yii','CSecurityManager requires PHP mcrypt extension to be loaded in order to use data encryption feature.'));\n\n\t\t$derivedKey=$this->substr($key,0,@mcrypt_enc_get_key_size($module));\n\t\t$ivSize=@mcrypt_enc_get_iv_size($module);\n\t\t$iv=$this->substr($data,0,$ivSize);\n\t\t@mcrypt_generic_init($module,$derivedKey,$iv);\n\t\t$decrypted=@mdecrypt_generic($module,$this->substr($data,$ivSize,$this->strlen($data)));\n\t\t@mcrypt_generic_deinit($module);\n\t\t@mcrypt_module_close($module);\n\t\treturn rtrim($decrypted,\"\\0\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$resize = new DynImage\Filter\Resize(array('height' => 200, 'width' => 200));
public function testResizeGmagick() { $resize = (new DynImage\Filter\Resize())->setHeight(200)->setWidth(200); $dynimage = new DynImage\DynImage(); $dynimage->add($resize); $filename = __DIR__ . '/Fixtures/test.jpg'; $image = $dynimage->apply(file_get_contents($filename), DynImage\Drivers::GMAGICK); $size = $image->getSize(); $this->assertInstanceOf('Imagine\Image\ImageInterface', $image); $this->assertEquals(200, $size->getWidth()); $this->assertEquals(200, $size->getHeight()); }
[ "function resizeImage ( ) {/* Contructor */}", "public function resizeimage($width, $height, $filter, $blur, $fit){}", "public function testResizeGd() {\n $resize = (new DynImage\\Filter\\Resize())->setHeight(200)->setWidth(200);\n\n $dynimage = new DynImage\\DynImage();\n $dynimage->add($resize);\n\n $filename = __DIR__ . '/Fixtures/test.jpg';\n\n $image = $dynimage->apply(file_get_contents($filename), DynImage\\Drivers::GD);\n\n $size = $image->getSize();\n\n $this->assertInstanceOf('Imagine\\Image\\ImageInterface', $image);\n $this->assertEquals(200, $size->getWidth());\n $this->assertEquals(200, $size->getHeight());\n }", "function dynamic_image_resize( $atts )\r\n{\r\n\treturn new oxoDynamicImageResize( $atts );\r\n}", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "function adaptiveResizeImage($columns, $rows, $bestfit, $legacy){}", "public function crateResizeFilter()\n {\n $resize = new Resize();\n $this->assertInstanceOf('Slick\\ImageCache\\FilterInterface', $resize);\n $this->assertInstanceOf(\n 'Slick\\ImageCache\\Filter\\Resize',\n $resize->setImage($this->image)\n );\n }", "public function resize( $width, $height );", "public function image_resize() {\n\t\treturn $this->image_process('resize');\n\t}", "function imageResize($file, $width=0, $height=0) {\n\t\t$filename = $_SERVER['DOCUMENT_ROOT'] . $file;\n\t\t$image = new Imagick();\n\t\t$image->readImage(\"$filename\");\n\t\t$image->thumbnailImage($width,$height);\n\t\t$image->writeImage(\"$filename\");\n\t\t$image->destroy();\n\t}", "public function testResizeEffect() {\n $this->assertImageEffect(['resize'], 'image_resize', [\n 'width' => 1,\n 'height' => 2,\n ]);\n\n // Check the parameters.\n $calls = $this->imageTestGetAllCalls();\n // Width was passed correctly.\n $this->assertEquals(1, $calls['resize'][0][0]);\n // Height was passed correctly.\n $this->assertEquals(2, $calls['resize'][0][1]);\n }", "public function testResizingImages()\n {\n }", "function resizeImage($width, $height, $quality, $source, $target) {\n\t\t$gfxObj = t3lib_div::makeInstance(\"t3lib_stdgraphic\");\n\t\tif ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im'] == 1) {\n\t\t\t$stdGraphic = t3lib_div::makeInstance(\"t3lib_stdGraphic\");\n\t\t\t$info = $stdGraphic->getImageDimensions($source);\n\t\t\t$options = array();\n\t\t\t$options[\"maxH\"] = $height;\n\t\t\t$options[\"maxW\"] = $width;\n\t\t\t$data = $stdGraphic->getImageScale($info, $width . \"m\", $height . \"m\", $options);\n\t\t\t$params = '-geometry ' . $data[0] . 'x' . $data[1] . '! -quality ' . $quality . ' ';\n\t\t\t$im = $stdGraphic->imageMagickExec($source, $target, $params);\n\t\t\treturn $im;\n\t\t} else {\n\t\t\t// Get new dimensions\n\t\t\tlist($width_orig, $height_orig) = getimagesize($source);\n\t\t\tif ($width && ($width_orig < $height_orig)) {\n\t\t\t\t$width = ($height / $height_orig) * $width_orig;\n\t\t\t} else {\n\t\t\t\t$height = ($width / $width_orig) * $height_orig;\n\t\t\t}\n\t\t\t// Resample\n\t\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\t\t$image = imagecreatefromjpeg($source);\n\t\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n\t\t\t// Output\n\t\t\timagejpeg($image_p, $target, $quality);\n\t\t}\n\t}", "public function resize(int $width, int $height) {}", "function add_image_size($name, $width = 0, $height = 0, $crop = \\false)\n{\n}", "private function resizeImageSmarter($options = array())\n\t{\n fb_log($options['width'], $options['height']);\n\t\tif (!isset($options['height'])) {\n\t\t\tthrow new Zend_Exception(\"Height is not set.\");\n\t\t}\n\n\t\t$old_width = $this->_image->getImageWidth();\n\t\t$old_height = $this->_image->getImageHeight();\n\n if ($old_width <= $options['width'] && $old_height <= $options['height'])\n return;\n\n\t\t$f = $options['height'] / $old_height;\n fb_log('$f', $old_height, $options['height'], $f);\n\n fb_log('$f * $old_width', $f * $old_width);\n fb_log('$options[width]', $options['width']);\n\n if (($f * $old_width) > $options['width']) {\n fb_log('resize case 1');\n $f = $options['width'] / $old_width;\n\t\t\t$new_width = $options['width'];\n $new_height = $f * $old_height;\n\t\t} else {\n fb_log('resize case 2');\n fb_log('$f * $old_width', $f, $old_width, $f * $old_width);\n $new_width = $f * $old_width;\n $new_height = $options['height'];\n\t\t}\n\n \t$this->_image->resizeImage($new_width, $new_height, imagick::FILTER_SINC, 1.0);\n\t}", "function half_image_resize_dimensions( $payload, $orig_w, $orig_h, $dest_w, $dest_h, $crop ){\r\n if($dest_w === 101){ //if half image size\r\n $width = $orig_w/2;\r\n $height = $orig_h/2;\r\n return array( 0, 0, 0, 0, $width, $height, $orig_w, $orig_h );\r\n } else { //do not use the filter\r\n return $payload;\r\n }\r\n}", "function adaptive_resize($width, $height = null) {\n\n\t\treturn $this->thumbnail($width, $height);\n\n\t}", "function image_size() {\n //Resources\n add_image_size('sample_pack', 720, 337, true);\n add_image_size( 'slider', 1920, 500, true);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create new shift for specified doctor.
public function newShift(Doctor $doctor, Request $request) { $schedule = new Schedule; $schedule->date = new Carbon($request->date); $in = $request->filled('time_in') ? new Carbon($request->time_in) : Schedule::DEFAULT_TIME_IN; $out = $request->filled('time_out') ? new Carbon($request->time_out) : Schedule::DEFAULT_TIME_OUT; $schedule->time_in = ($in instanceof Carbon) ? $in->toTimeString() : $in; $schedule->time_out = ($out instanceof Carbon) ? $out->toTimeString() : $out; $schedule->created_by = $request->user()->id; $doctor->schedules()->save($schedule); return $this->weekSchedule($doctor, $request); }
[ "public function newShift(Request $request)\n\t{\n\t\t$doctor = $request->user()->doctor;\n\n $schedule = new Schedule;\n\t\t$schedule->date = new Carbon($request->date);\n\n\t\t$in = $request->filled('time_in') ? new Carbon($request->time_in) : Schedule::DEFAULT_TIME_IN;\n\t $out = $request->filled('time_out') ? new Carbon($request->time_out) : Schedule::DEFAULT_TIME_OUT;\n\n\t\t$schedule->time_in = ($in instanceof Carbon) ? $in->toTimeString() : $in;\n\t\t$schedule->time_out = ($out instanceof Carbon) ? $out->toTimeString() : $out;\n\n\t\t$doctor->schedules()->save($schedule);\n\n\t\treturn $this->weekSchedule($request);\n\t}", "public function create_shift($hutch, $start_time, $end_time) {\n $this->assert_hutch($hutch);\n $hutch_escaped = $this->escape_string(strtoupper(trim($hutch)));\n\n // Calculate values not passed as parameters\n $username = $this->current_user();\n $stopper_out = $this->get_stopper_out();\n $door_open = $this->get_door_open();\n $total_shots = $this->get_total_shots();\n $last_modified_time = LusiTime::now()->sec;\n\n // Create the shift\n $sql = \"INSERT INTO {$this->database}.shift\";\n $sql .= \" VALUES(NULL,{$last_modified_time},'{$username}','{$hutch_escaped}',{$start_time},{$end_time},{$stopper_out},{$door_open},{$total_shots},'')\";\n $this->query($sql);\n\n // Fetch id from newly created shift\n $sql = \"SELECT id FROM {$this->database}.shift WHERE hutch='{$hutch_escaped}' AND start_time='{$start_time}' ORDER BY id DESC\";\n $result = $this->query($sql);\n $nrows = mysql_numrows($result);\n if ($nrows < 1) {\n throw new ShiftMgrException (\n __class__.'::'.__METHOD__ ,\n 'Could not find the shift we just created!'\n );\n return null;\n }\n $shallow_created_shift = mysql_fetch_array($result, MYSQL_ASSOC);\n $id = $shallow_created_shift[\"id\"];\n\n // Create a row for each area\n foreach (ShiftMgr::$areas as $area) {\n $sql = \"INSERT INTO {$this->database}.area_evaluation VALUES ({$id},'{$area}',1,0,'')\";\n $this->query($sql);\n }\n\n // Create a row for each use\n foreach (ShiftMgr::$uses as $use) {\n $sql = \"INSERT INTO {$this->database}.time_use VALUES ({$id},'{$use}',0,'')\";\n $this->query($sql);\n }\n\n // Now fetch and return complete shift.\n return $this->get_shift($id);\n }", "public function createWorkerShift(){\n $sqlQuery = \"INSERT INTO\n \". $this->db_table .\"\n SET\n workerId = :workerId, \n shiftId = :shiftId, \n date = :date\";\n \n $stmt = $this->conn->prepare($sqlQuery);\n \n // sanitize\n $this->workerId=htmlspecialchars(strip_tags($this->workerId));\n $this->shiftId=htmlspecialchars(strip_tags($this->shiftId));\n $this->date=htmlspecialchars(strip_tags($this->date));\n \n // bind data\n $stmt->bindParam(\":workerId\", $this->workerId);\n $stmt->bindParam(\":shiftId\", $this->shiftId);\n $stmt->bindParam(\":date\", $this->date);\n \n if($stmt->execute()){\n return true;\n }\n return false;\n }", "function createSwap($shift_id) {\n $db = DB::getInstance();\n $user_id = $GLOBALS['user_id'];\n $query = $db->query(\"INSERT INTO sage_shift_swaps (id, requester_id, shift_id) VALUES (NULL, $user_id, $shift_id)\")->results();\n }", "function add_shift($params)\n {\n $this->db->insert('shifts',$params);\n return $this->db->insert_id();\n }", "public function testAddShift()\n {\n $client = self::createClient();\n $user = $this->createUser(\n 'anotherUser@example.com',\n 'foo',\n '042515183',\n '80.00',\n 'https://imapictureofnothing.com',\n 'testme',\n 'now', ['ROLE_USER', 'ROLE_ADMIN']);\n try {\n $client->request('POST', '/shifts', [\n 'headers' => [\n 'Content-Type' => 'application/json'\n ],\n 'json' => [\n 'start' => '2020-12-12 10:00:00',\n 'end' => '2020-12-12 18:00:00',\n 'onDuty' => '/users/'.$user->getId(),\n 'ShiftStatus' => 'primary',\n 'isApproved' => false\n ]\n ]);\n } catch (TransportExceptionInterface $e) {\n }\n $this->assertResponseStatusCodeSame(201);\n }", "static public function generate($shift)\n {\n // Delete all existing slots for this shift\n Slot::where('shift_id', $shift->id)->delete();\n\n // Loop over shift days\n $date = new Carbon($shift->start_date);\n $end_date = new Carbon($shift->end_date);\n\n while($date->lte($end_date))\n {\n // Convert shift times to seconds\n $start = Slot::timeToSeconds($shift->start_time);\n $end = Slot::timeToSeconds($shift->end_time);\n $duration = Slot::timeToSeconds($shift->duration);\n\n // Now loop over the times based on the slot duration\n for($time = $start; $time + $duration <= $end; $time += $duration)\n {\n $slot =\n [\n 'shift_id' => $shift->id,\n 'start_date' => $date->format('Y-m-d'),\n 'start_time' => Slot::secondsToTime($time),\n 'end_time' => Slot::secondsToTime($time + $duration),\n ];\n \n Slot::create($slot);\n }\n \n $date->addDay();\n }\n }", "function creatActionForShift($sheetID)\n{\n $actionID = getShiftActionID($_POST[\"actionToAdd\"], $_POST[\"section\"]);\n if ($actionID == null) {\n $actionID = creatShiftAction($_POST[\"actionToAdd\"], $_POST[\"section\"]);\n setFlashMessage(\"Nouvelle action <strong>\" . $_POST[\"actionToAdd\"] . \"</strong> créée et ajoutée au rapport\");\n } else {\n setFlashMessage(\"L'action <strong>\" . $_POST[\"actionToAdd\"] . \"</strong> à été ajoutée au rapport\");\n }\n $modelID = configureModel($sheetID, $_POST[\"model\"]);\n $res = addShiftAction($modelID, $actionID);\n if ($res == false) {\n setFlashMessage(\"Une erreur est survenue. Impossible d'ajouter l'action.\");\n }\n redirect(\"shiftShow\", $sheetID);\n}", "function create(){\n\n // SQL query to create an shift\n // Adds to both shift table and relationship table with a transaction\n $query = \"START TRANSACTION;\n INSERT INTO {$this->tableName} (StartTime, EndTime, Employee_Id)\n VALUES (:startTime, :endTime, :employee_Id);\n SET @last_inserted_id = LAST_INSERT_ID();\n \n INSERT INTO {$this->relationship[0]->relTableName} (Shift_Id, {$this->relationship[0]->idColumnName}) \n VALUES (@last_inserted_id, :relation_Id);\n COMMIT\";\n\n // Prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // Santize and bind properties\n $this->startTime = parent::sanitize($this->startTime);\n $this->endTime = parent::sanitize($this->endTime);\n $this->employee_Id = parent::sanitize($this->employee_Id);\n $this->relationship[0]->id = parent::sanitize($this->relationship[0]->id);\n $stmt->bindParam(\":startTime\", $this->startTime);\n $stmt->bindParam(\":endTime\", $this->endTime);\n $stmt->bindParam(\":employee_Id\", $this->employee_Id);\n $stmt->bindParam(\":relation_Id\", $this->relationship[0]->id);\n\n // Execute query\n if($stmt->execute()){\n return true;\n }\n \n return false;\n }", "public function store(CreateRequestWorkshiftRequest $request)\n {\n $input = $request->all();\n\n $requestWorkshift = $this->getRepositoryObj()->create($input);\n if($requestWorkshift instanceof Exception){\n $workDate = explode('__',$input['work_date']);\n $input['work_date'] = localFormatDate($workDate[0]).' - '.localFormatDate($workDate[1]);\n return redirect()->back()->withInput($input)->withErrors(['error', $requestWorkshift->getMessage()]);\n }\n \n Flash::success(__('messages.saved', ['model' => __('models/requestWorkshifts.singular')]));\n\n return redirect(route('hr.requestWorkshifts.index'));\n }", "public function create($data): Doctor;", "public function setShiftType($shift_type)\n {\n $this->shift_type = $shift_type;\n\n return $this;\n }", "function addShift($start, $end) {\n $db = DB::getInstance();\n $query = $db->query(\"INSERT INTO sage_shifts (start_date, end_date) VALUES ('$start', '$end')\");\n}", "public function addShift(Shift $shift)\n {\n $this->shifts()->save($shift);\n }", "public function add_shift($shift);", "private function createSepaMandate() {\n $mandate = $this->getMandates();\n if ($mandate['count'] > 0) {\n $set = reset($mandate['values']);\n $this->values['id'] = $set['id'];\n }\n\n civicrm_api3('SepaMandate', 'create', $this->values, true);\n }", "public function setShift($value)\n {\n return $this->set('Shift', $value);\n }", "public function create($time = null)\n\t{\n\t\treturn new ShiftPatternDate($time);\t\t\n\t}", "public function createNewWorkingHours($clinic_id, $day, $time, $startDate);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make_filename Make a safe filename from domain and code
private function make_filename($domain,$code) { $s = array('http://','https://'); $r = array('',''); $domain = str_replace($s,$r,$domain); return $domain.'-'.$code; }
[ "function _safe_filename($filename) {\n $pi = pathinfo($filename);\n $sanitized = md5($pi['filename'] . ' ' . $_SERVER['REMOTE_ADDR'] . ' ' . time());\n if ( isset($pi['extension']) && $pi['extension'] ) return $sanitized . '.' . $pi['extension'];\n else return $sanitized;\n}", "function make_filename($filename)\r\n\t{\r\n\t\t// Check if it's an absolute or relative path.\r\n\t\tif ( substr($filename, 0, 1) != '/' )\r\n\t\t{\r\n\t\t\t$filename = ( $rp_filename = phpbb_realpath($this->root . '/' . $filename) ) ? $rp_filename : $filename;\r\n\t\t}\r\n\r\n\t\tif ( !file_exists($filename) )\r\n\t\t{\r\n\t\t\tdie(\"Template->make_filename(): Error - file $filename does not exist\");\r\n\t\t}\r\n\r\n\t\treturn $filename;\r\n\t}", "function make_filename($filename, $xs_include = false)\n\t{\n\t\t// Check replacements list\n\t\tif(isset($this->replace[$filename]))\n\t\t{\n\t\t\tif(!$xs_include)\n\t\t\t{\n\t\t\t\t$filename = $this->replace[$filename];\n\t\t\t\tif($filename === false)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($this->replace[$filename] === false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Check if it's an absolute or relative path.\n\t\tif ((substr($filename, 0, 1) !== '/') && (substr($filename, 1, 1) !== ':'))\n\t\t{\n\t\t\treturn $this->root . '/' . $filename;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn str_replace('\\\\', '/', $filename);\n\t\t}\n\t}", "public function get_safe_filename($filename)\n\t{\n\t\t$pi = pathinfo($filename);\n\t\t$sanitized = md5($pi['filename'] . ' ' . $_SERVER['REMOTE_ADDR'] . ' ' . time());\n\t\tif (isset($pi['extension']) && $pi['extension']) return $sanitized . '.' . $pi['extension'];\n\t\telse return $sanitized;\n\t}", "function files_encode_safe_name($filename=FALSE)\n{\n\tif ($filename!==FALSE)\n\t{\n\t\t$filename=stripslashes($filename);\n\t\t$filename=urlencode($filename);\n\t\t$filename=preg_replace(\"|%(\\d.)|\",\"_\\\\1_\",$filename);\n\t}\nreturn $filename;\n}", "public function make_filename($filename)\n\t{\n\t\t// Check if it's an absolute or relative path.\n\t\tif (substr($filename, 0, 1) != '/')\n\t\t{\n\t\t\t$filename = $this->root . '/' . $filename;\n\t\t}\n\n\t\tif (!file_exists($filename))\n\t\t{\n\t\t\tdie(\"Template->make_filename(): Erreur - Le fichier $filename est inexistant\");\n\t\t}\n\n\t\treturn $filename;\n\t}", "public function getFilenameSafe()\n\t{\n\t\t$filename_safe = Strings::utf8_accents_to_ascii($this->filename);\n\t\t$filename_safe = preg_replace('#[^a-zA-Z0-9\\-_\\.]#', '-', $filename_safe);\n\t\t$filename_safe = preg_replace('#\\-{2,}#', '-', $filename_safe);\n\n\t\treturn $filename_safe;\n\t}", "function secureFileName($input)\r\n\t{\r\n\t\treturn preg_replace('/[^a-zA-Z0-9\\-_]/', '', $input);\r\n\t}", "function file_create_filename($basename, $directory) {\n // Strip control characters (ASCII value < 32). Though these are allowed in\n // some filesystems, not many applications handle them well.\n $basename = preg_replace('/[\\x00-\\x1F]/u', '_', $basename);\n if (substr(PHP_OS, 0, 3) == 'WIN') {\n // These characters are not allowed in Windows filenames\n $basename = str_replace(array(':', '*', '?', '\"', '<', '>', '|'), '_', $basename);\n }\n\n // A URI or path may already have a trailing slash or look like \"public://\".\n if (substr($directory, -1) == '/') {\n $separator = '';\n }\n else {\n $separator = '/';\n }\n\n $destination = $directory . $separator . $basename;\n\n if (file_exists($destination)) {\n // Destination file already exists, generate an alternative.\n $pos = strrpos($basename, '.');\n if ($pos !== FALSE) {\n $name = substr($basename, 0, $pos);\n $ext = substr($basename, $pos);\n }\n else {\n $name = $basename;\n $ext = '';\n }\n\n $counter = 0;\n do {\n $destination = $directory . $separator . $name . '_' . $counter++ . $ext;\n } while (file_exists($destination));\n }\n\n return $destination;\n}", "public function getMakeFilenameUnique();", "private static function _basicFilenameClean($filename)\n {\n global $denyUploadExts;\n\n // Remove the magic quotes if enabled\n $filename = (ini_get('magic_quotes_gpc') ? stripslashes($filename) : $filename);\n\n $path_parts = pathinfo($filename);\n // We need a filename without any path info\n if ($path_parts['basename'] !== $filename) {\n return '';\n }\n // We need a filename with at least 1 chars plus the optional extension\n if (isset($path_parts['extension']) && ($path_parts['basename'] == '.'.$path_parts['extension'])) {\n return '';\n }\n if (!isset($path_parts['extension']) && (PMF_String_Basic::strlen($path_parts['basename']) == 0)) {\n return '';\n }\n\n // Deny some extensions (see inc/constants.php), if any\n if (!isset($path_parts['extension'])) {\n $path_parts['extension'] = '';\n }\n if (count($denyUploadExts) > 0) {\n if (in_array(strtolower($path_parts['extension']), $denyUploadExts)) {\n return '';\n }\n }\n\n // Clean the file to remove some chars depending on the server OS\n // 0. main/rfc1867.c: rfc1867_post_handler removes any char before the last occurence of \\/\n // 1. Besides \\/ on Windows: :*?\"<>|\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n $reservedChars = array(':', '*', '?', '\"', '<', '>', \"'\", '|');\n $filename = str_replace($reservedChars, '_', $filename);\n }\n\n return $filename;\n }", "protected function getSecureName(): string\n\t{\n\t\t$outFile = FileHelper::generateName() . '.' . $this->file->getExtension();\n\t\t$outFile = FileHelper::fileExists($this->targetDir, $outFile);\n\t\treturn $outFile;\n\t}", "function cre_clean_filename($fname){\n $fname = preg_replace('/[^a-z0-9-]/', ' ', strtolower($fname));\n $fname = preg_replace('/\\s\\s+/', '_', $fname);\n return str_replace(' ', '_', $fname);\n}", "function file_clean_name( $p_filename ) {\r\n\t\treturn preg_replace( \"/[\\/\\\\ :&]/\", \"_\", $p_filename);\r\n\t}", "public function createInternalFileName() {\r\n\t\t$newNameParts = explode(' ', microtime());\r\n\t\treturn $newNameParts[1] . substr($newNameParts[0], 2, 5);\r\n\t}", "public function _prep_filename($filename) {\n if ($this->mod_mime_fix === FALSE OR $this->allowed_types === '*' OR ( $ext_pos = strrpos($filename, '.')) === FALSE) {\n return $filename;\n }\n\n $ext = substr($filename, $ext_pos);\n $filename = substr($filename, 0, $ext_pos);\n return str_replace('.', '_', $filename) . $ext;\n }", "function sanitise_filename ($input) {\n\treturn preg_replace ('/[^A-Za-z0-9\\055\\056]/', '', $input);\n}", "function sanitizeTemplateName($filename)\n {\n return preg_replace('/[^A-Z0-9]/i', '_',\n ucfirst(str_replace('.dwt', '', $filename)));\n }", "protected function makeFileName()\n {\n\n $name = time() . '_' . $this->file->getClientOriginalname();\n\n return \"{$name}\";\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the authenticated user's list of accounts. (accounts.listAccounts)
public function listAccounts($optParams = array()) { $params = array(); $params = array_merge($params, $optParams); return $this->call('list', array($params), 'Google\Service\AdExchangeBuyer\AccountsList'); }
[ "public function getAccounts()\n {\n return $this->client->request('GET', '/accounts');\n }", "public function listAccounts($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_MyBusiness_ListAccountsResponse\");\n }", "public function listAccounts($optParams = array())\n {\n $params = array();\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_AdSense_Accounts\");\n }", "public function getAccounts();", "public function getAllAccounts()\n {\n $this->params['tableName'] = 'account';\n $excludeDeleted = $this->getOrDefault('GET.excludeDeleted', '');\n $query = \"\";\n if (!empty($excludeDeleted)) {\n $query = \"deleteAt eq ''\";\n }\n\n return $this->execQuery($query, 1000, null, null, '_config');\n }", "public function getAccountList() {\n return parent::_requestData('get','accounts');\n }", "public function get_accounts() {\n $post_arr = array();\n return $this->doWebRequest('accounts', $post_arr);\n }", "public function get_accounts() {\n\n\t\t/**\n\t\t * TODO: pull out object instantiation into independent functioni wherever this is being used.\n\t\t */\n\t\t$accounts_obj = phpQuery::newDocumentFileXML( $this->api_base_url.'accounts/list/?key='.$this->api_key() );\n\t\t$this->node_loop_assign( $accounts_obj, 'account', 'account_id', 'email_address' );\n\t\treturn $this->data['accounts'];\n\n\t}", "public function getAccounts()\n {\n return $this->accounts;\n }", "public function getAccountsList() {\r\n return $this->_em->getRepository(\"CommercialBankAccount\")->findAll();\r\n }", "public function list_radius_accounts()\n {\n return $this->fetch_results('/api/s/' . $this->site . '/rest/account');\n }", "public function getAccounts()\n {\n return $this->_accounts;\n }", "public static function getAccounts(): array\n {\n return self::queryMultiple(\"SELECT * FROM Account\", function($row) {\n return new Model\\Account((int)$row->id, $row->name, $row->email, $row->username, $row->password);\n });\n }", "public static function get_user_accounts()\n {\n $userid=Auth::user()->id;\n $accounts=DB::select(\"select * from accounts where fk_user_id='$userid'\");\n }", "public function getAllAccounts()\n { \n\n $accounts = fetch_all(\"SELECT `id`, `label`, `user`,\n `api_key`, `logo_path`, `is_live`, `has_cc`, `type`\n FROM `pmt_account`\n WHERE 1\n ORDER BY `is_live` DESC\");\n\n $this->hasAccounts = !empty($accounts);\n\n return $accounts;\n }", "public function getAccountEntries()\n {\n return $this->accountEntries;\n }", "public function findAllAccounts()\n {\n $results = [];\n $data = $this->soapApiService\n ->getConnection()\n ->Account_GetAll()\n ->Account_GetAllResult;\n\n if (!empty((array) $data)) {\n // It's a collection of objects\n foreach ($data->AccountHandle as $d) {\n $results[] = new AccountHandleEntity($d);\n }\n }\n\n return $results;\n }", "public function core_get_accounts()\n\t{\n\t\t$data = $this->db\n\t\t\t->select('account_id, account_type, username, bucket, path')\n\t\t\t->from('backup_accounts')\n\t\t\t->where('account_type', $this->core_get_short_name())\n\t\t\t->order_by('account_type', 'asc')\n\t\t\t->get()\n\t\t\t->result();\n\t\t$result = array();\n\t\tforeach($data as $row)\n\t\t{\n\t\t\t$result[$row->account_id] = $row->username;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public static function accountList() {\n\t\t$accounts = Account::getAllAccounts();\n\t\tforeach ($accounts as $account) {\n\t\t\tif (Friend::checkIfFriends(parent::get_user_logged_in()->id, $account->id)) {\n\t\t\t\t$account->friend = True;\n\t\t\t} else {\n\t\t\t\t$account->friend = False;\n\t\t\t}\n\t\t}\n\t\tView::make('account/accountsList.html', array('accounts' => $accounts));\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter for backend widgts
public function getBackendWidgets() { return $this->backendWidgets; }
[ "public function getBackend()\n {\n return $this->resourceType->getBackend();\n }", "public function getBackend()\n {\n return $this->backend;\n }", "final public function getBackend()\n {\n return $this->backend;\n }", "public function getBackend() {\n return $this->backend;\n }", "public function getDataBackend()\n {\n return $this->backend;\n }", "protected function getBackend() {\n return Backend::instance();\n }", "public function getDataBackend()\n {\n return $this->dataBackend;\n }", "public function getBackendName()\n {\n return $this->backendName;\n }", "protected function getWidgetRenderingContext() {}", "public function getBackendOptions() {\n\t\treturn $this->backendOptions;\n\t}", "public function getDataBackendSettings() {\n\t\treturn $this->backendConfiguration->getDataBackendSettings();\n\t}", "public static function getBackendStorage(){\n return \\Yii::getAlias('@backendUrl');\n }", "public function getBackendOptions()\n {\n if (isset($this->_options['backend']['options'])) {\n return (object) $this->_options['backend']['options'];\n }\n\n return null;\n }", "function YITH_WFBT(){\n\treturn YITH_WFBT::get_instance();\n}", "public function getBackendCounter()\n {\n return $this->getData(self::BACKEND_COUNTER);\n }", "function YITH_WCWL_Frontend(){\n\treturn defined( 'YITH_WCWL_PREMIUM' ) ? YITH_WCWL_Frontend_Premium::get_instance() : YITH_WCWL_Frontend::get_instance();\n}", "public function getWDB()\n {\n return $this->WDB;\n }", "function YITH_WCPB() {\n return YITH_WCPB::get_instance();\n}", "public function getStoreWw()\n {\n return $this->store_ww;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disable translating the block. All translations (except the main one) will be removed.
public function disableTranslations(Block $block): Block;
[ "public function enableTranslations(Block $block): Block;", "public function block_localization() {\n\t\t\tif ( function_exists( 'wp_set_script_translations' ) ) {\n\t\t\t\twp_set_script_translations( 'coblocks-editor', 'coblocks' );\n\t\t\t}\n\t\t}", "public function disableAction()\n {\n $session = Mage::getSingleton('core/session');\n $session->setInlineTranslationEnabled(false);\n\n $this->_redirectUrl(Mage::getBaseUrl());\n }", "public function disable_bitter( $translations, $text, $context, $domain ) {\n\t\tif ( 'Bitter font: on or off' == $context && 'on' == $text ) {\n\t\t\t$translations = 'off';\n\t\t}\n\n\t\treturn $translations;\n\t}", "public function trans_off()\n {\n $this->trans_enabled = FALSE;\n }", "public function trans_off()\r\n {\r\n $this->trans_enabled = FALSE;\r\n }", "public function testDisableLanguageSwitcher() {\n $block_id = 'test_language_block';\n\n // Enable the language switcher block.\n $this->drupalPlaceBlock('language_block:' . LanguageInterface::TYPE_CONTENT, ['id' => $block_id]);\n\n // Check if the language switcher block has been created.\n $block = Block::load($block_id);\n $this->assertNotEmpty($block, 'Language switcher block was created.');\n\n // Make sure language_content is not configurable.\n $edit = [\n 'language_content[configurable]' => FALSE,\n ];\n $this->drupalGet('admin/config/regional/language/detection');\n $this->submitForm($edit, 'Save settings');\n $this->assertSession()->statusCodeEquals(200);\n\n // Check if the language switcher block has been removed.\n $block = Block::load($block_id);\n $this->assertNull($block, 'Language switcher block was removed.');\n }", "function cancel_translation() {\n\t\t$this->setRedirect('index.php?option=com_eventbooking&task=show_translation');\n\t}", "public function deleteBlockTranslation(Block $block, string $locale): Block;", "private function disableNotActiveLangs()\n {\n $enabled_langs = explode(',',$this->settings_model['enabled_langs']);\n \n /*foreach ($this->langArr as $lang=>$language)\n {\n if(!in_array($lang,$enabled_langs)) unset($this->langArr[$lang]);\n }*/\n \n $langArr = array();\n foreach ($enabled_langs as $lang)\n {\n if(isset($this->langArr[$lang])) $langArr[$lang] = $this->langArr[$lang];\n }\n \n $this->langArr = $langArr;\n }", "function notMultiLanguage()\n {\n $this->_multilanguage = false;\n }", "function disableExtendedLanguageMaintenanceObject()\n\t{\n\t\tglobal $ilSetting, $ilCtrl;\n\t\t\n\t\t$ilSetting->set(\"lang_ext_maintenance\", 0);\n\t\t$ilCtrl->redirect($this, \"view\");\n\t}", "public function getFallbackOnTranslation();", "function cleanTranslations() {\n\n //Do not try to clean is dropdown translation is globally off\n if (DropdownTranslation::isDropdownTranslationActive()) {\n $translation = new DropdownTranslation();\n $translation->deleteByCriteria(['itemtype' => get_class($this),\n 'items_id' => $this->getID()]);\n }\n }", "public function wc_am_deactivate_text()\n {\n }", "public function resetAllTranslationFlags()\n {\n $this->getContainer()->get('kunstmaan_translator.repository.translation')->resetAllFlags();\n }", "function aarsberetning2011_links__locale_block($variables) {\n global $language;\n unset($variables['links'][$language->language]);\n\n return theme('links', $variables);\n}", "public static function deactivateLinearization() { self::$__linearize = FALSE; }", "public function toggle(){\n $content = strip_tags(\\request('content'));\n $currentLang = $this->translator->getTheSource('hi', $content);\n $source = ($currentLang == 'en') ? 'en' : \\request('language');\n $target = ($currentLang == 'en') ? \\request('language') : 'en';\n return $this->translator->convert($source, $target, $content);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the components are cached.
public function isComponentsCached(): bool { return is_file($this->componentCacheFile()); }
[ "private function cacheEnabled() {\n return isset(Yii::app()->components['cache']) ? true : false;\n }", "public function isCached() {}", "public function isCached();", "public function hasCaching(): bool;", "public function cache_valid() {\n return $this->cache_exists();\n }", "protected function _canUseCache()\n {\n return Mage::app()->useCache('collections') && !empty($this->_cacheConf);\n }", "public function isCached()\n {\n return $this->tplObj->isCached();\n }", "public function load_from_cache ()\n\t{\n\t\t//$this->rendered = \\Cache::get($this->get_cache_id());\n\t\treturn $this->rendered !== null;\n\t}", "protected function should_cache() {\n\t\tinclude_once ABSPATH . 'wp-admin/includes/plugin.php';\n\n\t\treturn ! is_plugin_active( 'wp-rest-cache/wp-rest-cache.php' );\n\t}", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "public function shouldRenderCaches()\n {\n if (!$this->supportCaching) return false;\n\n if ($this->handler->data->needsToClearCache()) {\n\n Cache::forget($this->getCacheKey());\n\n return false;\n }\n\n if (!$this->handler->handlerSupportDataCaching()) return false;\n\n return Cache::has($this->getCacheKey());\n }", "public function hasCache(): bool\n {\n return isset($this->contents);\n }", "protected function _canUseCache()\n {\n return $this->_getCacheInstance();\n }", "public function hasCache() {\n return !!$this->cache;\n }", "public function isCached() \n {\n $modified = (file_exists($this->cache_file)) ? filemtime($this->cache_file) : 0;\n return ((time() - $this->cache_expires) < $modified);\n }", "public function isCacheUsed()\n\t{\n\t\treturn $this->cache_enabled;\n\t}", "public function cache_exists() {\n return file_exists($this->cache_path);\n }", "protected function _canUseCacheForInit()\n {\n return Mage::app()->useCache('config') && $this->_allowCacheForInit\n && !$this->_loadCache($this->_getCacheLockId());\n }", "public function isCacheEnabled();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds and displays a Resource entity.
public function showAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('VMBResourceBundle:Resource')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Resource entity.'); } $official = ($request->query->get('official') == 1) ? true : 'all'; $personal = ($request->query->get('personal') == 1); $search = $request->query->get('search'); $topic = $request->query->get('topic'); if($topic != null) { $topic = $em->getRepository('VMBPresentationBundle:Topic')->find($topic); } $prev = $next = null; $position = intval($request->query->get('position')); if($position > 0) { if($position > 1) { $prev = $em->getRepository('VMBResourceBundle:Resource')->getResources($position - 1, 1, $topic, $official, ($personal ? $this->getUser() : null), $search); } $next = $em->getRepository('VMBResourceBundle:Resource')->getResources($position + 1, 1, $topic, $official, ($personal ? $this->getUser() : null), $search); } $rend_args = array( 'entity' => $entity, 'mainTitle' => $entity->getTitle(), 'editButtonUrl' => $this->generateUrl('resource_edit', array('id' => $id)), 'backButtonUrl' => $this->get('vmb_presentation.previous_url')->getPreviousUrl($request), 'saveToCaddy' => 'resource', 'inCaddy' => $this->getUser()->resourceIsInCaddy($entity), 'hasPlaybackFunction' => true, 'prev' => $prev, 'next' => $next, 'position' => $position); $typ = $entity->getType(); if($typ == 'text' || $typ == 'image'){ $rend_args['exportAssetUrl'] = $entity->getResourcePath(); } return $this->render('VMBResourceBundle:Resource:show.html.twig', $rend_args ); }
[ "public function show(Resource $resource) {\n //\n }", "public function show(Resource $resource)\n {\n //\n }", "public function viewResourceAction() {\n \t$idRole = intval($this->request->get('idRole'));\n \tif(empty($idRole)) {\n \t\t$this->flashSession->error($this->_(\"idRole is invalid\"));\n \t\treturn $this->redirect('index');\n \t}\n \t\n \t$role = AclRole::findFirst($idRole);\n \tif(empty($role)) {\n \t\t$this->flashSession->error($this->_(\"Role is null\"));\n \t\treturn $this->redirect('index');\n \t}\n \t\n \t$this->pageTitle = $this->_(\"Resources of: \". $role->name);\n \t\n \t$grid = new AclRoleResourceGrid('RoleResource', $idRole);\n \t$grid->run();\n \t$this->view->setVars(array(\n \t\t\t'grid' => $grid,\n \t\t\t'idRole' => $idRole\n \t));\n }", "public function testShowResourceReturnsTheCorrectResource()\n {\n $items = factory(Item::class, 10)->create();\n $item = $items->get(6);\n\n $this->call('GET', sprintf('/api/v1/item/%s', $item->id));\n\n $this->seeJson([\n 'id' => $item->id,\n 'name' => $item->name,\n ]);\n }", "public function show(Resource $resource)\n {\n return view('Resource.show',['resource'=> $resource]);\n }", "public function showAction(Humanresource $humanresource)\n {\n $deleteForm = $this->createDeleteForm($humanresource);\n\n return $this->render('humanresource/show.html.twig', array(\n 'humanresource' => $humanresource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Resource $resource)\n {\n $resource = new ResourceResource($resource);\n return $this->success('Resource Detail.', $resource);\n }", "public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n $id = $_GET['id'];\n $entity = $em->getRepository('BackendBundle:Bulto')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Bulto entity.');\n }\n\n return $this->render('BackendBundle:Bulto:show.html.twig', array(\n 'entity' => $entity\n ));\n }", "function action_show_entity_detail() {\n $rc = rcmail::get_instance();\n\n /** @var rcmail_output_html $output */\n $output = $rc->output;\n\n $type = $this->getInput(self::INPUT_ENTITY_TYPE, rcube_utils::INPUT_GET);\n\n switch ($type) {\n case self::ENTITY_FILTER:\n $title = $this->gettext('rubik_filter.title_filter_form');\n break;\n case self::ENTITY_VACATION:\n $title = $this->gettext('rubik_filter.title_vacation_form');\n break;\n case self::ENTITY_REPLY:\n $title = $this->gettext('rubik_filter.title_reply_form');\n break;\n default:\n $title = '';\n break;\n }\n\n $output->set_env('rubik_details_title', $title);\n\n $output->send('rubik_filter.rubik_entity_details');\n }", "function viewItem($pResourceId = null) {\n if (isset($pResourceId) && is_numeric($pResourceId) && ($pResourceId > 0)) {\n $this->load->model('findaids/FindingAidsItemDAO');\n $data['resource'] = $this->FindingAidsItemDAO->getItem($pResourceId); //get the resource data from the database\n }\n else {\n $data['msg'] = 'Resource not found';\n }\n \n $this->display('findaids/viewItem', $data);\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('BackendBundle:Requerimiento')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No existe el requerimiento solicitado.');\n }\n\n return $this->render('BackendBundle:Requerimiento:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BWBlogBundle:Resource')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Resource entity.');\n }\n\n $form = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BWBlogBundle:Resource:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Resource $resource)\n {\n return view('resources.show')->with('resource', $resource);\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CrestaAulasBundle:Recurso')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No se puede encontrar la entidad Recurso.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CrestaAulasBundle:Recurso:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BackendBundle:Recibo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Recibo entity.');\n }\n\n return $this->render('BackendBundle:Recibo:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "public function showAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('UsuarioBundle:Usuario')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha podido encontrar la entidad Usuario.');\n }\n\n return $this->render('UsuarioBundle:Usuario:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ServidorBundle:Solicitacao')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Solicitacao entity.');\n }\n\n return $this->render('ServidorBundle:Solicitacao:show.html.twig', array(\n 'usuario' => $this->getUser(),\n 'entity' => $entity,\n ));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function showAction($id) {\n\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('DataBaseBundle:RutaSugerida')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find RutaSugerida entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('DataBaseBundle:RutaSugerida:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles the JIRA callback and stores the auth token
public function callbackAction() { try { /** @var \Symfony\Component\HttpFoundation\Request $request */ $request = $this->get('request'); /** @var \Ma27\Jira\IssueVoteBundle\Util\OAuthSecurityAccessProvider $provider */ $provider = $this->get('ma27_jira_issue_vote.oauth.provider'); $verifyKey = $request->get('oauth_verifier'); /** @var \Ma27\Jira\IssueVoteBundle\Entity\OAuthToken $token */ $token = $request->getSession()->get(OAuthSecurityProxy::TEMP_TOKEN_ID); $request->getSession()->set(OAuthSecurityProxy::TEMP_TOKEN_ID, null); $request->getSession()->set( OAuthSecurityProxy::TEMP_TOKEN_ID, $provider->getCredentialsFromAccessUri( $token->getToken(), $token->getTokenSecret(), $verifyKey ) ); $request->getSession()->set(JiraCredentialsListener::OAUTH_LOGIN_FLAG, 1); return $this->redirect($this->generateUrl('ma27_jira_issue_vote_homepage')); } catch (ClientErrorResponseException $ex) { /** @var \Psr\Log\LoggerInterface $logger */ $logger = $this->get('logger'); $logger->emergency('OAuth Token Refused! (Exception: ' . json_encode($ex) . ')'); return $this->forward( 'Ma27JiraIssueVoteBundle:Authorize:invalidateTokens', ['error_text' => 'Token refused! Please contact an administrator. ', 'type' => 'danger'] ); } }
[ "public function process_callback() {\n\n\t\t$_REQUEST['hauth_done'] = $this->id;\n\n\t\twc_social_login()->get_hybridauth_instance()->process_endpoint();\n\t}", "public function callbackAction()\n {\n \t$analyticsService = $this->get('google_analytics_api.api');\n \t$client = $analyticsService->getClient();\n \ttry{\n \t$client = $analyticsService->getClient();\n }catch(Exception $e){\n \techo \"Exception: \".$e->getMessage();\n }\n // Handle authorization flow from the server.\n\t\tif (!isset($_GET['code']))\n\t\t{\n\t\t\t/* check first access token is not expired */\n\t\t\t$tokenFileLocation = __DIR__.'/../Data/token.json';\n\t\t\t/* Check Token JSON file exist if not then redirect to auth first time from GA */\n \tif(file_exists($tokenFileLocation)){\n\t\t $tokenJSONData = file_get_contents($tokenFileLocation); \n\t\t $tokenData = json_decode($tokenJSONData, true);\n\t\t $acessToken = isset($tokenData['access_token'])?$tokenData['access_token']:\"\";\n\t\t $refreshToken = isset($tokenData['refresh_token'])?$tokenData['refresh_token']:\"\";\n\t \tif(!empty($acessToken)){\n\t \t\t$isExpired = $client->isAccessTokenExpired();\n\t\t\t if($isExpired){\n\t\t\t\t\t\t$new_access_token = $client->refreshToken($refreshToken);\n\t\t\t\t\t\tif(isset($new_access_token['access_token']) && !empty($new_access_token['access_token'])){\n\t\t\t\t\t\t\t$new_access_token = json_encode($new_access_token);\n\t\t\t\t\t\t\tfile_put_contents($tokenFileLocation,$new_access_token);\n\t\t\t\t\t\t\t$redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/analytic';\n\t\t\t\t\t\t\t$redirect_uri = filter_var($redirect_uri, FILTER_SANITIZE_URL);\n\t\t\t\t\t\t\treturn $this->redirect($redirect_uri);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t \t}\n \t}\n\n\t\t\t$auth_url = $client->createAuthUrl();\n\t\t\t$auth_url = filter_var($auth_url, FILTER_SANITIZE_URL);\n\t\t\treturn $this->redirect($auth_url);\n\t\t} \n\t\telse\n\t\t{\n\t\t\t$cred = $client->authenticate($_GET['code']);\n\t\t\t/* write refresh token file */\n\t\t\t$token_json = json_encode($cred);\n\t\t\t$tokenFileLocation = __DIR__.'/../Data/token.json';\n\t \t$file = fopen($tokenFileLocation,\"w\");\n\t \tfwrite($file,$token_json);\n\t \tfclose($file);\n\n\t\t\t$session = $this->get('session');\n\t\t\tif (isset($_GET['code']))\n\t\t\t{\n\t\t\t\t$session->set('access_token', $client->getAccessToken());\n\t\t\t}\n\t\t\t$redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/analytic';\n\t\t\t$redirect_uri = filter_var($redirect_uri, FILTER_SANITIZE_URL);\n\t\t\treturn $this->redirect($redirect_uri);\n\t\t\t//return $this->redirectToRoute('analytic_homepage', array(), 301);\n\t\t}\n }", "public function post_request_auth() {\n\t\tsession_start();\n\t\t$this->init_gitlab_oauth_provider();\n\n\t\t$authUrl = $this->oauth_provider->getAuthorizationUrl();\n\t\t$_SESSION['oauth2state'] = $this->oauth_provider->getState();\n\t\theader('Location: '.$authUrl);\n\t\texit;\n\t}", "public function process_auth() {}", "public function callback() {\n $auth_code = Input::get('code');\n\n if ($auth_code) {\n $response = OAuth::token($auth_code);\n $access_token = $response['access_token'];\n $expiry_date = Carbon::now()->addSeconds($response['expires_in']);\n\n Session::set('access_token', $access_token);\n Session::set('access_token_expiry', $expiry_date);\n Api::setAccessToken($access_token);\n }\n\n return Redirect::to('/');\n }", "public function callback(){\n\t\techo \"<strong>Note: </strong>Application should set callback URL to application-side for further specific authentication process.\\n<br>\";\n\t\t\n\t/**\n\t* Fetch auth\n\t*/\n\t\t$response = null;\n\t\tswitch($this->env['Callback.transport']){\n\t\t\tcase 'session':\n\t\t\t\tsession_start();\n\t\t\t\t$response = $_SESSION['opauth'];\n\t\t\t\tunset($_SESSION['opauth']);\n\t\t\t\tbreak;\n\t\t\tcase 'post':\n\t\t\t\t$response = $_POST;\n\t\t\t\tbreak;\n\t\t\tcase 'get':\n\t\t\t\t$response = $_GET;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\techo '<strong style=\"color: red;\">Error: </strong>Unsupported Callback.transport.'.\"<br>\\n\";\n\t\t\t\tbreak;\n\t\t}\n\t\t\t\t\n\t/**\n\t * Validation\n\t */\n\t\tif (empty($response['auth']) || empty($response['timestamp']) || empty($response['signature']) || empty($response['auth']['provider']) || empty($response['auth']['uid'])){\n\t\t\techo '<strong style=\"color: red;\">Invalid auth response: </strong>Missing key auth response components.'.\"<br>\\n\";\n\t\t}\n\t\telseif (!$this->validate(sha1(print_r($response['auth'], true)), $response['timestamp'], $response['signature'], $reason)){\n\t\t\techo '<strong style=\"color: red;\">Invalid auth response: </strong>'.$reason.\".<br>\\n\";\n\t\t}\n\t\telse{\n\t\t\techo '<strong style=\"color: green;\">OK: </strong>Auth response is validated.'.\"<br>\\n\";\n\t\t}\n\t\t\n\t\t\n\t/**\n\t * Auth response dump\n\t */\n\t\techo \"<pre>\";\n\t\tprint_r($response);\n\t\techo \"</pre>\";\n\t}", "function callback()\n\t{\n\t\tif(isset($_REQUEST['oauth_token']) && isset($_REQUEST['oauth_verifier'])) {\t\t\t\n\t\t\t$access_token = $this->freshbooks_oauth->getAccessToken($_REQUEST['oauth_token'], $_REQUEST['oauth_verifier']);\n\n\t\t\t$this->session->set_userdata('oauth_token', $access_token['oauth_token']);\n\t\t\t$this->session->set_userdata('oauth_token_secret', $access_token['oauth_token_secret']);\n\t\t\tredirect('/freshbooks/demo');\n\t\t}\n\t}", "public function doAuthentication() {\n $lRequestToken = self::getRequestToken();\n $lRequest = OAuthClient::prepareRequest($this->getConsumer(), $lRequestToken, \"GET\", \"http://www.tumblr.com/oauth/authorize\");\n // redirect\n header(\"Location: \" . $lRequest->to_url());\n // do nothing more\n exit;\n }", "public function login_callback() {\n \n $code = $this->input->get( 'code' );\n \n $params = [\n 'client_id' => GIT_APP_CLIENT_ID,\n 'code' => $code,\n 'client_secret' => GIT_APP_CLIENT_SECRET\n ];\n \n $curl_response = curl_request( GIT_AUTH_POST_CODE_URL, array(), 'POST', $params );\n \n if( isset( $curl_response[ 'access_token' ] ) ) {\n \n // Access is granted\n // $this->session->set_userdata( 'git_access_token', $curl_response[ 'access_token' ] );\n \n $cookie= array(\n 'name' => 'git_access_token',\n 'value' => $curl_response[ 'access_token' ],\n 'expire' => GIT_TOKEN_EXPIRE_IN_SECONDS\n );\n\n set_cookie($cookie);\n return redirect( 'user' );\n }\n \n // Return back to login page with error message\n $error_msg = isset( $curl_response[ 'error_description' ] ) ? $curl_response[ 'error_description' ] : $curl_response[ 'msg' ];\n\t\t$this->load->view( 'login', array( 'login_error' => $error_msg ) );\n\t}", "public function callback() {\n // Checks if user cancel login via Twitch.\n $error = $this->request->getCurrentRequest()->get('error');\n if ($error == 'access_denied') {\n drupal_set_message($this->t('You could not be authenticated.'), 'error');\n return $this->redirect('user.login');\n }\n\n /* @var \\League\\OAuth2\\Client\\Provider\\Twitch false $twitch */\n $twitch = $this->networkManager->createInstance('social_auth_twitch')->getSdk();\n\n // If Twitch client could not be obtained.\n if (!$twitch) {\n drupal_set_message($this->t('Social Auth Twitch not configured properly. Contact site administrator.'), 'error');\n return $this->redirect('user.login');\n }\n\n $state = $this->dataHandler->get('oauth2state');\n\n // Retreives $_GET['state'].\n $retrievedState = $this->request->getCurrentRequest()->query->get('state');\n if (empty($retrievedState) || ($retrievedState !== $state)) {\n $this->userManager->nullifySessionKeys();\n drupal_set_message($this->t('Twitch login failed. Unvalid oAuth2 State.'), 'error');\n return $this->redirect('user.login');\n }\n\n // Saves access token to session.\n $this->dataHandler->set('access_token', $this->twitchManager->getAccessToken());\n\n $this->twitchManager->setClient($twitch)->authenticate();\n\n // Gets user's info from Twitch API.\n if (!$twitch_profile = $this->twitchManager->getUserInfo()) {\n drupal_set_message($this->t('Twitch login failed, could not load Twitch profile. Contact site administrator.'), 'error');\n return $this->redirect('user.login');\n }\n\n // If user information could be retrieved.\n return $this->userManager->authenticateUser($twitch_profile->getDisplayName(), $twitch_profile->getEmail(), $twitch_profile->getId(), $this->twitchManager->getAccessToken(), '', '');\n\n }", "public function on_success() {\n\t\tif ($this->CI->input->get('oauth_problem')) {\n\t\t\tredirect($this->on_failure_url);\n\t\t}\n\n\t\t// Set oauth consumer tokens\n\t\t$this->setToken($this->CI->input->get('oauth_token'), $this->CI->session->userdata('oauth_token_secret') ) ;\n\n\t\t// Sending request to Linkedin access_token_path to receive the array which it's keys\n\t\t// are tokens: oauth_token, oauth_token_secret for accessing Linkedin resources\n\t\t$access_token_reponse = $this->getAccessToken($this->CI->input->get('oauth_verifier')) ;\n\n\t\t// Setting session variables with tokens: oauth_token, oauth_token_secret for accessing Linkedin resources\n\t\t$this->CI->session->set_userdata('oauth_token', $access_token_reponse['oauth_token'] ) ;\n\t\t$this->CI->session->set_userdata('oauth_token_secret',$access_token_reponse ['oauth_token_secret'] );\n\n\t\t// Redirecting to main page\n\t\tredirect('') ;\n\t}", "public function int_callback(){\n\t\tif (array_key_exists('code', $_GET) && !empty($_GET['code'])){\n\t\t\t\n\t\t\t$keys = array();\n\t\t\t$keys['code'] = trim($_GET['code']);\n\t\t\t$keys['redirect_uri'] = $this->strategy['redirect_uri'];\n\t\t\t$results = null;\n\t\t\t$headers = null;\n\t\t\ttry {\n\t\t\t\t$results = $this->connection->getAccessToken( 'code', $keys ) ;\n\t\t\t} catch (OAuthException $e) {\n\t\t\t}\n\t\t\tif (!empty($results) && !empty($results['access_token'])){\n\t\t\t\t$me = $this->me($results['access_token'], $results['uid']);\n\t\t\t\t$this->auth = array(\n\t\t\t\t\t'provider' => 'Weibo',\n\t\t\t\t\t'uid' => $me['id'],\n\t\t\t\t\t'info' => array(\n\t\t\t\t\t\t'name' => $me['name'],\n\t\t\t\t\t\t'image' => $me['profile_image_url']\n\t\t\t\t\t),\n\t\t\t\t\t'credentials' => array(\n\t\t\t\t\t\t'token' => $results['access_token'],\n\t\t\t\t\t\t'expires' => date('c', time() + $results['expires_in'])\n\t\t\t\t\t),\n\t\t\t\t\t'raw' => $me\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif (isset($me['email '])) $this->auth['info']['email'] = $me['email'];\n\t\t\t\tif (isset($me['verified_contact_email'])) $this->auth['info']['email'] = $me['verified_contact_email'];\n\t\t\t\tif (isset($me['screen_name'])) $this->auth['info']['nickname'] = $me['screen_name'];\n\t\t\t\tif (isset($me['name'])) $this->auth['info']['first_name'] = $me['name'];\t\t\n\t\t\t\tif (isset($me['location'])) $this->auth['info']['location'] = $me['location'];\n\t\t\t\tif (isset($me['url'])) $this->auth['info']['urls']['website'] = $me['url'];\n\t\t\t\t\n\t\t\t\tif(!isset($this->auth['info']['email']) || !$this->auth['info']['email']){\n\t\t\t\t\t\n\t\t\t\t\t$opauthID = OpauthIdentity::get()->filter('UID',$me['id'])->first();\n\t\t\t\t\t\n\t\t\t\t\tif(!$opauthID || !$opauthID->Member() || !$opauthID->Member()->ID){\n\t\t\t\t\t\t$this->env['callback_url'] = '/weiboopauth/addemail/';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->callback();\n\t\t\t\t}else{\n\t\t\t\t\t$this->callback();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$error = array(\n\t\t\t\t\t'provider' => 'Weibo',\n\t\t\t\t\t'code' => 'access_token_error',\n\t\t\t\t\t'message' => 'Failed when attempting to obtain access token',\n\t\t\t\t\t'raw' => $headers\n\t\t\t\t);\n\n\t\t\t\t$this->errorCallback($error);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$error = array(\n\t\t\t\t'provider' => 'Weibo',\n\t\t\t\t'code' => $_GET['error'],\n\t\t\t\t'message' => $_GET['error_description'],\n\t\t\t\t'raw' => $_GET\n\t\t\t);\n\t\t\t\n\t\t\t$this->errorCallback($error);\n\t\t}\n\t}", "public function apiCallback()\n {\n\n global $jobsearch_plugin_options;\n if (isset($_COOKIE['facebook_redirect_url']) && $_COOKIE['facebook_redirect_url'] != '') {\n $real_redirect_url = $_COOKIE['facebook_redirect_url'];\n unset($_COOKIE['facebook_redirect_url']);\n setcookie('facebook_redirect_url', null, -1, '/');\n } else {\n\n $user_dashboard_page = isset($jobsearch_plugin_options['user-dashboard-template-page']) ? $jobsearch_plugin_options['user-dashboard-template-page'] : '';\n $user_dashboard_page = jobsearch__get_post_id($user_dashboard_page, 'page');\n $real_redirect_url = $user_dashboard_page > 0 ? get_permalink($user_dashboard_page) : home_url('/');\n }\n\n\n $this->redirect_url = $real_redirect_url;\n\n // We start the connection\n $fb = $this->initApi();\n\n // We save the token in our instance\n $this->access_token = $this->getToken($fb);\n\n // We get the user details\n $this->facebook_details = $this->getUserDetails($fb);\n\n //$this->facebook_get_pic = $this->getUserPictureURL($fb);\n\n // We first try to login the user\n $this->loginUser();\n\n // Otherwise, we create a new account\n $this->createUser();\n\n // Redirect the user\n header(\"Location: \" . $this->redirect_url, true);\n die();\n }", "public function doAuthentication() {\n $lRequestToken = self::getRequestToken();\n $lRequest = OAuthClient::prepareRequest($this->getConsumer(), $lRequestToken, \"GET\", \"https://www.linkedin.com/uas/oauth/authenticate\");\n // redirect\n header(\"Location: \" . $lRequest->to_url());\n // do nothing more\n exit;\n }", "function callback() {\n global $oauth_api, $applicationId, $applicationSecret;\n\n # Extract the returned authorization code from the URL\n $authorizationCode = $_GET['code'];\n if ($authorizationCode) {\n\n # Create Obtain Token requests\n $body = new \\SquareConnect\\Model\\ObtainTokenRequest();\n $body->setClientId($applicationId);\n $body->setClientSecret($applicationSecret);\n $body->setCode($authorizationCode);\n $body->setGrantType('authorization_code');\n\n try {\n $response = $oauth_api->obtainToken($body);\n\n # Extract the returned access token from the ObtainTokenResposne\n $accessToken = $response->getAccessToken();\n if ($accessToken != null) {\n\n # Here, instead of printing the access token, your application server should store it securely\n # and use it in subsequent requests to the Connect API on behalf of the merchant.\n echo nl2br('Access token: ' . $accessToken);\n echo \"<br>\";\n echo 'Authorization succeeded!';\n\n # The response from the Obtain Token endpoint did not include an access token. Something went wrong.\n } else {\n echo 'Code exchange failed!';\n }\n } catch (SquareConnect\\ApiException $e) {\n echo $e->getMessage();\n }\n\n # The request to the Redirect URL did not include an authorization code. Something went wrong.\n } else {\n echo 'Authorization failed!';\n }\n}", "protected function authorize() {\r\n\r\n $url = $this->base_url . self::LOGIN_ENDPOINT;\r\n\r\n $auth_array = array(\r\n 'login' => $this->username,\r\n 'password' => $this->password,\r\n );\r\n\r\n $json_data = json_encode($auth_array);\r\n\r\n $headers_array = array(\r\n 'Content-Type' => 'application/json'\r\n );\r\n\r\n $args = array(\r\n 'timeout' => 45,\r\n 'redirection' => 0,\r\n 'httpversion' => '1.0',\r\n 'sslverify' => FALSE,\r\n 'method' => 'POST',\r\n 'headers' => $headers_array,\r\n 'body' => $json_data,\r\n );\r\n\r\n\r\n $auth_response = wp_remote_post(\r\n $url, $args\r\n );\r\n\r\n $body = $auth_response['body'];\r\n\r\n $result = json_decode($body);\r\n\r\n $this->auth_status = $result->status;\r\n $this->timestamp = $result->timestamp;\r\n \r\n if (isset($result->error_message)) {\r\n $this->auth_error_message = $result->error_message;\r\n }\r\n\r\n $this->uid = $result->data->user_id;\r\n $this->key = base64_decode($result->data->auth_key);\r\n }", "public function handleGithubProviderCallback() {\n $this->user = Socialite::driver('github')->user();\n return $this->loginOrRegisterUser('github');\n }", "private function authenticate_GitHub() {\r\n\t\t\t$objOAuthGitHub = OAUTH_GITHUB::getInstanceFromParent($this);\r\n\t\t\tif ($this->hasAuthRequest()) \r\n\t\t\t{\r\n\t\t\t\tif (FALSE === (((int) $objOAuthGitHub->authenticate()) == OAUTH_GITHUB::OAUTH_GITHUB_STATUS_SUCCESS))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Something went wrong.. print the error or do something else!\r\n\t\t\t\t\t// new dump($this->getLastException());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function user_authenticate()\n\t{\n\t\t$this->init();\n\n\t\t$consumer = getConsumer();\n\n\t\t// Complete the authentication process using the server's response.\n\t\t$response = $consumer->complete($this->return_to);\n\n\t\t// Check the response status.\n\t\tif ( $response->status == Auth_OpenID_CANCEL )\n\t\t{\n\t\t\t// This means the authentication was cancelled.\n\t\t\tthrow new Exception('PLG_AUTHENTICATION_CLICKER_GOOGLE_AUTH_ERR_CANCELLED');\n\t\t}\n\t\telse if ( $response->status == Auth_OpenID_FAILURE )\n\t\t{\n\t\t\t// Authentication failed; display the error message.\n\t\t\t// This means the authentication was cancelled.\n\t\t\tthrow new Exception(sprintf('PLG_AUTHENTICATION_CLICKER_GOOGLE_AUTH_ERR_FAIL', $response->message));\n\t\t}\n\t\telse if ( $response->status == Auth_OpenID_SUCCESS )\n\t\t{\n\t\t\t// This means the authentication succeeded; extract the\n\t\t\t// identity URL and Simple Registration data (if it was returned).\n\t\t\t$openid = $response->getDisplayIdentifier();\n\n\t\t\t$ax = new Auth_OpenID_AX_FetchResponse();\n\t\t\t$obj = $ax->fromSuccessResponse($response);\n\n\t\t\t// $pape_resp = Auth_OpenID_PAPE_Response::fromSuccessResponse($response);\n\n\t\t\t// Get openid unique identifier\n\t\t\t$request = Request::create($openid);\n\t\t\t$openid_identifier = $request->input('id');\n\n\t\t\t// Log user into website\n\t\t\t// Save user if it doesn't already exist\n\t\t\t$this->save_or_update_user($obj, $openid_identifier);\n\n\t\t\tHelper::immediate_redirect(Request::url(), 200);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a rule for the minimum a numeric value can be
public function min($value) { $this->rules['min'] = $value; return $this; }
[ "public function requireNumbers($num = 1) {\n // Makes sure that the passed argument is a number and is greater than 0.\n\tif (is_numeric($num) && $num > 0) {\n // If so, it is assigned to the respective property of the current instance.\n\t $this->_minimumNumbers = (int) $num; \n\t}\n }", "public function setRealMin($value)\n {\n return $this->set(self::REAL_MIN, $value);\n }", "function CalcMin(){}", "public function setNormalizeMin($value) {\n\n $this->normalizeMin = (int) $value;\n\n }", "public function set_min($value)\r\n\t{\r\n\t\treturn $this->set_attr('min', $value);\r\n\t}", "public function setMin($min) {\n $this->setOptionNumeric(\"min\", $min);\n }", "public function setMinimumMatch($value) {}", "public function setMin(int $min): self;", "public function setMinValue($value) {\n\t\t$value = FormItBuilder::forceNumber($value);\n\t\tif($this->_maxValue!==NULL && $this->_maxValue<$value){\n\t\t\tFormItBuilder::throwError('[Element: '.$this->_id.'] Cannot set minimum value to \"'.$value.'\" when maximum value is \"'.$this->_maxValue.'\"');\n\t\t}else{\n\t\t\t$this->_minValue = FormItBuilder::forceNumber($value);\n\t\t}\n\t}", "abstract protected function minUnSignedValue();", "public function setMinimum($value) {\r\n $this->internalSetMinimum($value);\r\n }", "public function setMinColorValue($number) {\n $this->setOption(\"minColorValue\", $number);\n }", "public function testMinMax ()\n {\n //\n $result = (new FloatRule())->setMax(10)->validate(9);\n $this->assertTrue($result);\n\n $result = (new FloatRule())->setMax(10)->validate(11);\n $this->assertFalse($result);\n\n $result = (new FloatRule())->setMin(10)->validate(11);\n $this->assertTrue($result);\n\n $result = (new FloatRule())->setMin(10)->validate(9);\n $this->assertFalse($result);\n }", "public function setMinPriceThreshold($value);", "public function setMin($min) {\n\t\t$this->min = $min;\n\t}", "public function min($attribute = null);", "function setMinSeverity($value) {\n $this->min_severity = $value;\n }", "public function setMinOrderNumber($value) {\n return $this->set(self::MIN_ORDER_NUMBER, $value);\n }", "abstract protected function minSignedValue();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a target attribute to all links in passed content. By default, this function only applies to `` tags. However, this can be modified via the `$tags` parameter. NOTE: Any current target attribute will be stripped and replaced.
function links_add_target($content, $target = '_blank', $tags = array('a')) { }
[ "function links_add_target($content, $target = '_blank', $tags = array('a'))\n{\n}", "function _links_add_target( $m, $target ) {\n\t$tag = $m[1];\n\t$link = preg_replace('|(target=[\\'\"](.*?)[\\'\"])|i', '', $m[2]);\n\treturn '<' . $tag . $link . ' target=\"' . $target . '\">';\n}", "public function setLinkTarget($target);", "public function setTarget($target)\n {\n parent::setAttr(\"target\", $target);\n }", "function setLinksTargets($menu_name, $target)\r\n{\r\n\tfor ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {\t// this counter scans all nodes of the new menu\r\n\t\t$this->tree[$cnt]['parsed_target'] = ' target=\"' . $target . '\"';\r\n\t}\r\n}", "public function addLink($content)\n {\n /* Get tags order by tag length desc. */\n $tags = $this->dao->select('*')->from(TABLE_TAG)->where('link')->ne('')->orderBy('length(tag)_desc')->fetchAll('id');\n\n /* Mark tags need to added link. */\n foreach($tags as $tag) $content = $this->markTag($content, $tag);\n\n /* Replace mark with tags and links. */\n foreach($tags as $id => $tag)\n {\n $content = str_replace(\"{tag{$id}}\", $tag->tag, $content);\n $content = str_replace(\"{link{$id}}\", html::a($tag->link, $tag->tag, \"class='tag-link'\"), $content);\n }\n return $content;\n }", "function add_href_target($str, $target='_new') {\n return str_replace(' href=', ' target=\"status\" href=', $str);\n}", "function autolink($text, $target=NULL, $nofollow=true){\n\n\t\t // grab anything that looks like a URL...\n\t\t $urls = General::__autolink_find_URLS($text);\n\n\t\t if(!empty($urls)){ // i.e. there were some URLS found in the text{\n\t\t array_walk($urls, array('General', '__autolink_create_html_tags'), array('target'=>$target, 'nofollow'=>$nofollow));\n\t\t $text = strtr($text, $urls);\n\t\t }\n\n\t\t return $text;\n\t\t}", "public function addTarget($target);", "public function setUrlTarget($v=true) { $this->_target = (string)$v; }", "public function addLinkExtractionTags()\n {\n $tags = func_get_args();\n return $this->setLinkExtractionTags($tags);\n }", "public function getLinkTarget () {}", "private static function addRelNoOpener(string $content = null) : string\n {\n // Extract any <a> tags in the HTML content\n // For instance <a href=\"https://www.marknotes.fr\">MarkNotes</a>\n // and explode the links in an array like this :\n //\n // [0] => <a href=\"https://www.marknotes.fr\">MarkNotes</a> (entire tag)\n // [1] => href=\"https://www.marknotes.fr\" (attributes of <a xxxx>)\n // [2] => MarkNotes (the caption)\n //\n // And add the rel=\"noopener\" attribute and \"noreferrer\" for old browsers\n\n preg_match_all(\"/<a ([^\\>]*)>(.*)<\\/a>/siU\", $content, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $match) {\n $content = str_replace(\n $match[0],\n '<a '.$match[1].' rel=\"noopener noreferrer\">'.$match[2].'</a>',\n $content\n );\n }\n\n return $content;\n }", "public function linkToTags($quoteID, $tags) {\n // Create an array of tags and trim any extra spaces out\n $tagArray = explode(',',$tags);\n\n // Do an upsert to make sure all tags actually exist in the lookup table\n $quoteTags = new Datasource_Cms_HeaderQuote_Tags();\n $quoteTags->upsert($tagArray);\n\n // Delete current tag links for this testimonial\n $this->clearLinksToTags($quoteID);\n\n $quoteTagMap = new Datasource_Cms_HeaderQuote_TagMap();\n // Now loop through and link the testimonial to the tag\n\n foreach ($tagArray as $tag) {\n $tagID = $quoteTags->getId($tag);\n $quoteTagMap->addMap($quoteID, $tagID);\n }\n }", "public function target($target = '_self')\n {\n return $this->_attribute('target', strtolower($target));\n }", "public function setTarget($target);", "function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) {\n\tglobal $_links_add_base;\n\t$_links_add_base = $base;\n\t$attrs = implode('|', (array)$attrs);\n\treturn preg_replace_callback( \"!($attrs)=(['\\\"])(.+?)\\\\2!i\", '_links_add_base', $content );\n}", "protected function replaceLinkTargets($processedContent)\n {\n $noOpenerString = $this->fusionValue('setNoOpener') ? ' rel=\"noopener\"' : '';\n $externalLinkTarget = trim($this->fusionValue('externalLinkTarget'));\n $resourceLinkTarget = trim($this->fusionValue('resourceLinkTarget'));\n if ($externalLinkTarget === '' && $resourceLinkTarget === '') {\n return $processedContent;\n }\n $controllerContext = $this->runtime->getControllerContext();\n $host = $controllerContext->getRequest()->getHttpRequest()->getUri()->getHost();\n $processedContent = preg_replace_callback(\n '~<a.*?href=\"(.*?)\".*?>~i',\n function ($matches) use ($externalLinkTarget, $resourceLinkTarget, $host, $noOpenerString) {\n list($linkText, $linkHref) = $matches;\n $uriHost = parse_url($linkHref, PHP_URL_HOST);\n $target = null;\n if ($externalLinkTarget !== '' && is_string($uriHost) && $uriHost !== $host) {\n $target = $externalLinkTarget;\n }\n if ($resourceLinkTarget !== '' && strpos($linkHref, '_Resources') !== false) {\n $target = $resourceLinkTarget;\n }\n if ($target === null) {\n return $linkText;\n }\n if (preg_match_all('~target=\"(.*?)~i', $linkText, $targetMatches)) {\n return preg_replace('/target=\".*?\"/', sprintf('target=\"%s\"%s', $target, $target === '_blank' ? $noOpenerString : ''), $linkText);\n }\n return str_replace('<a', sprintf('<a target=\"%s\"%s', $target, $target === '_blank' ? $noOpenerString : ''), $linkText);\n },\n $processedContent\n );\n return $processedContent;\n }", "private function transform_a_tags( &$document ) {\n\t\t$links = $document->getElementsByTagName( 'a' );\n\n\t\t/**\n\t\t * The <a> element\n\t\t *\n\t\t * @var DOMElement $link The <a> element\n\t\t */\n\t\tforeach ( $links as $link ) {\n\t\t\tif ( ! $link->getAttribute( 'target' ) ) {\n\t\t\t\t$link->setAttribute( 'target', '_blank' );\n\t\t\t}\n\n\t\t\t$is_link_to_same_origin = 0 === strpos( $link->getAttribute( 'href' ), home_url() );\n\n\t\t\t$rel = $link->getAttribute( 'rel' );\n\n\t\t\t// Links to the same site should not have \"noreferrer\".\n\t\t\t// Other rel values should not be modified.\n\t\t\t// See https://github.com/google/web-stories-wp/issues/9494.\n\t\t\t$rel = str_replace( 'noreferrer', '', $rel );\n\t\t\tif ( ! $is_link_to_same_origin ) {\n\t\t\t\t$rel .= ' noreferrer';\n\t\t\t}\n\n\t\t\tif ( empty( $rel ) ) {\n\t\t\t\t$link->removeAttribute( 'rel' );\n\t\t\t} else {\n\t\t\t\t$link->setAttribute( 'rel', trim( $rel ) );\n\t\t\t}\n\n\t\t\tif ( ! $link->getAttribute( 'data-tooltip-icon' ) ) {\n\t\t\t\t$link->removeAttribute( 'data-tooltip-icon' );\n\t\t\t}\n\n\t\t\tif ( ! $link->getAttribute( 'data-tooltip-text' ) ) {\n\t\t\t\t$link->removeAttribute( 'data-tooltip-text' );\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test file service copy
public function testCopy() { // Create temporary file $path = tempnam(sys_get_temp_dir(), 'test'); $fileName = basename($path); // Create test dir $testDir = sys_get_temp_dir().'/testDir/'; if (!$this->fileService->exists($testDir)) { $this->fileService->mkDir($testDir); } // Try to null source file $this->fileService->copyPath($path.'TEST', $testDir.$fileName); // Perform test $this->assertFileNotExists($testDir.$fileName, 'File service copy file failed - Copied file not found'); // Move file to a new dir $this->fileService->copyPath($path, $testDir.$fileName); // Perform test $this->assertFileExists($testDir.$fileName, 'File service copy file failed - Copied file not found'); // Create test dir $testDir2 = sys_get_temp_dir().'/testDir2/'; if (!$this->fileService->exists($testDir2)) { $this->fileService->mkDir($testDir2); } // Copy whole dir with new file to a second new dir $this->fileService->copyPath($testDir, $testDir2); // Perform test $this->assertFileExists($testDir2.$fileName, 'File service copy folder dir failed - Copied file not found'); // Create temporary file $path2 = tempnam(sys_get_temp_dir(), 'test'); $fileName2 = basename($path2); // Copy whole dir to a file $this->fileService->copyPath(dirname($path2), $testDir2.$fileName2); // Perform test $this->assertFileNotExists($testDir2.$fileName2, 'File service copy file to folder failed - Copied file found'); }
[ "public function testCopyFile()\n {\n\n $fileManager = new FileManager();\n\n $testFile = TEST_DIRECTORY . basename(__FILE__);\n\n $this->assertEquals(true, $fileManager->copyFile(__FILE__, $testFile));\n\n unlink($testFile);\n }", "public static function testCopyingAFile()\r\n {\r\n $fileName = 'song.mp3';\r\n $copiedFileName = 'song2.mp3';\r\n $fileLoader = new FileLoader();\r\n\r\n $testFile = $fileLoader->loadFile($fileName);\r\n $testFile->setPath($fileName); // checks if file exists\r\n $fileCopier = new FileCopier();\r\n $fileCopier->copyFileToPath($testFile, $copiedFileName);\r\n $testFile->setPath($copiedFileName); // checks if copied file exists\r\n unlink($copiedFileName);\r\n }", "public function testCopy()\n {\n $this->workspaceUtility->createFile('/test.txt');\n\n $this->connectionAdapter->connect();\n\n $this->assertTrue($this->connectionAdapter->copy($this->workspaceUtility->getWorkspacePath().'/test.txt', $this->workspaceUtility->getWorkspacePath().'/test2.txt'));\n $this->assertFileExists($this->workspaceUtility->getWorkspacePath().'/test2.txt');\n $this->assertFileEquals($this->workspaceUtility->getWorkspacePath().'/test.txt', $this->workspaceUtility->getWorkspacePath().'/test2.txt');\n }", "public function testCopyFileExecuteSuccess() {\n\n $action = new Copyfile($this->source, $this->destination);\n $action->execute();\n\n $this->assertFileExists($this->destination);\n\n $sourceFileContents = file_get_contents($this->source);\n $destinationFileContents = file_get_contents($this->destination);\n\n $this->assertEquals($sourceFileContents, $destinationFileContents);\n }", "public function testCopyFS()\n\t\t{\n\t\t// test the copy\n\t\t$this->assertTrue($this->ioClass->copyFS(\"tests/fixtures/io_scanDirFS\", \"tests/fixtures/io_copyFS\"));\n\n\t\t// test if the copy equals original\n\t\t$this->assertEquals($this->ioClass->scanDirFS(\"tests/fixtures/io_scanDirFS\"),\n\t\t\t\t\t\t\t$this->ioClass->scanDirFS(\"tests/fixtures/io_copyFS\") );\n\t\t}", "public function test_transfer_file_to_path_copyfile() {\n // Initialize params.\n $parsedwebdavurl = parse_url($this->issuer->get_endpoint_url('webdav'));\n $webdavprefix = $parsedwebdavurl['path'];\n $srcpath = 'sourcepath';\n $dstpath = \"destinationpath/another/path\";\n\n // Mock the Webdavclient and set expected methods.\n $systemwebdavclientmock = $this->createMock(\\webdav_client::class);\n $systemwebdavclientmock->expects($this->once())->method('open')->willReturn(true);\n $systemwebdavclientmock->expects($this->once())->method('copy_file')->with($webdavprefix . $srcpath,\n $webdavprefix . $dstpath . '/' . $srcpath, true)->willReturn(201);\n $this->set_private_property($systemwebdavclientmock, 'systemwebdavclient', $this->linkmanager);\n\n // Call of function.\n $result = $this->linkmanager->transfer_file_to_path($srcpath, $dstpath, 'copy');\n\n $this->assertEquals(201, $result);\n }", "public function testCopy3()\n {\n // mount another filesystem\n $dir = $this->dir . 'x1';\n $this->object->mount('/disk', new Filesystem($dir));\n\n // put\n $this->assertTrue($this->object->put('/bingo', 'wow'));\n\n // copy\n $this->assertTrue($this->object->copy('/bingo', '/disk/bingo'));\n\n $this->assertEquals('wow', $this->object->get('/disk/bingo'));\n\n // clear\n $this->assertTrue($this->object->del('/bingo'));\n $this->assertTrue($this->object->del('/disk'));\n\n @rmdir($dir);\n }", "public function testCopyFileReverseSuccess() {\n\n $action = new Copyfile($this->source, $this->destination);\n $action->execute();\n\n $this->assertFileExists($this->destination);\n\n $action->reverse();\n\n $this->assertFileNotExists($this->destination);\n }", "public function copy() {\n $Copy = $this->getEntity(\"File\");\n foreach ($this->schema[\"fields\"] as $key => $field)\n $Copy->set($key, $this->get($key));\n $info = pathinfo($Copy->get(\"uri\"));\n $path = ($Copy->get(\"dir\") == \"private\" ? PRIVATE_PATH : PUBLIC_PATH).BASE_PATH;\n $uri = $info[\"dirname\"].\"/\";\n $name = $Copy->get(\"name\");\n $ext = $Copy->get(\"extension\");\n for ($fname = $name.\"-0.\".$ext, $i = 1; file_exists($path.$uri.$fname); $fname = $name.\"-\".$i.\".\".$ext, $i++);\n if (file_exists($this->path())) {\n if (!copy($this->path(), $path.$uri.$fname)) {\n setmsg(\"Failed to copy file: \".$this->path().\" to \".$path.$uri.$fname, \"error\");\n return false;\n }\n }\n $Copy->set(\"uri\", $uri.$fname);\n if (!$Copy->save())\n return false;\n return $Copy;\n }", "public function test_basic_file_manipulations() {\n /**\n * Test creating a file\n */\n $filename = 'testfile.txt';\n $uri = 'test://'.$filename;\n $path = $this->test_dir.'/'.$filename;\n $expected_contents = $this->sample_content;\n\n // Make sure the file doesn't exist to start with\n $this->assertFileNotExists($path);\n\n // Touch the file\n wp_touch($uri);\n $this->assertFileExists($path);\n\n // Unlink the file\n unlink($uri);\n $this->assertFileNotExists($path);\n\n // Open and write to the file\n $fh = fopen($uri, 'w');\n fwrite($fh, $expected_contents);\n fclose($fh);\n $this->assertFileExists($path);\n $this->assertEquals(filesize($uri), filesize($path));\n\n // Open and read from the file\n $fh = fopen($uri, 'r');\n $actual_contents = fread($fh, filesize($uri));\n fclose($fh);\n $this->assertEquals($expected_contents, $actual_contents);\n\n // Copy the file\n $second_filename = 'testfile2.txt';\n $second_uri = 'test://'.$second_filename;\n $second_path = $this->test_dir.'/'.$second_filename;\n\n copy($uri, $second_uri);\n $this->assertFileExists($this->test_dir.'/'.$second_filename);\n $this->assertEquals(filesize($uri), filesize($second_uri));\n\n // Unlink original file\n unlink($uri);\n $this->assertFileNotExists($path);\n\n // Rename second file to first file\n rename($second_uri, $uri);\n $this->assertFileNotExists($second_path);\n $this->assertfileExists($path);\n\n // Cleanup\n unlink($uri);\n $this->assertfileNotExists($path);\n }", "abstract protected function copy(tx_webconFtptransfer_File $file, $target);", "public function testCopy_OverwriteFile()\n {\n \tfile_put_contents(\"{$this->file}.x\", \"Another file\");\n $new = $this->Fs_Node->copy(\"{$this->file}.x\", Fs::OVERWRITE);\n \n $this->assertType('Q\\Fs_File', $new);\n $this->assertTrue(file_exists(\"{$this->file}.x\"));\n $this->assertEquals('Test case for Fs_File', file_get_contents(\"{$this->file}.x\"));\n\n $this->assertTrue(file_exists($this->file));\n }", "public function testCopy_FileExists()\n {\n \tif (function_exists('posix_getuid') && posix_getuid() == 0) $this->markTestSkipped(\"Won't test this as root for safety reasons.\");\n \t\n \tfile_put_contents(\"{$this->file}.x\", \"Another file\");\n $this->setExpectedException(\"Q\\Fs_Exception\", \"Unable to copy '{$this->file}' to '{$this->file}.x': Target already exists\");\n $this->Fs_Node->copy(\"{$this->file}.x\");\n\n $this->assertTrue(file_exists(\"{$this->file}.x\"));\n $this->assertEquals(\"Another file\", file_exists(\"{$this->file}.x\"));\n \n $this->assertTrue(is_dir($this->file));\n $this->assertTrue(file_exists(\"{$this->file}/\" . basename($this->file)));\n }", "abstract function copyFile($source_file, $dest_file);", "public function testFilter(): void\n {\n $copyFilter = new Copy([\n 'target' => self::TEST_FILE_TMP_COPY,\n 'overwrite' => true,\n ]);\n $copyFilter->filter(self::TEST_FILE_TMP);\n $this->assertEquals(self::TEST_CONTENT, file_get_contents(self::TEST_FILE_TMP_COPY));\n }", "private function _insert_test_file()\n {\n }", "public function testReadFile()\n {\n $file_name = $this->getTestFileName();\n $content = 'file content';\n $this->expectFileOperations($file_name);\n file_put_contents($file_name, $content);\n $this->assertEquals($content, $this->local_machine->readFile($file_name));\n }", "public function testSendFile()\n {\n }", "public function testCopy_NonEmptyDir()\n {\n \tmkdir(\"{$this->file}.x\");\n \tfile_put_contents(\"{$this->file}.x/\" . basename($this->file) . \".y\", \"Another file\");\n \t\n \t$this->setExpectedException(\"Q\\Fs_Exception\", \"Unable to copy '{$this->file}' to '{$this->file}.x': Target is a non-empty directory\");\n $new = $this->Fs_Node->copy(\"{$this->file}.x\", Fs::OVERWRITE);\n \n $this->assertTrue(file_exists($this->file));\n $this->assertTrue(file_exists(\"{$this->file}.x/\" . basename($this->file) . \".y\"));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
modifie la luminescence d'une couleur en hsl
function mod_l_hsl($delta_l) { $hsl=$this->get_hsl(); $l=$hsl[2]; if ($delta_l>0) $l=$l+(1-$l)*(($delta_l>1)?1:$delta_l); if ($delta_l<0) $l=$l*(($delta_l<-1)?-1:(1+$delta_l)); //echo $l."<br>\n"; $this->set_from_hsl($hsl[0],$hsl[1],$l); }
[ "function originaltint(){\n\tglobal $hue, $luminance, $saturation;\n\t$temp_satu = round($saturation/2 ,0);\n\tif ($luminance < 50) {\n\t\t$luminance += 50;\n\t}elseif($luminance > 60) {\n\t\t$luminance = ($luminance/2) + 50;\n\t}\n\techo \"hsl(\". round($hue, 0). \",\" . $temp_satu . \"%,\" . $luminance.\"%)\"; \n}", "protected function calculateHSL()\n {\n $hue = 0;\n\n $red = $this->red / 255;\n $green = $this->green / 255;\n $blue = $this->blue / 255;\n\n $chroma_min = min($red, $green, $blue);\n $chroma_max = max($red, $green, $blue);\n\n $lightness = ($chroma_max + $chroma_min) / 2;\n $delta = $chroma_max - $chroma_min;\n\n if ($delta == 0) {\n $hue = $saturation = 0; // achromatic\n } else {\n $saturation = $delta / (1 - abs(2 * $lightness - 1));\n\n switch ($chroma_max) {\n case $red:\n $hue = 60 * fmod((($green - $blue) / $delta), 6);\n if ($blue > $green) {\n //$hue += 360;\n }\n break;\n\n case $green:\n $hue = 60 * (($blue - $red) / $delta + 2);\n break;\n\n case $blue:\n $hue = 60 * (($red - $green) / $delta + 4);\n break;\n }\n }\n\n $this->hue = round($hue, 4);\n $this->hsl_saturation = round($saturation, 4);\n $this->lightness = round($lightness, 4);\n }", "function hsl2rgb($h, $s, $l) {\n $h_temp = $h / 360;\n $q = ($l < 0.5)? ($l * (1 + $s)) : ($l + $s - ($l*$s));\n $p = 2*$l - $q;\n $t_r = $h_temp + 1/3;\n $t_g = $h_temp;\n $t_b = $h_temp - 1/3;\n foreach (array(\"r\", \"g\", \"b\") as $C) {\n if (${\"t_$C\"} < 0) {\n ${\"t_$C\"} += 1;\n } elseif (${\"t_$C\"} > 1) {\n ${\"t_$C\"} -= 1;\n }\n if (${\"t_$C\"} < 1/6) {\n $$C = $p+(($q-$p)*6*${\"t_$C\"});\n } elseif (${\"t_$C\"} >= 1/6 && ${\"t_$C\"} < 0.5) {\n $$C = $q;\n } elseif (${\"t_$C\"} >= 0.5 && ${\"t_$C\"} < 2/3) {\n $$C = $p+(($q-$p)*6*(2/3 - ${\"t_$C\"}));\n } else {\n $$C = $p;\n }\n }\n return array($r, $g, $b);\n}", "protected function _convertToHSL()\n {\n $this->_hsl = $this->_rgb === null ? [0, 100, 50] : $this->_rgb2hsl($this->_rgb[0], $this->_rgb[1], $this->_rgb[2], false);\n $this->_hslRounded = null;\n }", "function mts_hex_to_hsl( $color ){\n\n // Sanity check\n $color = mts_check_hex_color($color);\n\n // Convert HEX to DEC\n $R = hexdec($color[0].$color[1]);\n $G = hexdec($color[2].$color[3]);\n $B = hexdec($color[4].$color[5]);\n\n $HSL = array();\n\n $var_R = ($R / 255);\n $var_G = ($G / 255);\n $var_B = ($B / 255);\n\n $var_Min = min($var_R, $var_G, $var_B);\n $var_Max = max($var_R, $var_G, $var_B);\n $del_Max = $var_Max - $var_Min;\n\n $L = ($var_Max + $var_Min)/2;\n\n if ($del_Max == 0) {\n $H = 0;\n $S = 0;\n } else {\n if ( $L < 0.5 ) $S = $del_Max / ( $var_Max + $var_Min );\n else $S = $del_Max / ( 2 - $var_Max - $var_Min );\n\n $del_R = ( ( ( $var_Max - $var_R ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max;\n $del_G = ( ( ( $var_Max - $var_G ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max;\n $del_B = ( ( ( $var_Max - $var_B ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max;\n\n if ($var_R == $var_Max) $H = $del_B - $del_G;\n else if ($var_G == $var_Max) $H = ( 1 / 3 ) + $del_R - $del_B;\n else if ($var_B == $var_Max) $H = ( 2 / 3 ) + $del_G - $del_R;\n\n if ($H<0) $H++;\n if ($H>1) $H--;\n }\n\n $HSL['H'] = ($H*360);\n $HSL['S'] = $S;\n $HSL['L'] = $L;\n\n return $HSL;\n}", "function hsl_same_light($hex, $hex2, $tolerance_percent = \"10\") { // compares the h value\n // if the two colors differ by less than 0.083 (30 deg)\n // they are considered the same color by the 12 color wheel\n// conversion of first hex code to hsl\n // convert hex to rgb\n // convert hex to rgb\n $rgb_array = hex_2_rgb($hex);\n list($r, $g, $b) = $rgb_array;\n // convert rgb to hsl\n $hsl_array = rgb_2_hsl($r, $g, $b);\n list($h, $s, $l) = $hsl_array;\n\n\n// conversion of second hex code to hsl\n // convert hex to rgb\n $rgb_array2 = hex_2_rgb($hex2);\n list($r2, $g2, $b2) = $rgb_array2;\n // convert rgb to hsl\n $hsl_array2 = rgb_2_hsl($r2, $g2, $b2);\n list($h2, $s2, $l2) = $hsl_array2;\n\n $tolerance = $tolerance_percent / 100;\n if (abs($l - $l2) <= $tolerance) {\n return true;\n }\n return false;\n}", "function emarking_get_hue_color($sequence) {\n $goldenratio = 0.618033988749895 * (float) 360;\n // We choose the number corresponding to the sequence\n $color = (float) $sequence * (float) $goldenratio;\n $color = $color % 360;\n \n // We need the int version\n $hue = intval($color);\n \n return \"hsl($hue,50%,85%)\";\n}", "function setHSL($hue, $saturation, $luminosity){}", "public function hsl($h,$s,$l)\n\t{\n\t\t$values = $this->_convert_HSL_to_RGB($h,$s,$l);\n\t\treturn \"rgb(\".implode(',',$values).\")\";\n\t}", "function rgb2hsl($rgb)\n{\n\t// Fill variables $r, $g, $b by array given.\n\tlist($r, $g, $b) = $rgb;\n\n\t// Determine lowest & highest value and chroma\n\t$max = max($r, $g, $b);\n\t$min = min($r, $g, $b);\n\t$chroma = $max - $min;\n\n\t// Calculate Luminosity\n\t$l = ($max + $min) / 2;\n\n\t// If chroma is 0, the given color is grey\n\t// therefore hue and saturation are set to 0\n\tif($chroma == 0){\n\t\t$h = 0;\n\t\t$s = 0;\n\t}\n\n\t// Else calculate hue and saturation.\n\t// Check http://en.wikipedia.org / wiki / HSL_and_HSV for details\n\telse\n\t{\n\t\tswitch($max)\n\t\t{\n\t\t\tcase $r:\n\t\t\t$h_ = fmod((($g - $b) / $chroma), 6);\n\t\t\tif($h_ < 0) $h_ = (6 - fmod(abs($h_), 6)); // Bugfix: fmod() returns wrong values for negative numbers\n\t\t\tbreak;\n\n\t\t\tcase $g:\n\t\t\t$h_ = ($b - $r) / $chroma + 2;\n\t\t\tbreak;\n\n\t\t\tcase $b:\n\t\t\t$h_ = ($r - $g) / $chroma + 4;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\t$h = $h_ / 6;\n\t\t$s = 1 - abs(2 * $l - 1);\n\t}\n\n\t// Return HSL Color as array\n\treturn array($h,$s,$l);\n}", "public function getHSL () {}", "function flo_RGBToHSL($RGB) {\n $r = 0xFF & ($RGB >> 0x10);\n $g = 0xFF & ($RGB >> 0x8);\n $b = 0xFF & $RGB;\n\n $r = ((float)$r) / 255.0;\n $g = ((float)$g) / 255.0;\n $b = ((float)$b) / 255.0;\n\n $maxC = max($r, $g, $b);\n $minC = min($r, $g, $b);\n\n $l = ($maxC + $minC) / 2.0;\n\n if($maxC == $minC) {\n $s = 0;\n $h = 0;\n } else {\n if($l < .5) {\n $s = ($maxC - $minC) / ($maxC + $minC);\n } else {\n $s = ($maxC - $minC) / (2.0 - $maxC - $minC);\n }\n if($r == $maxC)\n $h = ($g - $b) / ($maxC - $minC);\n if($g == $maxC)\n $h = 2.0 + ($b - $r) / ($maxC - $minC);\n if($b == $maxC)\n $h = 4.0 + ($r - $g) / ($maxC - $minC);\n\n $h = $h / 6.0; \n }\n\n $h = (int)round(255.0 * $h);\n $s = (int)round(255.0 * $s);\n $l = (int)round(255.0 * $l);\n\n return (object) Array('hue' => $h, 'saturation' => $s, 'lightness' => $l);\n }", "function HEX_TO_HSL ($hexcode) {\n\n $redhex = substr($hexcode,0,2);\n $greenhex = substr($hexcode,2,2);\n $bluehex = substr($hexcode,4,2);\n\n $var_r = (hexdec($redhex)) / 255;\n $var_g = (hexdec($greenhex)) / 255;\n $var_b = (hexdec($bluehex)) / 255;\n\n $var_min = min($var_r,$var_g,$var_b);\n $var_max = max($var_r,$var_g,$var_b);\n $del_max = $var_max - $var_min;\n\n $l = ($var_max + $var_min) / 2;\n\n if ($del_max == 0)\n {\n $h = 0;\n $s = 0;\n }\n else\n {\n if ($l < 0.5)\n {\n $s = $del_max / ($var_max + $var_min);\n }\n else\n {\n $s = $del_max / (2 - $var_max - $var_min);\n };\n\n $del_r = ((($var_max - $var_r) / 6) + ($del_max / 2)) / $del_max;\n $del_g = ((($var_max - $var_g) / 6) + ($del_max / 2)) / $del_max;\n $del_b = ((($var_max - $var_b) / 6) + ($del_max / 2)) / $del_max;\n\n if ($var_r == $var_max)\n {\n $h = $del_b - $del_g;\n }\n elseif ($var_g == $var_max)\n {\n $h = (1 / 3) + $del_r - $del_b;\n }\n elseif ($var_b == $var_max)\n {\n $h = (2 / 3) + $del_g - $del_r;\n };\n\n if ($h < 0)\n {\n $h += 1;\n };\n\n if ($h > 1)\n {\n $h -= 1;\n };\n }\n\n $HSL['0'] = $h;\n $HSL['1'] = $s;\n $HSL['2'] = $l;\n\n return $HSL;\n\n}", "public static function GetHsl($color,$char_index = true)\n { \n $hsl = array('h' => 0,'s' => 0,'l' => 0);\n\n $rgb = self::GetRgb($color);\n $rgb = array_map('ColorName::divide',$rgb);\n\n $min_color = min($rgb);\n $max_color = max($rgb);\n\n $egim = $max_color - $min_color;\n\n $hsl['l'] = ($min_color + $max_color) / 2;\n\n\n if($hsl['l'] > 0 && $hsl['l'] < 1)\n $hsl['s'] = $egim / ($hsl['l'] < 0.5 ? (2 * $hsl['l']) : (2 - 2 * $hsl['l']));\n\n if($egim > 0)\n {\n if ($max_color == $rgb['r'] && $max_color != $rgb['g']) \n $hsl['h'] += ($rgb['g'] - $rgb['b']) / $egim;\n if ($max_color == $rgb['g'] && $max_color != $rgb['b']) \n $hsl['h'] += (2 + ($rgb['b'] - $rgb['r']) / $egim);\n if ($max_color == $rgb['b'] && $max_color != $rgb['r']) \n $hsl['h'] += (4 + ($rgb['r'] - $rgb['g']) / $egim);\n $hsl['h'] /= 6;\n }\n $hsl = array_map(\"ColorName::multiple\",$hsl);\n \n if($char_index)\n return $hsl;\n else\n return array_values($hsl);\n }", "function RGBToHSL($RGB)\n{\n $r = 0xFF & ($RGB >> 0x10);\n $g = 0xFF & ($RGB >> 0x8);\n $b = 0xFF & $RGB;\n\n $r = ((float)$r) / 255.0;\n $g = ((float)$g) / 255.0;\n $b = ((float)$b) / 255.0;\n\n $maxC = max($r, $g, $b);\n $minC = min($r, $g, $b);\n\n $l = ($maxC + $minC) / 2.0;\n\n if ($maxC == $minC) {\n $s = 0;\n $h = 0;\n } else {\n if ($l < .5) {\n $s = ($maxC - $minC) / ($maxC + $minC);\n } else {\n $s = ($maxC - $minC) / (2.0 - $maxC - $minC);\n }\n if ($r == $maxC) {\n $h = ($g - $b) / ($maxC - $minC);\n }\n if ($g == $maxC) {\n $h = 2.0 + ($b - $r) / ($maxC - $minC);\n }\n if ($b == $maxC) {\n $h = 4.0 + ($r - $g) / ($maxC - $minC);\n }\n $h = $h / 6.0;\n }\n\n $h = (int)round(255.0 * $h);\n $s = (int)round(255.0 * $s);\n $l = (int)round(255.0 * $l);\n\n return (object) Array('hue' => $h, 'saturation' => $s, 'lightness' => $l);\n}", "public function luminance();", "function prettyColor($hue, $saturation=100, $lightness=40) {\r\n\treturn \"hsl(\" . $hue . \",\" . $saturation . \"%,\" . $lightness . \"%);\";\r\n}", "function calculateLuminosity($color) {\n if(is_array($color)) {\n $r = $color[0]; // red value\n $g = $color[1]; // green value\n $b = $color[2]; // blue value\n } else if(preg_match(\"/#/\",$color)) {\n $r = hexdec(substr($color, 0, 2)) / 255; // red value\n $g = hexdec(substr($color, 2, 2)) / 255; // green value\n $b = hexdec(substr($color, 4, 2)) / 255; // blue value\n }\n if ($r <= 0.03928) {\n $r = $r / 12.92;\n } else {\n $r = pow((($r + 0.055) / 1.055), 2.4);\n }\n if ($g <= 0.03928) {\n $g = $g / 12.92;\n } else {\n $g = pow((($g + 0.055) / 1.055), 2.4);\n }\n if ($b <= 0.03928) {\n $b = $b / 12.92;\n } else {\n $b = pow((($b + 0.055) / 1.055), 2.4);\n }\n $luminosity = 0.2126 * $r + 0.7152 * $g + 0.0722 * $b;\n return $luminosity;\n}", "static function _HLSToRGB($a_hls)\n\t{\n\t\t$h = $a_hls[\"h\"] / 255;\n\t\t$l = $a_hls[\"l\"] / 255;\n\t\t$s = $a_hls[\"s\"] / 255;\n\t\t\n\t\t$rgb[\"r\"] = $rgb[\"g\"] = $rgb[\"b\"] = 0;\n\t\t\n\t\t// If S=0, define R, G, and B all to L\n\t\tif ($s == 0)\n\t\t{\n\t\t\t$rgb[\"r\"] = $rgb[\"g\"] = $rgb[\"b\"] = $l;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\tif ($l < 0.5)\n\t\t\t{\n\t\t\t\t$temp2 = $l * (1.0 + $s);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$temp2 = $l + $s - $l * $s;\n\t\t\t}\n\n\t\t\t$temp1 = 2.0 * $l - $temp2;\n\t\t\t\n\n\t\t\t# For each of R, G, B, compute another temporary value, temp3, as follows:\n\t\t\tforeach ($rgb as $k => $v)\n\t\t\t{\n\t\t\t\tswitch ($k)\n\t\t\t\t{\n\t\t\t\t\tcase \"r\":\n\t\t\t\t\t\t$temp3 = $h + 1.0 / 3.0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase \"g\":\n\t\t\t\t\t\t$temp3 = $h;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase \"b\":\n\t\t\t\t\t\t$temp3 = $h - 1.0/3.0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($temp3 < 0)\n\t\t\t\t{\n\t\t\t\t\t$temp3 = $temp3 + 1.0;\n\t\t\t\t}\n\t\t\t\tif ($temp3 > 1)\n\t\t\t\t{\n\t\t\t\t\t$temp3 = $temp3 - 1.0;\n\t\t\t\t}\n\n\t\t\t\tif (6.0 * $temp3 < 1)\n\t\t\t\t{\n\t\t\t\t\t$rgb[$k] = $temp1 + ($temp2 - $temp1) * 6.0 * $temp3;\n\t\t\t\t}\n\t\t\t\telse if (2.0 * $temp3 < 1)\n\t\t\t\t{\n\t\t\t\t\t$rgb[$k] = $temp2;\n\t\t\t\t}\n\t\t\t\telse if (3.0 * $temp3 < 2)\n\t\t\t\t{\n\t\t\t\t\t$rgb[$k] = $temp1 + ($temp2 - $temp1) * ((2.0/3.0) - $temp3) * 6.0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$rgb[$k] = $temp1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$rgb[\"r\"] = round($rgb[\"r\"] * 255);\n\t\t$rgb[\"g\"] = round($rgb[\"g\"] * 255);\n\t\t$rgb[\"b\"] = round($rgb[\"b\"] * 255);\n\t\t\n\t\treturn $rgb;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the age column Example usage: $query>filterByAge(1234); // WHERE age = 1234 $query>filterByAge(array(12, 34)); // WHERE age IN (12, 34) $query>filterByAge(array('min' => 12)); // WHERE age > 12
public function filterByAge($age = null, $comparison = null) { if (is_array($age)) { $useMinMax = false; if (isset($age['min'])) { $this->addUsingAlias(AliMemberTableMap::COL_AGE, $age['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($age['max'])) { $this->addUsingAlias(AliMemberTableMap::COL_AGE, $age['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(AliMemberTableMap::COL_AGE, $age, $comparison); }
[ "private function applyUserAge($age)\n {\n $date = Carbon::now();\n $date->subYears($age);\n $year = $date->format('Y-m-d');\n\n $this->query->where('birth', '<', $date);\n }", "public function filterByAge($age = null, $comparison = null)\n {\n if (is_array($age)) {\n $useMinMax = false;\n if (isset($age['min'])) {\n $this->addUsingAlias(ClientTableMap::COL_AGE, $age['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($age['max'])) {\n $this->addUsingAlias(ClientTableMap::COL_AGE, $age['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientTableMap::COL_AGE, $age, $comparison);\n }", "public function filter(string $column, int $value)\n {\n $perPage = 3;\n $operator = '<=';\n if ($column == \"age_limit\") {\n if ($value == 0) {\n $operator = '>=';\n }\n return $this->blogRepositoryInterface->filter($column, $operator, $value, $perPage);\n }\n if ($value != 2) {\n $operator = '=';\n }\n return $this->blogRepositoryInterface->filter($column, $operator, $value, $perPage);\n }", "public function columnFilter(array $columns);", "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 filterByAgeClient($ageClient = null, $comparison = null)\n\t{\n\t\tif (is_array($ageClient)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($ageClient['min'])) {\n\t\t\t\t$this->addUsingAlias(TblClientPeer::AGE_CLIENT, $ageClient['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($ageClient['max'])) {\n\t\t\t\t$this->addUsingAlias(TblClientPeer::AGE_CLIENT, $ageClient['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(TblClientPeer::AGE_CLIENT, $ageClient, $comparison);\n\t}", "public function searchUserByAge($agefrom,$ageTo){\r\n \r\n $yearIntervalInSec = 60 * 60 * 24 * 365;\r\n \r\n //calc birthday range ( can be better )\r\n $fromDate = time() - $yearIntervalInSec * $ageTo;\r\n $toDate = time() - $yearIntervalInSec * $agefrom;\r\n\r\n $result = $this->DB->fetchAll('select * from user where birthday > ? and birthday < ? ',array($fromDate,$toDate));\r\n \r\n return $this->formatResult($result);\r\n }", "public function filterByUserAge($userAge = null, $comparison = null)\n {\n if (is_array($userAge)) {\n $useMinMax = false;\n if (isset($userAge['min'])) {\n $this->addUsingAlias(UserTableMap::COL_USER_AGE, $userAge['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($userAge['max'])) {\n $this->addUsingAlias(UserTableMap::COL_USER_AGE, $userAge['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserTableMap::COL_USER_AGE, $userAge, $comparison);\n }", "public function filter($sql);", "public function search($minAge, $maxAge, $gender){\r\n # Enter code here\r\n\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n $sql = \"SELECT * FROM person\r\n WHERE age >= :minAge AND age <= :maxAge\r\n \";\r\n\r\n if ($gender != 'a') {\r\n $sql .= \"AND gender = :gender\";\r\n }\r\n\r\n\r\n $stmt = $pdo->prepare($sql);\r\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\r\n\r\n $stmt->bindParam(\":minAge\", $minAge);\r\n $stmt->bindParam(\":maxAge\", $maxAge);\r\n\r\n if ($gender != 'a') {\r\n $stmt->bindParam(\":gender\", $gender);\r\n }\r\n\r\n $stmt->execute();\r\n\r\n $result = [];\r\n while($row = $stmt->fetch()){\r\n $result[] = new Person($row[\"name\"],$row[\"gender\"],$row[\"age\"]);\r\n }\r\n\r\n $stmt = null;\r\n $pdo = null;\r\n\r\n return $result;\r\n }", "public function filterValue($value, $filter);", "public static function searchByAge($data)\n {\n $age = $data['age'];\n $age_upto = $data['age_upto'];\n $query = DB::table('users')\n ->select('users.*','basic_details.*','user_profile_images.*')\n ->join('basic_details','basic_details.user_id','=','users.id')\n ->leftjoin('user_profile_images','users.id','=','basic_details.user_id');\n if ($data['age_upto']) \n {\n $query->whereBetween('basic_details.age',[$age,$age_upto]);\n }\n else\n {\n $query->where([\n ['basic_details.age','>=',$data['age']]\n ]);\n }\n\n $result = $query->where(['users.deleted_at' => NULL])->get();\n /*print_r($result);die();*/\n return $result;\n }", "public function filterRows()\n {\n if (!empty($this->request->query())) {\n $columns = $this->getGrid()->getColumns();\n $tableColumns = $this->getValidGridColumns();\n\n foreach ($columns as $columnName => $columnData) {\n // skip rows that are not to be filtered\n if (!$this->canFilter($columnName, $columnData)) {\n continue;\n }\n // user input check\n if (!$this->canUseProvidedUserInput($this->getRequest()->get($columnName))) {\n continue;\n }\n // column check. Since the column data is coming from a user query\n if (!$this->canUseProvidedColumn($columnName, $tableColumns)) {\n continue;\n }\n $operator = $this->extractFilterOperator($columnName, $columnData)['operator'];\n\n $this->doFilter($columnName, $columnData, $operator, $this->getRequest()->get($columnName));\n }\n }\n }", "function setFilterHAge($filterHAge)\n\t{\n\t\t$this->filterHAge=$filterHAge;\n\t}", "public function searchUserByAge($ageFrom,$ageTo){\n\n $ageQuery = \"\";\n \n if (empty($ageFrom) && empty($ageTo)){\n return \"\";\n }\n \n if (!empty($ageFrom) && !empty($ageTo)) {\n $ageQuery = \"?startkey={$ageFrom}&endkey={$ageTo}\";\n }\n \n if (!empty($ageFrom) && empty($ageTo)) {\n $ageQuery = \"?startkey={$ageFrom}\";\n }\n \n if (empty($ageFrom) && !empty($ageTo)) {\n $ageQuery = \"?endkey={$ageTo}\";\n }\n \n $json = $this->doGetRequest(\"/_design/app/_view/searchuser_age{$ageQuery}\");\n $result = json_decode($json, true);\n \n $result = $this->filterUserAry($result);\n \n return $result;\n }", "public function filter(Persons $persons);", "public function applyFilter(Query $query);", "function filterInt($field, $value) {\n if (($value = ltrim($value, '=')) !== '') {\n switch ($value[0]) {\n case '>': $this->where($field, '>', (int) substr($value, 1)); break;\n case '<': $this->where($field, '<', (int) substr($value, 1)); break;\n case '!': $this->where($field, '<>', (int) substr($value, 1)); break;\n default: $this->where($field, '=', (int) $value); break;\n }\n }\n }", "public function filter($value);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
///////////////// customtype implementation: returns an argument, ostensibly to be sent to a query for storage. number of indices must be determined form getFieldNames
public function getArgParam($index) { if ($index > 1) throw new data_exception("data_phone stores only 2 parameters"); return $this->args[$index]; }
[ "public function getArgument($index);", "public function getNamedTypeArgument($name);", "public function showOnIndex(): FieldInterface;", "public function getArgumentValue(string $name);", "protected function get_arg($arg){\n return $this->_args[$arg];\n }", "public function getQueryArrayItem($index);", "function value($arg = -1)\r\n {\r\n\t\tif ($arg == -1)\r\n {\r\n\t return $this->Array;\r\n\t\t}\r\n else\r\n {\r\n\t return $this->Array[$arg]->Value();\r\n\t\t}\r\n }", "public function getArgument($key);", "public function getArg($name);", "abstract protected function getArgumentName();", "function venture_pm_get_view_field($view, $item, $index) {\n $field = $view->field[$index]['queryname'];\n return $item->{$field};\n}", "function cubrid_field_type($result, $field_offset)\n{\n}", "function getValue($field,$where,$order='') {\n $row = $this->getData($field,'',$where,$order,1);\n if(is_array($field))\n $fieldname = key($field);\n else $fieldname = $field;\n return $row[$fieldname];\n }", "public function getFldIndex ()\n {\n return $this->fld_index;\n }", "public function getCustomParam(): Parameters;", "function getIndexType(){\r\n\t\treturn $this->indexed;\r\n\t}", "public function getNamedStringArgument($name);", "function getIndex($row, $indexField) {\n\t\tif (is_array($indexField)) {\n\t\t\t$indexVal = array();\n\t\t\tforeach ($indexField as $field) {\n\t\t\t\t$indexVal[] = $row[$field];\n\t\t\t}\n\t\t\t$indexVal = implode('_',$indexVal);\n\n\t\t} else {\n\t\t\t$indexVal = $row[$indexField];\n\t\t}\n\t\treturn $indexVal;\n\t}", "public function getNamedExpressionArgument($name);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation postPrototypeDestroyByIdComments Delete a related item by id for comments.
public function postPrototypeDestroyByIdComments($fk, $id) { list($response) = $this->postPrototypeDestroyByIdCommentsWithHttpInfo($fk, $id); return $response; }
[ "public function postPrototypeDestroyByIdComments($fk, $id)\n {\n list($response, $statusCode, $httpHeader) = $this->postPrototypeDestroyByIdCommentsWithHttpInfo ($fk, $id);\n return $response; \n }", "public function flagPrototypeDestroyComments($id)\n {\n list($response) = $this->flagPrototypeDestroyCommentsWithHttpInfo($id);\n return $response;\n }", "public function postPrototypeDestroyByIdCommentsWithHttpInfo($fk, $id)\n {\n \n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling postPrototypeDestroyByIdComments');\n }\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling postPrototypeDestroyByIdComments');\n }\n \n // parse inputs\n $resourcePath = \"/Posts/{id}/comments/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n \n \n \n // path params\n \n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }// path params\n \n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'DELETE',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n }\n \n throw $e;\n }\n }", "public function postPrototypeDeleteComments($id)\n {\n list($response) = $this->postPrototypeDeleteCommentsWithHttpInfo($id);\n return $response;\n }", "public function postPrototypeDestroyByIdCommentsWithHttpInfo($fk, $id)\n {\n // verify the required parameter 'fk' is set\n if ($fk === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $fk when calling postPrototypeDestroyByIdComments');\n }\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling postPrototypeDestroyByIdComments');\n }\n // parse inputs\n $resourcePath = \"/Posts/{id}/comments/{fk}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($fk !== null) {\n $resourcePath = str_replace(\n \"{\" . \"fk\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($fk),\n $resourcePath\n );\n }\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/Posts/{id}/comments/{fk}'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }", "public function delete_comments($id);", "public function commentPrototypeDestroyByIdFlags($fk, $id)\n {\n list($response, $statusCode, $httpHeader) = $this->commentPrototypeDestroyByIdFlagsWithHttpInfo ($fk, $id);\n return $response; \n }", "public function flagPrototypeDestroyCommentsWithHttpInfo($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling flagPrototypeDestroyComments');\n }\n // parse inputs\n $resourcePath = \"/Flags/{id}/comments\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/x-www-form-urlencoded','application/xml','text/xml'));\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n null,\n '/Flags/{id}/comments'\n );\n\n return array(null, $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n }", "public function deleteMediaComment($id, $commentID);", "public function postPrototypeUpdateByIdComments($fk, $id, $data = null)\n {\n list($response, $statusCode, $httpHeader) = $this->postPrototypeUpdateByIdCommentsWithHttpInfo ($fk, $id, $data);\n return $response; \n }", "public function deleteComment($commentId){\n\t\t\n\t}", "#[Route('/wishmap/{wishmapId}/comment/delete/{commentId}', name: 'delete_comment')]\n public function deleteComment(int $commentId, int $wishmapId,\n CommentsRepository $commentsRepository, WishMapRepository $wishMapRepository)\n {\n $comment = $commentsRepository->find($commentId);\n $wishMap = $wishMapRepository->find($wishmapId);\n\n $currentUserId = $this->getUser()->getId(); // current user\n $userId = $wishMap->getUser()->getId(); // user of wish map card\n $commentUserId = $comment->getSendUser()->getId(); // user, who sends comment to wish map card\n\n // if CURRENT USER not user of wish map card or who send this comment, cannot delete\n if ($userId != $currentUserId && $currentUserId != $commentUserId) {\n $this->addFlash('info',\n 'Chunchunmaru');\n return $this->redirect('/wishmap/' . $wishmapId . '/comments');\n }\n\n $entityManager = $this->getDoctrine()->getManager();\n $wishMap->getComments()->removeElement($comment);\n $entityManager->remove($comment);\n $entityManager->flush();\n\n $this->addFlash('info',\n 'Comment successfully deleted!');\n\n $response = new Response();\n return $response->send();\n }", "public function postPrototypeFindByIdComments($fk, $id)\n {\n list($response) = $this->postPrototypeFindByIdCommentsWithHttpInfo($fk, $id);\n return $response;\n }", "public function deleteComment($comment_id, $issue_id = null);", "public function deleteGalleryItemComment($id)\r\n {\r\n // TODO: Implement\r\n }", "public function flagPrototypeCreateComments($id, $data = null)\n {\n list($response) = $this->flagPrototypeCreateCommentsWithHttpInfo($id, $data);\n return $response;\n }", "public function deleteComment() {\n\t\tif (isset($_POST['commentId'])) {\n\t\t\t$commentId = (int) $_POST['commentId'];\n\t\t\tif ($commentId != 0) {\n\t\t\t\t$commentsManager = new CommentsManager();\n\t\t\t\t$commentsManager->deleteComment($commentId);\n\t\t\t\techo json_encode('success');\n\t\t\t} else {\n\t\t\t\techo json_encode('error');\n\t\t\t}\n\t\t} else {\n\t\t\techo json_encode('error');\n\t\t}\n\t}", "public function flagPrototypeDestroyReviews($id)\n {\n list($response) = $this->flagPrototypeDestroyReviewsWithHttpInfo($id);\n return $response;\n }", "public function postPrototypeFindByIdComments($fk, $id)\n {\n list($response, $statusCode, $httpHeader) = $this->postPrototypeFindByIdCommentsWithHttpInfo ($fk, $id);\n return $response; \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Configure the redis connection.
protected function configureRedis() { $config = [ 'REDIS_HOST' => null, 'REDIS_DATABASE' => null, 'REDIS_PORT' => null, ]; $config['REDIS_HOST'] = $this->ask('What is the host of your redis server?'); $config['REDIS_DATABASE'] = $this->ask('What is the name of the database that Cachet should use?'); $config['REDIS_PORT'] = $this->ask('What port should Cachet use?', 6379); foreach ($config as $setting => $value) { $this->writeEnv($setting, $value); } }
[ "protected function configureRedis()\n {\n $config = [\n 'REDIS_HOST' => null,\n 'REDIS_DATABASE' => null,\n 'REDIS_PORT' => null,\n ];\n\n $config['REDIS_HOST'] = $this->ask('What is the host of your redis server?');\n $config['REDIS_DATABASE'] = $this->ask('What is the name of the database that Assessment Suite should use?');\n $config['REDIS_PORT'] = $this->ask('What port should Assessment Suite use?', 6379);\n\n foreach ($config as $setting => $value) {\n $this->writeEnv($setting, $value);\n }\n }", "private function initRedis()\n\t{\n\t\tRedisWorkerAdapterFactory::createAdapter(self::$config[Config::REDIS_CONFIG]);\n\t}", "protected function setUpRedis() {}", "protected function _setup_redis()\r\n\t{\r\n\t\t$config = array();\r\n\t\t$CI =& get_instance();\r\n\t\tif ($CI->config->load('redis', TRUE, TRUE)) {\r\n\t\t $redis_center = $CI->config->item('redis');\r\n\t\t $reidis_conf = configcenter4_get_serv($redis_center['redis'][0], 0, 0);\r\n\t\t log_message('info', 'Cache: Redis config :'.$reidis_conf);\r\n\t\t $reids_conf = explode(':', $reidis_conf);\r\n\t\t $conf =array(\r\n\t\t 'socket_type' => 'tcp',\r\n\t\t 'host'\t\t\t=> $reids_conf[0],\r\n\t\t 'port'\t\t\t=> $reids_conf[1],\r\n\t\t 'timeout'\t\t=> '0',\r\n\t\t );\r\n\t\t\t$config += $conf;\r\n\t\t} else {\r\n\t\t log_message('error', 'Cache: Redis config error');\r\n\t\t}\r\n\t\t\r\n\t\t$config = array_merge(self::$_default_config, $config);\r\n\t\t$this->_redis = new Redis();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif ($config['socket_type'] === 'unix')\r\n\t\t\t{\r\n\t\t\t\t$success = $this->_redis->connect($config['socket']);\r\n\t\t\t}\r\n\t\t\telse // tcp socket\r\n\t\t\t{\r\n\t\t\t\t$success = $this->_redis->connect($config['host'], $config['port'], $config['timeout']);\r\n\t\t\t}\r\n\t\t\tif ( ! $success)\r\n\t\t\t{\r\n\t\t\t\tlog_message('debug', 'Cache: Redis connection refused. Check the config.');\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (RedisException $e)\r\n\t\t{\r\n\t\t\tlog_message('debug', 'Cache: Redis connection refused ('.$e->getMessage().')');\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tif (isset($config['password']))\r\n\t\t{\r\n\t\t\t$this->_redis->auth($config['password']);\r\n\t\t}\r\n\t\t// Initialize the index of serialized values.\r\n\t\t$serialized = $this->_redis->sMembers('_ci_redis_serialized');\r\n\t\tif ( ! empty($serialized))\r\n\t\t{\r\n\t\t\t$this->_serialized = array_flip($serialized);\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "public function init()\n {\n parent::init();\n $this->redis = Instance::ensure($this->redis, Connection::className());\n }", "public function __construct()\n {\n\n $this->redis = new \\Redis();\n $this->redis->connect('121.37.255.12', 6379, 60);\n $this->redis->auth('waHqes-nijpi8-ruwqex');\n\n }", "public function init()\n\t{\n\t\tparent::init();\n\t\tif (is_string($this->redis)) {\n\t\t\t$this->redis = Yii::$app->get($this->redis);\n\t\t} elseif (is_array($this->redis)) {\n\t\t\tif (!isset($this->redis['class'])) {\n\t\t\t\t$this->redis['class'] = Connection::className();\n\t\t\t}\n\t\t\t$this->redis = Yii::createObject($this->redis);\n\t\t}\n\t\tif (!$this->redis instanceof Connection) {\n\t\t\tthrow new InvalidConfigException(\"Counter::redis must be either a Redis connection instance or the application component ID of a Redis connection.\");\n\t\t}\n\t}", "public function connect() {\n\t\tif ($this->_connection) return ;\n\n\t\textract($this->_config['connection'] + array(\n\t\t\t\t\t\t'hostname'\t\t=> '127.0.0.1',\n\t\t\t\t\t\t'port'\t\t\t=> '6379',\n\t\t\t\t\t\t'persistent'\t=> FALSE,\n\t\t\t\t\t\t'timeout'\t\t=> 30,\n\t\t\t\t\t\t'options'\t\t=> array(\n\t\t\t\t\t\t\tRedis::OPT_SERIALIZER =>\n\t\t\t\t\t\t\t\t\t\t\tRedis::SERIALIZER_PHP,\n\t\t\t\t\t\t),\n\t\t\t\t\t));\n\t\ttry {\n\t\t\t$this->_connection = new \\Redis();\n\n\t\t\tif (!empty($this->_config['connection']['options'])) {\n\t\t\t\tforeach ($this->_config['connection']['options'] as\n\t\t\t\t\t\t\t$key => $val) {\n\t\t\t\t\t$this->_connection->setOption($key, $val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($persistent) {\n\t\t\t\t$this->_connection->pconnect(\n\t\t\t\t\t\t\t\t\t$hostname, $port, $timeout);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->_connection->connect(\n\t\t\t\t\t\t\t\t\t$hostname, $port, $timeout);\n\t\t\t}\n\t\t} catch (RedisException $e) {\n\t\t\t$this->_connection = NULL;\n\t\t\tthrow new KVS_Exception(':error',\n\t\t\t\t\t\tarray(':error' => $e->getMessage()),\n\t\t\t\t\t\t$e->getCode());\n\t\t}\n\t}", "protected function initRedis()\n {\n $this->setRedisValue(1);\n }", "protected function bootstrap_redis() {\n global $CFG;\n\n if (!class_exists('Redis')) {\n throw new \\coding_exception('Redis class not found, Redis PHP Extension is probably not installed');\n }\n if (empty($CFG->auth_saml2_redis_server)) {\n throw new \\coding_exception('Redis connection string is not configured in $CFG->auth_saml2_redis_server');\n }\n\n try {\n $redis = new \\Redis();\n $redis->connect($CFG->auth_saml2_redis_server);\n } catch (\\RedisException $e) {\n throw new \\coding_exception(\"RedisException caught with message: {$e->getMessage()}\");\n }\n\n if (!$redis->setOption(\\Redis::OPT_PREFIX, $this->prefix)) {\n throw new \\coding_exception('Could not set Redis prefix option: ' . $this->prefix);\n }\n if (!$redis->setOption(\\Redis::OPT_SERIALIZER, \\Redis::SERIALIZER_PHP)) {\n throw new \\coding_exception('Could not set Redis serializer option to PHP Serializer');\n }\n return $redis;\n }", "private static function init()\n {\n if (is_null(self::$redis)) {\n $redis = new \\Redis();\n\n $redis->connect(\n '127.0.0.1',\n '6379'\n );\n\n self::$redis = $redis;\n }\n }", "public function redisConnection() {\n return $this->app['config']->get('laravel-compleet::redis');\n }", "private function __construct() \n {\n self::$redisInstance = new Predis\\Client('tcp://127.0.0.1:6379');\n }", "private final function __construct()\n {\n try {\n self::$redisClient = new Predis\\Client([\n 'scheme' => 'tcp',\n 'host' => $this->host,\n 'port' => $this->port,\n ]);\n } catch (\\Exception $e) {\n die($e->getMessage());\n }\n }", "public function __construct ($options = array()) {\n $accept = array('host', 'port', 'auth', 'channel');\n foreach ($options as $key => $value) {\n if (in_array($option, $accept)) {\n $this[$key] = $value;\n }\n }\n\n $this->_client = new \\redisent\\Redis(\n $this->host,\n $this->port\n );\n\n if ($this->auth) {\n $this->_client->auth(\n $this->auth\n );\n }\n }", "public function init()\n {\n if (is_string($this->redis)) {\n $this->redis = Yii::$app->get($this->redis);\n } elseif (is_array($this->redis)) {\n if (!isset($this->redis['class'])) {\n $this->redis['class'] = Connection::className();\n }\n $this->redis = Yii::createObject($this->redis);\n }\n if (!$this->redis instanceof Connection) {\n throw new InvalidConfigException(\"Session::redis must be either a Redis connection instance or the application component ID of a Redis connection.\");\n }\n if ($this->keyPrefix === null) {\n $this->keyPrefix = substr(md5(Yii::$app->id), 0, 5);\n }\n //parent::init();\n if ($this->getIsActive()) {\n Yii::warning('Session is already started', __METHOD__);\n $this->updateFlashCounters();\n }\n }", "protected function getRedisAdapter()\n {\n }", "private function buildRedis(array $config)\n {\n return new RedisConnectionFactory($config);\n }", "public function __construct()\n {\n $this->pool = new RedisPool();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the default locale.
public static function getDefaultLocale(): string { return self::instance()->defaultLocale; }
[ "public function getDefaultLocale(): string\n {\n return $this->defaultLocale;\n }", "public static function getDefaultLocale(): string\n {\n return self::proxy()->getDefaultLocale();\n }", "public function getDefaultLocale()\n {\n return $this->defaultLocale;\n }", "public function getDefaultLocale()\n {\n /** @var \\Illuminate\\Config\\Repository $config */\n $config = $this->application->make('config');\n\n return $config->get('app.locale');\n }", "function getDefaultLocale()\n {\n return $this->getLanguagesArray()[0][0];\n }", "public function getDefaultLocale()\n {\n return $this->config->get('app.fallback_locale');\n }", "public function getDefault()\n {\n return IntlLocale::getDefault();\n }", "private function getDefaultLocale() {\n\t\treturn craft()->i18n->getPrimarySiteLocale();\n\t}", "public function defaultLocale()\n {\n $locale = $this->getCore()->config('locale.translation-default');\n\n if ($locale) {\n return $locale;\n }\n\n // Fall back to default based on CMS configuration and app locale.\n $locale = app()->getLocale();\n $available = $this->availableLocales();\n\n // If no translation locales are set, use app's locale as default.\n // If current app locale is available, use it as default.\n if ( ! count($available) || in_array($locale, $available)) {\n return $locale;\n }\n\n return head($available);\n }", "public function getDefaultSystemLocale()\n\t{\n\t\treturn $this->_defaultSystemLocale;\n\t}", "function default_locale()\n { \n return config('localization.default_locale', env('LOCALE', 'fa')); \n }", "private function defaultLocale()\n {\n return $this->data->get($this->default_locale);\n }", "public function getLocale()\n {\n return $this['config']->get('app.locale') ?: \\get_locale();\n }", "public static function getLocale()\n\t\t{\n\t\t\tif (is_null(static::$_locale)) return static::$_defaultLocale;\t\t\t\n\t\t\treturn static::$_locale;\n\t\t}", "public function getLocale()\r\n {\r\n if ($this->currentLocale !== null) {\r\n return $this->currentLocale;\r\n }\r\n return $this->defaultLocale;\r\n }", "public static function getDefaultLanguage()\n {\n if(isset($_SESSION['site']['default_localization'])){\n return $_SESSION['site']['default_localization'];\n }else{\n return 'en_US';\n }\n }", "public function getDefaultLocale()\n {\n // Check configuration first\n $defaultLocale = SpellController::config()->get('default_locale');\n if ($defaultLocale) {\n return $defaultLocale;\n }\n\n // Grab the first one in the list\n $locales = SpellController::get_locales();\n if (empty($locales)) {\n return false;\n }\n return reset($locales);\n }", "public static function getDefault() {\n\t\tif ( !static::$default ) {\n\t\t\tstatic::$default = static::getInstance( Locale::getDefault() );\n\t\t}\n\t\treturn static::$default;\n\t}", "public function getLocale()\n {\n return $this['config']->get('app.locale');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reads the target table, yielding rows as associative arrays.
private function readTargetTable(TargetTable $targetTable): Generator { $query = 'SELECT * FROM ' . $this->driver->getTableIdentifier($targetTable->table); if ($targetTable->conditions !== null) { $query .= ' ' . $targetTable->conditions; } $statement = $this->pdo->query($query); while (false !== $row = $statement->fetch(PDO::FETCH_ASSOC)) { /** @psalm-var non-empty-array<string, scalar|null> $row */ yield $row; } }
[ "public function readAll() : array\n {\n $result = $this->db->query('SELECT * FROM ' . $this->tablename);\n\n return $this->readQuery($result);\n }", "function readTable(string $tableName): array\r\n {\r\n $results = $this->querySimpleExecute('select * from ' . $tableName);\r\n $results = $this->formatData($results);\r\n return $results;\r\n }", "public function readAll()\n {\n if (!$this->reader) {\n $this->init();\n }\n \n $rows = array();\n foreach ($this as $row) {\n $rows[] = $row;\n }\n return $rows;\n }", "public function readRow()\n\t{\n\t\t\n\t}", "public function read_table()\n {\n $this->bitcount = $this->bits = 0;\n $tlen = $this->read_php_int();\n\n if ($tlen < 0) {\n throw new Rabbit_Exception(\n Rabbit_Exception::ERROR_SERIALIZE_TABLE\n );\n }\n\n $table_data = new Rabbit_AMQP_Serialize_Read($this->rawread($tlen));\n $result = array();\n\n while ($table_data->tell() < $tlen) {\n $name = $table_data->read_shortstr();\n $ftype = $table_data->rawread(1);\n if ($ftype == 'S') {\n $val = $table_data->read_longstr();\n } else if ($ftype == 'I') {\n $val = $table_data->read_signed_long();\n } else if ($ftype == 'D') {\n $e = $table_data->read_octet();\n $n = $table_data->read_signed_long();\n $val = new Rabbit_AMQP_Serialize_Decimal($n, $e);\n } else if ($ftype == 'T') {\n $val = $table_data->read_timestamp();\n } else if ($ftype == 'F') {\n $val = $table_data->read_table(); // recursion\n } else {\n $val = NULL;\n }\n $result[$name] = array(\n $ftype, $val\n );\n }\n\n return $result;\n }", "public function getTableAsArray();", "public function readTable()\n {\n $sql = \"SELECT Cubans.Id, FirstName, LastName, Gender, YearOfBirth, \n `Name`, IsInGroup FROM Cubans\n JOIN Genre ON Cubans.IdGenre=Genre.id\";\n $statement = $this->connect->prepare($sql);\n $statement->execute();\n return $statement->fetchAll();\n }", "function importData() {\n $rows = parent::importData();\n\n $extendedRows = array();\n $prefix = $this->getPrefix();\n foreach ($rows as $row) {\n foreach ($row as $columnName => $data) {\n if (strpos($data, $prefix) === 0) { // found prefix\n $filename = substr($data, strlen($prefix));\n $fullPath = $this->getFullPath($columnName, $filename);\n\n if (!file_exists($fullPath)) {\n throw new IOException(\"Can't locate file \\\"$filename\\\" for reading\");\n }\n\n $content = file_get_contents($fullPath);\n $row[$columnName] = $content;\n }\n // TODO: check for array\n }\n\n array_push($extendedRows, $row);\n }\n\n return $extendedRows;\n }", "public function read_table($returnObject = false)\n {\n $this->resetCounters();\n $tlen = $this->read_php_int();\n\n if ($tlen < 0) {\n throw new AMQPOutOfBoundsException('Table is longer than supported');\n }\n\n $table_data = new AMQPReader($this->rawread($tlen), null);\n $result = $returnObject ? new AMQPTable() : array();\n\n while ($table_data->tell() < $tlen) {\n $name = $table_data->read_shortstr();\n $ftype = AMQPAbstractCollection::getDataTypeForSymbol($ftypeSym = $table_data->rawread(1));\n $val = $table_data->read_value($ftype, $returnObject);\n $returnObject ? $result->set($name, $val, $ftype) : $result[$name] = array($ftypeSym, $val);\n }\n\n return $result;\n }", "public function get_assoc_array(){\n\t\t$this->execute();\n\t\treturn $this->statement->fetchAll(PDO::FETCH_ASSOC);\n\t}", "function table_to_array($table) {\n\t$response = array(); $row_count = 0;\n\n\twhile ($row = mysql_fetch_assoc($table)) {\n\t\tforeach($row as $column => $value) {\n\t\t\t$response[$row_count][$column] = $value;\n\t\t}\n\t\t++$row_count;\n\t}\n\treturn $response;\n}", "public function getRows();", "private function table_data()\n {\n return $this->_logger->fetchAll();\n }", "public function fetchAllAssoc()\n {\n $res = $this->statement->fetchAll();\n foreach ($res as $rowName => $row) {\n $firstVal = '';\n foreach ($row as $col => $val) {\n if ($val = $row[0]) {\n $firstVal = $val;\n }\n if (is_numeric($col)) {\n unset($res[$rowName][$col]);\n }\n }\n $res[$firstVal] = $res[$rowName];\n unset($res[$rowName]);\n }\n return $res;\n }", "public function read($table){\n $readResult = array();\n $connection = new mysqli($this -> hostname, $this -> username, $this -> password, $this -> database);\n if ($connection -> connect_error) {\n die(\"Connection failed: \".$connection -> connect_errno);\n }\n $query = \"SELECT * FROM $table\";\n $result = $connection -> query($query);\n if ($result -> num_rows > 0) {\n while($row = $result -> fetch_assoc()) {\n array_push($readResult, $row);\n }\n }\n $connection -> close();\n return $readResult;\n }", "function readRow(){\r\n \r\n }", "public function readRow(): ?array;", "public function getIteratorRow () {}", "function _readTableStructure($options = array()){\n\t\t$accessor_class = \"TableRecord_DatabaseAccessor_\".$this->dbmole->getDatabaseType();\n\t\treturn $accessor_class::ReadTableStructure($this,$options);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns value from CUSTOM_19.
public function getCustom19(){ return $this->_dataArray[ProspectProps::CUSTOM_19]; }
[ "public function getCustomValue()\n {\n return $this->customValue;\n }", "public function getCustom14(){\n return $this->_dataArray[ProspectProps::CUSTOM_14];\n }", "public function getCustom16(){\n return $this->_dataArray[ProspectProps::CUSTOM_16];\n }", "public function getCustom10(){\n return $this->_dataArray[ProspectProps::CUSTOM_10];\n }", "public function getCustom01(){\n return $this->_dataArray[ProspectProps::CUSTOM_01];\n }", "public function getCustomsValue()\n {\n return $this->CustomsValue;\n }", "public function getCustom08(){\n return $this->_dataArray[ProspectProps::CUSTOM_08];\n }", "public function getCustom03(){\n return $this->_dataArray[ProspectProps::CUSTOM_03];\n }", "public function getCustom1()\n {\n $value = $this->get(self::CUSTOM1);\n return $value === null ? (string)$value : $value;\n }", "abstract public function getCustomValueQuestion();", "public function getBusinessValue();", "public function getValue();", "public function getCustom07(){\n return $this->_dataArray[ProspectProps::CUSTOM_07];\n }", "public function getCustomField9()\n {\n return $this->CustomField9;\n }", "public function getOther19()\n {\n return $this->other19;\n }", "public function getCustomerCustom1()\n {\n $value = $this->get(self::CUSTOMERCUSTOM1);\n return $value === null ? (string)$value : $value;\n }", "public function getCustomField11() {\n return $this->CustomField11;\n }", "public function getCustomValueUnwrapped()\n {\n return $this->readWrapperValue(\"custom_value\");\n }", "public function getCustomerCustom2()\n {\n $value = $this->get(self::CUSTOMERCUSTOM2);\n return $value === null ? (string)$value : $value;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To more easily process a file repository based on Mime Types, it's sometimes easier to tokenize a mimetype and process using the tokens (e.g. if you have a directory of image icons that you want to map back to a mime type or a collection of mime types, a tokenizedversion of the mime type would be more appropriate). Given a stringbased mime type, this will return a "tokenized" version of the mime type, which only consists of lower case characters and underscores (_).
public static function GetTokenForMimeType($strMimeType) { $strMimeType = strtolower($strMimeType); $strToReturn = ''; $intLength = strlen($strMimeType); for ($intIndex = 0; $intIndex < $intLength; $intIndex++) { $strCharacter = $strMimeType[$intIndex]; if ((ord($strCharacter) >= ord('a')) && (ord($strCharacter) <= ord('z'))) $strToReturn .= $strCharacter; else if ($strCharacter == '/') $strToReturn .= '_'; } return $strToReturn; }
[ "function get_mime_class($mime)\n{\n if (empty($mime) || is_null($mime)) {\n return 'mime mime-file';\n }\n $_temp_mime = explode('/', $mime);\n $part1 = $_temp_mime[0];\n $part2 = $_temp_mime[1];\n\n // Image\n if ($part1 == 'image') {\n if (strpos($part2, 'photoshop') !== false) {\n return 'mime mime-photoshop';\n }\n return 'mime mime-image';\n } else if ($part1 == 'audio') {\n // Audio\n return 'mime mime-audio';\n } else if ($part1 == 'video') {\n // Video\n return 'mime mime-video';\n } else if ($part1 == 'text') {\n // Text\n return 'mime mime-file';\n } else if ($part1 == 'application') {\n if ($part2 == 'pdf') {\n // Pdf\n return 'mime mime-pdf';\n } else if ($part2 == 'illustrator') {\n // Ilustrator\n return 'mime mime-illustrator';\n } else if ($part2 == 'zip' || $part2 == 'gzip' || strpos($part2, 'tar') !== false || strpos($part2, 'compressed') !== false) {\n // Zip\n return 'mime mime-zip';\n } else if (strpos($part2, 'powerpoint') !== false || strpos($part2, 'presentation') !== false) {\n // PowerPoint\n return 'mime mime-powerpoint ';\n } else if (strpos($part2, 'excel') !== false || strpos($part2, 'sheet') !== false) {\n // Excel\n return 'mime mime-excel';\n } else if ($part2 == 'msword' || $part2 == 'rtf' || strpos($part2, 'document') !== false) {\n // Word\n return 'mime mime-word';\n } else {\n // Else\n return 'mime mime-file';\n }\n } else {\n return 'mime mime-file';\n }\n}", "function get_mime_class($mime)\r\n{\r\n if (empty($mime) || is_null($mime)) {\r\n return 'mime mime-file';\r\n }\r\n $_temp_mime = explode('/', $mime);\r\n $part1 = $_temp_mime[0];\r\n $part2 = $_temp_mime[1];\r\n // Image\r\n if ($part1 == 'image') {\r\n if (strpos($part2, 'photoshop') !== false) {\r\n return 'mime mime-photoshop';\r\n }\r\n ;\r\n return 'mime mime-image';\r\n }\r\n // Audio\r\n else if ($part1 == 'audio') {\r\n return 'mime mime-audio';\r\n }\r\n // Video\r\n else if ($part1 == 'video') {\r\n return 'mime mime-video';\r\n }\r\n // Text\r\n else if ($part1 == 'text') {\r\n return 'mime mime-file';\r\n }\r\n // Applications\r\n else if ($part1 == 'application') {\r\n // Pdf\r\n if ($part2 == 'pdf') {\r\n return 'mime mime-pdf';\r\n }\r\n // Ilustrator\r\n else if ($part2 == 'illustrator') {\r\n return 'mime mime-illustrator';\r\n }\r\n // Zip\r\n else if ($part2 == 'zip' || $part2 == 'gzip' || strpos($part2, 'tar') !== false || strpos($part2, 'compressed') !== false) {\r\n return 'mime mime-zip';\r\n }\r\n // PowerPoint\r\n else if (strpos($part2, 'powerpoint') !== false || strpos($part2, 'presentation') !== false) {\r\n return 'mime mime-powerpoint ';\r\n }\r\n // Excel\r\n else if (strpos($part2, 'excel') !== false || strpos($part2, 'sheet') !== false) {\r\n return 'mime mime-excel';\r\n }\r\n // Word\r\n else if ($part2 == 'msword' || $part2 == 'rtf' || strpos($part2, 'document') !== false) {\r\n return 'mime mime-word';\r\n }\r\n // Else\r\n else {\r\n return 'mime mime-file';\r\n }\r\n }\r\n // Else\r\n else {\r\n return 'mime mime-file';\r\n }\r\n}", "function get_file_type_from_mimetype($mimetype)\n{\n return explode('/', $mimetype)[1];\n}", "function mimetype_from_filename(string $filename)\n{\n return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION));\n}", "function healthgovau_get_friendly_mime($mimetype) {\n $descriptions = [\n 'application/pdf' => '<abbr title=\"Portable Document Format\">PDF</abbr>',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => '<abbr title=\"Microsoft Word document\">Word</abbr>',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => '<abbr title=\"Microsoft Excel document\">Excel</abbr>',\n 'text/plain' => 'plain text',\n 'image/jpeg' => '<abbr title=\"Joint Photographic Experts Group\">JPEG</abbr>',\n 'image/png' => '<abbr title=\"Portable Network Graphics\">PNG</abbr>',\n 'image/gif' => '<abbr title=\"Graphics Interchange Format\">GIF</abbr>',\n 'video/mp4' => '<abbr title=\"MPEG-4 Part 14\">MP4</abbr>',\n 'audio/mpeg' => '<abbr title=\"MPEG-1 Audio Layer III\">MP3</abbr>',\n ];\n if (array_key_exists($mimetype, $descriptions)) {\n return $descriptions[$mimetype];\n }\n return $mimetype;\n}", "function mime_content_type ($filename) {}", "function mime_content_type($filename){}", "static function findMimeType( $file_type ) {\n switch( strtolower( $file_type ) ) {\n case 'html':\n case 'htm':\n $mime = 'text/html';\n break;\n case 'text':\n case 'md':\n case 'markdown':\n case 'txt':\n $mime = 'text/plain';\n break;\n case 'css':\n $mime = 'text/css';\n break;\n case 'js':\n case 'javascript':\n $mime = 'text/javascript';\n break;\n case 'jpg':\n case 'jpeg':\n $mime = 'image/jpeg';\n break;\n case 'gif':\n $mime = 'image/gif';\n break;\n case 'png':\n $mime = 'image/png';\n break;\n case 'pdf':\n $mime = 'application/pdf';\n break;\n default:\n $mime = 'application/octet-stream';\n break;\n }\n return $mime;\n }", "function derive_mimetype($name)\n{\n global $config_doc_root;\n include(\"$config_doc_root/config/mimetype_map.php\");\n\n //if name is stringtype derive mime through names tail\n if(is_string($name) && isset($mimetype_map[strrchr($name, '.')]))\n $mimetype = $mimetype_map[strrchr($name, '.')];\n\n //if name is array derive mime through names tail or directly over mimetype\n else if(is_array($name))\n {\n if(isset($name[DOC_MIME_TYPE]) && trim($name[DOC_MIME_TYPE]) != \"\")\n $mimetype = $name[DOC_MIME_TYPE];\n else if(isset($name[OBJ_NAME]))\n $mimetype = $mimetype_map[strrchr($name[OBJ_NAME], '.')];\n else\n $mimetype = \"\";\n }\n\n //if failed => no mimetype\n else\n $mimetype = \"\";\n\n return $mimetype;\n}", "function mime($x)\n {\n if(!isText($x,1)){return;}; $x=trim($x); if(!$x){return;};\n if(isPath($x)){$x=path::type($x);}elseif(isin($x,'.')){$x=rstub($x,'.')[2]; $x=trim($x); if(!$x){return;}};\n $r=conf('Proc/mimeType')->$x; return $r;\n }", "public function guessExtensionForMimeType(string $type): string;", "public function getFileType()\n {\n if (!$this->mime || $this->mime === 'directory' || $this->mime === 'dir') {\n return 'dir';\n }\n\n foreach ($this->mimes as $mime => $mime_values) {\n $key = collect($mime_values)->search(function ($mime_value) {\n return preg_match($mime_value, $this->mime);\n });\n\n if ($key !== false) {\n return $mime;\n }\n }\n\n return 'file';\n }", "function sanitize_mime_type($mime_type)\n{\n}", "function mime_content_type($filename): string|false {}", "function getFileType($file_name)\n{\n $file = explode('/', $file_name->getMimeType());\n $fileType = isset($file[0]) ? $file[0] : '';\n if ($fileType == \"application\") {\n $fileType = \"file\";\n }\n return $fileType;\n}", "function sanitize_mime_type($mime_type)\n {\n }", "function getContentType($file)\n{\n $type ='';\n\n // guess the content type based on the suffix\n $suffix = strrchr($file, \".\");\n switch($suffix)\n {\n case '.pdf':\n $type = \"application/pdf\";\n break;\n case '.doc':\n $type = \"application/msword\";\n break;\n case '.s19':\n default:\n $type = \"text/plain\";\n }\n return $type;\n}", "protected function parseMimeType(): string\n {\n $mime = ($this->utf8) ? $this->mime . \"; charset=utf-8 ;\" : $this->mime;\n\n return $mime;\n }", "function getFileExtList($str) {\n $mimeTypes = array_filter(cockpit()->response::$mimeTypes, function($v) use($str) {\n return substr($v, 0, strlen($str)) == $str;\n });\n\n return implode(', ', array_keys($mimeTypes));\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ / /Method Name: appusers /Description: CreateUpdate Post Method / /
public function createupdateappuser() { $logger = Logger::getLogger(__CLASS__); try { $taskCode = "AppUsers"; $this->LogAccess($taskCode); $authResult = $this->Authorize($taskCode); if ($authResult == "LOGIN") { return $this->view->outputJson(Constants::$LOGIN, "", ""); } $_AppUserRequestHelper = new AppUserRequestHelper(); $_AppUser = $_AppUserRequestHelper->AssembleAppUserSignUpControl(); $AppUserID = 0; if(isset($_GET["rstate"]) && !empty($_GET["rstate"])) { $AppUserID = RequestStateHelper::GetRequestState("AppUserID", $_GET["rstate"]); } $_AppUser->setAppUserID($AppUserID); $_AppUser->setRequestStateDictionary(RequestStateHelper::SetRequestState("AppUserID", $_AppUser->getAppUserID(), $_AppUser->getRequestStateDictionary())); $_AppUserBO = new AppUserBO($this->_UserInfo); $_AppUserValidator = new AppUserValidator(); $_AppUserValidator->ValidateAppUserSignUpControl($_AppUser, $this->_UserInfo); if (!$_AppUser->getIsValid()) { return $this->view->outputJson(Constants::$VALERROR, "", $_AppUser->getErrors()); } else { if ($_AppUser->getAppUserID() > 0) { $_AppUserBO->UpdateAppUser($_AppUser); } if ($_AppUser->getAppUserID() == 0) { $_AppUser->setPassword(CommonUtils::EncryptTripleDES($_AppUser->getPassword())); $_AppUserBO->InsertAppUser($_AppUser); } $_AppUser->setPageMessage("Record Updated Successfully!"); $_AppUser->setRequestState("ContextName", "appusers"); ob_start(); include('views/appuser/_appusersconfirmation.php'); $output = ob_get_contents(); ob_end_clean(); return $this->view->outputJson(Constants::$REFRESHCONTENT, $output, ""); } } catch (Exception $ex) { $logger->error($ex->getMessage()); } }
[ "public function systemusers_post()\n {\n $email=$this->post('UserEmail');\n $password=sha1($this->post('UserPass'));\n $add_data = array(\n\n 'UserFirstName' => $this->post('UserFirstName'),\n 'UserLastName' => $this->post('UserLastName'),\n 'UserEmail' => $this->post('UserEmail'),\n 'UserType' =>1,\n 'UserState' => 1,\n 'UserAddress' => $this->post('UserAddress'),\n 'UserPass' => $this->post('UserPass') //sha1($this->post('UserPass')),\n );\n $this->Systemusers_mdl->add_systemusers($add_data);\n $this->Systemusers_mdl->validate_user($email, $password);\n $message = [\n\n 'message' => 'Added a resource',\n ];\n $this->set_response($message, REST_Controller::HTTP_CREATED); // CREATED (201) being the HTTP response code\n\n }", "public function postAdminApplication() {\n $viewDataController = new ViewDataController();\n\n $data = $viewDataController->buildData();\n\n $input = Request::all();\n\n $user_id = $data['user_id'];\n\n try {\n\n if ( isset($input['admin-profile-photo']) ) { \n $response = $this->generalUploadDoc($input, 'admin-profile-photo', 'asset.plexuss.com/users/images');\n\n $profile_img_loc = $response['saved_as'];\n }\n\n } catch (\\Exception $e) {\n\n }\n\n $user = User::find($user_id);\n\n if (isset($input['country_code']) && isset($input['phone_number'])) {\n $phone = $input['country_code'] . ' ' . $input['phone_number'];\n $user->phone = $phone;\n }\n\n $user->fname = $input['fname'];\n $user->lname = $input['lname'];\n\n if (isset($profile_img_loc))\n $user->profile_img_loc = $profile_img_loc;\n\n $user->save();\n\n $response = CollegeSelfSignupApplications::insertOrUpdate($user_id, $input);\n\n $mac = new MandrillAutomationController;\n $mac->collegesSelfSignUpRequest($user_id);\n\n return $response;\n }", "public function saveUsersAction()\r\n\t{\r\n\t\tif($this->getRequest()->isPost()) {\r\n\t\t\t//\r\n\t\t\t$data=$this->getRequest()->getPost()->users;\r\n\t\t\t$users=$this->getModelUser()->update($data);\r\n\t\t $generator = new \\Application\\Generator\\Xml();\r\n $requestConfig = new RequestConfig();\r\n $request = new Request($requestConfig->getByAlias('updateUsers'), $this->getServiceLocator());\r\n\t\t//echo \"<head>header('Content-Type: application/xml')</head>\";\r\n\t\t//echo $generator->generateUpdateUser($users);die();\r\n $request->setBody($generator->generateUpdateUser($users));\r\n $response = $request->request();\r\n if($response->isSuccess()) {\r\n\t\t\t\techo \"OK\";die();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function testUpdateUser()\n {\n }", "public function actionUpdate()\n {\n $post = Yii::$app->request->post();\n\n if(!isset($post['id'])) return $this->createErrorResponse('param id is missing');\n\n $model = $this->findModel($post['id']);\n $model->setScenario(User::SCENARIO_USER_API_UPDATE);\n\n if($model) {\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->setPassword($model->password);\n $model->setRole($model->role);\n\n if ($model->validate()) {\n\n if ($model->save()) {\n\n return $this->createSuccessResponse($model);\n }\n\n } else {\n\n return $this->createErrorResponse($model->getErrors());\n\n }\n\n }\n }\n\n return $this->createErrorResponse('user not found');\n\n }", "public function create_user() {\n global $json_api;\n\n $this->_verify_admin();\n\n $updating = (isset($_REQUEST['id']));\n\n // Only Require these if we're updating\n if(!$updating) {\n if(!isset($_REQUEST['user_login']))\n $json_api->error(\"You need to pass a value for 'user_login'.\");\n\n if(!isset($_REQUEST['user_password']))\n $json_api->error(\"You need to pass a value for 'user_password'.\");\n\n if(!isset($_REQUEST['user_email']))\n $json_api->error(\"You need to pass a value for 'user_email'.\");\n\n if( email_exists( $_REQUEST[ 'user_email' ] ) )\n $json_api->error(__(\"This email address already exists\"));\n\n $this->_verify_nonce('create_user');\n }\n else\n $this->_verify_nonce('update_user');\n\n nocache_headers();\n\n require_once(ABSPATH . WPINC . '/registration.php');\n \n if(isset($_REQUEST['user_password']))\n $password = $_REQUEST['user_password'];\n else\n $password = wp_generate_password( 12, false );\n\n $userdata = array( \"user_pass\" => $password,\n \"user_login\" => $_REQUEST['user_login'],\n \"user_email\" => $_REQUEST['user_email'] );\n\n if($updating and isset($_REQUEST['id']))\n $userdata['ID'] = $_REQUEST['id'];\n\n if(isset($_REQUEST['user_nicename']))\n $userdata['user_nicename'] = $_REQUEST['user_nicename'];\n\n if(isset($_REQUEST['user_url']))\n $userdata['user_url'] = $_REQUEST['user_url'];\n\n if(isset($_REQUEST['display_name']))\n $userdata['display_name'] = $_REQUEST['display_name'];\n\n if(isset($_REQUEST['nickname']))\n $userdata['nickname'] = $_REQUEST['nickname'];\n\n if(isset($_REQUEST['first_name']))\n $userdata['first_name'] = $_REQUEST['first_name'];\n\n if(isset($_REQUEST['last_name']))\n $userdata['last_name'] = $_REQUEST['last_name'];\n\n if(isset($_REQUEST['description']))\n $userdata['description'] = $_REQUEST['description'];\n\n if(isset($_REQUEST['rich_editing']))\n $userdata['rich_editing'] = $_REQUEST['rich_editing'];\n\n if(isset($_REQUEST['user_registered']))\n $userdata['user_registered'] = $_REQUEST['user_registered'];\n\n if(isset($_REQUEST['role']))\n $userdata['role'] = $_REQUEST['role'];\n\n if(isset($_REQUEST['jabber']))\n $userdata['jabber'] = $_REQUEST['jabber'];\n\n if(isset($_REQUEST['aim']))\n $userdata['aim'] = $_REQUEST['aim'];\n\n if(isset($_REQUEST['yim']))\n $userdata['yim'] = $_REQUEST['yim'];\n\n $user_id = wp_insert_user( $userdata );\n\n if($updating)\n $user_id = $_REQUEST['id'];\n\n if (empty($user_id))\n $json_api->error(__(\"Could not create user.\"));\n\n $user = get_userdata($user_id);\n\n return array( 'user' => $user );\n }", "public function saveAction(){\n\t\t$request = $this->_request->getParams();\n\t\t$oValidationHelper = new Helpers_Usermanagement_Validate();\n\t\t\n\t\t$error = false;\n\t\tif(!$oValidationHelper->ifEmailAvailable($request['user_email'],$this->_auth->user_id)){\n\t\t\t$error = true;\n\t\t\t$this->_messages->setMessage('User with such email already exists','error','user_email');\n\t\t}\n\n\t\tif(!$oValidationHelper->ifUsernameAvailable($request['user_login'],$this->_auth->user_id)){\n\t\t\t$this->_messages->setMessage('User with such username already exists','error','user_login');\n\t\t\t$error = true;\n\t\t}\n\t\t\t\t\n\t\tif($this->_validator->validate('registration_form',$request) && !$error){\n\t\t\t\n\t\t\tif($request['user_email']!=$this->_auth->user_email){\n\t\t\t\t$request['user_confirmation_code'] = md5(time()+rand(10000,99999));\n\t\t\t\t$request['user_active'] = 0;\n\t\t\t\t$this->_sendConfirmationEmail($request['user_email'],$request['user_login'],$request['user_confirmation_code']);\n\t\t\t\t$this->_messages->setMessage('WARNING!!! Your email has been changed and your account has been disabled. Instructions on how to activate account were sent to you','error');\n\t\t\t}\n\t\t\t\n\t\t\t$request['user_id'] = $this->_auth->user_id;\n\t\t\t$oUsers = new Models_Usermanagement_Users();\n\t\t\t$oUsers->updateEntry($request);\t\t\t\n\t\t\t\n\t\t\t$this->_messages->setMessage('Account has been updated');\n\t\t\t$this->_redirect('/usermanagement/profile/generaldataform/');\n\t\t}else{\n\t\t\tforeach ( $this->_validator->getErrors () as $field=>$error ) {\n\t\t\t\t$this->_messages->setMessage ( $error, 'error' , $field);\n\t\t\t}\n\t\t\t$this->_redirect('/usermanagement/profile/generaldataform/?error=1');\n\t\t}\n\t}", "public function update_user() {\n global $json_api;\n\n if(!isset($_REQUEST['id']))\n $json_api->error(__(\"The user's 'id' must be set.\"));\n\n return $this->create_user();\n }", "function updateUser($updateArray){\n\t\t\t$id = '';\n foreach($updateArray as $key=>$val){\n switch($key){\n case \"id\": // case will be the name of the form field the user types in\n $id = $val;\n\t\t\t\t\t\tbreak;\n case 'password':\n $this->updateField('pass', $val, $id);\n break;\n case 'name':\n $this->updateField('name', $val, $id);\n break;\n case 'gender':\n $this->updateField('gender', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'email':\n $this->updateField('email', $val, $id);\n break;\n case 'cellPhone':\n $this->updateField('cellPhone', $val, $id);\n break;\n case 'homePhone':\n $this->updateField('homePhone', $val, $id);\n\t\t\t\t\t\tbreak;\t\t\n\t\t\t\t\tcase 'address':\n \t$this->updateField('address', $val, $id);\n break;\n case 'city':\n $this->updateField('city', $val, $id);\n break;\n case 'state':\n $this->updateField('state', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'zip':\n\t\t\t\t\t\t$this->updateField('zip', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'highschool':\n\t\t\t\t\t\t$this->updateField('highschool', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'weight':\n\t\t\t\t\t\t$this->updateField('weight', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'height':\n\t\t\t\t\t\t$this->updateField('height', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'gradYear':\n\t\t\t\t\t\t$this->updateField('gradYear', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'sport':\n\t\t\t\t\t\t$this->updateField('sport', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'primaryPosition':\n\t\t\t\t\t\t$this->updateField('primaryPosition', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'secondaryPosition':\n\t\t\t\t\t\t$this->updateField('secondaryPosition', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'travelTeam':\n\t\t\t\t\t\t$this->updateField('travelTeam', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'gpa':\n\t\t\t\t\t\t$this->updateField('gpa', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'sat':\n\t\t\t\t\t\t$this->updateField('sat', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'act':\n\t\t\t\t\t\t$this->updateField('act', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref1Name':\n\t\t\t\t\t\t$this->updateField('ref1Name', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref1JobTitle':\n\t\t\t\t\t\t$this->updateField('ref1JobTitle', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref1Email':\n\t\t\t\t\t\t$this->updateField('ref1Email', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref1Phone':\n\t\t\t\t\t\t$this->updateField('ref1Phone', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref2Name':\n\t\t\t\t\t\t$this->updateField('ref2Name', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref2JobTitle':\n\t\t\t\t\t\t$this->updateField('ref2JobTitle', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref2Email':\n\t\t\t\t\t\t$this->updateField('ref2Email', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref2Phone':\n\t\t\t\t\t\t$this->updateField('ref2Phone', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref3Name':\n\t\t\t\t\t\t$this->updateField('ref3Name', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref3JobTitle':\n\t\t\t\t\t\t$this->updateField('ref3JobTitle', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref3Email':\n\t\t\t\t\t\t$this->updateField('ref3Email', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'ref3Phone':\n\t\t\t\t\t\t$this->updateField('ref3Phone', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'persStatement':\n\t\t\t\t\t\t$this->updateField('persStatement', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'commitment':\n\t\t\t\t\t\t$this->updateField('commitment', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'service':\n\t\t\t\t\t\t$this->updateField('service', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'profileImage':\n\t\t\t\t\t\t$this->updateField('profileImage', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'showcase1':\n\t\t\t\t\t\t$this->updateField('showcase1', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'showcase2':\n\t\t\t\t\t\t$this->updateField('showcase2', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'showcase3':\n\t\t\t\t\t\t$this->updateField('showcase3', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'college':\n\t\t\t\t\t\t$this->updateField('college', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'facebook':\n\t\t\t\t\t\t$this->updateField('facebook', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'twitter':\n\t\t\t\t\t\t$this->updateField('twitter', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'instagram':\n\t\t\t\t\t\t$this->updateField('instagram', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'website':\n\t\t\t\t\t\t$this->updateField('website', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'velocity':\n\t\t\t\t\t\t$this->updateField('velocity', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'gpareq':\n\t\t\t\t\t\t$this->updateField('gpareq', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'satactreq':\n\t\t\t\t\t\t$this->updateField('satactreq', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'characteristics':\n\t\t\t\t\t\t$this->updateField('characteristics', $val, $id);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'major':\n\t\t\t\t\t\t$this->updateField('major', $val, $id);\n\t\t\t\t\t\tbreak;\n }\n\t\t\t}\n\t\t}", "public function createapiuserAction () {\n $cid = (int) $this->getRequest()->getParam('id');\n\n if (!$cid)\n return $this->_redirect('adminhtml/customer');\n\n $customer = Mage::getModel('customer/customer')->load($cid);\n\n if (!$cid = $customer->getId())\n return $this->_redirect('adminhtml/customer');\n\n $address = $customer->getPrimaryBillingAddress();\n\n if (!($address && $address->getId()))\n return $this->_redirectToCustomer($cid, self::_NO_ADDRESS, 'error');\n\n $address = $customer->getPrimaryShippingAddress();\n\n if (!($address && $address->getId()))\n return $this->_redirectToCustomer($cid, self::_NO_ADDRESS, 'error');\n\n unset($address);\n\n $user = Mage::getModel('api/user')->loadByUsername($cid);\n\n if ($uid = $user->getUserId())\n return $this->_redirectToCustomer(\n $cid,\n sprintf(\n self::_USER_EXISTS,\n $cid,\n $this->getUrl('adminhtml/api_user/edit', array('user_id' => $uid))\n ),\n 'warning'\n );\n\n $roleName = Mage::helper('mventory')\n ->getConfig(MVentory_API_Model_Config::_DEFAULT_ROLE);\n\n $role = Mage::getResourceModel('api/role_collection')\n ->addFieldToFilter('role_name', $roleName);\n\n if (!$role->count())\n return $this->_redirectToCustomer($cid, self::_NO_ROLE, 'error');\n\n try {\n $user\n ->setUsername($cid)\n ->setFirstname($customer->getFirstname())\n ->setLastname($customer->getLastname())\n ->setEmail($customer->getEmail())\n ->setIsActive(false)\n ->save()\n ->setRoleIds(array($role->getFirstItem()->getRoleId()))\n ->setRoleUserId($user->getUserId())\n ->saveRelations();\n } catch (Exception $e) {\n return $this->_redirectToCustomer($cid, $e->getMessage(), 'error');\n }\n\n $this->_redirectToCustomer(\n $cid,\n sprintf(\n self::_HELP,\n $this->getUrl(\n 'adminhtml/api_user/edit',\n array('user_id' => $user->getUserId())\n )\n )\n );\n }", "public function actionAddApp(){\r\n\r\n\t\t$app_id = $_POST['AppInfo']['app_id'];\r\n\t\t$app_id = trim($app_id);\r\n\t\tif(!is_numeric($app_id) && !is_int($app_id) ){\r\n\t\t\t$response_message = \"App Id should be an integer only.\";\r\n\t\t\tself::terminate(-1, $response_message, APIConstant::APP_ID_SHOULD_BE_INTEGER);\r\n\t\t}\r\n\r\n\t\t$appInfo = AppInfo::model()->findByAttributes(array(\"app_id\"=>$app_id));\r\n\r\n\t\tif($appInfo !== null){\r\n\t\t\t$response_message = \"app_id already exist.\";\r\n\t\t\tself::terminate(-1, $response_message, APIConstant::APP_ID_ALREADY_EXIST);\r\n\t\t}\r\n\r\n\t\t$upgrade_status = $_POST['AppInfo']['upgrade_status'];\r\n\t\tif($upgrade_status == null){\r\n\t\t\t$response_message = \"Please mention upgrade status.\";\r\n\t\t\tself::terminate(-1, $response_message, APIConstant::UPGRADE_STATUS_MISSING);\r\n\t\t}\r\n\r\n\t\t$current_app_version = $_POST['AppInfo']['current_app_version'];\r\n\t\t$os_type = $_POST['AppInfo']['os_type'];\r\n\t\t$os_version = $_POST['AppInfo']['os_version'];\r\n\t\t$latest_version = $_POST['AppInfo']['latest_version'];\r\n\t\t$latest_version_url = $_POST['AppInfo']['latest_version_url'];\r\n\r\n\t\t$appInfo = new AppInfo();\r\n\t\t$appInfo->app_id = $app_id;\r\n\t\t$appInfo->current_app_version = $current_app_version;\r\n\t\t$appInfo->os_type = $os_type;\r\n\t\t$appInfo->os_version = $os_version;\r\n\t\t$appInfo->latest_version = $latest_version;\r\n\t\t$appInfo->latest_version_url = $latest_version_url;\r\n\t\t$appInfo->upgrade_status = $upgrade_status;\r\n\r\n\t\t$response_message = \"\";\r\n\r\n\t\tif($appInfo->save()){\r\n\t\t\t$response_message = \"You have successfully added new app version.\";\r\n\t\t\tself::success($response_message);\r\n\t\t}else{\r\n\t\t\t$response_message = \"Problem adding new app version.\";\r\n\t\t\tself::terminate(-1, $response_message, APIConstant::ERROR_IN_ADDING_NEW_APP);\r\n\t\t}\r\n\r\n\t\t$this->renderPartial('/default/defaultView', array('content' => $content));\r\n\r\n\t}", "public function testUpdateUserTemplate()\n {\n }", "public function actionCreate()\n {\n $model = new AppUser();\n $model->user_id = Yii::$app->user->id;\n $model->auth_key = Yii::$app->security->generateRandomString();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $model;\n }\n return $model->errors;\n }", "public function postUpdateUser()\n\t{\n\n\t\ttry {\n\n\t\t\t$user = Sentry::findUserById(Input::get('userID'));\n\n\t\t} catch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e) {\n\n\t\t\tApp::abort(404);\n\t\t}\n\n\t\ttry {\n\n\t\t\t$adminGroup = Sentry::findGroupByName('Administrators');\n\n\t\t} catch (Cartalyst\\Sentry\\Groups\\GroupNotFoundException $e) {\n\n\t\t\treturn Redirect::back()\n\t\t\t\t->withInput()\n\t\t\t\t->withErrors('Administrators group could not be found');\n\t\t}\n\n\t\t$user->email = Input::get('email');\n\n\t\tif (Input::get('username') != '')\n\t\t\t$user->username = Input::get('username');\n\n\t\tif (Input::get('password') != '')\n\t\t\t$user->password = Input::get('password');\n\n\t\t$user->first_name = Input::get('first_name');\n\t\t$user->last_name = Input::get('last_name');\n\n\t\tif (Input::get('is_admin') == 'yes')\n\t\t\t$user->addGroup($adminGroup);\n\t\telse\n\t\t\t$user->removeGroup($adminGroup);\n\n\t\tif ($user->save())\n\t\t\treturn Redirect::action('UserController@getDetail', array($user->getKey()))\n\t\t\t\t->with('success', 'User has been updated');\n\t\telse\n\t\t\treturn Redirect::back()\n\t\t\t\t->withInput()\n\t\t\t\t->withErrors('Error updating user');\n\t}", "public function postEditUsers()\n {\n\n\n $database = new Database();\n $id = $this->_params['id'];\n\n $results = $database->getAdminForEdit($id);\n\n $admin = new Admin($results['adminId'], $results['username'], $results['adminLevel'], $results['active']);\n $this->_f3->set('Admin', $admin);\n\n\n $errors = usersEditValidation($id);\n\n if(sizeOf($errors) >= 1) {\n\n $this->_f3->set('errors', $errors);\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-users.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n if($loggedIn['adminId'] == $id) {\n $this->_f3->reroute('/Logout');\n } else {\n $this->_f3->reroute('/Admin');\n }\n\n\n }\n\n }", "public function createAction() {\n\t\tif (Minz_Request::isPost() && (\n\t\t\t\tFreshRSS_Auth::hasAccess('admin') ||\n\t\t\t\t!max_registrations_reached()\n\t\t)) {\n\t\t\t$new_user_name = Minz_Request::param('new_user_name');\n\t\t\t$passwordPlain = Minz_Request::param('new_user_passwordPlain', '', true);\n\t\t\t$new_user_language = Minz_Request::param('new_user_language', FreshRSS_Context::$user_conf->language);\n\n\t\t\t$ok = self::createUser($new_user_name, $passwordPlain, '', array('language' => $new_user_language));\n\t\t\tMinz_Request::_param('new_user_passwordPlain');\t//Discard plain-text password ASAP\n\t\t\t$_POST['new_user_passwordPlain'] = '';\n\t\t\tinvalidateHttpCache();\n\n\t\t\t$notif = array(\n\t\t\t\t'type' => $ok ? 'good' : 'bad',\n\t\t\t\t'content' => _t('feedback.user.created' . (!$ok ? '.error' : ''), $new_user_name)\n\t\t\t);\n\t\t\tMinz_Session::_param('notification', $notif);\n\t\t}\n\n\t\t$redirect_url = urldecode(Minz_Request::param('r', false, true));\n\t\tif (!$redirect_url) {\n\t\t\t$redirect_url = array('c' => 'user', 'a' => 'manage');\n\t\t}\n\t\tMinz_Request::forward($redirect_url, true);\n\t}", "protected function createUserOfApplication($request){\n\n $model = GroupUsers::firstOrNew(['email'=>$request->email]);\n if(!$model->exists){\n $model->name = $request->name;\n $model->email = $request->email;\n $password = str_random();\n $model->password = Hash::make($password);\n $model->status = 1;\n $model->app_password = $password;\n $model->save();\n $user_id = $model->id;\n $userModel = new User;\n $userModel->user_id = $user_id;\n $userModel->user_type = 'applicant';\n $userModel->status = 1;\n $userModel->save();\n return ['status'=>'new_user','password'=>$password,'user_id'=>$user_id];\n }else{\n $user_id = $model->id;\n $userModel = User::firstOrNew(['user_type'=>'applicant','user_id'=>$model->id]);\n $userModel->user_id = $user_id;\n $userModel->user_type = 'applicant';\n $userModel->status = 1;\n $userModel->save();\n return ['status'=>'exists','user_id'=>$user_id];\n }\n }", "public function testUpdateUserAccount()\n {\n }", "public function testUpdateUserProperties()\n {\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create's a new instance of the login module with the passed class name.
public function createLoginModuleInstance(String $className) { return parent::createLoginModuleInstance($className); }
[ "public function instantiate($className);", "public static function loginFactory($tipo_login){\n\t\tif($tipo_login === \"promotec\"){\n\t\t\treturn new LoginPromotor();\n\n\t\t}else if($tipo_login === \"microtae\"){\n\n\t\t}else if($tipo_login === \"login3\"){\n\t\t\t\n\t\t}else if($tipo_login === \"login4\"){\n\t\t\t\n\t\t}else{\n\t\t\tthrow new Exception(\"Tipo de login \".$tipo_login.\" no es valido.\");\n\t\t}\n\t}", "public function login_instance() {\n\t\tif (empty($this->_login_instance)) {\n\t\t\tif (!class_exists('Keyy_Login')) include_once(KEYY_DIR.'/includes/login.php');\n\t\t\t$this->_login_instance = new Keyy_Login($this);\n\t\t}\n\n\t\treturn $this->_login_instance;\n\t}", "public function login()\n {\n static $obj;\n if ( (object) $obj === $obj ):\n return $obj;\n else:\n $obj = new Login( __CLASS__ );\n $_settings = bcFormControl::getSettings();\n bc::publisher()->addHeadIncludes( $this->template_path . $_settings['TEMPLATE'] . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'UiWizard' . DIRECTORY_SEPARATOR . 'Login' . DIRECTORY_SEPARATOR . 'login.css', 'css' );\n bc::publisher()->addHeadIncludes( $this->template_path . $_settings['TEMPLATE'] . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'UiWizard' . DIRECTORY_SEPARATOR . 'Login' . DIRECTORY_SEPARATOR . 'login.js', 'js' );\n return $obj;\n endif;\n }", "public static function getInstance( $class_name );", "protected function createComponentSignInForm($name)\n\t{\n\t\t$form = new \\CoreModule\\Forms\\LoginForm;\n\t\treturn $form;\n\t}", "public function testCreateLoginModuleInstance()\n {\n\n // prepare the mocks for the login context\n $subjectMock = $this->getMock('AppserverIo\\Psr\\Security\\Auth\\Subject');\n $callbackHandlerMock = $this->getMock('AppserverIo\\Psr\\Security\\Auth\\Callback\\CallbackHandlerInterface');\n $configurationMock = $this->getMock('AppserverIo\\Psr\\Security\\Auth\\Login\\SecurityDomainConfigurationInterface');\n\n // initialize a new test instance\n $loginContext = new MockLoginContext($subjectMock, $callbackHandlerMock, $configurationMock);\n\n // test the createLoginModuleInstance() method\n $this->assertInstanceOf(\n 'AppserverIo\\Psr\\Security\\Auth\\Spi\\LoginModuleInterface',\n $loginContext->createLoginModuleInstance(new String('AppserverIo\\Psr\\Security\\Auth\\Spi\\LoginModuleWrapper'))\n );\n }", "protected function createComponentLoginForm()\n\t{\n\t\treturn new LoginForm;\n\t}", "function new_instance($class)\n {\n }", "protected function loginWithNewUser() {\n $this->loginWithExistentUser($this->createNewUser());\n }", "public static function instance($name = NULL, array $config = NULL)\n {\n if ($name === NULL)\n {\n // Use the default instance name\n $name = Hauthlite::$default;\n }\n if ( ! isset(Hauthlite::$instances[$name]) || ! (Hauthlite::$instances[$name] instanceof Hauthlite))\n {\n Hauthlite::$instances[$name] = Hauthlite::factory($name, $config);\n }\n\n return Hauthlite::$instances[$name];\n }", "public static function login()\r\n {\r\n if (!isset(self::$instancia)) {\r\n $c = __CLASS__;\r\n self::$instancia = new $c();\r\n }\r\n return self::$instancia;\r\n }", "public function init_usermod(){\n foreach(CMS::$_usermod as $classname){\n $name = '\\UserMod\\\\'.$classname;\n if (class_exists($name)) {\n $this->_modules[$classname] = new $name($this->_uid);\n }\n }\n }", "function SugarAuthenticate()\n\t{\n\t // check in custom dir first, in case someone want's to override an auth controller\n\t SugarAutoLoader::requireWithCustom('modules/Users/authentication/'.$this->authenticationDir.'/' . $this->userAuthenticateClass . '.php');\n\n $this->userAuthenticate = new $this->userAuthenticateClass();\n\t}", "function factory($driver)\n {\n $driver = basename($driver);\n\n if (empty($driver) || (strcmp($driver, 'none') == 0)) {\n return new Net_IMSP_Auth();\n }\n\n if (file_exists(dirname(__FILE__) . '/Auth/' . $driver . '.php')) {\n require_once dirname(__FILE__) . '/Auth/' . $driver . '.php';\n }\n\n $class = 'Net_IMSP_Auth_' . $driver;\n\n if (class_exists($class)) {\n return new $class();\n }\n\n throw new Horde_Exception(sprintf(_(\"Unable to load the definition of %s.\"), $class));\n }", "public static function getInstance($name)\n\t{\n\t\tif (User::getAccessLevel() === User::ANONYMOUS) {\n\t\t\t// Anonymous users are always and only shown the login form\n\t\t\tinclude_once 'classes/pages/Page_login.class.php';\n\t\t\t$retval = new Page_Login();\n\t\t} else if (file_exists('classes/pages/Page_' . $name . '.class.php')) {\n\t\t\t// The requested page exists\n\t\t\tinclude_once 'classes/pages/Page_' . $name . '.class.php';\n\t\t\t$className = 'Page_' . $name;\n\t\t\t// Figure out the access level for the page\n\t\t\t$reflectionClass = new ReflectionClass('Page_' . $name);\n\t\t\t$accessLevel = $reflectionClass->getMethod('getAccessLevel')->invoke(null);\n\t\t\t// Check access level of current user\n\t\t\tif ($accessLevel > User::ANONYMOUS && User::getAccessLevel() != $accessLevel && $name != 'main') {\n\t\t\t\tinclude_once 'classes/pages/Page_authError.class.php';\n\t\t\t\t$retval = new Page_authError();\n\t\t\t} else {\n\t\t\t\t$retval = new $className();\n\t\t\t}\n\t\t\tif (Config::DISPLAY_ERRORS) {\n\t\t\t\tforeach ($retval->getRequiredParams() as $param) {\n\t\t\t\t\tif (! isset($_REQUEST[$param])) {\n\t\t\t\t\t\t$retval->addNotification(\n\t\t\t\t\t\t\t'warning',\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t__('Warning: Missing required parameter \"%s\"'),\n\t\t\t\t\t\t\t\t$param\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}\n\t\t\t}\n\t\t} else {\n\t\t\tinclude_once 'classes/pages/Page_main.class.php';\n\t\t\t$retval = new Page_Main();\n\t\t\tif (! empty($name)) {\n\t\t\t\t$retval->addNotification(\n\t\t\t\t\t'warning',\n\t\t\t\t\t__('The requested page does not exist')\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $retval;\n\t}", "public function pickLoginMethod()\n {\n if($key = $this->request->get(\\ModuleSSO::METHOD_KEY)) {\n if(isset(self::$MAP[$key])) {\n $class = self::$MAP[$key];\n $this->loginMethod = new $class($this->request);\n } else {\n $this->loginMethod = new HTTP\\DirectLogin($this->request);\n }\n } else {\n $this->loginMethod = new HTTP\\DirectLogin($this->request);\n }\n\n $this->loginMethod->setRenderer($this->renderer->getRenderer($this->loginMethod));\n }", "private function useAuthentication() {\n\t\tQuantum::registry(\"authentication_class\",$this->config['authentication']['class']);\n\t\tQuantum::registry(\"authentication_sign\",$this->config['authentication']['sign']);\n\t\tQuantum::registry(\"authentication_timeout\",$this->config['authentication']['logintimeout']);\n\n\t\t$className = explode(\".\",Quantum::registry(\"authentication_class\"));\n\t\t$className = $className[count($className) - 1];\n\t\t\n\t\tQuantum::registry(\"authentication_className\",$className);\n\t\tuses (\"core.base.Authentication\");\n\n\t\ttrace(\"using authentication module '\".$className.\"'\",$this);\n\n\t\tif ($this->config['authentication']['create']) {\n\t\t\tuses (Quantum::registry(\"authentication_class\"));\n\t\t\ttrace(\"creating authentication class '\".$className.\"'\",$this);\n\t\t\t$this->_authentication = new $className;\n\t\t\tQuantum::registry(\"auth\",$this->_authentication->getClassName());\n\t\t}\n\t}", "private static function getLoginCont(){\r\n return new LoginController('login', 'Login', null);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mendapatkan username dari userid
function getUsername($userid) { global $conn; $sql = "select username from gate.sc_user where userid = ".Query::escape($userid); return $conn->GetOne($sql); }
[ "private function username( $uid ){\n \n $query = USR_NAME . $uid;\n $result = mysql_query($query) or die(\"Query failed: \" . mysql_error());\n $res;\n while( $r = mysql_fetch_array($result, MYSQL_ASSOC) ){\n $res = $r['username'];\n }\n echo \"<script> placeUser('\".$res.\"');</script>\";\n }", "function getUsername($userid) {\n\t\treturn false;\n\t\t// in case you decide to store the userid use this\n\t\t// $user = mysqli_fetch_object(mysql_query($this->link, \"SELECT * FROM `users` WHERE 'userid' = '\".(int)$userid.\"'\"));\n\t\t// return $user->username;\n\t}", "public function change_username()\n {\n global $mysqli, $message, $user;\n $id = $this->id;\n\n $stmt = $mysqli->prepare(\"SELECT count(*) FROM users WHERE username LIKE ?\");\n $stmt->bind_param(\"s\",$_POST[\"username\"]);\n $stmt->execute();\n if ($stmt->num_rows > 0)\n {\n $message = _(\"This username is already taken.\");\n return;\n }\n $stmt->close();\n\n if ($_SESSION['user'] != $id && $user->get_rank()>0)\n {\n $message = _(\"Cannot change username of other users!\");\n }else{\n $stmt = $mysqli->prepare(\"UPDATE users SET username = ? WHERE id=?\");\n $stmt->bind_param(\"si\",$_POST[\"username\"],$id);\n $stmt->execute();\n $stmt->close();\n header(\"Location: \".WEB_URL.\"/admin/?do=user&id=\".$id);\n }\n }", "function searchUserID($username){\n\t\ttry {\n\t\t\t$conn=new PDO('mysql:host=localhost;dbname=unixender', 'root', \"\");\n\t\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$sql= \"SELECT id, username, category FROM detail WHERE username LIKE :username\";\n\t\t\t$stmt= $conn->prepare($sql);\n\t\t\t$stmt->bindparam(\":username\", $username, PDO::PARAM_STR);\n\t\t\t$stmt->execute();\t\t\n\t\t\t$count=0;\t\t\n\t\t\tforeach ($stmt->fetchAll() as $row) {\n\t\t\t$count++; \n \t\techo '<br><br><br><table class=\"table table-sm table-hover\">\n\t\t\t\t\t <thead class=\"tb-head\">\n\t\t\t\t\t <tr>\n\t\t\t\t\t <th scope=\"col\">s/n</th>\n\t\t\t\t\t <th scope=\"col\">Username</th>\n\t\t\t\t\t <th scope=\"col\">Category</th>\n\t\t\t\t\t <th scope=\"col\">id</th>\n\t\t\t\t\t </tr>\n\t\t\t\t\t </thead>\n\t\t\t\t\t <tbody id=\"tb-text\">\n\t\t\t\t\t <tr>'\n\t\t\t\t\t \t\t.'<td>'.$count.'</td>\n\t\t\t\t\t \t\t<td>'.$row[\"username\"].'</td>\n\t\t\t\t\t \t\t<td>'.$row[\"category\"].'</td>\n\t\t\t\t\t \t\t<td>'.$row[\"id\"].'</td> \n\t\t\t\t\t </tr>\n\t\t\t\t\t </tbody>\n\t\t\t\t\t</table>';\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t//\techo \"<br> username: \". $row[\"username\"]. \" category: \". $row[\"category\"].\" Message id: \". $row[\"id\"];\n\t\t\t//}\n\t\t} catch (PDOException $e) {\n\t\t\tdie(\"Query Failed: \".$e->getMessage());\n\t\t}\n\t}", "public function findUserUsername($id){\n $korisnik = $this->find($id);\n if($korisnik == null){\n return null;\n } \n return $korisnik->username;\n }", "public function giveUserName(){\r\n return $this->nome_utente;\r\n }", "function getUserNameUsingId($user_id){\n\t\treturn $resultSet = getOne(\"select name from users where is_active =1 AND user_id='\".$user_id.\"'\");\n\t}", "public function column_username($user)\n {\n }", "public function column_username($user)\n {\n }", "public function setUsername($username){\n\t\t$this->username = $username;\n if($this->id != 0){\n\t\t $sql = \"UPDATE `tbl_sinhvien` SET `name` = '$username' WHERE id = '$this->$id'\";\n\t\t $this->db->executeQuery($sql);\n }\n\t}", "public function change_my_username()\n\t{\n\t\t$data = $this->Admin_self_m->admin_form();\n\t\t$this->load_my_views('Forms/username_f', $data);\t\n\t}", "function get_username_by_userid($userids){\r\n\t\t$userNames = array();\r\n\t\tfor($i = 0; $i < sizeof($userids); $i++){\r\n\t\t\tif($userids[$i] == null)\r\n\t\t\t\tarray_push($userNames,'Visitor');\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t$userName=qa_db_read_one_value(qa_db_query_sub('SELECT handle FROM ^users where userid = $',$userids[$i]));\r\n\t\t\t\tarray_push($userNames,$userName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn $userNames;\r\n\t}", "abstract public function GetUserID(string $username);", "public function checkUsernameId(){\n\t\t$uname = 'abcd.xyz..1234';\n\t\techo \"+++\". $this->getIdfromUname($uname);\n\t}", "public static function getUsernameFromId($idUser)\n {\n $connection = Yii::app()->db; \n $command = $connection->createCommand(\"SELECT username FROM user WHERE idUser = $idUser\");\n return $command->queryScalar();\n }", "public function updateUserName($idUser, $userName);", "function GetUserInfoByUserName($username) {\r\n $sql = \"select * from \" . $this->TableUser . \" where login = '\" . $username . \"'\";\r\n $result = parent::select($sql);\r\n return $result;\r\n }", "public function getUsername()\n {\n }", "function getuserById($id_user);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets up a new Comments widget instance.
public function __construct() { $widget_options = array( 'classname' => 'widget_acw_recent_comments', 'description' => __( 'A comments widget with extended features.' ), 'customize_selective_refresh' => true, ); $control_options = array(); parent::__construct( 'acw-recent-comments', // $this->id_base __( 'Advanced Recent Comments' ), // $this->name $widget_options, // $this->widget_options $control_options // $this->control_options ); $this->alt_option_name = 'widget_acw_recent_comments'; }
[ "function register_Zappy_Lates_Comment_Widget() {\n register_widget('Zappy_Lates_Comment_Widget');\n}", "function onourmoon_loar_recent_comments_widget() {\n register_widget( 'OnourMoon_Recent_Comments' );\n}", "public function CommentsForm()\n {\n // Check if enabled\n $enabled = $this->getCommentsEnabled();\n\n if ($enabled && $this->owner->getCommentsOption('include_js')) {\n Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');\n Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');\n Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/lib/jquery.form.js');\n Requirements::javascript(COMMENTS_THIRDPARTY . '/jquery-validate/jquery.validate.min.js');\n Requirements::add_i18n_javascript('comments/javascript/lang');\n Requirements::javascript('comments/javascript/CommentsInterface.js');\n }\n\n $controller = CommentingController::create();\n $controller->setOwnerRecord($this);\n $controller->setBaseClass($this->ClassName);\n $controller->setOwnerController(Controller::curr());\n\n $moderatedSubmitted = Session::get('CommentsModerated');\n Session::clear('CommentsModerated');\n\n $form = ($enabled) ? $controller->CommentsForm() : false;\n\n // Customise the comments form to be more suitable for\n // discussions. We remove the URL field and set the name\n // To use the member's nickname (and be hidden)\n if ($form) {\n $member = Member::currentUser();\n $fields = $form->Fields();\n \n $fields->removeByName(\"URL\");\n $fields->removeByName(\"NameView\");\n\n $name_field = HiddenField::create(\"Name\");\n\n if ($member->Nickname) {\n $name_field->setValue($member->Nickname);\n } else {\n $name_field->setValue($member->getName()); \n }\n\n $fields->push($name_field);\n\n // Customise comments field\n $comments_field = $fields->dataFieldByName(\"Comment\");\n\n if ($comments_field) {\n $comments_field\n ->setTitle(_t(\n \"Discussions.EnterYourComments\",\n \"Enter Your Comments\"\n ))\n ->setDescription(_t(\n \"Discussions.URLsAutomaticallyConverted\",\n \"URLs will be converted to links, images or video embeds automatically\"\n ));\n }\n\n $this->extend(\"updateDiscussionCommentsForm\", $form);\n }\n\n // a little bit all over the show but to ensure a slightly easier upgrade for users\n // return back the same variables as previously done in comments\n return $this\n ->owner\n ->customise(array(\n 'AddCommentForm' => $form,\n 'ModeratedSubmitted' => $moderatedSubmitted,\n ))\n ->renderWith('DiscussionsCommentsInterface');\n }", "public function __construct() {\n\t\t$widget_ops = array('classname' => 'widget_recent_comments', 'description' => __( 'Your site&#8217;s most recent comments.' ) );\n\t\tparent::__construct('recent-comments', __('Recent Comments'), $widget_ops);\n\t\t$this->alt_option_name = 'widget_recent_comments';\n\n\t\tif ( is_active_widget(false, false, $this->id_base) )\n\t\t\tadd_action( 'wp_head', array($this, 'recent_comments_style') );\n\t}", "public function setComments($comments) {$this->comments = $comments;}", "public function initWikiComment()\n\t{\n\t\t$this->initWiki();\n\t\t\n\t\t$this->wiki2xhtml->setOpts(array(\n\t\t\t'active_title' => 0,\n\t\t\t'active_setext_title' => 0,\n\t\t\t'active_hr' => 0,\n\t\t\t'active_lists' => 1,\n\t\t\t'active_quote' => 0,\n\t\t\t'active_pre' => 1,\n\t\t\t'active_empty' => 0,\n\t\t\t'active_auto_br' => 1,\n\t\t\t'active_auto_urls' => 1,\n\t\t\t'active_urls' => 1,\n\t\t\t'active_auto_img' => 0,\n\t\t\t'active_img' => 0,\n\t\t\t'active_anchor' => 0,\n\t\t\t'active_em' => 1,\n\t\t\t'active_strong' => 1,\n\t\t\t'active_br' => 1,\n\t\t\t'active_q' => 1,\n\t\t\t'active_code' => 1,\n\t\t\t'active_acronym' => 1,\n\t\t\t'active_ins' => 1,\n\t\t\t'active_del' => 1,\n\t\t\t'active_footnotes' => 0,\n\t\t\t'active_wikiwords' => 0,\n\t\t\t'active_macros' => 0,\n\t\t\t'parse_pre' => 0,\n\t\t\t'active_fr_syntax' => 0\n\t\t));\n\t\t\n\t\t# --BEHAVIOR-- coreInitWikiComment\n\t\t$this->callBehavior('coreInitWikiComment',$this->wiki2xhtml);\n\t}", "public function __construct()\n {\n $this->CommentManager = new CommentManager;\n }", "public static function load()\n {\n P4Cms_PubSub::subscribe('p4cms.content.render.close',\n function($html, $helper)\n {\n $entry = $helper->getEntry();\n\n // if we don't have an entry id or the entry being rendered\n // isn't the default we won't append comments\n if (!$entry->getId()\n || $entry->getId() != $helper->getDefaultEntry()->getId()\n ) {\n return $html;\n }\n\n // let comment view helper take care of the rest.\n $html = $helper->getView()->comments(\n \"content/\" . $entry->getId(),\n (array) $entry->getValue('comments')\n ) . $html;\n\n return $html;\n }\n );\n\n // participate in content editing by providing a subform.\n P4Cms_PubSub::subscribe('p4cms.content.form.subForms',\n function(Content_Form_Content $form)\n {\n return new Comment_Form_Content(\n array(\n 'name' => 'comments',\n 'order' => -10\n )\n );\n }\n );\n\n // provide comment grid (moderate) actions\n P4Cms_PubSub::subscribe('p4cms.comment.grid.actions',\n function($actions)\n {\n $actions->addPages(\n array(\n array(\n 'label' => 'Approve',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickApprove();',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowApprove(this);',\n 'order' => '10'\n ),\n array(\n 'label' => 'Reject',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickReject();',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowReject(this);',\n 'order' => '20'\n ),\n array(\n 'label' => 'Pend',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickPend();',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowPend(this);',\n 'order' => '30'\n ),\n array(\n 'label' => 'Delete',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickDelete();',\n 'order' => '40'\n ),\n array(\n 'label' => '-',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowView(this);',\n 'order' => '50'\n ),\n array(\n 'label' => 'View Content Entry',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickView();',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowView(this);',\n 'order' => '60'\n ),\n )\n );\n }\n );\n\n // provide form to search comments\n P4Cms_PubSub::subscribe('p4cms.comment.grid.form.subForms',\n function(Zend_Form $form)\n {\n return new Ui_Form_GridSearch;\n }\n );\n\n // filter comment list by search term\n P4Cms_PubSub::subscribe('p4cms.comment.grid.populate',\n function(P4Cms_Record_Query $query, Zend_Form $form)\n {\n $values = $form->getValues();\n\n // extract search query.\n $keywords = isset($values['search']['query'])\n ? $values['search']['query']\n : null;\n\n // early exit if no search text.\n if (!$keywords) {\n return;\n }\n\n // add a text search filter to the comment query.\n $filter = new P4Cms_Record_Filter;\n $fields = array('comment', 'user', 'name');\n $filter->addSearch($fields, $keywords);\n $query->addFilter($filter);\n }\n );\n\n // provide form to filter comments by status.\n P4Cms_PubSub::subscribe('p4cms.comment.grid.form.subForms',\n function(Zend_Form $form)\n {\n $form = new P4Cms_Form_SubForm;\n $form->setName('status');\n $form->addElement(\n 'radio',\n 'status',\n array(\n 'label' => 'Status',\n 'multiOptions' => array(\n '' => 'Any State',\n Comment_Model_Comment::STATUS_PENDING => 'Only Pending',\n Comment_Model_Comment::STATUS_APPROVED => 'Only Approved',\n Comment_Model_Comment::STATUS_REJECTED => 'Only Rejected'\n ),\n 'autoApply' => true,\n 'value' => ''\n )\n );\n\n return $form;\n }\n );\n\n // filter comment list by status\n P4Cms_PubSub::subscribe('p4cms.comment.grid.populate',\n function(P4Cms_Record_Query $query, Zend_Form $form)\n {\n $values = $form->getValues();\n\n // extract status filter.\n $status = isset($values['status']['status'])\n ? $values['status']['status']\n : null;\n\n // early exit if no status filter.\n if (!$status) {\n return;\n }\n\n // add a status filter to the comment query.\n $filter = new P4Cms_Record_Filter;\n $filter->add('status', $status);\n $query->addFilter($filter);\n }\n );\n\n // organize comment records when pulling changes.\n P4Cms_PubSub::subscribe(\n 'p4cms.site.branch.pull.groupPaths',\n function($paths, $source, $target, $result)\n {\n $paths->addSubGroup(\n array(\n 'label' => 'Comments',\n 'basePaths' => $target->getId() . '/comments/...',\n 'inheritPaths' => $target->getId() . '/comments/...'\n )\n );\n }\n );\n }", "public function __construct()\n {\n parent::__construct();\n $this->model = new CommentsModel();\n }", "function cr_load_widget() {\n\tregister_widget( 'Comments_Rating_Widget' );\n}", "protected function getCommentsForm()\n {\n $this->controller['query_results']\n = $this->plugin_data->{$this->comments_form}->data;\n\n $this->controller['model_registry']\n = $this->plugin_data->{$this->comments_form}->model_registry;\n\n return $this;\n }", "public function initComments()\n\t{\n\t\t$this->collComments = array();\n\t}", "protected function createCommentForm()\n {\n $form = new Form;\n\n $form['comment'] = (new Input\\Textarea('comment'))\n ->setLabel(gettext('Comment'));\n\n $form['internal'] = (new Input\\Checkbox('internal'))\n ->setLabel(gettext('Is internal?'));\n\n $form->setAttribute('method', 'POST');\n $form['submit'] = (new Input\\Button('submit'))\n ->setAttribute('type', 'submit')\n ->setContents(gettext('Add comment'));\n\n return $form;\n }", "public function setComments($comments);", "protected function initNewCommentsAdmin()\n\t{\n\t\tadd_filter('manage_edit-comments_columns', array($this->Main, 'newCommentsColumnHandler'));\n\t\tadd_filter('manage_comments_custom_column', array($this->Main, 'commentColumnContentHandler'), 10, 2 );\n\t}", "public function cpl_widget_init() {\n\t\t// TODO\n\t}", "function Studiorum_Side_Comments()\n\t{\n\n\t\t$Studiorum_Side_Comments = new Studiorum_Side_Comments;\n\n\t}", "function register_block_core_post_comments_form()\n {\n }", "protected function createComponentCommentForm()\n\t{\n\t\t$form = new Form;\n\t\t$this->configureFormBulma($form);\n\n\t\t$form->addText('name', 'Your Name')->setRequired();\n\t\t$form->addEmail('email', 'Email');\n\t\t$form->addTextArea('content', 'Comment:')\n\t\t\t->setRequired();\n\n\t\t$form->addSubmit('submit', 'Add comment');\n\t\t$form->onSuccess[] = [$this, 'commentFormSuccess'];\n\n\t\treturn $form;\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get request types of itil object between 2 dates
function getUsedRequestTypeBetween($date1 = '', $date2 = '') { global $DB; $ctable = $this->getTable(); $criteria = [ 'SELECT' => 'requesttypes_id', 'DISTINCT' => true, 'FROM' => $ctable, 'WHERE' => [ "$ctable.is_deleted" => 0 ] + getEntitiesRestrictCriteria($ctable), 'ORDERBY' => 'requesttypes_id' ]; if (!empty($date1) || !empty($date2)) { $criteria['WHERE'][] = [ 'OR' => [ getDateCriteria("$ctable.date", $date1, $date2), getDateCriteria("$ctable.closedate", $date1, $date2), ] ]; } $iterator = $DB->request($criteria); $tab = []; while ($line = $iterator->next()) { $tab[] = [ 'id' => $line['requesttypes_id'], 'link' => Dropdown::getDropdownName('glpi_requesttypes', $line['requesttypes_id']), ]; } return $tab; }
[ "public static function getDateFilterTypes()\n\t{\n\t\t$dateFilters = Condition::DATE_OPERATORS;\n\t\tforeach (array_keys($dateFilters) as $filterType) {\n\t\t\t$dateValues = \\DateTimeRange::getDateRangeByType($filterType);\n\t\t\t$dateFilters[$filterType]['startdate'] = $dateValues[0];\n\t\t\t$dateFilters[$filterType]['enddate'] = $dateValues[1];\n\t\t}\n\t\treturn $dateFilters;\n\t}", "abstract function getResponseTypes();", "public function getEventTypes();", "public static function getDateTimeTypes() {}", "private function getAllCurRequests($reqType){\n\t\t$entity = 'ElskModelBundle:'.$reqType;\n\t\t$previousEvent = $this->getPreviousEvent();\n\t\t$beginDate = $previousEvent? $previousEvent->getEndDate()->format(ScheduleController::MYSQL_DATE_FORMAT) : '0';\n\t\t$qb = $this->entityManager->createQueryBuilder();\n\t\t$query = $qb->select('r')\n\t\t\t->from($entity, 'r')\n\t\t\t->where($qb->expr()->between('r.requestDate', '?1', '?2'))\n\t\t\t->setParameters([1 => $beginDate, 2 => $this->helpEvent->getStartDate()])\n\t\t\t->getQuery();\n\n\t\treturn $query->getResult();\n\t}", "function inDateRange(&$request){\n global $dateFields;\n foreach ($dateFields as $dateField){\n $fromYearField = \"{$dateField}FromYear\";\n $toYearField = \"{$dateField}ToYear\";\n if (!($_REQUEST[$fromYearField] || $_REQUEST[$toYearField]))\n continue;\n else{\n $fromYear = \"0000\"; // YYYY as string\n $fromMonth = \"00\"; // MM as string\n $fromDay = \"00\"; // DD as string\n if ($_REQUEST[$fromYearField]){\n $fromYear = str_pad((int) $_REQUEST[$fromYearField],4,\"0\",STR_PAD_LEFT);\n if ($_REQUEST[\"{$dateField}FromMonth\"])\n $fromMonth = str_pad((int) $_REQUEST[\"{$dateField}FromMonth\"],2,\"0\",STR_PAD_LEFT);\n if ($_REQUEST[\"{$dateField}FromDay\"])\n $fromDay = str_pad((int) $_REQUEST[\"{$dateField}FromDay\"],2,\"0\",STR_PAD_LEFT);\n }\n $toYear = \"9999\"; // YYYY as string\n $toMonth = \"99\"; // MM as string\n $toDay = \"99\"; // DD as string\n if ($_REQUEST[$toYearField]){\n $toYear = str_pad(((int) $_REQUEST[$toYearField]?$_REQUEST[$toYearField]:\"9999\"),4,\"0\",STR_PAD_LEFT);\n if ($_REQUEST[\"{$dateField}ToMonth\"])\n $toMonth = str_pad(((int) $_REQUEST[\"{$dateField}ToMonth\"]?$_REQUEST[\"{$dateField}ToMonth\"]:\"99\"),\n 2,\n \"0\",\n STR_PAD_LEFT);\n if ($_REQUEST[\"{$dateField}ToDay\"])\n $toDay = str_pad(((int) $_REQUEST[\"{$dateField}ToDay\"]?$_REQUEST[\"{$dateField}ToDay\"]:\"99\"),\n 2,\n \"0\",\n STR_PAD_LEFT);\n }\n $xmlField = str_replace('_','-',$dateField);\n if (!((string) $request->$xmlField >= \"$fromYear.$fromMonth.$fromDay\" &&\n (string) $request->$xmlField <= \"$toYear.$toMonth.$toDay\"))\n return false;\n }\n }\n return true;\n}", "public function getDataWithTypeDate() {}", "function in_range($start = null, $end = null, $date = null, $type = 0) {\r\n $date = $date ? $date : self::timestamp();\r\n $start = $start ? $start : self::today();\r\n $end = $end ? $end : xpDate::next_date($start);\r\n $t1 = $date > $start || (($type & 1) && $date == $start);\r\n $t2 = $date < $end || (($type & 2) && $date == $end);\r\n return $t1 && $t2;\r\n }", "private function typesConvertor($request)\n {\n /* type & ranking conditions */\n if(!empty($request->filters['types'])){\n $types_rankings = FilterType::whereIn('id', $request->filters['types'])->get();\n } else {\n $types_rankings = FilterType::all();\n }\n\n foreach($types_rankings as $key => $item){\n if($item['flag'] == 'type'){\n $data['type'][] = $item['id'];\n } else {\n $data['rank'][$key]['min'] = $item['min'];\n $data['rank'][$key]['max'] = $item['max'];\n }\n }\n\n return $data;\n }", "function getResponseByDate($start_date, $end_date)\n {\n \n }", "public function getConditionTypes(): array;", "public function getQueryTypes();", "public function getNeededOperations(Request $request)\n {\n $results = array();\n if ($request->isXmlHttpRequest()) {\n $rib = $request->request->get('rib');\n\n $startDate = $request->request->get('startDate');\n if ($startDate) {\n $startDate = new \\DateTime($startDate);\n $startDate = $startDate->getTimestamp();\n }\n\n $endDate = $request->request->get('endDate');\n if ($endDate) {\n $endDate = new \\DateTime($endDate);\n $endDate = $endDate->getTimestamp();\n }\n\n $allOperations = $this->getAllOperationsFromApi();\n\n if ($rib) {\n if ($startDate > $endDate || $endDate < $startDate) {\n $response = 'Veuillez sélectionner une période valide.';\n } else {\n /*\n * create a new associative array that only contains the operations of the rib that has been asked\n * use the date timeswamp as an array key to facilitate chronological handling\n */\n foreach ($allOperations[$rib] as $key => $operation) {\n $date = str_replace('/', '-', $operation['date'] );\n $date = new \\DateTime($date);\n $date = $date->getTimestamp();\n\n if (is_int($startDate)) {\n if ($endDate) {\n if ($date >= $startDate && $date <= $endDate) {\n $results[$date][$key] = array(\n 'montant' => $operation['montant'],\n 'date' => $operation['date'],\n );\n }\n } else {\n if ($date >= $startDate) {\n $results[$date][$key] = array(\n 'montant' => $operation['montant'],\n 'date' => $operation['date'],\n );\n }\n }\n } elseif (is_int($endDate)) {\n if ($date <= $endDate) {\n $results[$date][$key] = array(\n 'montant' => $operation['montant'],\n 'date' => $operation['date'],\n );\n }\n } else {\n $results[$date][$key] = array(\n 'montant' => $operation['montant'],\n 'date' => $operation['date'],\n );\n }\n }\n\n /* return help messages if error */\n if (empty($results)) {\n $response = 'Aucune opération réalisée sur cette période.';\n } else {\n $response = $results;\n }\n }\n } else {\n $response = 'Veuillez sélectionner un RIB.';\n }\n\n } else {\n $response = 'Une erreur s\\'est produite, veuillez réessayer.';\n }\n\n return $response;\n }", "public function getRecurrenceTypes();", "public function getPayments2Types()\n {\n $month = $this->req->get('month') ?? Carbon::today()->month;\n $year = $this->req->get('year') ?? Carbon::today()->year;\n\n $payments = $this->repository->getByDeadline($month, $year);\n\n $valid = [];\n $invalid = [];\n foreach ($payments as $p) {\n if ($p->done)\n $valid [] = $p;\n else\n $invalid [] = $p;\n }\n\n return response()->json([\n 'valid' => $valid,\n 'invalid' => $invalid\n ]);\n }", "function date_item_get_types($name = NULL, $for_options=false) {\n $types = entity_load_multiple_by_name('date_item_type', isset($name) ? array($name) : FALSE);\n\n if ($for_options) {\n $ret_types = array();\n foreach ($types as $type_key=>$type_value) {\n $ret_types[$type_key] = $type_value->label;\n }\n\n return $ret_types;\n }\n \n return isset($name) ? reset($types) : $types;\n}", "public function getRequestsByUserYears( $user, $yearRangeStr, $requestTypeStr, $status=null ) {\n\n// $userSecUtil = $this->container->get('user_security_utility');\n// //academicYearStart\n// $academicYearStart = $userSecUtil->getSiteSettingParameter('academicYearStart','vacreq');\n// if( !$academicYearStart ) {\n// $academicYearStart = \\DateTime::createFromFormat('Y-m-d', date(\"Y\").\"-07-01\");\n// //throw new \\InvalidArgumentException('academicYearStart is not defined in Site Parameters.');\n// }\n// //academicYearEnd\n// $academicYearEnd = $userSecUtil->getSiteSettingParameter('academicYearEnd','vacreq');\n// if( !$academicYearEnd ) {\n// $academicYearEnd = \\DateTime::createFromFormat('Y-m-d', date(\"Y\").\"-06-30\");\n// //throw new \\InvalidArgumentException('academicYearEnd is not defined in Site Parameters.');\n// }\n $academicYearStart = $this->getAcademicYearStart();\n $academicYearEnd = $this->getAcademicYearEnd();\n\n //constract start and end date for DB select \"Y-m-d\"\n $academicYearStartStr = $academicYearStart->format('m-d');\n\n //years\n $yearRangeArr = $this->getYearsFromYearRangeStr($yearRangeStr);\n $previousYear = $yearRangeArr[0];\n $currentYear = $yearRangeArr[1];\n\n $academicYearStartStr = $previousYear.\"-\".$academicYearStartStr;\n //echo \"current academicYearStartStr=\".$academicYearStartStr.\"<br>\";\n //academicYearEnd\n $academicYearEndStr = $academicYearEnd->format('m-d');\n\n $academicYearEndStr = $currentYear.\"-\".$academicYearEndStr;\n //echo \"current academicYearEndStr=\".$academicYearEndStr.\"<br>\";\n\n $parameters = array();\n\n //process.py script: replaced namespace by ::class: ['AppVacReqBundle:VacReqRequest'] by [VacReqRequest::class]\n $repository = $this->em->getRepository(VacReqRequest::class);\n\n $dql = $repository->createQueryBuilder(\"request\");\n $dql->select('request');\n\n $dql->leftJoin(\"request.user\", \"user\");\n //$dql->leftJoin(\"request.requestType\", \"requestType\");\n\n if( $requestTypeStr == 'business' || $requestTypeStr == 'requestBusiness' ) {\n $dql->leftJoin(\"request.requestBusiness\", \"requestType\");\n }\n\n if( $requestTypeStr == 'vacation' || $requestTypeStr == 'requestVacation' ) {\n $dql->leftJoin(\"request.requestVacation\", \"requestType\");\n }\n\n $dql->andWhere(\"requestType.id IS NOT NULL\");\n\n //$dql->where(\"requestType.id IS NOT NULL AND user.id = :userId AND requestType.status = :status\");\n\n // |----|year|-----start-----end-----|year+1|----|\n // |----|2015-07-01|-----start-----end-----|2016-06-30|----|\n //echo \"range=\".$academicYearStartStr.\" > \".$academicYearEndStr.\"<br>\";\n $dql->andWhere(\"requestType.startDate >= '\" . $academicYearStartStr . \"'\" . \" AND requestType.endDate <= \" . \"'\" . $academicYearEndStr . \"'\");\n\n $dql->andWhere(\"user.id = :userId\");\n $parameters['userId'] = $user->getId();\n\n if( $status ) {\n $dql->andWhere(\"requestVacation.status = :status\");\n $parameters['status'] = $status;\n }\n\n $dql->orderBy('request.createDate', 'ASC');\n\n $query = $dql->getQuery(); //$query = $this->em->createQuery($dql);\n\n if( count($parameters) > 0 ) {\n $query->setParameters($parameters);\n }\n\n $requests = $query->getResult();\n //echo \"requests to analyze=\".count($requests).\"<br>\";\n\n return $requests;\n }", "public function getApprovedBeforeAcademicYearDays( $user, $requestTypeStr, $startStr=null, $endStr=null, $status=\"approved\" ) {\n //$logger = $this->container->get('logger');\n $days = 0;\n $accurate = true;\n $subRequestGetMethod = \"getRequest\".$requestTypeStr;\n\n //echo \"before startStr=\".$startStr.\"<br>\";\n //echo \"before endStr=\".$endStr.\"<br>\";\n $requests = $this->getApprovedYearDays($user,$requestTypeStr,$startStr,$endStr,\"before\",$asObject=true,$status);\n //echo \"before requests count=\".count($requests).\"<br>\";\n\n //$accurateNoteArr = array();\n\n foreach( $requests as $request ) {\n $subRequest = $request->$subRequestGetMethod();\n $requestEndAcademicYearStr = $this->getAcademicYearEdgeDateBetweenRequestStartEnd($request,\"first\");\n if( !$requestEndAcademicYearStr ) {\n //echo $request->getId().\" continue <br>\";\n continue;\n }\n //echo \"requestStartDate=\".$subRequest->getStartDate()->format('Y-m-d').\"<br>\";\n //echo \"requestEndAcademicYearStr=\".$requestEndAcademicYearStr.\"<br>\";\n //echo $request->getId().\": before: request days=\".$subRequest->getNumberOfDays().\"<br>\";\n //$workingDays = $this->getNumberOfWorkingDaysBetweenDates( $subRequest->getStartDate(), new \\DateTime($requestEndAcademicYearStr) );\n $workingDays = $this->getNumberOfWorkingDaysBetweenDates( new \\DateTime($requestEndAcademicYearStr), $subRequest->getEndDate() );\n //echo \"workingDays=\".$workingDays.\"<br>\";\n\n $requestNumberOfDays = $subRequest->getNumberOfDays();\n\n if( $workingDays > $requestNumberOfDays ) {\n //$logger->warning(\"Logical error getApprovedBeforeAcademicYearDays: number of calculated working days (\".$workingDays.\") are more than number of days in request (\".$subRequest->getNumberOfDays().\")\");\n $workingDays = $requestNumberOfDays;\n }\n\n if( $workingDays != $requestNumberOfDays ) {\n //inaccuracy\n //echo \"user=\".$request->getUser().\"<br>\";\n //echo \"Before: ID# \".$request->getId().\" inaccurate: workingDays=\".$workingDays.\" enteredDays=\".$subRequest->getNumberOfDays().\"<br>\";\n $accurate = false;\n //$accurateNoteArr[$request->getId()] = \"Submitted $requestNumberOfDays days off differ from $workingDays weekly working days\"; //based on 5 days per week\n }\n\n// //TODO: Use holiday dates to calculate the WCM working days\n// if( $accurate ) {\n// //$requestTypeStr = 'vacation' or 'business'\n// //getDaysDifferenceNote($vacreqRequest)\n// //count number of vacation days from $startDate and $endDate\n// $startDate = null;\n// $endDate = null;\n// if( $startStr ) {\n// $startDate = \\DateTime::createfromformat('Y-m-d H:i:s', $startStr);\n// }\n// if( $endStr ) {\n// $endDate = \\DateTime::createfromformat('Y-m-d H:i:s', $endStr);\n// }\n// $institution = $request->getInstitution();\n// $institutionId = null;\n// if( $institution ) {\n// $institutionId = $institution->getId();\n// }\n// //$countedNumberOfDays = $this->getNumberOfWorkingDaysBetweenDates($startDate,$endDate);\n// $holidays = $this->getHolidaysInRange($startDate,$endDate,$institutionId,$custom=false);\n// //$holidays = array(); $holidays[] = 1;//testing\n// $countedNumberOfDays = intval($workingDays) - count($holidays);\n//\n// if( $countedNumberOfDays != $requestNumberOfDays ) {\n// $accurate = false;\n// $accurateNoteArr[$request->getId()] = \"Submitted $requestNumberOfDays days off differ\".\n// \" from $countedNumberOfDays working days corrected by holidays\".\n// \" (\".intval($workingDays).\"-\".count($holidays).\")\";\n// }\n// //$accurate = false;\n// }\n\n //echo $request->getId().\": before: request days=\".$workingDays.\"<br>\";\n $days = $days + $workingDays;\n }\n\n $res = array(\n 'numberOfDays' => $days,\n 'accurate' => $accurate, //accurate = false indicates that calculation contains transition between academic year\n //'accurateNoteArr' => $accurateNoteArr\n );\n\n return $res;\n }", "public function getUserGrantedRequestTypes($user_id,$request_type='')\n {\n $request_types = DB::select( \n DB::raw(\"EXEC get_user_granted_rfr_request_types '\"\n .$user_id\n .\"','\".$request_type\n .\"';\") \n );\n \n return $request_types;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reassign documents to the default document set, where they'd previously have been assigned to pages
protected function reassignDocuments() { $countCheck = SQLSelect::create('*', 'DMSDocument_Pages'); if (!$countCheck->count()) { $this->output('There was no data to migrate. Finishing.'); return $this; } $query = SQLSelect::create(array('DMSDocumentID', 'SiteTreeID'), 'DMSDocument_Pages'); $result = $query->execute(); foreach ($result as $row) { $document = DMSDocument::get()->byId($row['DMSDocumentID']); if (!$document) { $this->addResult('Skipped: document does not exist'); continue; } $page = SiteTree::get()->byId($row['SiteTreeID']); if (!$page) { $this->addResult('Skipped: page does not exist'); continue; } // Don't try and process pages that don't have a document set. This should be created by the first // action step in this build task, so shouldn't occur if run in correct order. if (!$page->DocumentSets()->count()) { $this->addResult('Skipped: no default document set'); continue; } $this->addDocumentToSet($document, $page->DocumentSets()->first()); $this->addResult('Reassigned to document set'); } return $this; }
[ "public function resetDefault() {\r\n // delete content page where page_id = $this->page_id\r\n $contentTable = Engine_Api::_()->getDbtable('content', 'core');\r\n $contentTable->delete(array('page_id = ?' => $this->page_id));\r\n \r\n //copy content structure\r\n Engine_Api::_()->getApi('layout', 'ynbusinesspages')->resetPageProxy($this->page_id, $this->page_name);\r\n }", "public function restoreToDefault()\n {\n $this->lastCollection = $this->collection;\n $this->collection = clone $this->originalCollection;\n }", "private function __removeAllDocuments() {\n\t\t$posts = $this->Post->find('list', array('fields' => array('Post.rev')));\n\n\t\tforeach ($posts as $id => $post) {\n\t\t\t$this->Post->rev = $post;\n\t\t\t$this->Post->delete($id);\n\t\t}\n\t}", "public function reset_document()\n {\n if(is_null($this->summary))\n {\n throw new \\CollectionException(__('tapioca.no_collection_selected'));\n }\n\n $update = static::$db\n ->where(static::$summaryWhere)\n ->update(static::$dbCollectionName, array('$set' => array('documents' => (int) 0)), array(), true);\n\n if($update)\n {\n $this->summary['documents'] = (int) 0;\n }\n }", "public function testCreateDefaultDocumentSets()\n {\n $this->fixtureOldRelations();\n\n $result = $this->runTask(array('action' => 'create-default-document-set'));\n $this->assertContains('Finished', $result);\n // There are four pages in the fixture, but one of them already has a document set, so should be unchanged\n $this->assertContains('Default document set added: 3', $result);\n $this->assertContains('Skipped: already has a set: 1', $result);\n\n // Test that some of the relationship records were written correctly\n $this->assertCount(1, $firstPageSets = $this->objFromFixture('SiteTree', 'one')->getDocumentSets());\n $this->assertSame('Default', $firstPageSets->first()->Title);\n $this->assertCount(1, $this->objFromFixture('SiteTree', 'two')->getDocumentSets());\n\n // With dryrun enabled and being run the second time, nothing should be done\n $result = $this->runTask(array('action' => 'create-default-document-set', 'dryrun' => '1'));\n $this->assertContains('Skipped: already has a set: 4', $result);\n $this->assertContains('NOTE: Dryrun mode enabled', $result);\n }", "public function clearDocentes()\n\t{\n\t\t$this->collDocentes = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function resetDocFreqs(){\n $this->performInOrder(function($currentNode){\n if($currentNode->getTerm() !== null){\n if($currentNode->getTermFreq() < 1 && !$this->constructing_index && $currentNode->getTermExisted()){\n $newDocFreq = ($currentNode->getDocFreq() > 0)?$currentNode->getDocFreq() - 1: 0;\n $currentNode->setDocFreq($newDocFreq);\n }\n }\n }, $this->root_node, $this->root_node);\n \n }", "public function clearPagess()\n\t{\n\t\t$this->collPagess = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function index_rebuild() {\n\t\tglobal $wpdb;\n\n\t\t$default = \\SearchWP\\Settings::get_single( 'document_content_reset', 'boolean' );\n\t\t$skipped = apply_filters( 'searchwp\\source\\attachment\\skipped\\reset', $default );\n\t\t$content = apply_filters( 'searchwp\\source\\attachment\\attribute\\document_content\\reset', $default );\n\t\t$meta = apply_filters( 'searchwp\\source\\attachment\\attribute\\pdf_metadata\\reset', $default );\n\t\t$exif = apply_filters( 'searchwp\\source\\attachment\\attribute\\image_exif\\reset', $default );\n\n\t\tif ( $skipped ) {\n\t\t\t$wpdb->delete( $wpdb->prefix . 'postmeta', [ 'meta_key' => Document::$meta_key . '_skipped' ] );\n\t\t}\n\n\t\tif ( $content ) {\n\t\t\t$wpdb->delete( $wpdb->prefix . 'postmeta', [ 'meta_key' => SEARCHWP_PREFIX . 'content' ] );\n\t\t}\n\n\t\tif ( $meta ) {\n\t\t\t$wpdb->delete( $wpdb->prefix . 'postmeta', [ 'meta_key' => SEARCHWP_PREFIX . 'content_pdf_metadata' ] );\n\t\t}\n\n\t\tif ( $exif ) {\n\t\t\t$wpdb->delete( $wpdb->prefix . 'postmeta', [ 'meta_key' => SEARCHWP_PREFIX . 'image_exif' ] );\n\t\t}\n\t}", "public function clearRikssymDocumentEntitys()\n\t{\n\t\t$this->collRikssymDocumentEntitys = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function unloadDocument() {\n\t\tphpQuery::unloadDocuments($this->getDocumentID());\n\t}", "final public function removePages(): void\n {\n $this->pages = [];\n $this->index = [];\n }", "public function reset_items_pages() {\n global $DB;\n\n $whereparams = ['surveyproid' => $this->surveypro->id];\n $DB->set_field('surveypro_item', 'formpage', 0, $whereparams);\n }", "private function reset()\n {\n // Drop references to old DOM document.\n unset($this->xpath, $this->head, $this->body);\n\n // Reference of the document itself doesn't change here, but might need to change in the future.\n return $this;\n }", "public function setDocIdResetting($resetIds)\n {\n $this->_resetDocIds = $resetIds;\n }", "public function setDocuments(?array $documents)\n {\n $this->documents = $documents;\n }", "public function setDocIdResetting($resetIds) {\r\n\t\t$this->_resetDocIds = $resetIds;\r\n\t}", "public function __wakeup()\n {\n $this->documents = array();\n }", "public function refresh($document);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the defenderNetworkProtectionType Value indicating the behavior of NetworkProtection. Possible values are: userDefined, enable, auditMode, warn, notConfigured.
public function setDefenderNetworkProtectionType($val) { $this->_propDict["defenderNetworkProtectionType"] = $val; return $this; }
[ "public function getDefenderNetworkProtectionType()\n {\n if (array_key_exists(\"defenderNetworkProtectionType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"defenderNetworkProtectionType\"], \"\\Beta\\Microsoft\\Graph\\Model\\DefenderProtectionType\") || is_null($this->_propDict[\"defenderNetworkProtectionType\"])) {\n return $this->_propDict[\"defenderNetworkProtectionType\"];\n } else {\n $this->_propDict[\"defenderNetworkProtectionType\"] = new DefenderProtectionType($this->_propDict[\"defenderNetworkProtectionType\"]);\n return $this->_propDict[\"defenderNetworkProtectionType\"];\n }\n }\n return null;\n }", "public function setProtectionType($protectionType)\n {\n $this->protectionType = $protectionType;\n }", "public function setDefenderGuardMyFoldersType(?FolderProtectionType $value): void {\n $this->getBackingStore()->set('defenderGuardMyFoldersType', $value);\n }", "function setOptNetworkType($networkType) {\r\n // error check\r\n if ($networkType < 0 || $networkType > 3) {\r\n trigger_error (\"setNetworkType only accepts values between 0-3, see constants\", E_USER_ERROR);\r\n }\r\n $this->m_OptNetworkType = intval($networkType);\r\n }", "public function setDefenderSecurityCenterDisableNetworkUI(?bool $value): void {\n $this->getBackingStore()->set('defenderSecurityCenterDisableNetworkUI', $value);\n }", "public function setDefenderDisableOnAccessProtection($val)\n {\n $this->_propDict[\"defenderDisableOnAccessProtection\"] = boolval($val);\n return $this;\n }", "public function setDefenderAllowCloudProtection(?bool $value): void {\n $this->getBackingStore()->set('defenderAllowCloudProtection', $value);\n }", "public function setDefenderBlockPersistenceThroughWmiType(?DefenderAttackSurfaceType $value): void {\n $this->getBackingStore()->set('defenderBlockPersistenceThroughWmiType', $value);\n }", "public function setAuthenticationType(?WiredNetworkAuthenticationType $value): void {\n $this->getBackingStore()->set('authenticationType', $value);\n }", "public function getDefenderGuardMyFoldersType()\n {\n if (array_key_exists(\"defenderGuardMyFoldersType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"defenderGuardMyFoldersType\"], \"\\Beta\\Microsoft\\Graph\\Model\\FolderProtectionType\") || is_null($this->_propDict[\"defenderGuardMyFoldersType\"])) {\n return $this->_propDict[\"defenderGuardMyFoldersType\"];\n } else {\n $this->_propDict[\"defenderGuardMyFoldersType\"] = new FolderProtectionType($this->_propDict[\"defenderGuardMyFoldersType\"]);\n return $this->_propDict[\"defenderGuardMyFoldersType\"];\n }\n }\n return null;\n }", "public function setDefenderEmailContentExecutionType(?DefenderAttackSurfaceType $value): void {\n $this->getBackingStore()->set('defenderEmailContentExecutionType', $value);\n }", "public function setDefenderAllowOnAccessProtection(?bool $value): void {\n $this->getBackingStore()->set('defenderAllowOnAccessProtection', $value);\n }", "public function setSkypeMeNonTransactionalEnabled(\\Nogrod\\eBaySDK\\MerchantData\\SkypeMeNonTransactionalEnabledDefinitionType $skypeMeNonTransactionalEnabled)\n {\n $this->skypeMeNonTransactionalEnabled = $skypeMeNonTransactionalEnabled;\n return $this;\n }", "public function setCryptType($cryptType = 'Blowfish')\n {\n if (in_array(strtolower($cryptType), array('des', 'blowfish', 'ssl'))) {\n $this->crypt_type = $cryptType;\n }\n }", "protected function setDefaultBodyType($bodyType){\n $this->defaultBodyType = $bodyType;\n }", "public function setGrantType(string $grantType) {\n $this->defaultGrantType = $grantType;\n }", "function qtype_lti_force_type_config_settings($instance, array $typeconfig) {\n $forced = array('instructorchoicesendname' => 'sendname', 'instructorchoicesendemailaddr' => 'sendemailaddr',\n 'instructorchoiceacceptgrades' => 'acceptgrades');\n\n foreach ($forced as $instanceparam => $typeconfigparam) {\n if (array_key_exists($typeconfigparam, $typeconfig) && $typeconfig[$typeconfigparam] != QTYPE_LTI_SETTING_DELEGATE) {\n $instance->$instanceparam = $typeconfig[$typeconfigparam];\n }\n }\n}", "function set_user_type($user_type)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER_TYPE, $user_type);\r\n }", "public function setDefenderScanNetworkFiles($val)\n {\n $this->_propDict[\"defenderScanNetworkFiles\"] = boolval($val);\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
======================================================= printTop() Prints the heading of the webpage =======================================================
function printTop() { print " <div class='container-fluid'> \n". " <div class='page-header'> \n". " <div class='row'> \n". " <div class='col-xs-12'> \n". " <h1>Music Shop Checkout</h1> \n". " </div> <!--/col-xs-12--> \n". " </div> <!-- /row --> \n". " </div> <!-- /page-header --> \n"; }
[ "function printTop() {\n print\n \" <div class='container-fluid'> \\n\".\n \" <div class='page-header'> \\n\".\n \" <div class='row'> \\n\".\n \" <div class='col-xs-12'> \\n\".\n \" <h1>Music Shop Login</h1> \\n\".\n \" </div> <!--/col-xs-12--> \\n\".\n \" </div> <!-- /row --> \\n\".\n \" </div> <!-- /page-header --> \\n\";\n\n}", "public function print_header() {\n global $OUTPUT, $PAGE;\n $PAGE->set_heading(format_string($PAGE->course->fullname));\n $this->set_url();\n $this->set_session_url();\n\n $this->create_navbar();\n echo $OUTPUT->header();\n echo $this->wikioutput->content_area_begin();\n\n $this->print_help();\n $this->print_pagetitle();\n $this->setup_tabs();\n // Tabs are associated with pageid, so if page is empty, tabs should be disabled.\n if (!empty($this->page) && !empty($this->tabs)) {\n $tabthing = $this->wikioutput->tabs($this->page, $this->tabs, $this->taboptions); // Calls tabs function in renderer.\n echo $tabthing;\n }\n }", "public function renderTop()\n\t{\n\t\t/** @noinspection SpellCheckingInspection */\n\t\techo\n\t\t'<!DOCTYPE html>',\n\t\t'<html lang=\"en\">',\n\t\t'<head>';\n\t\t$this->renderHead();\n\t\techo\n\t\t'</head>',\n\t\t'<body>';\n\t}", "protected function displayTop()\n {\n $root = ROOT_URL;\n $webTitle = ine($this->controller->websiteTitle, ' ');\n echo <<<EOT\n <div id=\"top\">\n <a id=\"logo-link\" href=\"{$root}\" title=\"Hlavní strana webu{$webTitle}\">\n <img src=\"/images/geo/logo.png\">\n </a>\n <div id=\"top-right\">\n <a id=\"top-link\" href=\"{$root}\" title=\"Hlavní strana webu{$webTitle}\">\n {$this->controller->websiteTitle}\n </a>\n {$this->controller->cachedMenu}\n </div>\n </div>\nEOT;\n }", "public function indexTop() {\n print $this->render(indexTop);\n }", "public function printHeader($pageTitle) { return; }", "public function printHeader();", "function print_header() {\n parent::print_header();\n $this->print_pagetitle();\n }", "function printHeader()\n\t{\n\t\t$_SESSION['last_page'] = $_SERVER['QUERY_STRING'];\n\t\tif( isset($_SESSION['admin']) && $_SESSION['admin'])\n\t\t{\n\t\t\t$this->admin_nav = \"<a class=\\\"button\\\" href=\\\"?section=project_management\\\" title=\\\"Go to project management\\\">Project Management</a>\\n\n\t\t\t\t\\t\\t<a class=\\\"button\\\" href=\\\"?section=reference_value_management\\\" title=\\\"Go to reference value management\\\">Reference Value Management</a>\\n\n\t\t\t\t\\t\\t<a class=\\\"button\\\" href=\\\"?section=user_management\\\" title=\\\"Go to user management\\\">User Management</a>\\n\";\n\t\t}\n\t\t$this->initSessionVariables();\n\t\tinclude 'View/Header.html';\n\t}", "function print_head($page) {\n\techo \"<!DOCTYPE html>\" . PHP_EOL; \n\techo \"<html><head>\" . PHP_EOL;\n\techo \"<!-- Metadata -->\" . PHP_EOL;\n\techo \"<meta charset='utf-8'>\" . PHP_EOL;\n\techo \"<meta name='author' content='Hannu Ranta'/>\" . PHP_EOL;\n\techo \"<meta name='robots' content='all'/>\" . PHP_EOL;\n\techo \"<meta name='keywords' content='webstore, fishing'/>\" . PHP_EOL;\n\t\n\techo \"<!-- Title and stylesheet definitions -->\" . PHP_EOL;\n\techo \"<title>\" . $page . \"</title>\" . PHP_EOL;\n\techo \"<link href='style.css' rel='stylesheet' type='text/css' media='screen'/>\" . PHP_EOL;\n\techo \"<script type='text/javascript' src='scripts.js'></script>\" . PHP_EOL;\n\t\t\n\techo \"</head>\" . PHP_EOL;\n\techo \"<body>\" . PHP_EOL;\n\techo \"<!-- Header part -->\" . PHP_EOL;\n\techo \"<div id='header'><a href='index.php'><img style='border:0' src='img/header.png' alt='Shadowfishing'/></a></div>\" . PHP_EOL;\n}", "function head()\n {\n print($this->_head);\n }", "function print_heading(){\r\n\t\t$html='';\r\n\t\t$html.='<h1>'.$this->custom_page->page_name.'</h1>';\r\n\r\n\t\t//if the page allows multiple instances, add an \"Add instance\" button\r\n\t\tif($this->custom_page->allow_multiinstance){\r\n\t\t\t$html.='<a class=\"button new-instance-button\">Add New '.$this->custom_page->page_name.'</a>';\r\n\t\t}\r\n\r\n\t\techo $html;\r\n\t}", "private static function staticHTML_top() {\r\n $show = <<< EOF\r\n <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"cs\">\r\n <head>\r\n <title>\r\n STAG OOP |\r\n http://stag-portal.it</title>\r\n <meta http-equiv=\"Content-Type\" content=\"application/xhtml+xml; charset=UTF-8\" />\r\n <meta http-equiv=\"Content-Language\" content=\"cs\" />\r\n <meta name=\"author\" content=\"Trakal, Gajzler and Sonsky\" />\r\n <meta name=\"keywords\" content=\"STAG\" />\r\n <meta name=\"description\" content=\"The best of STAG agenda\" />\r\n <meta name=\"robots\" content=\"all,follow\" />\r\n <link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"/rss.xml\" />\r\n <link rel=\"stylesheet\" href=\"/css/screen.css\" type=\"text/css\" media=\"screen\" />\r\n <!-- not implemented <link rel=\"stylesheet\" href=\"/css/print.css\" type=\"text/css\" media=\"print\" /> -->\r\n </head>\r\n <body><div id=\"main\"><a href=\"/\"><img src=\"/img/top_logo.png\" alt=\"STAG\" /></a> <div id=\"top_menu\">\r\n <form class=\"left\" action=\"/index.php?action=login\" method=\"post\">\r\n </form>\r\n </div><!-- top_menu --> <div id=\"left_menu\">\r\n <ul>\r\n <li><a href=\"/\">Úvodní stránka</a></li>\r\n </ul>\r\n </div><!-- left_menu --> <div id=\"page\">\r\nEOF;\r\n\r\n echo $show;\r\n }", "function mainTop(){\n\t\techo \"<table align='center' cellpadding='0' cellspacing='0' width='\".$this->width.\"'>\\n<tr>\\n<td width='\".$this->width.\"' class='main-bg'>\\n\";\n\t}", "function displayHeader()\n\t{\n\t\t// output locator\n\t\t$this->displayLocator();\n\n\t\t// output message\n\t\tif($this->message)\n\t\t{\n\t\t\tilUtil::sendInfo($this->message);\n\t\t}\n\t\tilUtil::infoPanel();\n\n//\t\t$this->tpl->setTitleIcon(ilUtil::getImagePath(\"icon_pd_b.gif\"),\n//\t\t\t\"\");\n\t\t$this->tpl->setTitle($this->lng->txt(\"bookmarks\"));\n\t}", "public function printHTMLHeader($pageTitle = NULL, $redirectURL = NULL);", "public function printPage()\n {\n $this->printDoctype();\n $this->printOpenHtml();\n $this->printHead(' ');\n $this->printBody(' ');\n $this->printCloseHtml();\n }", "public function printHeader()\r\n {\r\n foreach($this->headerElemsArray as $elem){\r\n echo(\"$elem\\n\\t\\t\");\r\n }\r\n }", "protected function display_header () {\n\t\t$title\t= $this->title;\n\t\t/**\n\t\t * HTML presentation\n\t\t */\n\t\tif (!$this->cli) {\n\t\t\t@ini_set('output_buffering', 'off');\n\t\t\t@ini_set('zlib.output_compression', 'off');\n\t\t\tob_implicit_flush(true);\n\t\t\theader('Content-Type: text/html; charset=utf-8');\n\t\t\techo\t\"<!doctype html>\\n\".\n\t\t\t\t\t\"<title>$title: Test in progress 0%...</title>\\n\".\n\t\t\t\t\t\"<meta charset=\\\"utf-8\\\">\\n\".\n\t\t\t\t\t\"<style>html, body {font-size: 0; height: 100%; margin: 0; padding: 0; width: 100%;} body > p {background: #B9B9B9; display: inline-block; height: 10%; margin: 0; padding: 0; width: 10%;}</style>\\n\".\n\t\t\t\t\t\"<script>function update_title_percents(percent) {document.getElementsByTagName('title')[0].innerHTML = \\\"$title: Test in progress \\\" + percent + '%...'}</script>\".\n\t\t\t\t\tstr_repeat(' ', 1024 * 64);\n\t\t/**\n\t\t * CLI presentation\n\t\t */\n\t\t} else {\n\t\t\techo\t\"\\e[1m$title\\e[21m\\n\".\n\t\t\t\t\tstr_repeat('-', strlen($title)).\"\\n\\n\";\n\t\t\techo\t\"\\e[1ATest in progress 0%...\\n\";\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the domain used for cookies
function phpgw_set_cookiedomain() { $dom = $_SERVER['HTTP_HOST']; if (preg_match("/^(.*):(.*)$/",$dom,$arr)) { $dom = $arr[1]; } $parts = explode('.',$dom); if (count($parts) > 2) { if (!ereg('[0-9]+',$parts[1])) { for($i=1;$i<count($parts);$i++) { $this->cookie_domain .= '.'.$parts[$i]; } } else { $this->cookie_domain = ''; } } else { $this->cookie_domain = ''; } print_debug('COOKIE_DOMAIN',$this->cookie_domain,'api'); $this->set_cookie_params($this->cookie_domain); // for php4 sessions necessary }
[ "private function _set_cookie_domain() {}", "public function setCookieDomain ($domain = '') {\r\n\t\t\r\n\t\t$explicit = false;\r\n\t\t\r\n\t\tif ( ! $domain ) {\r\n\t\t\t$domain = $_SERVER['HTTP_HOST'];\r\n\t\t\t$explicit = true;\r\n\t\t}\r\n\t\t\r\n\t\t// strip port, add leading period etc.\r\n\t\t$domain = owa_lib::sanitizeCookieDomain($domain);\r\n\t\t\t\t\t\r\n\t\t// Set the cookie domain only if the domain name is a Fully qualified domain name (FQDN) \r\n\t\t// i.e. avoid attempts to set cookie domain for e.g. \"localhost\" as that is not valid \r\n\t\t\r\n\t\t//check for two dots in the domain name\r\n\t\t$twodots = substr_count($domain, '.');\r\n\t\t\r\n\t\tif ( $twodots >= 2 ) {\r\n\t\t\r\n\t\t\t// unless www.domain.com is passed explicitly\r\n\t\t\t// strip the www from the domain.\r\n\t\t\tif ( ! $explicit ) {\r\n\t\t\t\t$part = substr( $domain, 0, 5 );\r\n\t\t\t\tif ($part === '.www.') {\r\n\t\t\t\t\t//strip .www.\r\n\t\t\t\t\t$domain = substr( $domain, 5);\r\n\t\t\t\t\t// add back the leading period\r\n\t\t\t\t\t$domain = '.'.$domain;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$this->set('base','cookie_domain', $domain); \r\n\t\t\towa_coreAPI::debug(\"Setting cookie domain to $domain\"); \r\n \t\t} else {\r\n \t\t\towa_coreAPI::debug(\"Not setting cookie domain as $domain is not a FQDN.\");\r\n \t\t}\r\n \t}", "protected function getCookieDomain() {}", "private function setCookieDomain($server)\n {\n $host = \"\";\n if (array_key_exists('HTTP_HOST', $server)) {\n $host = $server[\"HTTP_HOST\"];\n if(strpos($host, \"www.\") === 0) {\n $host = substr($host, 4);\n }\n }\n $this->cookieDomain = $host;\n }", "public static function domain($domain){\n\t\tif(empty($domain)) return ini_get('session.cookie_domain');\n\t\tini_set('session.cookie_domain', $domain);\n\t}", "protected function getDomain() {\r\n $this->_domain = 'http://'.$_SERVER['HTTP_HOST'].DIRECTORY_SEPARATOR;\r\n }", "public static function getCookieDomain() {\n return SessionHandler::$COOKIE_DOMAIN;\n }", "public function setDomain($domain){ }", "public function It_can_set_cookies_with_the_same_name_for_multiple_domains()\n\t{\n\t\t/*\n\t\t$response = new Prack_Response();\n\t\t$response->setCookie( 'foo', array( 'value' => 'bar', 'domain' => 'sample.example.com' ) );\n\t\t$response->setCookie( 'foo', array( 'value' => 'bar', 'domain' => '.example.com' ) );\n\t\t$cookie_string = implode( \"\\n\", array( 'foo=bar; domain=sample.example.com', 'foo=bar; domain=.example.com' ) );\n\t\t$this->assertEquals( $cookie_string, $response->get( 'Set-Cookie' ) );\n\t\t*/\n\t\t$this->markTestSkipped( 'pending cookie implementation' );\n\t}", "private function get_cookie_domain() {\n\t\t$requested_domain_parts = explode( '.', $_SERVER['HTTP_HOST'] );\n\t\t$cookie_domain = array_pop( $requested_domain_parts );\n\t\t$cookie_domain = '.' . array_pop( $requested_domain_parts ) . '.' . $cookie_domain;\n\n\t\treturn $cookie_domain;\n\t}", "function setDomain( $domain ) {\n \n $this->domain = $domain;\n }", "public function get_cookie_domain() {\n\n\t\t// COOKIE_DOMAIN is false by default\n\t\t$cookie_domain = COOKIE_DOMAIN;\n\n\t\t$share_cookies = affiliate_wp()->settings->get( 'cookie_sharing', false );\n\n\t\t// providing a domain to jQuery.cookie or PHP's setcookie results prefixes the cookie domain\n\t\t// with a dot, indicating it should be shared with sub-domains\n\t\tif ( ! $cookie_domain && $share_cookies ) {\n\t\t\t$cookie_domain = parse_url( get_home_url(), PHP_URL_HOST );\n\t\t}\n\n\t\t/**\n\t\t * Filters the tracking cookie domain.\n\t\t *\n\t\t * @since 2.1.10\n\t\t *\n\t\t * @param string $cookie_domain cookie domain\n\t\t */\n\t\treturn apply_filters( 'affwp_tracking_cookie_domain', $cookie_domain );\n\t}", "function cookie_domain()\n{\n global $config;\n $r = array('http://www', 'https://www', 'http://', 'https://');\n $d = str_replace($r, '', $config['site_url']);\n $x = strpos($d, '/');\n $dom = $x ? substr($d, 0, $x) : $d;\n\n // except for localhost, return nothing (IE & Chrome doesn't accept 'localhost')\n if (strpos($config['site_url'], '//localhost')) {\n return '';\n } else {\n return $dom;\n }\n}", "function cookie_domain ()\n{\n\tglobal $config;\n\t$r = array ('http://www', 'https://www', 'http://', 'https://');\n\t$d = str_replace ($r, '', $config['site_url']);\n\t$x = strpos ($d, '/');\n\t$dom = $x ? substr ($d, 0, $x) : $d;\n\n\t// except for localhost, return nothing (IE & Chrome doesn't accept 'localhost')\n\tif (strpos ($config['site_url'], '//localhost'))\n\t\treturn '';\n\telse\n\t\treturn $dom;\n}", "public function setDomain($domain);", "public function getDomain() {\n return $this->domain ?: $this->domain = (string) ini_get('session.cookie_domain');\n }", "function wp_irving_jwt_token_cookie_domain( $domain ) {\n\treturn strstr( home_url(), 'alley.test' ) ? '.alley.test' : '.irvingjs.com';\n}", "public function getCookieDomainName()\n {\n return $this->_getCookieDomain();\n }", "function payswarm_set_authority_host_cookie($host) {\n global $_SERVER;\n setcookie('payswarm-authority-host', $host, 0, '/');\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return all the audio options
public function getAllAudioOptions() { return $this->audioOptions; }
[ "private function _audio_stream(): array\n\t{\n\t\treturn $this->__get_stream(self::CODEC_TYPE_AUDIO);\n\t}", "public function getAudio();", "private function getAudioSounds()\n {\n return [\n 'finish_task' => [\n [\n 'name' => 'Sound 1',\n 'file' => \"/audio/finish_task_1.wav\"\n ], [\n 'name' => 'Sound 2',\n 'file' => \"/audio/finish_task_2.wav\"\n ], [\n 'name' => 'Sound 3',\n 'file' => \"/audio/finish_task_3.wav\"\n ]\n ]\n ];\n }", "public function audio() {\n if(!is_null($this->audio)) return $this->audio;\n return $this->filterBy('type', 'audio');\n }", "public function getAudio()\n {\n return $this->get('audio');\n }", "public function getAudioConfigAliases()\n {\n if(empty($this->data[self::AUDIO_SET_ALIAS])){\n $this->data[self::AUDIO_SET_ALIAS] = array();\n }\n\n return $this->data[self::AUDIO_SET_ALIAS];\n }", "protected function audioExtensions()\n {\n return [\n 'mp3',\n 'wav',\n 'wma',\n 'm4a',\n 'ogg'\n ];\n }", "public function getAudio()\n {\n return $this->Audio;\n }", "function listAudioFiles() {\n $this->loadAudioFiles();\n return $this->audioFiles->getFileNames();\n }", "function wp_get_audio_extensions() {\n\t/**\n\t * Filter the list of supported audio formats.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param array $extensions An array of support audio formats. Defaults are\n\t * 'mp3', 'ogg', 'wma', 'm4a', 'wav'.\n\t */\n\treturn apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'wma', 'm4a', 'wav' ) );\n}", "function wp_get_audio_extensions() {\n\t/**\n\t * Filters the list of supported audio formats.\n\t *\n\t * @since 3.6.0\n\t *\n\t * @param array $extensions An array of support audio formats. Defaults are\n\t * 'mp3', 'ogg', 'flac', 'm4a', 'wav'.\n\t */\n\treturn apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'flac', 'm4a', 'wav' ) );\n}", "public function getAudio()\n {\n return $this->audio;\n }", "function snax_get_audio_allowed_types() {\n\treturn apply_filters( 'snax_audio_allowed_types', get_option( 'snax_audio_allowed_types', array( 'mp3' ) ) );\n}", "function eduplayer_audio_extensions() {\n $extensions = array(\n '.mp3',\n\t\t'.m4a'\n );\n return $extensions;\n}", "function getAudioAssets($params) {\n if (!is_array($params)) $params = array('id' => $params);\n $path_chunks = array('groups', $params['id'], 'audio-assets');\n $query_params = array();\n if (array_key_exists('limit', $params)) $query_params['max-results'] = $params['limit'];\n if (array_key_exists('offset', $params)) $query_params['start-index'] = $params['offset'] + 1;\n return $this->typepad->get($path_chunks, $query_params, 'List<Audio>');\n }", "public static function getMediaOptionsForSelect()\r\n {\r\n return array(\r\n self::MEDIUM_PRINT => self::MEDIUM_PRINT,\r\n self::MEDIUM_MAIL => self::MEDIUM_MAIL,\r\n self::MEDIUM_PERSOONLIJK => self::MEDIUM_PERSOONLIJK,\r\n self::MEDIUM_TELEFOON => self::MEDIUM_TELEFOON\r\n );\r\n }", "public function getOutputAudioConfig()\n {\n return $this->output_audio_config;\n }", "public function getAudioContents()\n {\n return $this->audio_contents;\n }", "public function getAll()\n\t{\n\t\treturn static::$options;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the paymentTerm property value. The paymentTerm property
public function getPaymentTerm(): ?PaymentTerm { $val = $this->getBackingStore()->get('paymentTerm'); if (is_null($val) || $val instanceof PaymentTerm) { return $val; } throw new \UnexpectedValueException("Invalid type found in backing store for 'paymentTerm'"); }
[ "public function getPaymentTerms()\n {\n return $this->paymentTerms;\n }", "public function getBusinessPartnerCreditTerm() {\n return $this->businessPartnerCreditTerm;\n }", "public function getDeliveryTerm();", "public function getTerm() {\n \treturn $this->getOffering()->getTerm();\n\t}", "public function getTerm()\n {\n return $this->Term;\n }", "function getPaymentTerms();", "public function getCollectPaymentTerms()\n {\n return $this->collectPaymentTerms;\n }", "public function getTerm() {\n\t\treturn $this->term;\n\t}", "public function getTerm()\n {\n return $this->term;\n }", "public function getTerm() {\n \treturn $this->session->getTermLookupSession()->getTerm($this->getTermId());\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->_payment;\n }", "public function getDOCUMENT_PRODUCT_UNITARY_VALUE()\n {\n return $this->DOCUMENT_PRODUCT_UNITARY_VALUE;\n }", "public function getFormattedPaymentTerm()\n {\n $dueDuration = $this->getPaymentTerm();\n\n if ($dueDuration > 1) {\n return __('admin::app.admin.system.due-duration-days', ['due-duration' => $dueDuration]);\n }\n\n return $dueDuration\n ? __('admin::app.admin.system.due-duration-day', ['due-duration' => $dueDuration])\n : __('admin::app.admin.system.due-duration-day', ['due-duration' => 0]);\n }", "public function getPayment()\n {\n return isset($this->Payment) ? $this->Payment : null;\n }", "public function getPaymentTermsRelativeTo(): string;", "public function getSpecifiedTradePaymentTerms()\n {\n return $this->specifiedTradePaymentTerms;\n }", "public function getStatusPayment()\r\n {\r\n return $this->statusPayment;\r\n }", "public function getMerchantTermsAttribute(){\n return $this->getMeta('policy');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete delivery method configs for delivery methods that no longer exist in system.
public function deleteObsoleteConfigs() { $this->storage->deleteObsoleteMethodConfigs(); }
[ "public function deleteObsoleteConfigs();", "protected static function deleteRemovedPaymentMethods()\n {\n foreach (self::$aRemovedPaymentMethods as $sPaymentId) {\n self::deletePaymentMethod($sPaymentId);\n }\n }", "function clearDelivery() {\n $this->storage['delivery_id'] = '';\n $this->storage['delivery_bonuses'] = 0;\n }", "public function removeConfigs()\n {\n /** @var \\Magento\\Framework\\App\\Config\\ConfigResource\\ConfigInterface $configResource */\n $configResource = Bootstrap::getObjectManager()->get(\n '\\Magento\\Framework\\App\\Config\\ConfigResource\\ConfigInterface'\n );\n foreach ($this->cleanup as list($path, $scopeType, $scopeId)) {\n $configResource->deleteConfig($path, $scopeType, $scopeId);\n }\n }", "private function removeAmqpConfig(array $config)\n {\n $this->env->log(\"Removing AMQP configuration from env.php.\");\n if (isset($config['queue']['amqp'])) {\n if (count($config['queue']) > 1) {\n unset($config['queue']['amqp']);\n } else {\n unset($config['queue']);\n }\n }\n\n return $config;\n }", "private function delete_config_files() {\n\t\t$this->delete( $this->config_path );\n\t}", "public function deleteBackupShippingMethod()\n {\n $id = $this->getConfigService()->getBackupCarrierId();\n\n /** @var Dispatch $carrier */\n if ($id !== null && $carrier = $this->getDispatchRepository()->find($id)) {\n $this->deleteShopwareEntity($carrier);\n }\n\n return true;\n }", "public static function purge()\n {\n $configTable = pSQL(_DB_PREFIX_ . 'configuration');\n $configLangTable = pSQL($configTable . '_lang');\n\n Db::getInstance()->execute(\n 'DELETE `' . $configLangTable . '` FROM `' . $configLangTable . '`\n LEFT JOIN `' . $configTable . '`\n ON `' . $configLangTable . '`.`id_configuration` = `' . $configTable . '`.`id_configuration`\n WHERE `' . $configTable . '`.`name` LIKE \"NOSTOTAGGING_%\"'\n );\n Db::getInstance()->execute(\n 'DELETE FROM `' . $configTable . '`\n WHERE `' . $configTable . '`.`name` LIKE \"NOSTOTAGGING_%\"'\n );\n\n // Reload the config.\n Configuration::loadConfiguration();\n\n return true;\n }", "public function cleanChosenPaymentMethod()\n {\n $this->session->delete(Session::CHOSEN_PAYMENT_METHOD);\n }", "public function deletePaymentMethod()\n {\n\n $payment_method = \\Stripe\\PaymentMethod::retrieve(\n\n 'pm_123456789'\n\n );\n\n $payment_method->detach();\n \n }", "public function remove()\n {\n secupay_log($this->sp_log, \"remove\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key IN ('\" . implode(\n \"', '\",\n $this->keys()\n ) . \"','MODULE_PAYMENT_SECUPAY_SK_XTC_ALLOWED') AND configuration_key NOT IN ('MODULE_PAYMENT_SECUPAY_APIKEY','MODULE_PAYMENT_SECUPAY_EXPERIENCE','MODULE_PAYMENT_SECUPAY_TAUTOSEND','MODULE_PAYMENT_SECUPAY_ORDER_BEFORE_PAYMENT','MODULE_PAYMENT_SECUPAY_SESSION')\");\n\n //check for other secupay payment module\n $qry = xtc_db_query(\"SELECT * FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key LIKE 'MODULE_PAYMENT_SP%_SORT_ORDER';\");\n\n if (xtc_db_num_rows($qry) == 0) {\n //no other secupay payment module installed, remove apikey\n secupay_log($this->sp_log, \"remove apikey\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_APIKEY'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_TAUTOSEND'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_EXPERIENCE'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_ORDER_BEFORE_PAYMENT'\");\n xtc_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key = 'MODULE_PAYMENT_SECUPAY_SESSION'\");\n }\n }", "public static function cleanupSimilarNotifications()\n {\n static::where('type', get_called_class())->delete();\n }", "public function cleanupProvidedRoutes()\n {\n $existingRoutes = $this->getStoredProvidedRoutes();\n\n /** @var RouteProvider $provider */\n foreach(config('dynamic-routing.route-providers') as $provider) {\n foreach($provider::getDefaultDynamicRoutes() as $providedRoute) {\n unset($existingRoutes[$providedRoute->name]);\n }\n }\n\n $deletedRoutes = $existingRoutes;\n foreach($existingRoutes as $route) {\n $route->delete();\n }\n\n return $deletedRoutes;\n }", "protected function deleteConfiguration(){\n Configuration::deleteByName($this->name.'_settings');\n }", "public function deleteAll() {\n $this->config = array();\n }", "protected function deleteConfigFiles()\n {\n foreach ($this->filesToDelete as $file) {\n if (file_exists($file)) {\n unlink($file);\n }\n }\n }", "public static function purgeExpiredConfigurations() {\n\t\tif ( wfReadOnly() ) return;\n\t\t$dbw = wfGetDB( DB_MASTER );\n\t\t# Find pages with expired configs...\n\t\t$config = self::getDefaultVisibilitySettings(); // config is to be reset\n\t\t$encCutoff = $dbw->addQuotes( $dbw->timestamp() );\n\t\t$ret = $dbw->select(\n\t\t\tarray( 'flaggedpage_config', 'page' ),\n\t\t\tarray( 'fpc_page_id', 'page_namespace', 'page_title' ),\n\t\t\tarray( 'page_id = fpc_page_id', 'fpc_expiry < ' . $encCutoff ),\n\t\t\t__METHOD__\n\t\t\t// array( 'FOR UPDATE' )\n\t\t);\n\t\t# Figured out to do with each page...\n\t\t$pagesClearConfig = array();\n\t\t$pagesClearTracking = $titlesClearTracking = array();\n\t\tforeach ( $ret as $row ) {\n\t\t\t# If FlaggedRevs got \"turned off\" (in protection config)\n\t\t\t# for this page, then clear it from the tracking tables...\n\t\t\tif ( FlaggedRevs::useOnlyIfProtected() && !$config['override'] ) {\n\t\t\t\t$pagesClearTracking[] = $row->fpc_page_id; // no stable version\n\t\t\t\t$titlesClearTracking[] = Title::newFromRow( $row ); // no stable version\n\t\t\t}\n\t\t\t$pagesClearConfig[] = $row->fpc_page_id; // page with expired config\n\t\t}\n\t\t# Clear the expired config for these pages...\n\t\tif ( count( $pagesClearConfig ) ) {\n\t\t\t$dbw->delete( 'flaggedpage_config',\n\t\t\t\tarray( 'fpc_page_id' => $pagesClearConfig, 'fpc_expiry < ' . $encCutoff ),\n\t\t\t\t__METHOD__\n\t\t\t);\n\t\t}\n\t\t# Clear the tracking rows and update page_touched for the\n\t\t# pages in $pagesClearConfig that do now have a stable version...\n\t\tif ( count( $pagesClearTracking ) ) {\n\t\t\tFlaggedRevs::clearTrackingRows( $pagesClearTracking );\n\t\t\t$dbw->update( 'page',\n\t\t\t\tarray( 'page_touched' => $dbw->timestamp() ),\n\t\t\t\tarray( 'page_id' => $pagesClearTracking ),\n\t\t\t\t__METHOD__\n\t\t\t);\n\t\t}\n\t\t# Also, clear their squid caches and purge other pages that use this page.\n\t\t# NOTE: all of these updates are deferred via $wgDeferredUpdateList.\n\t\tforeach ( $titlesClearTracking as $title ) {\n\t\t\tFlaggedRevs::purgeSquid( $title );\n\t\t\tif ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) {\n\t\t\t\tFlaggedRevs::HTMLCacheUpdates( $title ); // purge pages that use this page\n\t\t\t}\n\t\t}\n\t}", "public function testDeletePaymentMethod()\n {\n try {\n $config = new Gr4vyConfig(self::$gr4vyId, self::$privateKeyLocation);\n $payment_method_request = array(\n \"method\"=>\"card\",\n \"number\"=>\"4111111111111111\",\n \"expiration_date\"=>\"11/25\",\n \"security_code\"=>\"123\"\n );\n $result = $config->storePaymentMethod($payment_method_request);\n $this->assertArrayHasKey(\"id\", $result);\n $this->assertEquals($result[\"method\"], \"card\");\n\n $result = $config->deletePaymentMethod($result[\"id\"]);\n $this->assertArrayHasKey(\"success\", $result);\n } catch (Exception $e) {\n $this->fail(\"Exception thrown: \" . $e->getMessage());\n }\n }", "public function clearConfig();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Maps settings to param variables.
public static function settings_to_params() { return [ 'dropcap_color' => 'color', 'dropcap_text_color' => 'text_color', ]; }
[ "private function set_params()\n {\n $this->params = json_decode(preg_replace($this->mask[0], $this->mask[1], file_get_contents(_GEN_ROOT . \"/data/params.json\")));\n\n $this->scheme = isset($_POST['scheme']) && in_array(preg_replace('/[^A-Za-z]*/', '', $_POST['scheme']), $this->params->scheme->options)\n ? $_POST['scheme']\n : $this->params->scheme->options[$this->params->scheme->value];\n\n $this->map = json_decode(preg_replace($this->mask[0], $this->mask[1], file_get_contents(_GEN_ROOT . \"/data/maps/$this->scheme.json\")));\n\n if ($this->locale === 'en') {\n $this->params->_template->locale = $this->params->_template->en->locale;\n $this->map->_tabs->width = $this->map->_tabs->width_eng;\n }\n }", "public static function settings_to_params() {\n\t\t\t\treturn [\n\t\t\t\t\t'video_max_width' => 'width',\n\t\t\t\t\t'video_controls' => 'controls',\n\t\t\t\t\t'video_preload' => 'preload',\n\t\t\t\t];\n\t\t\t}", "public static function settings_to_params() {\n\n\t\t\t\treturn [\n\t\t\t\t\t'google_map_api_type' => 'api_type',\n\t\t\t\t];\n\t\t\t}", "public static function settings_to_params() {\n\t\t\treturn [\n\t\t\t\t'animation_offset' => 'animation_offset',\n\t\t\t\t'col_margin[top]' => 'margin_top',\n\t\t\t\t'col_margin[bottom]' => 'margin_bottom',\n\t\t\t];\n\t\t}", "public static function settings_to_params() {\r\n\t\t\treturn [\r\n\t\t\t\t'animation_offset' => 'animation_offset',\r\n\t\t\t\t'col_margin[top]' => 'margin_top',\r\n\t\t\t\t'col_margin[bottom]' => 'margin_bottom',\r\n\t\t\t];\r\n\t\t}", "public static function settings_to_params() {\n\t\t\t\treturn [\n\t\t\t\t\t'timeline_bg_color' => 'grid_box_color',\n\t\t\t\t\t'timeline_color' => 'grid_element_color',\n\t\t\t\t\t'blog_grid_padding' => 'blog_grid_padding',\n\t\t\t\t\t'blog_grid_columns' => 'blog_grid_columns',\n\t\t\t\t\t'blog_grid_column_spacing' => 'blog_grid_column_spacing',\n\t\t\t\t\t'blog_excerpt' => 'excerpt',\n\t\t\t\t\t'blog_excerpt_length' => 'excerpt_length',\n\t\t\t\t];\n\t\t\t}", "public static function settings_to_params() {\n\t\t\t\treturn [\n\t\t\t\t\t'animation_offset' => 'animation_offset',\n\t\t\t\t\t'imageframe_blur' => 'blur',\n\t\t\t\t\t'imgframe_border_color' => 'bordercolor',\n\t\t\t\t\t'imageframe_border_radius' => 'borderradius',\n\t\t\t\t\t'imageframe_border_size' => 'bordersize',\n\t\t\t\t\t'imgframe_style_color' => 'stylecolor',\n\t\t\t\t\t'imageframe_style_type' => 'style_type',\n\t\t\t\t];\n\t\t\t}", "protected static function generateParamMap() {\n $map_files = [\n 'actions' => config('common.param_map_file'),\n 'triggers' => config('common.trigger_param_file'),\n ];\n foreach ($map_files as $folder => $map_file) {\n $map = [];\n foreach (static::getPHPFiles(getenv('APP_DIR') . '/' . $folder) as $file) {\n $content = file_get_contents($file);\n if (preg_match_all('/^\\s*\\*\\s*\\@param\\s+([a-z]+)\\s+(.+?)$/ium', $content, $m)) {\n foreach ($m[0] as $k => $matches) {\n $map[$file][] = [\n 'name' => $param = substr(strtok($m[2][$k], ' '), 1),\n 'type' => $m[1][$k],\n 'default' => trim(substr($m[2][$k], strlen($param) + 1)) ?: null,\n ];\n }\n }\n }\n App::writeJSON($map_file, $map);\n }\n }", "protected function get_params_mapping()\n\t{\n\t\treturn [];\n\t}", "protected function set_params() {}", "private function localize_map_params() {\n\t\t\n\t\t//Init vars\n\t\tglobal $prso_google_maps_infowindow;\n\t\t$map_params \t= array();\n\t\t$marker_data\t= array();\n\t\t$view_path \t\t= $this->view_template_path . '/info_window_view.php';\n\t\t$map_data\t\t= $this->map_data_cache;\n\t\t\n\t\t//Setup data for creating map markers/info windows\n\t\tif( !empty($map_data) ) {\n\t\t\t\n\t\t\t//Cache map places LatLng and any rich content\n\t\t\tforeach( $map_data as $key => $dataArray ) {\n\t\t\t\t\n\t\t\t\t$marker_data[$key]['lat'] \t= $dataArray['lat'];\n\t\t\t\t$marker_data[$key]['lng'] \t= $dataArray['lng'];\n\t\t\t\t\n\t\t\t\t$marker_data[$key]['title'] = $dataArray['title'];\n\t\t\t\t\n\t\t\t\t//Set content param for view template\n\t\t\t\t$prso_google_maps_infowindow = $dataArray['content'];\n\t\t\t\t\n\t\t\t\t//Cache html content\n\t\t\t\tob_start();\n\t\t\t\t\t$this->include_file( $view_path, FALSE );\n\t\t\t\t\t$marker_data[$key]['html'] \t= ob_get_contents();\n\t\t\t\tob_end_clean();\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\t//Setup data for map api params - get these from database?\n\t\t$map_params = array(\n\t\t\t'canvasID' \t=> 'prso-gmaps-map',\n\t\t\t'zoom'\t\t=> 3,\n\t\t\t'center'\t=> array(\n\t\t\t\t\t\t\t\t'lat' => '',\n\t\t\t\t\t\t\t\t'lng' => ''\t\n\t\t\t\t\t\t\t),\n\t\t\t'mapType'\t=> '',\n\t\t\t'markerImages' => plugins_url( 'images/markers', PrsoGmapsConfig::$plugin_file_path )\n\t\t);\n\t\t\n\t\t//Localize params from plugin js\n\t\twp_localize_script( 'prso_google_maps', 'prsoGmapPlaces', $marker_data );\n\t\twp_localize_script( 'prso_google_maps', 'prsoGmapOptions', $map_params );\n\t\t\n\t}", "function getParameters() {\n $ar = split(\";\", $GLOBALS[\"pagedata\"][\"module\"]);\n for ($c = 0; $c < sizeof($ar); $c++) {\n $a = split(\"=\", $ar[$c]);\n $this->module_param[$a[0]] = $a[1];\n }\n }", "public function injectSettings(array $settings) {\n\n\t}", "function get_settings( $settings, $setting, $my_param ) {\n\t}", "function map_vars($mapping, $post_vars)\n{\n $obj = array();\n while (list($key,$val) = each($mapping))\n {\n if($post_vars[$key] != \"\") {\n $obj[$val] = $post_vars[$key];\n }\n }\n return $obj;\n}", "protected function loadParameters()\n {\n $this->cflHost = $this->loadSetting('confluence-host');\n $this->cflSpace = $this->loadSetting('confluence-space');\n $this->cflPage = $this->loadSetting('confluence-page');\n $this->cflUser = $this->loadSetting('user');\n $this->cflPass = $this->loadSetting('password');\n $this->filter = $this->loadSetting('filter', false);\n $this->noDeploy = $this->loadSetting('no_deploy', false);\n }", "function map_vars($mapping, $post_vars, &$NsMapping, $ns)\n{\n $obj = array();\n while (list($key,$val) = each($mapping))\n {\n if ($NsMapping[$val]==$ns) \n $obj[$val] = $post_vars[$key];\n }\n return $obj;\n}", "abstract function mapParamToKeys();", "protected function prepareParams()\n\t{\n\t\t$params = [];\n\t\t$filename = $this->path . 'params.php';\n\n\t\tif (is_file($filename)) {\n\t\t\tinclude($filename);\n\n\t\t\t$this->assign($params);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets ownership of Item to Owner
public function setOwner($item_id, $owner_id) { $sql = "UPDATE items SET owner_id=:owner_id WHERE item_id = :item_id"; $query = $this->db->prepare($sql); $query->execute(array( ':owner_id' => $owner_id, ':item_id' => $item_id )); }
[ "protected function setOwner($owner) {\r\n $this->owner = $this->create($owner);\r\n }", "function setOwner($owner) {\r\r\n\t\t$this->owner = $owner;\r\r\n\t}", "function setOwner(&$owner)\n {\n assert('$id = $this->getObjectId()');\n assert('$oid = $this->owner->getObjectId()');\n assert('$nid = $owner->getObjectId()');\n assert('Debug::log(\"Component: changing owner of \\'$id\\' from \\'$oid\\' to \\'$nid\\'\")');\n $this->owner =& $owner;\n }", "function setOwnerForAssignor()\n {\n $recipTable = mapi_message_getrecipienttable($this->message);\n $recips = mapi_table_queryallrows($recipTable, array(PR_DISPLAY_NAME));\n\n if (!empty($recips)) {\n $owner = array();\n foreach ($recips as $value) {\n $owner[] = $value[PR_DISPLAY_NAME];\n }\n\n $props = array($this->props['owner'] => implode(\"; \", $owner));\n mapi_setprops($this->message, $props);\n }\n }", "public function setOwner(WebUserEntry $owner = null);", "public function changeOwner($user_name);", "public function setOwner($args, $assoc_args) {\n $site = $this->sites->get(\n Input::siteName(array('args' => $assoc_args))\n );\n $workflow = $site->setOwner($assoc_args['set']);\n $workflow->wait();\n $this->workflowOutput($workflow);\n }", "public function setOwnerGuid($guid);", "public function setOwner($owner) {\n chown($this->__full_path, $owner);\n }", "public function setItem(ItemOrcamento $oItem) {\n $this->oItem = $oItem;\n }", "protected function _set_owner($value) {\n // add author's username to the appropriate rules\n if (isset($this->policy) && isset($this->policy->draft))\n $this->policy->draft->condition->user = $value;\n parent::_set_owner($value);\n }", "public function setOwnerUserId($ownerUserId);", "protected function _set_owner($value) {\n // add author's username to the appropriate rules\n if (isset($this->policy) && isset($this->policy->draft))\n $this->policy->draft->condition->user = $value;\n\n // store author's username in rels-ext as author\n if (isset($this->rels_ext)) {\n if (isset($this->rels_ext->author)) $this->rels_ext->author = $value;\n else $this->rels_ext->addRelation(\"rel:author\", $value);\n }\n parent::_set_owner($value);\n }", "function setOwner() {\n if(isset($_SESSION['PHPWS_User'])) {\n if(isset($_SESSION['PHPWS_User']->username)) {\n $this->_owner = $_SESSION['PHPWS_User']->username;\n } else {\n $this->_owner = NULL;\n $error = 'The user session did not contain a name in PHPWS_Item::setOwner().';\n return PEAR::raiseError($error);\n }\n } else {\n $this->_owner = NULL;\n $error = 'The user session was not available in PHPWS_Item::setOwner().';\n $er = new PEAR;\n return $er->raiseError($error);\n }\n }", "public function setIdOwner($idOwner)\n {\n $this->idOwner = $idOwner;\n }", "private function setOwnerValue(FormEvent $event): void\n {\n if (!$event->getForm()->has(self::OWNER_FIELD)) {\n return;\n }\n\n $owner = $event->getForm()->get(self::OWNER_FIELD)->getData();\n if (!$owner) {\n return;\n }\n\n /** @var Client $client */\n $client = $event->getData();\n $client->setOwnerEntity(ClassUtils::getClass($owner), $owner->getId());\n }", "public function withOwner($value)\n {\n $this->setOwner($value);\n return $this;\n }", "public function markAsNotOwner(){\n\t\t$this->forceFill(['is_owner' => false])->save();\n\t\treturn $this;\n\t}", "public function setOwner($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Storage\\V2\\Owner::class);\n $this->owner = $var;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the current curl verison if curl is installed
public function get_curl_version() { if ( function_exists( 'curl_version' ) ) { $curl = curl_version(); if ( isset( $curl['version'] ) ) { return $curl['version']; } } return false; }
[ "public function version()\n {\n $version = curl_version();\n return $version;\n }", "function curl_version() {}", "public function getVersion() {\n\t\treturn curl_version();\n\t}", "public function version()\n {\n return curl_version();\n }", "public function version() {\n\t\treturn curl_version();\n\t}", "protected function get_curl_version()\n {\n }", "public function isCurlEnabled()\n {\n return function_exists('curl_version') ? '1' : '0';\n }", "function isCurlInstalled()\n {\n return function_exists('curl_version');\n }", "private function curlInstalled() {\n return in_array('curl', get_loaded_extensions()) && function_exists('curl_version');\n }", "function curl_enabled() {\n return function_exists('curl_version');\n}", "public static function isCurlActivated()\n {\n return function_exists('curl_version');\n }", "function envira_curl_available() {\n\t\treturn extension_loaded( 'curl' );\n\t}", "function get_tls_version($curl_ssl_opt = null)\n{\n $c = curl_init();\n curl_setopt($c, CURLOPT_URL, \"https://www.howsmyssl.com/a/check\");\n curl_setopt($c, CURLOPT_RETURNTRANSFER, true);\n if ($sslversion !== null) {\n curl_setopt($c, CURLOPT_SSLVERSION, $sslversion);\n }\n $rbody = curl_exec($c);\n if ($rbody === false) {\n $errno = curl_errno($c);\n $msg = curl_error($c);\n curl_close($c);\n return \"Error! errno = \" . $errno . \", msg = \" . $msg;\n } else {\n $r = json_decode($rbody);\n curl_close($c);\n return $r->tls_version;\n }\n}", "protected function curlHttpVersion()\n {\n switch ($this->request->version) {\n case '1.0':\n curl_setopt($this->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n break;\n case '1.1':\n curl_setopt($this->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n break;\n default:\n // let curl decide\n curl_setopt($this->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_NONE);\n break;\n }\n }", "protected function getHttpVersion(): int\n {\n\t$http_version = CURL_HTTP_VERSION_1_1;\n\t$curlopt = getenv('CURLOPT_HTTP_VERSION');\n\tswitch ($curlopt) {\n\t case false:\n break;\n case 'CURL_HTTP_VERSION_1_0':\n $http_version = constant($curlopt);\n break;\n case 'CURL_HTTP_VERSION_1_1':\n $http_version = constant($curlopt);\n break;\n case 'CURL_HTTP_VERSION_2':\n $http_version = constant($curlopt);\n break;\n case 'CURL_HTTP_VERSION_2_0':\n $http_version = constant($curlopt);\n break;\n default:\n\t\techo \"Unknown HTTP version $curlopt, continuing anyway\";\n\t\t$http_version = 0;\n }\n\treturn $http_version;\n }", "public function curl_enabled()\n {\n if (function_exists('curl_version')) {\n return true;\n }\n\n return false;\n }", "public function isCurlSupported() {\n\t\treturn extension_loaded( 'curl' );\n\t}", "protected function curlEnabled()\n {\n return function_exists('curl_version');\n }", "function _is_curl_installed() {\n if (in_array ('curl', get_loaded_extensions())) {\n return true;\n }\n else {\n return false;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display the specified driverStripe.
public function show($id) { $driverStripe = $this->driverStripeRepository->findWithoutFail($id); if (empty($driverStripe)) { Flash::error('Driver Stripe not found'); return redirect(route('driverStripes.index')); } return view('driver_stripes.show')->with('driverStripe', $driverStripe); }
[ "public function payWithStripe()\n {\n return view('front.visaTestingDemo');\n }", "public function payWithStripe()\n {\n if (file_exists(resource_path('views/extend/back-end/paymentstripe.blade.php'))) {\n return view('extend.back-end.paymentstripe');\n } else {\n return view('back-end.paymentstripe');\n }\n }", "public function payWithStripe()\n {\n if (file_exists(resource_path('views/extend/back-end/paymentstripe.blade.php'))) {\n return view('extend.back-end.paymentstripe');\n } elseif (file_exists(resource_path('views/back-end/paymentstripe.blade.php'))) {\n return view('back-end.paymentstripe');\n } else {\n abort(404);\n }\n }", "private function fillStripeCardWidget() {\n $expYear = date('y') + 1;\n // Wait for the credit card form to load in.\n $stripeCardElement = $this->assertSession()->waitForElementVisible('xpath', '//div[contains(@class, \"StripeElement\")]/div/iframe');\n $this->assertNotEmpty($stripeCardElement);\n $this->getSession()->switchToIFrame($stripeCardElement->getAttribute('name'));\n $this->assertSession()->assertWaitOnAjaxRequest();\n\n $this->assertSession()->waitForElementVisible('css', 'input[name=\"cardnumber\"]');\n $this->getSession()->getPage()->fillField('cardnumber', '4111 1111 1111 1111');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->getSession()->getPage()->fillField('exp-date', '11 / ' . $expYear);\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->getSession()->getPage()->fillField('cvc', '123');\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->getSession()->getPage()->fillField('postal', '12345');\n $this->assertSession()->assertWaitOnAjaxRequest();\n\n $this->getSession()->switchToIFrame();\n }", "public function show($giftcard_id) {\n return \"You are looking for giftcard with id: \".$giftcard_id;\n }", "public function find($stripeId);", "public function stripe_authorize_button() {\n $vendor_id = get_current_user_id();\n $key = get_user_meta( $vendor_id, '_stripe_connect_access_key', true );\n $connected_vendor_id = get_user_meta( $vendor_id, 'dokan_connected_vendor_id', true );\n $auth_url = '#';\n $disconnect_url = '#';\n\n if ( empty( $key ) && empty( $connected_vendor_id ) ) {\n $auth_url = Auth::get_vendor_authorize_url();\n } else {\n $disconnect_url = Auth::get_vendor_deauthorize_url();\n }\n\n Helper::get_template( 'vendor-settings-payment', [\n 'vendor_id' => $vendor_id,\n 'key' => $key,\n 'connected_vendor_id' => $connected_vendor_id,\n 'auth_url' => $auth_url,\n 'disconnect_url' => $disconnect_url,\n ] );\n }", "public function printDriver(Driver &$driver)\n {\n\n $session = new Session();\n\n $session->regenerate(TRUE);\n\n $token = RandomToken::generate();\n\n $session->add($token, 'vote_key');\n\n $this->screen->add($driver->getPlate(), 'plate');\n\n $this->screen->add($driver->getTimeStamp(), 'timestamp');\n\n $likes = $driver->getPlus();\n\n $fails = $driver->getMinus();\n\n if($likes > $fails)\n {\n $image = \"happy\";\n }\n elseif ($likes == $fails)\n {\n $image = \"unsure\";\n }\n else\n {\n $image = \"sad\";\n }\n\n $plus_link =\n \"/vote/plus/{$driver->getPlate()}/$token\";\n\n $minus_link =\n \"/vote/minus/{$driver->getPlate()}/$token\";\n\n $this->screen->add($likes, 'likes');\n\n $this->screen->add($fails, 'fails');\n\n $this->screen->add($plus_link, 'plus_link');\n\n $this->screen->add($minus_link, 'minus_link');\n\n $this->screen->add($image, 'image');\n\n return;\n }", "private function setStripeDetails()\n {\n $this->setStripeApi();\n $token = $this->stripeCardToken();\n $this->stripeCustomerId = $this->stripeCustomerId($token);\n $this->cardBrand =$token->card->brand;\n $this->cardLastFour = $token->card->last4;\n }", "public function display()\n {\n echo 'Not Dealt: ';\n\n foreach ($this->nd as $card) {\n echo $card->display() . ' ';\n }\n echo \"\\n\";\n\n echo 'Dealt: ';\n\n foreach ($this->d as $card) {\n echo $card->display() . ' ';\n }\n\n echo \"\\n\";\n }", "function link_card()\n\t{\n\t\tlog_message('debug', 'Account/link_card');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['featuredBanks'] = $this->_api->get('money/banks', array('offset'=>0, 'limit'=>'10', 'isFeatured'=>'Y'));\n\n\t\t$data = load_page_labels('link_card', $data);\n\t\t$this->load->view('account/link_card', $data);\n\t}", "function render_stripe_nudge() {\n\tif ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {\n\t\t\\jetpack_require_lib( 'memberships' );\n\t\t$blog_id = get_current_blog_id();\n\t\t$settings = (array) \\get_memberships_settings_for_site( $blog_id );\n\n\t\treturn stripe_nudge(\n\t\t\t$settings['connect_url'],\n\t\t\t__( 'Connect to Stripe to use this block on your site.', 'jetpack' ),\n\t\t\t__( 'Connect', 'jetpack' )\n\t\t);\n\t} elseif ( jetpack_is_atomic_site() ) {\n\t\t// On Atomic sites, the Stripe connection url is not easily available\n\t\t// server-side, so we redirect them to the post in the editor in order\n\t\t// to connect.\n\t\treturn stripe_nudge(\n\t\t\tget_edit_post_link( get_the_ID() ),\n\t\t\t__( 'Connect to Stripe in the editor to use this block on your site.', 'jetpack' ),\n\t\t\t__( 'Edit post', 'jetpack' )\n\t\t);\n\t}\n\n\t// The Premium Content block is not supported on Jetpack sites.\n\treturn '';\n}", "public function payWithStripe()\n {\n $cart = HomeController::cart();\n \n \n return view('cart.paywithstripe',compact('cart'));\n }", "protected function registerStripe()\n {\n $this->app->singleton('stripe', function ($c) {\n return new Stripe($this->config['secret'], $this->config['version']);\n });\n }", "public function printCards()\n {\n $this->createCards();\n $this->renderCards();\n }", "function displayDriverRecords(){\nglobal $con;\n\n$sql = \"SELECT * FROM driver_details\";\n$result = $con->query($sql);\n\n if($result->num_rows > 0){\n echo (\"<center>\");\n echo (\"<table>\");\n echo (\"<tr>\");\n echo (\"<th>Driver ID</th>\");\n echo (\"<th>First Name</th>\");\n echo (\"<th>Last Name</th>\");\n echo (\"<th>Gender</th>\");\n echo (\"<th>Phone No.</th>\");\n echo (\"<th>E-mail</th>\");\n echo (\"<th>Address</th>\");\n echo (\"<th>Licence No.</th>\");\n echo (\"<th>Password</th>\");\n echo (\"<th>Birthday</th>\");\n echo (\"</tr>\");\n //read data and store in a array\n while($record = $result->fetch_assoc()){\n echo \"<tr>\";\n echo \"<td>\" .$record[\"driverID\"]. \"</td>\".\"<td>\" .$record[\"firstName\"]. \"</td>\".\"<td>\" .$record[\"lastName\"]. \"</td>\";\n echo \"<td>\" .$record[\"gender\"]. \"</td>\".\"<td>\" .$record[\"phoneNo\"]. \"</td>\";\n echo \"<td>\" .$record[\"email\"]. \"</td>\".\"<td>\" .$record[\"address\"]. \"</td>\".\"<td>\" .$record[\"licenceNo\"]. \"</td>\";\n echo \"<td>\" .$record[\"password\"]. \"</td>\".\"<td>\" .$record[\"DOB\"]. \"</td>\";\n echo \"</tr>\";\n }\n echo \"</table>\";\n echo (\"</center>\");\n }\n else{\n echo \"no results found in the database\";\n }\n}", "public function displaycredit_payment() {\n\t\t$this->_html .\n\t\t'</p><p style=\"text-align: center;\"></p><div style=\"clear: right;\"></div></div>'\n\t\t.'<img src=\"'.Configuration::get('CCPAY_MARK_BUTTON_IMG').'\" style=\"float:left; margin-right:15px;\" /><b>'\n\t\t.$this->l ( 'Payment Gateway.' ) . '</b><br /><br />' . '<br />' . '<div style=\"clear:both;\">&nbsp;</div>';\n\t}", "public function asStripeCard()\n {\n return $this->card;\n }", "public function printOwnerCard($id)\n {\n $owner = Owner::findOrFail($id);\n $owner->print_status = 1;\n $owner->renew_status = 0;\n $owner->print_count = $owner->print_count + 1;\n $owner->print_date = date('Y-m-d H:s:i');\n $owner->save();\n\n\n $customPaper = [0, 0, 459.213, 731.339];\n $pdf = PDF::loadView('printer.owner.print', ['owner' => $owner])->setPaper($customPaper, 'landscape');\n $fileName = $owner->name;\n return $pdf->stream($fileName . '.pdf');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Agregar pagina en PDF
public function PDF_Add() { $this->PDF->AddPage(); }
[ "public function PDF_Add() {\n $this->PDF->AddPage();\n }", "function addPage($pdf, $font = 'freesans') {\n\t\t$pdf->AddPage();\n\t\t$pdf->SetXY(80, 0);\n\t\t$pdf->SetFont($font, '', 20);\n\t\t\n\t\t$pdf->write(30, \"Fluxo de Caixa\");\n\t\t//$pdf->writeHTML('Fluxo de Caixa');\n\t\t$pdf->SetXY(10, 24);\n\t\t$pdf->SetFont($font, 'B', 11);\n\t\t//$pdf->Cell(190, 10, \"Contas a Pagar\", 1, 1, \"C\");\n\t\t$pdf->Cell(100, 5, \"Título\", 1, 0, \"C\");\n\t\t$pdf->Cell(30, 5, \"Dt. Venc.\", 1, 0, \"C\");\n\t\t$pdf->Cell(30, 5, \"Valor\", 1,0, \"C\");\n\t\t$pdf->Cell(30, 5, \"Valor\", 1, 1, \"C\");\n\t}", "public function imprimirPdf()\n {\n $url = Storage::url('public/100-JEAN-CARLOS-ACNAPURI.pdf');\n //return $url;\n //$contents = Storage::files('/public/100-JEAN-CARLOS-ACNAPURI.pdf');\n $printerId = '2147c452-5582-a70c-a44d-a65f8fc99757';\n GoogleCloudPrint::asPdf()\n ->file('storage/100-JEAN-CARLOS-ACNAPURI.pdf')\n ->range(1, 1)\n ->printer($printerId)\n ->marginsInCentimeters(5, 5, 5, 5)\n ->send();\n return View('index');\n }", "function PDF_new(){}", "public function pdf($pdf);", "function visitasPDF()\n\t{\n\t\t$wlidvisita=$this->argumentos[\"wl_idvisita\"];\n\t\t//echo \"<error>$wlidvisita</error>\t\";\n \techo \"<abresubvista></abresubvista>\";\n \techo \"<wlhoja>visitasPDF.php</wlhoja>\";\n \techo \"<wlcampos>wlidvisita=\".$wlidvisita.\"</wlcampos>\";\n \techo \"<wldialogWidth>50</wldialogWidth>\";\n \techo \"<wldialogHeight>30</wldialogHeight>\"; \t\n }", "public function getPDF()\n {\n\n $fpdf = new PDF();\n $docentes = Docente::all();\n $columnas = ['NRO','CODIGO','APELLIDOS Y NOMBRES'];\n $fpdf->AddPage();\n $fpdf->Cell(80);\n $fpdf->Cell(30,5,'Lista de Docentes',0,1,'C');\n $fpdf->SetFont('Arial','B',9);\n $fpdf->Ln(2);\n $fpdf->SetFont('Arial','B',16);\n\n $fpdf->docentes($columnas,$docentes);\n $fpdf->Output();\n exit;\n }", "public function asPdf();", "protected function generar_pdf_encabezado_pie(){}", "abstract public function getPdf();", "function intestazione_doc_pdf($_cosa, $datidoc, $LINGUA, $_anno, $_titolo, $_pg, $pagina, $_parametri)\n{//inizio funzioni testata documenti\n//\n global $conn;\n global $dec;\n global $_percorso;\n \n//per prima cosa passiamo l'inclusione dei files vars.php\n require $_percorso.\"../setting/vars.php\";\n // includiamo il file delle lingue\n include $_percorso.\"librerie/$LINGUA\";\n // passo la variabile globale..\n\n GLOBAL $pdf;\n global $MARGINE_SINISTRO;\n global $MARGINE_SUPERIORE;\n\n\n if ($_GET['intesta'] == \"no\")\n {\n\t$pdf->SetXY($MARGINE_SINISTRO, 45);\n }\n else\n {\n //logo =0 ovvero carta intestata\n if ($datidoc[ST_TLOGO] == \"0\")\n\t{\n\t //provo a lasciare il puntatore\n\t $pdf->SetXY($MARGINE_SINISTRO, 45);\n\t}\n\n //logo 1 con logo azienda\n\tif ($datidoc[ST_TLOGO] == \"1\")\n\t{\n\t // inserisco l'immagine con l'intestazione\n\t $pdf->Image($_percorso .\"../setting/loghiazienda/$datidoc[ST_LOGOG]\", $MARGINE_SINISTRO, $MARGINE_SUPERIORE, 193, 30);\n\n\t //provo a lasciare il puntatore\n\t $pdf->SetXY($MARGINE_SINISTRO, 45);\n\t}\n\n //logo azienda completo\n\tif ($datidoc[ST_TLOGO] == \"2\")\n\t{\n\t //provo a lasciare il puntatore\n\t $pdf->SetXY($MARGINE_SINISTRO, 9);\n\t $pdf->SetFont($datidoc[ST_FONTOLOGO], 'B', $datidoc[ST_FONTLOGOSIZE]);\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(80, 5, $azienda, 0, 1, 'L');\n\t $pdf->SetFont($datidoc[ST_FONTOLOGO], '', $datidoc[ST_FONTLOGOSIZE]-1);\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(80, 4, $azienda2, 0, 1, 'L');\n\t $pdf->SetFont($datidoc[ST_FONTOLOGO], '', $datidoc[ST_FONTLOGOSIZE]-2);\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(80, 4, $indirizzo, 0, 1, 'L');\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(15, 4, $cap, 0, 0, 'L');\n\t $pdf->Cell(60, 4, $citta, 0, 0, 'L');\n\t $pdf->Cell(10, 4, $prov, 0, 1, 'L');\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(40, 4, $LG001 . \" \" . $piva, 0, 0, 'L');\n\t $pdf->Cell(40, 4, $LG002 . \" \" . $codfisc, 0, 1, 'L');\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(40, 4, $LG003 . \" \" . $telefono, 0, 0, 'L');\n\t $pdf->Cell(40, 4, $LG004 . \" \" . $fax, 0, 1, 'L');\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(50, 4, $LG005 . \" \" . $sitointernet, 0, 0, 'L');\n\t $pdf->Cell(50, 4, $LG006 . \" \" . $email1, 0, 1, 'L');\n\n\t //provo a lasciare il puntatore\n\t $pdf->SetXY($MARGINE_SINISTRO, 45);\n\t}\n\n //logo 3 minimale tipo contabilita\n\tif ($datidoc[ST_TLOGO] == \"3\")\n\t{\n\t //logo aziendale a sinistra e intestazione a destra\n\t // inserisco l'immagine con l'intestazione\n\t $pdf->SetXY($MARGINE_SINISTRO, 9);\n\t $pdf->SetFont($datidoc[ST_FONTOLOGO], 'B', $datidoc[ST_FONTLOGOSIZE]);\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(80,5,$azienda,0,1,'L');\n\t $pdf->SetFont($datidoc[ST_FONTOLOGO], '', $datidoc[ST_FONTLOGOSIZE]-2);\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(80,4,$indirizzo,0,1,'L');\n $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(11,4,$cap,0,0,'L');\n\t $pdf->Cell(50,4,$citta,0,0,'L');\n\t $pdf->Cell(10,4,$prov,0,1,'L');\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(40,4,\"P.I. \".$piva,0,0,'L');\n\t $pdf->Cell(40,4,\"C.F. \".$codfisc,0,1,'L');\n\n\t //provo a lasciare il puntatore\n\t $pdf->SetXY(87,5);\n $pdf->SetFont($datidoc[ST_FONTOLOGO], '', $datidoc[ST_FONTLOGOSIZE]-2);\n\t $pdf->Cell(75,5,$_title,0,0,'L');\n $pdf->SetFont($datidoc[ST_FONTOLOGO], '', $datidoc[ST_FONTLOGOSIZE]-2);\n $pdf->Cell(10,5,'Pag.',0,0,'L');\n\t $pdf->Cell(10,5,$_POST['anno'],0,0,'C');\n $pdf->Cell(3,5,'/',0,0,'C');\n $pdf->Cell(15,5,$_pg,0,1,'L');\n \n $pdf->SetXY($MARGINE_SINISTRO, 30);\n \n \n\t}\n \n //logo minimale ,a completo\n if ($datidoc[ST_TLOGO] == \"4\")\n\t{\n //logo super minimale\n\t $pdf->SetXY($MARGINE_SINISTRO, 9);\n\t $pdf->SetFont($datidoc[ST_FONTOLOGO], 'B', $datidoc[ST_FONTLOGOSIZE]);\n\t $pdf->SetX($MARGINE_SINISTRO);\n\t $pdf->Cell(80,5,$azienda,0,0,'L');\n\t $pdf->SetFont($datidoc[ST_FONTOLOGO], '', $datidoc[ST_FONTLOGOSIZE]-2);\n\t $pdf->Cell(70,5,$_titolo,0,0,'L');\n $pdf->SetFont($datidoc[ST_FONTOLOGO], '', $datidoc[ST_FONTLOGOSIZE]-2);\n $pdf->Cell(10,5,'Pag.',0,0,'L');\n\t $pdf->Cell(10,5,$pdf->PageNo(),0,0,'C');\n $pdf->Cell(3,5,'/',0,0,'C');\n $pdf->Cell(10,5,$pagina,0,0,'L');\n $pdf->Cell(10,5,$_anno,0,1,'L');\n \n $pdf->SetXY($MARGINE_SINISTRO, 15);\n\n }\n \n \n if ($datidoc[ST_TLOGO] == \"5\")\n\t{\n //provo a lasciare il puntatore\n $pdf->SetXY($MARGINE_SINISTRO, 9);\n $pdf->SetFont($datidoc[ST_FONTOLOGO], 'B', $datidoc[ST_FONTLOGOSIZE]);\n $pdf->SetX($MARGINE_SINISTRO);\n $pdf->Cell(80, 5, $azienda, 0, 1, 'L');\n $pdf->SetFont($datidoc[ST_FONTOLOGO], '', $datidoc[ST_FONTLOGOSIZE]-2);\n $pdf->SetX($MARGINE_SINISTRO);\n $pdf->Cell(80, 4, $indirizzo, 0, 1, 'L');\n $pdf->SetX($MARGINE_SINISTRO);\n $pdf->Cell(15, 4, $cap, 0, 0, 'L');\n $pdf->Cell(60, 4, $citta, 0, 0, 'L');\n $pdf->Cell(10, 4, $prov, 0, 1, 'L');\n $pdf->SetX($MARGINE_SINISTRO);\n $pdf->Cell(40, 4, \"P.I. \" . $piva, 0, 0, 'L');\n $pdf->Cell(40, 4, \"Cod.Fisc \" . $codfisc, 0, 1, 'L');\n $pdf->SetX($MARGINE_SINISTRO);\n $pdf->Cell(40, 4, \"Tel. \" . $telefono, 0, 0, 'L');\n $pdf->Cell(40, 4, \"Tel. / Fax \" . $fax, 0, 1, 'L');\n $pdf->SetX($MARGINE_SINISTRO);\n\n if ($_parametri['email'] == \"3\")\n {\n $pdf->Cell(50, 4, \"E-mail \" . $email3, 0, 1, 'L');\n }\n elseif ($_parametri['email'] == \"2\")\n {\n $pdf->Cell(50, 4, \"E-mail \" . $email2, 0, 1, 'L');\n }\n else\n {\n $pdf->Cell(50, 4, \"E-mail \" . $email1, 0, 1, 'L');\n }\n\n //provo a lasciare il puntatore\n $pdf->SetXY($MARGINE_SINISTRO, 30);\n }\n \n \n }\n}", "public function PedidoPdf($pedido,$lineas,$enviar=false) {\n \n \n \n $pdf= new FPDF();\n $pdf->AddPage();\n $pdf->SetFont('Arial','B',14);\n $pdf->Cell(40,7,\"Pedido: \".$pedido['idpedido'],0);\n $pdf->Cell(70,7,\"Estado: \".$pedido['estado_ped'],0);\n $pdf->Cell(70,7,\"Fecha: \".$pedido['fecha_pedido'],0);\n $pdf->Ln();\n $pdf->Ln();\n $pdf->Ln();\n $pdf->Cell(70,7,\"Nombre del producto\",1);\n $pdf->Cell(26,7,\"Cantidad\",1); \n $pdf->Cell(40,7,\"Precio\",1); \n $pdf->Cell(40,7,\"Precio Final *\",1);\n $pdf->Ln();\n \n foreach ($lineas as $linea) { \n $pdf->Cell(70,7,$linea['nombrepro'],1);\n $pdf->Cell(26,7,$linea['cantidad'],1); \n $pdf->Cell(40,7,$linea['preciopro'].iconv('UTF-8', 'windows-1252', '€'),1); \n $pdf->Cell(40,7,$linea['precio_ped'].iconv('UTF-8', 'windows-1252', '€'),1);\n $pdf->Ln();\n }\n $pdf->Ln();\n $pdf->Ln();\n $pdf->Cell(100,7,\"Total del pedido: \".$pedido['total_ped'].iconv('UTF-8', 'windows-1252', '€'),1);\n $pdf->Ln();\n $pdf->Ln();\n $pdf->Ln();\n $pdf->Cell(100,7,\"* Impuestos y descuento aplicados \",0);\n if ($enviar==false)\n $pdf->Output();\n else \n $pdf->Output('F','asset/pedidocorreo/pedido.pdf',true);\n }", "public function SoloBautizadosPdf()\n {\n \n $person = Persona::where([\n ['bautismo', 'si'],\n ['estado', 'activo'],\n ])\n ->orderBy(\"nombres\")\n ->get();\n\n return \\PDF::loadView('secretaria.pdf.pdfHermanosBautizados', compact(\"person\"))\n ->setPaper('a4', 'portrait')\n ->stream('Sectetaría.pdf'); //si lo quiero descargar enseguida uso download(), si lo quiero\n\n }", "public function getPDF();", "public function register_esig_pdf_page() {\n add_submenu_page('', 'Pdf link page', 'Pdf link page', 'read', 'esigpdf', array($this, 'save_as_pdf_content'));\n //add_menu_page('E-signature save as pdf','manage_options', 'esigpdf', array($this,'save_as_pdf_content'),'', 6 );\n }", "public function pedidoPDF(){\r\n\t\t\t$this->oSystem->getLogger()->debug( \"pedidoPDF\" );\r\n\t\t\t\r\n\t\t\t/** datos */\r\n\t\t\t$id = $_REQUEST[id];\r\n\t\t\t$sql = \"SELECT cli.*,concat(fijo,'/',movil) telefonos, adm.nombre responsable, o.*, LPAD(o.id,4,'0') proyecto, \";\r\n\t\t\t$sql.= \"date_format(finicio,'%d-%m-%Y') finicio, date_format(ffin,'%d-%m-%Y') ffin, date_format(o.falta,'%d-%m-%Y') falta, \";\r\n\t\t\t$sql.= \"(select nombre from os_administradores where id=o.id_administrador) usuario, \";\r\n\t\t\t$sql.= \"(abs(o.imponible) - round(ifnull((select sum(importe) from caja where id_pedido=o.id),0),2)) 'pendiente' \";\r\n\t\t\t$sql.= \"FROM proyectos o, clientes cli, os_administradores adm WHERE o.id_cliente=cli.id AND o.id_responsable=adm.id AND o.id=$id;\";\r\n\t\t\t$resultado = $this->computeSQL($sql,false);\r\n\t\t\t$datos = $this->oSystem->getConnection()->getColumnas($resultado);\r\n\t\t\t$estado = $datos[estado];\r\n\t\t\t$proyecto = $datos[proyecto];\r\n\t\t\t$html = file_get_contents( OS_ROOT.\"/applications/proyectos/print_pedido.html\") ;\r\n\t\t\t$html = str_replace(\"{WEB_PATH}\",OS_ROOT,$html);\r\n\t\t\t$html = str_replace(\"{observaciones}\",$_REQUEST[observaciones],$html);\r\n\t\t\t\r\n\t\t\t$fields = array('telefono','contacto','@ncondiciones','estado','proyecto','falta','cliente','razon_social','responsable','finicio','ffin','@cimponible');\r\n\t\t\t\r\n\t\t\t$this->tratamientosEspeciales(&$datos);\r\n\t\t\t\t\t\t\r\n\t\t\tforeach ( $fields as $field ){\r\n\t\t\t\t\t$format = substr($field, 0, 2);\r\n\t\t\t\t\tswitch ( $format ){\r\n\t\t\t\t\t\t\tcase '@n'://no format\r\n\t\t\t\t\t\t\t\t$field = substr($field, 2);\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase '@p'://porcen\r\n\t\t\t\t\t\t\t\t$field = substr($field, 2);\r\n\t\t\t\t\t\t\t\t$datos[$field] = number_format($datos[$field],2,',','.').\" %\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase '@c'://currency\r\n\t\t\t\t\t\t\t\t$field = substr($field, 2);\r\n\t\t\t\t\t\t\t\t$datos[$field] = number_format($datos[$field],2,',','.').\" &#0128;\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault://sin formatos\r\n\t\t\t\t\t\t\t\t$datos[$field] = htmlentities( $datos[$field] );\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t$html = str_replace('{'.$field.'}',$datos[$field],$html);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/** detalles */\r\n\t\t\t//$color = \"#CDCDCD\";\r\n\t\t\t$detalles = $this->detallesObra();\r\n\t\t\t$fields = array('cantidad','codigo','articulo','@cprecio','@pdto','@cimporte');\r\n\t\t\tereg(\"(<!--LIST1)(.*)(LIST1-->)\",$html,$reg);\r\n\t\t\twhile ( $datos = $this->oSystem->getConnection()->getColumnas($detalles) ){\r\n\t\t\t\t\r\n\t\t\t\tif ( $color==\"#EEEEEE\" )\r\n\t\t\t\t\t\t$color=\"#D3D3D3\";\r\n\t\t\t\telse\r\n\t\t\t\t\t\t$color=\"#EEEEEE\";\r\n\t\t\t\t$html = str_replace('{color}',\"$color\",$html);\r\n\t\t\t\t\t\r\n\t\t\t\tforeach ( $fields as $field ){\r\n\t\t\t\t\t$format = substr($field, 0, 2);\r\n\t\t\t\t\tswitch ( $format ){\r\n\t\t\t\t\t\t\tcase '@n'://no format\r\n\t\t\t\t\t\t\t\t$field = substr($field, 2);\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase '@p'://porcen\r\n\t\t\t\t\t\t\t\t$field = substr($field, 2);\r\n\t\t\t\t\t\t\t\t$datos[$field] = number_format($datos[$field],2,',','.').\" %\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase '@c'://currency\r\n\t\t\t\t\t\t\t\t$field = substr($field, 2);\r\n\t\t\t\t\t\t\t\t$datos[$field] = number_format($datos[$field],2,',','.').\" &#0128;\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault://sin formatos\r\n\t\t\t\t\t\t\t\t$datos[$field] = htmlentities( $datos[$field] );\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t$html = str_replace('{'.$field.'}',$datos[$field],$html);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t$html = str_replace(\"<!--LIST1\",\"\",$html);\r\n\t\t\t\t$html = str_replace(\"LIST1-->\",\"<!--NEXT-->\",$html);\r\n\t\t\t\t$html = str_replace(\"<!--NEXT-->\",\"\\n$reg[1]$reg[2]$reg[3]\\n\",$html);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//presupuesto-aceptacion\r\n\t\t\tif ( $estado=='PRESUPUESTO')\r\n\t\t\t\t$html = str_replace(\"{aceptacion}\",\"Para la aceptaci&oacute;n del presupuesto es necesario firmar todas las hojas del documento<br>\",$html);\r\n\t\t\telse\r\n\t\t\t\t$html = str_replace(\"{aceptacion}\",\"\",$html);\r\n\t\t\t\r\n\t\t\t$dompdf = new DOMPDF();\r\n\t\t\t$dompdf->set_base_path ( \"../_commons/css\" );\r\n\t\t\t$dompdf->load_html( $html );\r\n\t\t\t$dompdf->render();\r\n\t\t\t$dompdf->stream(\"$estado $proyecto.pdf\");\r\n\t\t}", "public function listarPDF(){\n $instructores = Instructores::orderBy('id', 'desc')->get();\n $cont = Instructores::count();\n $pdf = \\PDF::loadView('pdf.instructorpdf',['instructores'=>$instructores,'cont'=>$cont]);\n return $pdf->download('instructor.pdf');\n }", "public function imprimirpdf()\n {\n //dependiendo si es administrador o no podrá ver sus incidencias o todas\n if (auth()->user()->perfil == 'admin')\n {\n $incidencias = incidencia::get();\n }\n else\n {\n //sacamos las incidencias del usuario que está logado\n $incidencias = incidencia::where('id_usuario',auth()->user()->id)->get();\n }\n \n $pdf = PDF::loadView('/incidenciasPDF',['incidencias'=>$incidencias]);\n\n return $pdf->download('incidenciasPDF.pdf');\n }", "public function pdf()\n\t{\n\n\t\t$this->load->view('public/pdf');\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Team Name Abreviation
function getTeamNameAbrv() { return $this->_team_name_abrv ; }
[ "public static function team() : string\n {\n return static::teamName();\n }", "public function getTeamName(){\n\t\treturn($this->teamName);\n\t}", "public function getTeamName()\n {\n return $this->getText();\n }", "public function getTeamName ()\r\n {\r\n return $this->teamName;\r\n }", "public function getName(){\r\n \t\treturn $this->teamname;\r\n \t}", "public function getTeamName() {\n\t\treturn ($this->teamName);\n\t}", "public function getTeam();", "function teamName()\r\n {\r\n // string teamName()\r\n if( func_num_args() == 0 )\r\n {\r\n return $this->teamName;\r\n }\r\n\r\n // void teamName($value)\r\n else if( func_num_args() == 1 )\r\n {\r\n $this->teamName = htmlspecialchars((string)func_get_arg(0));\r\n }\r\n\r\n return $this;\r\n }", "function get_team_name($team_id){\n\treturn db_query(\"SELECT `name` FROM `tr_teams` WHERE `team_id` = \".$team_id)->fetchField(); \n}", "public function getHomeTeamString() {\n\t\treturn ($this->homeTeamId) ? $this->homeTeam->organization->name . \" \" . $this->homeTeam->designation : \n\t\t\t\t\"Team \" . $this->homeTeamAssignedNumber;\n\t}", "function getTeam()\n\t{\n\t\treturn $this->Info['Team'];\n\t}", "public function getAwayTeamName()\n\t{\n\t\tif(!isset($this->awayTeamName) || $this->awayTeamName === null)\n\t\t{\n\t\t\t$xpath = new DOMXPath($this->getXml());\n\t\t\t$nodeList = $xpath->query(\"//AwayTeam/TeamName\");\n\t\t\t$this->awayTeamName = $nodeList->item(0)->nodeValue;\n\t\t}\n\t\treturn $this->awayTeamName;\n\t}", "private function fakeTeamName() : string {\n $faker = Faker\\Factory::create();\n\n return 'The ' . $faker->city() . ' ' . $faker->jobTitle() . 's';\n }", "public function getOppenentTeamName()\r\n\t{\r\n\t\tif(!isset($this->opponentTeamName) || $this->opponentTeamName === null)\r\n\t\t{\r\n\t\t\t$this->opponentTeamName = $this->getXml()->getElementsByTagName('TeamName')->item(0)->nodeValue;\r\n\t\t}\r\n\t\treturn $this->opponentTeamName;\r\n\t}", "public function get_team_name($team_id){\n $team_id = (int)$team_id;\n $cols = array(\n \"id\" =>$team_id,\n );\n $names = $this->rawQuery('SELECT name from Teams where id = ?', $cols);\n $output =\"\";\n if(count($names) > 0){\n foreach ($names as $name) {\n $output .=\"\".$name['name'];\n }\n }\n return $output;\n }", "public function getAwayTeamName()\n\t{\n\t\tif(!isset($this->awayTeamName) || $this->awayTeamName === null)\n\t\t{\n\t\t\t$this->awayTeamName = $this->getXml()->getElementsByTagName('AwayTeamName')->item(0)->nodeValue;\n\t\t}\n\t\treturn $this->awayTeamName;\n\t}", "public function getAwayTeamName()\r\n\t{\r\n\t\tif(!isset($this->awayTeamName) || $this->awayTeamName === null)\r\n\t\t{\r\n\t\t\t$this->awayTeamName = $this->getXml()->getElementsByTagName('AwayTeamName')->item(0)->nodeValue;\r\n\t\t}\r\n\t\treturn $this->awayTeamName;\r\n\t}", "public function getTeamName($team) {\r\n if ($this->switched_sides) {\r\n $team = $this->getOtherTeam($team);\r\n }\r\n $name = '';\r\n switch ($team) {\r\n case 'CT': $name = $this->match_data->getTeam1Name(); break;\r\n case 'T': $name = $this->match_data->getTeam2Name(); break;\r\n }\r\n return str_replace(['\"', ';'], '', $name);\r\n }", "public function getOpponentTeamName()\n\t{\n\t\tif(!isset($this->opponentTeamName) || $this->opponentTeamName === null)\n\t\t{\n\t\t\t$this->opponentTeamName = $this->getXml()->getElementsByTagName('TeamName')->item(0)->nodeValue;\n\t\t}\n\t\treturn $this->opponentTeamName;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Embed the related [Tenant] resource.
public function embedTenant() { $this->addEmbed("Tenant"); return $this; }
[ "public function tenant()\n {\n return $this->belongsTo(Tenant::class);\n }", "public function tenant()\n {\n return $this->belongsTo(config('multitenancy.tenant_model'));\n }", "public function setTenant($var)\n {\n GPBUtil::checkString($var, True);\n $this->tenant = $var;\n\n return $this;\n }", "public function setTenant($tenant) {\n $this->container['Tenant'] = $tenant;\n return $this;\n\t}", "public function getTenant()\n {\n return $this->tenant;\n }", "public function creating(Tenant $tenant)\n {\n //dd( $tenant );\n }", "public static function getTenant()\n {\n return Tenant::get();\n }", "function getCurrentAssortmentSubTenant() ;", "public function getTenant($tenantID);", "public function retrieveTenants()\n {\n return $this->start()->uri(\"/api/tenant\")\n ->get()\n ->go();\n }", "public function withDefaultTenant(Tenant $tenant);", "public function getTenantClass(): Tenant\n {\n return app($this->tenantClass);\n }", "public function tenantContract()\n {\n return $this->belongsTo('App\\TenantContract');\n }", "public function getTenantId()\n {\n return $this->tenant_id;\n }", "function getCurrentAssortmentTenant() ;", "protected function currentTenant()\n {\n return $this->tenant ?? $this->app[Tenant::class];\n }", "public function findById(string $id): Tenant;", "public function setTenantId($tenantId);", "public function creating(Tenant $tenant)\n {\n if(empty($tenant->trading_name)) {\n $tenant->trading_name = $tenant->name;\n }\n\n $tenant->uuid = Str::uuid();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return if $nbr is valid UN Nbr
public function hazmat_unnbr($nbr) { return true; }
[ "private function RUcheck($number)\n {\n // 10 digit INN numbers\n if (10 === strlen($number)) {\n $total = 0;\n $multipliers = [2, 4, 10, 3, 5, 9, 4, 6, 8, 0];\n\n for ($i = 0; $i < 10; ++$i) {\n $total += (int) $number[$i] * $multipliers[$i];\n }\n\n $total = $total % 11;\n if (9 < $total) {\n $total = $total % 10;\n }\n\n // Compare it with the last character of the VAT number. If it is the same, then it's valid\n return (int) $number[9] === $total;\n }\n // 12 digit INN numbers\n elseif (12 === strlen($number)) {\n $total1 = 0;\n $multipliers1 = [7, 2, 4, 10, 3, 5, 9, 4, 6, 8, 0];\n $total2 = 0;\n $multipliers2 = [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8, 0];\n\n for ($i = 0; $i < 11; ++$i) {\n $total1 += (int) $number[$i] * $multipliers1[$i];\n }\n\n $total1 = $total1 % 11;\n if (9 < $total1) {\n $total1 = $total1 % 10;\n }\n\n for ($i = 0; $i < 11; ++$i) {\n $total2 += (int) $number[$i] * $multipliers2[$i];\n }\n\n $total2 = $total2 % 11;\n if (9 < $total2) {\n $total2 = $total2 % 10;\n }\n\n // Compare the first check with the 11th character and the second\n // check with the 12th and last character of the VAT number.\n // If they're both the same, then it's valid\n return (int) $number[10] === $total1 && (int) $number[11] === $total2;\n }\n\n return false;\n }", "function isNbValid($number)\n{\n if (is_int($number) ===false) {\n // si non, convertir en nombre entier\n $number = intval($number);\n }\n return $number;\n \n}", "function validateNrc($NRC){\n\t\t\t$p=\"/^(0)([0-9]{4})$/i\";\n\t\t\tif(preg_match($p,$NRC)==1){\n\t\t\t\treturn $NRC;\n\t\t\t}else\n\t\t\t\treturn false;\n\t\t\t\n\t\t}", "function validar_letra($dni){\n\t$letra = substr($dni, -1);\n\t$numeros = substr($dni, 0, -1);\n\t//realiza la comprobacion del dato\n\tif ( substr(\"TRWAGMYFPDXBNJZSQVHLCKE\", $numeros%23, 1) == $letra && strlen($letra) == 1 && strlen ($numeros) == 8 ){\n\t\treturn true;\n\t}//en caso contrario\n\telse{\n\t\treturn false;\n\t}\n}", "public function numeroValido($numero){\n switch (strtolower($numero)) {\n case \"as\":\n case \"k\":\n case \"q\":\n case \"j\":\n return TRUE;\n }\n return FALSE;\n }", "function checkDNI($number, $letter) {\n $error=false;\n echo $number; \n if (!preg_match(\"\\d{8}\", $number)) {\n printMessage(2);\n $error=true;\n } \n if (!preg_match(\"[a-zA-Z]\", $letter)) {\n printMessage(3);\n $error=true;\n }\n if (!$error) {\n if (getDNILetter($number)==$letter) { \n printMessage(1);\n } else {\n printMessage(0);\n }\n }\n}", "public static function validate_nip($nip){\r\n $nip_9 = strlen($nip)==9?TRUE:FALSE;\r\n $nip_18 = strlen($nip)==18?TRUE:FALSE;\r\n \r\n if(Validasi::validate_number($nip)==FALSE) return FALSE;\r\n \r\n if($nip_9 OR $nip_18){\r\n if(strlen($nip)==9){\r\n return preg_match('/^060[0-9]{6}$/',$nip);\r\n }else if(strlen($nip)==18){\r\n $th_lhr = (int) substr($nip, 0,4);\r\n $bl_lhr = (int) substr($nip, 4,2);\r\n $bl_angkat = (int) substr($nip,12,2);\r\n $year = (int) date('Y');\r\n $resign = $year-50;\r\n if($resign<$th_lhr AND $th_lhr<($year-18)){\r\n if(0<$bl_lhr AND $bl_lhr<13 AND 0<$bl_angkat AND $bl_angkat<13){\r\n if(preg_match('/^19([0-9]{12})([1-2]{1})([0]{1})([0-9]{2})$/', $nip)) return TRUE;\r\n return FALSE;\r\n }\r\n }\r\n \r\n }\r\n }else{\r\n return FALSE;\r\n }\r\n }", "public static function validateBsn($bsn) {\n \t$bsn = trim(strip_tags($bsn));\n \t/*\n \t * if bsn is empty, return false\n \t*/\n \tif (empty($bsn)) {\n \t\treturn false;\n \t}\n \t/*\n \t * if bsn contains non-numeric digits, return false\n \t*/\n \tif (!is_numeric($bsn)) {\n \t\treturn false;\n \t}\n \t/*\n \t * if bsn has 8 digits, put '0' in front\n \t*/\n \tif (strlen($bsn) == 8) {\n \t\t$bsn = \"0\".$bsn;\n \t}\n \t/*\n \t * if length bsn is not 9 now, return false\n \t*/\n \tif (strlen($bsn) != 9) {\n \t\treturn false;\n \t}\n\n \t$digits = array(\"\");\n \t/*\n \t * put each digit in array\n \t*/\n \t$i = 0;\n \twhile ($i < 9) {\n \t\t$digits[$i] = substr($bsn,$i,1);\n \t\t$i++;\n \t}\n \t/*\n \t * compute total for 11 check\n \t*/\n \t$check = 0;\n \t$number1 = $digits[0] * 9;\n \t$number2 = $digits[1] * 8;\n \t$number3 = $digits[2] * 7;\n \t$number4 = $digits[3] * 6;\n \t$number5 = $digits[4] * 5;\n \t$number6 = $digits[5] * 4;\n \t$number7 = $digits[6] * 3;\n \t$number8 = $digits[7] * 2;\n \t$number9 = $digits[8] * -1;\n \t$check = $number1 + $number2 + $number3 + $number4 + $number5 + $number6 +\n \t$number7 + $number8 + $number9;\n \t/*\n \t * divide check by 11 and use remainder\n \t*/\n \t$remain = $check % 11;\n \tif ($remain == 0) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "private static function isValidNationalNumber(string $national_number): bool\n {\n $national_number = filter_var($national_number, FILTER_SANITIZE_NUMBER_INT);\n\n if (false === $national_number) {\n return false;\n }\n\n $allowedCharactersPattern = '/^[0-9\\\\ \\\\-]+$/';\n $nonNumericPattern = '/\\\\D/';\n\n if (1 !== preg_match($allowedCharactersPattern, $national_number)) {\n return false;\n }\n\n $national_number = preg_replace($nonNumericPattern, '', $national_number);\n\n if (null === $national_number) {\n return false;\n }\n\n if (11 !== mb_strlen($national_number)) {\n return false;\n }\n\n $birthDatePart = (int) mb_substr($national_number, 0, 6);\n $counterPart = (int) mb_substr($national_number, 6, 3);\n $controlPart = (int) mb_substr($national_number, 9, 2);\n\n // 1. CONTROL NUMBER CHECKING\n $born2kOrLater = false;\n $calculatedControl = 97 - (($birthDatePart . $counterPart) % 97);\n\n if ($calculatedControl !== $controlPart) {\n $born2kOrLater = true;\n $calculatedControl = 97 - (('2' . $birthDatePart . $counterPart) % 97);\n\n if ($calculatedControl !== $controlPart) {\n return false;\n }\n }\n\n // 2. BIRTHDATE CHECKING\n $birthDate = true === $born2kOrLater ?\n '20' . $birthDatePart :\n '19' . $birthDatePart;\n\n $checkdate = checkdate(\n (int) mb_substr($birthDate, 4, 2),\n (int) mb_substr($birthDate, 6, 2),\n (int) mb_substr($birthDate, 0, 4)\n );\n\n if (false === $checkdate) {\n return false;\n }\n\n // 3. COUNTER CHECKING\n if (1 > $counterPart || 997 < $counterPart) {\n return false;\n }\n\n return true;\n }", "function validar_dni($dni){\n $dni = strtoupper($dni);\n $letra = substr($dni, -1);\n $numeros = substr($dni, 0, -1);\n if ( substr(\"TRWAGMYFPDXBNJZSQVHLCKE\", $numeros%23, 1) == $letra && strlen($letra) == 1 && strlen ($numeros) == 8 ){\n return true; //es valido\n }else{\n return false; //no es valido\n }\n }", "function luhn_check($cc_num) {\n\n\t // Set the string length and parity\n\t $number_length=strlen($cc_num);\n\t $parity=$number_length % 2;\n\n\t // Loop through each digit and do the maths\n\t $total=0;\n\t for ($i=0; $i<$number_length; $i++) {\n\t\t$digit=$cc_num[$i];\n\t\t// Multiply alternate digits by two\n\t\tif ($i % 2 == $parity) {\n\t\t $digit*=2;\n\t\t // If the sum is two digits, add them together (in effect)\n\t\t if ($digit > 9) {\n\t\t\t$digit-=9;\n\t\t }\n\t\t}\n\t\t// Total up the digits\n\t\t$total+=$digit;\n\t }\n\n\t // If the total mod 10 equals 0, the number is valid\n\t return ($total % 10 == 0) ? TRUE : FALSE;\n\n\t}", "public function testValidNir() {\n\t\t\t$result = valid_nir( '179012A00123471' );\n\t\t\t$expected = true;\n\t\t\t$this->assertEqual( $result, $expected, var_export( $result, true ) );\n\n\t\t\t$result = valid_nir( 'A79012A00123471' );\n\t\t\t$expected = false;\n\t\t\t$this->assertEqual( $result, $expected, var_export( $result, true ) );\n\t\t }", "function NOVATCheckDigit($vatnumber) {\r\n // See http://www.brreg.no/english/coordination/number.html\r\n\r\n $total = 0;\r\n $multipliers = array(3,2,7,6,5,4,3,2);\r\n\r\n // Extract the next digit and multiply by the counter.\r\n for ($i = 0; $i < 8; $i++) $total = $total + $vatnumber[$i] * $multipliers[$i];\r\n\r\n // Establish check digits by getting modulus 11. Check digits > 9 are invalid\r\n $total = 11 - $total % 11;\r\n if ($total == 11) {$total = 0;}\r\n if ($total < 10) {\r\n\r\n\t// Compare it with the last character of the VAT number. If it is the same, then it's a valid\r\n\t// check digit.\r\n\tif ($total == substr($vatnumber,8,1))\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n }\r\n}", "protected function isValidInn($inn): bool\n {\n $innLength = \\mb_strlen($inn);\n switch ($innLength) {\n case 10:\n $checksum = $this->checksum($inn);\n\n return $checksum === (int) \\mb_substr($inn, -1);\n break;\n case 12:\n $inn11 = $this->checksum(\\mb_substr($inn, 0, -1));\n $inn12 = $this->checksum($inn);\n\n return $inn11 === (int) $inn[10] && $inn12 === (int) $inn[11];\n break;\n }\n\n return false;\n }", "function abn($abn)\n {\n $weights = array(10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19);\n $length = array(\"11\");\n\n $abn = preg_replace(\"/[^\\d]/\", \"\", $abn);\n $abn = str_split($abn);\n $abn[0]--;\n\n return Validate_AU::checkDigit($abn, 89, $weights, $length);\n }", "private function columnchecker($column,$nbr){\n for($tempnbrs=0;$tempnbrs<9;$tempnbrs++){\n if($this->array[$tempnbrs][$column]==$nbr){\n return false;\n }\n }\n return true;\n }", "function validaNumero ($numero){\n\treturn is_numeric($numero);\n}", "function validarNumber($elDato)\r\n{\r\n\t$val = FALSE;\r\n\t$dato = numberNotAdmited();\r\n\t\r\n\tfor($i = 0; $i < count($dato); $i++)\r\n\t{\r\n\t\t$posicion = strpos(strval($elDato), strval($dato[$i]));\r\n\t\t\r\n\t\tif($posicion !== FALSE)\r\n\t\t\t$val = TRUE;\r\n\t}\r\n\t\r\n\treturn $val;\r\n}", "function checkValidNRIC($nric){\n\tif(!matchRegex($nric,\"/^[S]{1}[0-9]{7}[a-zA-Z]{1}$/\")){\n\t\treturn false;\n\t}\n\t\n\t$modNum = ( ($nric{1}*2) + ($nric{2}*7) + ($nric{3}*6) + ($nric{4}*5) + ($nric{5}*4) + ($nric{6}*3) + ($nric{7}*2))%11;\n\tswitch($modNum){\n\t\tcase 0:\n\t\t\tif($nric{8}!=\"J\") return false;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tif($nric{8}!=\"Z\") return false;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tif($nric{8}!=\"I\") return false;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tif($nric{8}!=\"H\") return false;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tif($nric{8}!=\"G\") return false;\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tif($nric{8}!=\"F\") return false;\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tif($nric{8}!=\"E\") return false;\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tif($nric{8}!=\"D\") return false;\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tif($nric{8}!=\"C\") return false;\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tif($nric{8}!=\"B\") return false;\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tif($nric{8}!=\"A\") return false;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\t\n\treturn true;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns Reader of this Rating
public function getReader() { return $this->hasOne(Reader::className(), ['User_ID' => 'User_ID']); }
[ "protected function getReader()\n {\n return $this->reader;\n }", "public function get_reader() {\n if (!$this->reader) {\n $iid = \\csv_import_reader::get_new_iid('modratingallocate');\n $this->reader = new \\csv_import_reader($iid, 'modratingallocate');\n }\n\n return $this->reader;\n }", "public function getReader()\n {\n return $this->reader;\n }", "private function getReader() {\n // If the annotation reader isn't set, create it.\n if (!$this->reader) {\n $this->reader = Reader::createFromDefaults();\n }\n\n return $this->reader;\n }", "public function getReader() {\n\t\treturn singleton('ContentService')->getReader($this->getContentId());\n\t}", "public function getRecommender()\n {\n return $this->recommender;\n }", "public function getRater()\n {\n return $this->rater;\n }", "public function getRating()\n {\n return $this->_rating;\n }", "public function getRating()\n {\n return $this->rating;\n }", "public function ClientRating(){\n\t\treturn UserRating::get()->filter(array(\n\t\t\t\t'SubmissionID' => $this->ID,\n\t\t\t\t'RatedForID' => $this->ClientID\n\t\t))->first();\n\t}", "public function reader()\r\n {\r\n return $this->belongsTo(Reader::class);\r\n }", "public function rating()\n {\n return $this->hasOne(Rating::class);\n }", "abstract public function getRating();", "public function getAnnotationReader()\n {\n\n // query whether or not an instance already exists\n if (AbstractDescriptor::$annotationReaderInstance === null) {\n AbstractDescriptor::$annotationReaderInstance = new AnnotationReader();\n }\n\n // return the instance\n return AbstractDescriptor::$annotationReaderInstance;\n }", "protected function getCachedReader()\n {\n \tif (null === self::$cachedReader) {\n\t \t$annotationReader = new AnnotationReader;\n\t\t\t//$indexedReader \t = new IndexedReader($annotationReader);\n\t\t\t//self::$cachedReader = new CachedReader($indexedReader, $this->cache);\n\t\t\tself::$cachedReader = new CachedReader($annotationReader, $this->cache);\n \t}\n \treturn self::$cachedReader;\n }", "protected function getRating(){\n\n // Find if a rating entry exists for the given object otherwise create one for this object\n if (!$rating = $this->rating()->getResults()){\n // Create a new Rating an created the relation \n // to this object\n $rating = new Rating();\n $rating->save();\n \n // Add to relation\n $this->rating()->save($rating);\n // Reload is necessary otherwise we get a dirty instance\n // of Rating \n $rating->reload();\n } \n \n return $rating;\n }", "public function getAnnotationReader(): Reader\n {\n return $this->annotationReader;\n }", "private function getAnnotationReader()\n {\n if ($this->reader === null) {\n $this->reader = new AnnotationReader();\n }\n return $this->reader;\n }", "public function getResponseReader()\n {\n return $this->reader;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Drupal core's CKEditor version number.
protected function getCkeditorVersion() { // Get CKEditor semantic version number from the JS file. // @see core/core.libraries.yml $definition = $this->libraryDiscovery->getLibraryByName('core', 'ckeditor'); $ckeditor_version = $definition['js'][0]['version']; // Parse CKEditor semantic version number from security patches // (i.e. 4.8.0+2018-04-18-security-patch). if (preg_match('/^\d+\.\d+\.\d+/', $ckeditor_version, $match)) { return $match[0]; } else { return $ckeditor_version; } }
[ "public function getRevisionVersion() : int;", "public function EngineVersionNumber() {\n $version = $this->EngineVersion();\n $start = strpos($version['VERSION'], '.');\n return intval(substr($version['VERSION'], 0, $start));\n }", "final public function get_version() {\n\t\treturn $this->get_arg_or_plugin_data( 'version', 'Version' );\n\t}", "public function browserVersionPatch(): int;", "public function getEngineVersion(): string;", "function getVersionNumber();", "public function EngineVersionNumber()\n {\n $version = $this->EngineVersion()->Version();\n $parts = explode('.', $version);\n return (int)reset($parts);\n }", "public function getVersionNumber()\n {\n return $this->client->info()['version']['number'];\n }", "public function version(){\n\t\treturn self::core9_version;\n\t}", "function g2_version(){\n\tlist ($ret, $g2Version) = GalleryCoreApi::getPluginParameter('module', 'core', '_version');\n\t\n\tif ($ret->isError()) {\n\t\treturn 'error';\n\t}\n\treturn $g2Version;\n}", "public function getVersionNumber()\n {\n return $this->version_number;\n }", "public static function getJsRevision()\n {\n return 3;\n }", "public function getVersionString() {\n\t\tif ($this->installedVersion === 'core') {\n\t\t\treturn Cgn_SystemRunner::getReleaseNumber();\n\t\t}\n\t\treturn $this->installedVersion;\n\t}", "public function getExtensionVersion() {\n return (string)Mage::getConfig()->getModuleConfig(\"CheckoutApi_ChargePayment\")->version;\n }", "function getPluginVersion()\r\n\t{\r\n\t\tif (is_object($this->plug_node))\r\n\t\t{\r\n\t\t\treturn $this->plug_node->get_attribute(\"PluginVersion\");\r\n\t\t}\r\n\t}", "private function get_plugin_version() {\n\t\treturn $this->convert_version_string_to_number( TYPES_VERSION );\n\t}", "public function getVersion() {\n if (!$this->version) {\n $query = $this->db->prepare(\"\n SELECT c.age\n FROM codepoints c, blocks b\n WHERE replace(replace(lower(b.name), '_', ''), ' ', '') = ?\n AND c.cp >= b.first\n AND c.cp <= b.last\n GROUP BY c.age\");\n $query->execute([Toolkit::normalizeName($this->name)]);\n $r = $query->fetchAll(\\PDO::FETCH_COLUMN, 0);\n if (! $r) {\n $this->version = '1.0';\n } else {\n sort($r, SORT_NUMERIC);\n $this->version = $r[0];\n }\n }\n return $this->version;\n }", "public function getModuleVersion();", "function get_version_number() {\n\tglobal $ofy, $versionclass;\n\t$version = $ofy->query($versionclass)->filter('id', '1')->get();\n\tif ($version == null) {\n\t\t$version = new Version('1', '0');\n\t\t$ofy->put($version);\n\t}\n\treturn $version->getVersion();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Location Address Meta Box
function locaddress_meta_box() { global $post; echo '<table class="form-table"> <tbody> <tr valign="top"> <th scope="row"><label for="location_address_aptno">' . __( 'Apartment / Room Number', 'locations' ) . '</label></th> <td><input name="location_address_aptno" type="text" id="location_address_aptno" value="' . get_post_meta( $post->ID, '_location_address_aptno', true ) . '" class="regular-text" placeholder="' . __( 'e.g. Apartment or suite number', 'locations' ) . '" /></td> </tr> <tr valign="top"> <th scope="row"><label for="location_address_street">' . __( 'Street Address', 'locations' ) . '</label></th> <td><input name="location_address_street" type="text" id="location_address_street" value="' . get_post_meta( $post->ID, '_location_address_street', true ) . '" class="regular-text" /></td> </tr> <tr valign="top"> <th scope="row"><label for="location_address_locality">' . __( 'Locality', 'locations' ) . '</label></th> <td><input name="location_address_locality" type="text" id="location_address_locality" value="' . get_post_meta( $post->ID, '_location_address_locality', true ) . '" class="regular-text" placeholder="' . __( 'e.g. City', 'locations' ) . '" /></td> </tr> <tr valign="top"> <th scope="row"><label for="location_address_region">' . __( 'Region', 'locations' ) . '</label></th> <td><input name="location_address_region" type="text" id="location_address_region" value="' . get_post_meta( $post->ID, '_location_address_region', true ) . '" class="regular-text" placeholder="' . __( 'e.g. State, county or province', 'locations' ) . '" /></td> </tr> <tr valign="top"> <th scope="row"><label for="location_address_postcode">' . __( 'Postal Code', 'locations' ) . '</label></th> <td><input name="location_address_postcode" type="text" id="location_address_postcode" value="' . get_post_meta( $post->ID, '_location_address_postcode', true ) . '" class="regular-text" /></td> </tr> <tr valign="top"> <th scope="row"><label for="location_address_country">' . __( 'Country', 'locations' ) . '</label></th> <td><input name="location_address_country" type="text" id="location_address_country" value="' . get_post_meta( $post->ID, '_location_address_country', true ) . '" class="regular-text" /></td> </tr> </tbody> </table>'; wp_nonce_field( 'update_location_address', '_nonce_location_address' ); }
[ "function add_location_metaboxes() {\n\t\t\tadd_meta_box( 'wpseo_locations', __( 'Business address details', 'yoast-local-seo' ), array(\n\t\t\t\t&$this,\n\t\t\t\t'metabox_locations',\n\t\t\t), 'wpseo_locations', 'normal', 'high' );\n\t\t}", "function ctloc_location_meta() {\n\tadd_meta_box( 'ctloc_meta', __( 'Georeferencia', 'ctloc-textdomain' ), 'ctloc_meta_callback', 'tour', 'normal', 'core' );\n}", "public function markupAddressFields() {\n global $post;\n\n $address = get_post_meta($post->ID, self::PREFIX . 'address', true);\n $city = get_post_meta($post->ID, self::PREFIX . 'city', true);\n $postalcode = get_post_meta($post->ID, self::PREFIX . 'postalcode', true);\n $telephone = get_post_meta($post->ID, self::PREFIX . 'telephone', true);\n $fax = get_post_meta($post->ID, self::PREFIX . 'fax', true);\n $email = get_post_meta($post->ID, self::PREFIX . 'email', true);\n $website = get_post_meta($post->ID, self::PREFIX . 'website', true);\n \n $latitude = get_post_meta($post->ID, self::PREFIX . 'latitude', true);\n $longitude = get_post_meta($post->ID, self::PREFIX . 'longitude', true);\n \n require_once( dirname(__FILE__) . '\\metaboxes\\meta-address.php' );\n }", "public function address_field()\n {\n echo '<input type=\"text\" name=\"hackerspace_spaceapi[location][address]\" value=\"'.esc_attr($this->options->location->address).'\" class=\"regular-text\" />';\n echo '<p class=\"description\">'.__('The postal address of your space. Example: Netzladen e.V., Breite Straße 74, 53111 Bonn, Germany', 'wp-hackerspace').'</p>';\n }", "function sh_register_google_maps_meta_box() {\n //search and generate short code with latitude & longitude\n add_meta_box('google-maps-meta-box-id', __('Google Maps', 'shgm'), 'sh_google_maps_display_callback', array('post', 'page'));\n}", "public function getLocationBox()\r\n\t{\r\n\t\treturn <<<EOT\r\n\t\t<a id=\"$this->locationCode\"></a>\r\n\t\t<div class=\"col-sm-6 location-inner $this->side\">\r\n\t\t\t<div class=\"photo\">\r\n\t\t\t\t<a target=\"_blank\" href=\"{$this->getVoUrl()}\"><img src=\"{$this->getImageUrl()}\" alt=\"\">\r\n\t\t\t\t</a>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"content\">\r\n\t\t\t\t<h4 class=\"title\">\r\n\t\t\t\t\t<a target=\"_blank\" href=\"{$this->getVoUrl()}\">$this->name</a>\r\n\t\t\t\t\t{$this->getNewLocationText()}\r\n\t\t\t\t</h4>\r\n\t\t\t\t<p class=\"addr\">$this->address<br>\r\n\t\t\t\t\tT <a class=\"phone\" href=\"tel:$this->phoneNumber\">$this->phoneNumber</a><br>\r\n\t\t\t\t\t{$this->getBestAddressText()}\r\n\t\t\t\t\t{$this->getBestPriceText()}\r\n\t\t\t\t\t{$this->getVoDealBox()}\r\n\t\t\t\t\t<a href=\"{$this->getVoUrl()}\" class=\"more\" target=\"”_blank”\">詳細 »</a>\r\n\t\t\t\t</p>\r\n\t\t\t\t<br>{$this->getCoworkingBox()}\r\n\t\t\t</div>\r\n\t\t\t<div class=\"clearfix\"></div>\r\n\t\t</div>\r\nEOT;\r\n\t}", "public function add_location_metaboxes() {\n\t\t\t$post_type = PostType::get_instance()->get_post_type();\n\t\t\tadd_meta_box(\n\t\t\t\t$post_type,\n\t\t\t\t__( 'Yoast Local SEO', 'yoast-local-seo' ),\n\t\t\t\t[ $this, 'metabox_locations' ],\n\t\t\t\t$post_type,\n\t\t\t\t'normal',\n\t\t\t\t'high'\n\t\t\t);\n\t\t}", "public static function render_banner_meta_location() {\n\t\t$location = Inventor_Query::get_listing_location_name();\n\n\t\tif ( ! empty( $location ) ) {\n\t\t\techo '<div class=\"detail-banner-meta-info\">';\n\t\t\t\techo '<i class=\"fa fa-fw fa-map-marker\"></i>' . wp_kses( $location, wp_kses_allowed_html( 'post' ) );\n\t\t\techo '</div>';\n\t\t}\n\t}", "public function maps_add_custom_box() {\n\t\t$screens = array( 'product' );\n\t\tforeach ( $screens as $screen )\n\t\t\tadd_meta_box( 'gmap_address', 'Адрес Дома/Квартиры', array(__CLASS__,'maps_meta_box_callback'), $screen );\n\t}", "function loccontact_meta_box() {\n\t\tglobal $post;\n\t\techo '<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"location_contact_telephone\">' . __( 'Telephone', 'locations' ) . '</label></th>\n\t\t\t\t\t\t<td><input name=\"location_contact_telephone\" type=\"text\" id=\"location_contact_telephone\" value=\"' . get_post_meta( $post->ID, '_location_contact_telephone', true ) . '\" class=\"regular-text\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"location_contact_email\">' . __( 'Email', 'locations' ) . '</label></th>\n\t\t\t\t\t\t<td><input name=\"location_contact_email\" type=\"text\" id=\"location_contact_email\" value=\"' . get_post_meta( $post->ID, '_location_contact_email', true ) . '\" class=\"regular-text\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"location_contact_web\">' . __( 'Web', 'locations' ) . '</label></th>\n\t\t\t\t\t\t<td><input name=\"location_contact_web\" type=\"text\" id=\"location_contact_web\" value=\"' . get_post_meta( $post->ID, '_location_contact_web', true ) . '\" class=\"regular-text\" placeholder=\"http://\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>';\n\t\twp_nonce_field( 'update_location_contact', '_nonce_location_contact' );\n\t}", "function wf_crm_location_fields() {\n return array('address', 'email', 'phone', 'website', 'im');\n}", "function add_details_to_location_address( $address_fields ) {\n $address_fields['phone'] = '<br/>';\n $address_fields['email'] = '<br/>';\n return $address_fields;\n }", "public function address_widget() {\r\r\r\n\t\tglobal $woocommerce;\r\r\r\n\r\r\r\n\t\t?>\r\r\r\n\t\t<div class=\"col2-set\">\r\r\r\n\t\t\t<div class=\"col-1\">\r\r\r\n\t\t\t\t<?php\r\r\r\n\t\t\t\tif ( $woocommerce->cart->needs_shipping() ) {\r\r\r\n\t\t\t\t\t?><h3><?php _e( 'Shipping Address', 'woocommerce' ); ?></h3><?php\r\r\r\n\t\t\t\t} else {\r\r\r\n\t\t\t\t\t?><h3><?php _e( 'Your Address', 'woocommerce' ); ?></h3><?php\r\r\r\n\t\t\t\t}\r\r\r\n\t\t\t\t?>\r\r\r\n\t\t\t\t<div id=\"amazon_addressbook_widget\"></div>\r\r\r\n\t\t\t\t<input type=\"hidden\" name=\"amazon_reference_id\" value=\"<?php echo $this->reference_id; ?>\" />\r\r\r\n\t\t\t</div>\r\r\r\n\t\t<?php\r\r\r\n\t}", "function admin_display_meta_box ($post) {\n\t\t\t$details = \"\";\n\t\t\t$coords = \"\";\n\t\t\t$latlon = array (\"\", \"\");\n\t\t\t$display_coords = \"\";\n\t\t\t$name = \"\";\n\n\t\t\t$geotag = $this->get_geotag_by_post_id ($post->ID);\n\t\t\tif (isset ($geotag) && !empty ($geotag)) {\n\t\t\t\t$details = $geotag->loc;\n\t\t\t\t$coords = $geotag->coord;\n\t\t\t\t$latlon = explode (' ', $coords);\n\t\t\t\t$display_coords = $latlon[0] . ', ' . $latlon[1];\n\t\t\t\t$name = $geotag->name;\n\t\t\t}\n\t\t\t\n\t\t\t$content = array ();\n\t\t\t$content[] = wp_nonce_field (basename (__FILE__), self::META_NONCE);\n\t\t\t\n\t\t\t$content[] = '<p><strong>' . __('Geotag Name', 'geopress') . '</strong><br />\n\t\t\t\t<input type=\"text\" name=\"geopress_location_name\" id=\"geopress-location-name\" value=\"' . $name . '\" /><br />\n\t\t\t\t<small>' . __('Geotag name', 'geopress') . '</small></p>';\n\n\t\t\t$content[] = '<p><strong>' . __('Geotag Details; Name, Address, Coordinates', 'geopress') . '</strong><br />\n\t\t\t\t<input type=\"text\" name=\"geopress_location_details\" id=\"geopress-location-details\" value=\"' . $details . '\" /><br />\n\t\t\t\t<small>' . __('Geotag details', 'geopress') . '</small></p>';\n\t\t\t\t\n\t\t\t$content[] = '<p><strong>' . __('Geotag Coordinates', 'geopress') . '</strong><br />\n\t\t\t\t<input type=\"text\" name=\"geopress_location_coords\" id=\"geopress-location-coords\" readonly=\"readonly\" value=\"' . $display_coords . '\" /><br />\n\t\t\t\t<small>' . __('Geotag Coordinates', 'geopress') . '</small></p>';\n\n\t\t\t$content[] = '<a class=\"button-secondary\" name=\"geopress_location_geocode\" id=\"geopress-location-geocode\">' . __('Geocode', 'geopress') . '</a>';\n\n\t\t\t$content[] = '<p><strong>' . __('Choose An Existing Geotag', 'geopress') . '</strong><br />\n\t\t\t\t<select name=\"geopress_existing_geotags\" id=\"geopress-existing-geotags\">\n\t\t\t\t<option value=\"\">' . __('-- Geotag --', 'geopress') . '</option>';\n\t\t\t$geotags = $this->get_all_geotags ();\n\t\t\tforeach ($geotags as $tag) {\n\t\t\t\t$content[] = '<option value=\"' . $tag->geopress_id . '\">' . $tag->name . '</option>';\n\t\t\t}\t// end-foreach\n\t\t\t$content[] = '</select><br />';\n\t\t\t\n\t\t\t$content[] = '<input type=\"hidden\" name=\"geopress_location_lat\" id=\"geopress-location-lat\" value=\"' . $latlon[0] . '\"/><br />';\n\t\t\t$content[] = '<input type=\"hidden\" name=\"geopress_location_lon\" id=\"geopress-location-lon\" value=\"' . $latlon[1] . '\"/><br />';\n\n\n\t\t\t$content[] = '<p class=\"geopress-error\" id=\"geopress-geocode-failure\"></p>';\n\t\t\t$content[] = '<p class=\"geopress-success\" id=\"geopress-geocode-success\">The geocoder seems to like your geotag details.</p>';\n\t\t\t\n\t\t\techo implode (PHP_EOL, $content);\n\t\t}", "function _uc_store_address_summarize($form) {\n $address = trim(uc_store_address());\n\n return array(\n 'data' => t('Store address:<br />!address', array('!address' => empty($address) ? t('Not set yet.') : $address)),\n );\n}", "function agentpress_listing_post_info( $info ){\n\tglobal $post;\n\n\t$map = get_field( 'map', $post->ID );\n\tif( ! is_array( $map ) || 0 == count( $map ) )\n\t\treturn false;\n\n\t$info = '<span class=\"address\">' . $map['address'] . ' (<a href=\"https://www.google.com/maps/place/' . urlencode( $map['address'] ) . '\" target=\"_blank\">View Map</a>)</span>';\n\n\treturn $info;\n}", "public function convention_address() : string {\n\t\t$key = $this->get_this_convention();\n\t\t$location = $this->get_single_convention_info( $key );\n\t\t$address = $location['address']['street_address'] . ', ' . $location['address']['city'] . ', ' . $location['address']['state'] . ' ' . $location['address']['zip'];\n\n\t\tob_start();\n\t\t?>\n\t\t\t<div class=\"address-stripe\" style=\"background-image: url(<?php the_post_thumbnail_url(); ?>)\">\n\t\t\t\t<div class=\"container\">\n\t\t\t\t\t<span class=\"dashicons dashicons-location\"></span>\n\t\t\t\t\t<h2><?php echo esc_attr( $location['address']['convention_center_name'] ); ?></h2>\n\t\t\t\t\t<address class=\"meta\"><?php echo wp_kses_post( $address ); ?></address>\n\t\t\t\t\t<p><a class=\"button\" target=\"_blank\" href=\"<?php echo esc_url( 'https://www.google.com/maps/dir/?api=1&destination=' . rawurlencode( $address ) ); ?>\">Get Directions</a></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php\n\t\treturn ob_get_clean();\n\t}", "function show_location_details_in_email( $item_id, $item, $order ) {\n if ( empty( $item['item_meta']['_location_id'] ) ) {\n return;\n }\n add_filter( 'slp_formatted_location_address_elements' , array( $this , 'add_details_to_location_address' ) );\n $this->slplus->currentLocation->get_location( $item['item_meta']['_location_id'] );\n echo '<br/>' . __( 'Location for service: ' , 'slp-premier' ) . '<br/>';\n echo $this->slplus->currentLocation->get_formatted_address();\n\n remove_filter( 'slp_formatted_location_address_elements' , array( $this , 'add_details_to_location_address' ) );\n }", "private static function render_location( $query ) { ?>\n <Location>\n <?php self::echo_meta( 'street-address', 'StreetAddress'); ?>\n <?php self::echo_meta( 'unit-number', 'UnitNumber' ); ?>\n <?php self::echo_meta( 'city', 'City' ); ?>\n <?php self::echo_meta( 'state', 'State' ); ?>\n <?php self::echo_meta( 'zip', 'Zip' ); ?>\n <?php self::echo_meta( 'latitude', 'Lat' ); ?>\n <?php self::echo_meta( 'longitude', 'Long' ); ?>\n <?php self::echo_meta( 'display-address', 'DisplayAddress' ); ?>\n </Location>\n <?php }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new wave with a list of participants on it
public function newWave($_domain, $_participants, $_msg, $_proxyForId, $_rpcServerUrl) {}
[ "public function create() {\n $data = Ensure::Input(func_get_args());\n $data = $data->get();\n if (!isset($data['recordingId'])) {\n $data['recordingId'] = \"\";\n }\n \n return parent::create($data,\n new RemoveResource($this,array(\"recordingId\"),\n new PathResource($this, array(\n \"recordings\" => $data['recordingId'],\n \"transcriptions\" => \"\"\n )\n )\n ));\n }", "public function create()\n {\n return view('level_sounds.create');\n }", "public function create()\n {\n return view('audio.create');\n }", "public function create_participant(array $data)\n\t{\n\n\t\t$player = \\DB::table('participants')\n\t\t\t->where('tournament_id', '=', $data['tournament_id'])\n\t\t\t->where('player_id', '=', $data['player_id'])\n\t\t\t->where('division_id', '=', $data['division_id'])\n\t\t\t->first();\n\n\t\tif (is_null($player)) {\n\t\t\treturn Participant::create([\n\t\t\t\t'tournament_id' => $data['tournament_id'],\t\t\t\t\n\t\t\t\t'player_id' => $data['player_id'],\n\t\t\t\t'division_id' => $data['division_id'],\n\t\t\t]);\n\t\t}\n\t}", "private function createBroadcasts()\n {\n $message =\n 'Shop will open at 10 am. If you will be driving yourself, ' .\n 'your parent must call a coach first. Be careful - the roads ' .\n 'are very slick!';\n $this->createBroadcast($message, $this->studentUserIds);\n\n // Generate a broadcast for mentors\n $message =\n 'Mentor meeting Saturday morning at 8:30. We will be discussing ' .\n 'robot progress and preparations for the upcoming competitions.';\n $this->createBroadcast($message, $this->mentorUserIds);\n\n // Generate a broadcast for all users\n $message =\n 'Pre-competition meeting next Monday at 7 pm. All team members ' .\n 'and parents must attend.';\n $all = array_unique(array_merge($this->studentUserIds, $this->parentUserIds, $this->mentorUserIds));\n $this->createBroadcast($message, $all);\n }", "public function createAction(Request $request)\n {\n $em = $this->getDoctrine()->getManager();\n $form = $this->createForm(new CustomwaveType());\n $form->bind($request);\n\n $entity = new Customwave();\n $data = $form->getData();\n \n $questionnaire = $request->get('surveySelection');\n $questionnaire_uniq = array_unique($questionnaire);\n $campaign = $request->get('selectCampaign');\n\n $projects = $data['aceproject'];\n $customProjectId = $data['customproject']->getId();\n $curdate = $data['date'];\n $entity->setCustomproject($data['customproject']);\n if($data['number'] == 100){\n $number = 'DEMO';\n }else{\n $number = $data['number'];\n }\n $name = $data['projectname'].'_w'.$number.'_'.$curdate;\n $entity->setName($name);\n $entity->setWavenum($data['number']);\n $entity->setTotalnum($data['totalnum']);\n if($data['bis'] !== null){\n $entity->setBis('bis');\n }\n $yearAndMonth = explode(' ',$curdate);\n $entity->setMonth(date('m',strtotime($yearAndMonth[0])));\n $entity->setYear($yearAndMonth[1]);\n if(!empty($campaign) && $campaign != null){\n foreach($campaign as $c){\n $campaign_entity = $em->getRepository('AlbatrossAceBundle:Campaign')->findOneById($c);\n $campaign_entity->addCustomwave($entity);\n $entity->addCampaign($campaign_entity);\n $em->persist($campaign_entity);\n }\n }\n if(!empty($questionnaire_uniq) && $questionnaire_uniq[0] != ''){\n foreach($questionnaire_uniq as $q){\n $questionnaire_entity = $em->getRepository('AlbatrossAceBundle:Questionnaire')->findOneById($q);\n $questionnaire_entity->addCustomwave($entity);\n $entity->addQuestionnaire($questionnaire_entity);\n $em->persist($questionnaire_entity);\n }\n }\n foreach($projects as $p){\n $p->setCustomwave($entity);\n $em->persist($p);\n }\n $em->persist($entity);\n $em->flush();\n return $this->redirect($this->generateUrl('customproject_show', array('id' => $customProjectId)));\n }", "function add_wave($name, $label, $initial_values = array(), $hidden=false, $strip_nonfixed = false, $extra_classes = array())\n\t{\n\t\t//use this instead\n\t\tif($this->name == null)\n\t\t\t$this->name = $name;\n\t\t\n\t\t\t\n\t\t//TODO: handle string $values\n\t\tif(is_string($initial_values))\n\t\t\t$initial_values = self::classes_from_shorthand($initial_values, $strip_nonfixed);\n\n\t\t//establish local variables for template use\n\t\t$maxDuration = $this->duration;\n\t\t$hide_name = !$this->show_label;\n\t\t$dynamic_edit = $this->dynamic_edit;\n\n\t\t++$this->wave_count;\n\n\t\t//store the wave internally for comparison\n\t\t$this->waves[] = $initial_values;\n\t\t\n\t\t\n\t\t\n\t\t//add the wave template to the output buffer\n\t\tob_start();\n\t\tinclude 'templates/wave.tpl.php';\n\t\t$this->out_buffer .= ob_get_clean();\n\t}", "public function create()\n\t{\n\t\treturn view('participantes.create');\n\t}", "public function createBlip()\n {\n $blipData = $this->_context->builder->appendWaveletBlip(\n $this->waveId, $this->waveletId\n );\n \n return $this->_context->addBlip($blipData);\n }", "public function createParticipant()\n {\n if ($this->page->request->isPost()) {\n $post = $this->page->request->post;\n\n } else {\n $post = new StdClass();\n }\n\n $output = $this->model->createParticipant($post);\n\n $this->jsonOutput($output);\n }", "function maybe_create_audiences() {\n\t$existing = get_demo_audiences();\n\n\t// Audiences already exist.\n\tif ( count( $existing ) === 2 ) {\n\t\treturn;\n\t}\n\n\t// Could happen, if it does we'll just delete it and recreate it.\n\tif ( count( $existing ) === 1 ) {\n\t\twp_delete_post( $existing[0]->ID, true );\n\t}\n\n\t// Custom audiences.\n\t$audiences = [\n\t\t[\n\t\t\t'title' => 'France',\n\t\t\t'config' => [\n\t\t\t\t'include' => 'all',\n\t\t\t\t'groups' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'include' => 'any',\n\t\t\t\t\t\t'rules' => [\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'field' => 'endpoint.Location.Country',\n\t\t\t\t\t\t\t\t'operator' => '=',\n\t\t\t\t\t\t\t\t'value' => 'FR',\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],\n\t\t\t],\n\t\t],\n\t\t[\n\t\t\t'title' => 'Japan',\n\t\t\t'config' => [\n\t\t\t\t'include' => 'all',\n\t\t\t\t'groups' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'include' => 'any',\n\t\t\t\t\t\t'rules' => [\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'field' => 'endpoint.Location.Country',\n\t\t\t\t\t\t\t\t'operator' => '=',\n\t\t\t\t\t\t\t\t'value' => 'JP',\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],\n\t\t\t],\n\t\t],\n\t];\n\n\tforeach ( $audiences as $audience ) {\n\t\t$post_id = wp_insert_post( [\n\t\t\t'post_type' => 'audience',\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_title' => $audience['title'],\n\t\t\t'post_name' => strtolower( $audience['title'] ),\n\t\t] );\n\n\t\tupdate_post_meta( $post_id, '_altis_analytics_demo_data', true );\n\t\tupdate_post_meta( $post_id, 'audience', $audience['config'] );\n\t}\n}", "public function createSpeaker()\n {\n return view(SELF::CREATE_VIEW);\n }", "private function createTimes()\n {\n $this->user1Time = $this->user1->times()->create([\n 'worked_hours' => '8',\n 'date' => Carbon\\Carbon::now(),\n 'note' => 'note test'\n ]);\n\n $this->user2Time = $this->user2->times()->create([\n 'worked_hours' => '7',\n 'date' => Carbon\\Carbon::now(),\n 'note' => 'note test 123'\n ]);\n }", "function generateWAV($letters)\n {\n $data_len = 0;\n $files = array();\n $out_data = '';\n\n foreach ($letters as $letter) {\n $filename = $this->audio_path . strtoupper($letter) . '.wav';\n\n $fp = fopen($filename, 'rb');\n\n $file = array();\n\n $data = fread($fp, filesize($filename)); // read file in\n\n $header = substr($data, 0, 36);\n $body = substr($data, 44);\n\n\n $data = unpack('NChunkID/VChunkSize/NFormat/NSubChunk1ID/VSubChunk1Size/vAudioFormat/vNumChannels/VSampleRate/VByteRate/vBlockAlign/vBitsPerSample', $header);\n\n $file['sub_chunk1_id'] = $data['SubChunk1ID'];\n $file['bits_per_sample'] = $data['BitsPerSample'];\n $file['channels'] = $data['NumChannels'];\n $file['format'] = $data['AudioFormat'];\n $file['sample_rate'] = $data['SampleRate'];\n $file['size'] = $data['ChunkSize'] + 8;\n $file['data'] = $body;\n\n if ( ($p = strpos($file['data'], 'LIST')) !== false) {\n // If the LIST data is not at the end of the file, this will probably break your sound file\n $info = substr($file['data'], $p + 4, 8);\n $data = unpack('Vlength/Vjunk', $info);\n $file['data'] = substr($file['data'], 0, $p);\n $file['size'] = $file['size'] - (strlen($file['data']) - $p);\n }\n\n $files[] = $file;\n $data = null;\n $header = null;\n $body = null;\n\n $data_len += strlen($file['data']);\n\n fclose($fp);\n }\n\n $out_data = '';\n for($i = 0; $i < sizeof($files); ++$i) {\n if ($i == 0) { // output header\n $out_data .= pack('C4VC8', ord('R'), ord('I'), ord('F'), ord('F'), $data_len + 36, ord('W'), ord('A'), ord('V'), ord('E'), ord('f'), ord('m'), ord('t'), ord(' '));\n\n $out_data .= pack('VvvVVvv',\n 16,\n $files[$i]['format'],\n $files[$i]['channels'],\n $files[$i]['sample_rate'],\n $files[$i]['sample_rate'] * (($files[$i]['bits_per_sample'] * $files[$i]['channels']) / 8),\n ($files[$i]['bits_per_sample'] * $files[$i]['channels']) / 8,\n $files[$i]['bits_per_sample'] );\n\n $out_data .= pack('C4', ord('d'), ord('a'), ord('t'), ord('a'));\n\n $out_data .= pack('V', $data_len);\n }\n\n $out_data .= $files[$i]['data'];\n }\n\n $this->scrambleAudioData($out_data, 'wav');\n return $out_data;\n }", "private function createParticipantsTable()\n {\n DB::schema()->create(\n 'participants',\n function ($table) {\n $table->increments('id');\n $table->integer('thread_id')->unsigned();\n $table->integer('user_id')->unsigned();\n $table->timestamp('last_read')->nullable();\n $table->timestamps();\n $table->softDeletes();\n }\n );\n }", "abstract protected function prepareAudienceList(array $audiences);", "public function add_participant($id, $request);", "public function actionCreate()\n {\n $model = new PollingUnit(['scenario' => 'create']);\n $count = Party::find()->count();\n $modelsResult = [new AnnouncedPuResults([])];\n if ($model->load(Yii::$app->request->post())) {\n $modelsResult = Model::createMultiple(AnnouncedPuResults::class);\n Model::loadMultiple($modelsResult , \\Yii::$app->request->post()); \n $valid = $model->validate();\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n foreach ($modelsResult as $result) {\n $result->polling_unit_uniqueid = $model->uniqueid;\n if (! ($flag = $result->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->uniqueid]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n return $this->redirect(['view', 'id' => $model->uniqueid]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'modelsResult'=>(empty($modelsResult)) ? [new AnnouncedPuResults()] : $modelsResult,\n 'count' => $count\n ]);\n }", "public function registerParticipant(Request $request)\n {\n $currentEventId = $request->eventId;\n $maxCount = 0;\n $status = self::STATUS['join']; // 1: 참가, 2: 대기\n\n //-- 이름이 입력되지 않았으면 에러 메세지\n if (empty($request->participantName))\n {\n $request->session()->flash('message.level', 'danger');\n $request->session()->flash('message.content', '이름을 입력해 주세요.');\n\n return redirect()->route('event.view', [$currentEventId]);\n }\n\n //-- Check bulk add\n $participantInput = $request->participantName;\n $participantsArray = explode(\"|\", $participantInput);\n if (count($participantsArray) > 1) \n {\n //-- 만약 벌크 인풋일경우\n foreach($participantsArray as $value) \n {\n //-- 현재 참여 인원수를 구한 후 참여자 상태 결정\n $currentCount = count($this->_getEventParticipants($request->eventId));\n\n if ( !empty($this->_eventDetails->max_head) && $this->_eventDetails->max_head > 0)\n {\n $maxCount = $this->_eventDetails->max_head;\n $status = $currentCount < $maxCount ? self::STATUS['join'] : self::STATUS['waiting'];\n }\n\n $participant = new Participant();\n $participant->event_id = $currentEventId;\n $participant->name = $value;\n $participant->status_id = $status;\n\n // dd($status);\n if(!$participant->save())\n {\n abort(500, 'Error');\n }\n }\n }\n else \n {\n //-- 현재 참여 인원수를 구한 후 참여자 상태 결정\n $currentCount = count($this->_getEventParticipants($request->eventId));\n \n if ( !empty($this->_eventDetails->max_head) && $this->_eventDetails->max_head > 0)\n {\n $maxCount = $this->_eventDetails->max_head;\n $status = $currentCount < $maxCount ? self::STATUS['join'] : self::STATUS['waiting'];\n }\n \n // dd($currentEventId);\n $participant = new Participant();\n\n $participant->event_id = $currentEventId;\n $participant->name = $request->participantName;\n $participant->status_id = $status;\n\n // dd($status);\n if(!$participant->save())\n {\n abort(500, 'Error');\n }\n\n if ($status == 1) \n {\n $request->session()->flash('message.level', 'success');\n $request->session()->flash('message.content', '\"' .$request->participantName . '\"' . ' 님이 추가 되었습니다.');\n }\n elseif ($status == 2) \n {\n $request->session()->flash('message.level', 'warning');\n $request->session()->flash('message.content', '인원 초과로 인해 \"' .$request->participantName . '\"' . ' 님이 대기 명단에 추가 되었습니다.');\n }\n }\n \n \n \n return redirect()->route('event.view', [$currentEventId]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Listing of orgGroup members as b_tab
static function b_tab_groupMembers($org_id){ // Open the tabs locateAndInclude('b_tabs'); $b_tabs = new b_tabs(array_values(myOrg($org_id)->orgGroups()->get_groups())); // Fill the tab locateAndInclude('bHolder_Avatar_ea'); foreach(myOrg($org_id)->orgGroups()->get_groups() as $group_code=>$group_name){ if ($b_tabs->body()){ // List the group members, but instead of SQL query // provide the list of av_id to be listed $holder = new bHolder_Avatar_ea(); $holder->show_icons = superUser_here || (defined('EA_ORG_manager_here') && EA_ORG_manager_here); $holder->custom_header = array('icon_nosort_afirst' => ' ', 'name' => 'Name', 'av_email' => 'Email', 'av_institute' => "Affiliation", 'av_lastlogin' => 'login'); if ($holder->av_ids = array_keys(myOrg($org_id)->orgGroups()->get_groupMembers($group_code,True))){ $holder->listEntries(); } } } $b_tabs->close(); }
[ "function listgroup()\n\t{\n\t\tglobal $atmail;\n\n\t $h = array();\n\n\t $abookGroup = Filter::cleanSqlFieldNames($this->db->AbookGroup);\n\n\t // users from addressbooks for current account\n\t $users = $this->db->sqlarray(\"SELECT id\n\t FROM $abookGroup\n\t WHERE Account = $this->Account_Escape AND GroupEmail != ''\");\n\n\t foreach ($users as $user)\n\t {\n\t $user = $this->db->quote($user);\n\t $v = $this->db->getvalue(\"SELECT GroupName\n\t FROM $abookGroup\n\t WHERE id = $user\");\n\n\t $h[$v] .= $this->db->getvalue(\"SELECT GroupEmail\n\t FROM $abookGroup\n\t WHERE id = $user\") . \", \";\n\t }\n\n\t return $h;\n\t}", "function gadget_organization_groups()\n{\n\tglobal $db, $main;\n\t\n\t$groups = $db->get('*',\"usergroups\",null,8);\n\tif(!$groups) return '';\n\tif(isset($groups['gid'])) $groups = array($groups);\n\t\n\t$list = '';\n\tforeach($groups as $group)\n\t{\n\t\t$gmarkup = markup($group['name'], $group['style_start'], $group['style_end'], $group['is_multi_colour']);\n\t\tif(!$main->settings['enable_stafflist']) $list .= \"<tr><td class='tbody'>{$gmarkup}</td></tr>\";\n\t\telse $list .= \"<tr><td class='tbody'><a itemprop='url' href='//{$main->settings['site_url']}/group.php?gid={$group['gid']}'>{$gmarkup}</a></td></tr>\";\n\t}\n\t\n\treturn \"<div itemscope itemtype='http://schema.org/Organization'>\n\t<link itemprop='sameAs' href='//{$main->settings['site_url']}/pages/?area={$main->settings['about_page']}' />\n\t<table>\n\t\t<tr><td class='thead'>Groups</td></tr>{$list}\n\t</table>\n</div>\";\n}", "function detailGroup($group){\n if (!isAlphaNumeric($group)){\n return false;\n }\n\n $sql = dbconnect();\n \n $usersQ = \"select gid,username from userGroups where name='$group' order by username\";\n $usersR = $sql->query($usersQ);\n \n $gid = 0;\n echo \"<table cellspacing=2 cellpadding=2 border=1>\";\n echo \"<tr><th>Users</th></tr>\";\n while ($row = $sql->fetch_array($usersR)){\n $gid = $row[0];\n echo \"<tr><td>$row[1]</td></tr>\";\n }\n echo \"</table>\";\n\n $authsQ = \"select auth,sub_start,sub_end from userGroupPrivs where gid=$gid order by auth\";\n $authsR = $sql->query($authsQ);\n echo \"<table cellspacing=2 cellpadding=2 border=1>\";\n echo \"<tr><th>Authorization Class</th><th>Subclass start</th><th>Subclass End</th></tr>\";\n while ($row = $sql->fetch_array($authsR)){\n echo \"<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td></tr>\";\n }\n echo \"</table>\";\n}", "public function list() {\n\t\t$groups = $this->groupsTable->findAll(groupName);\n\t\t$title = 'Groups';\n\t\treturn [\n\t\t\t'template' => 'grouplist.html.php',\n\t\t\t'title' => $title,\n\t\t\t'variables' => ['groups' => $groups]\n\t\t];\n\t}", "private function get_group_members_html()\n {\n $html = array();\n\n // Title\n $html[] = '<div style=\"font-weight:bold; float:left\">';\n $html[] = Translation::get('GroupMembers') . ':&nbsp;<br />';\n $html[] = '</div>';\n\n // Content\n $html[] = '<div style=\"float:left\">';\n $html[] = $this->get_group_members() . '<br />';\n $html[] = '</div><br />';\n\n return implode(PHP_EOL, $html);\n }", "function fbsgroups()\n\t{\n\t\tif(!empty($this->params['url']['id']))\n\t\t{\n\t\t\t$id = $this->params['url']['id'];\n\t\t\t$qry=\"select distinct f.name from fb_group f where f.login_id = $id and f.isCreator='Yes'\";\n\t\t\t$result = $this->Lfmalbum->findBySql($qry);\n\t\t\t$data = \"[\";\n\t\t\tforeach($result as $key =>$val)\n\t\t\t{\n\t\t\t\t$nm = str_replace(array(\"\\\"\",\"'\"),array(\" \",\" \"),$val['f']['name']);\n\t\t\t\t$data.= \"{ optionValue:'$nm' , optionDisplay:'$nm'},\";\n\t\t\t}\n\t\t\t$data= substr($data,0,strlen($data)-1);\n\t\t\t$data.=\"]\";\n\t\t\techo $data;\n\t\t\texit;\n\n\t\t}\n\n\t}", "function membersOf($db,$groupID)\n{\n $q = \"select * from acad_object_groups where id = %d\";\n $group = dbOneTuple($db, mkSQL($q, $groupID));\n $codes = array();\n\n switch ($group[\"gdefby\"]) {\n /* Enumerated Codes */\n case \"enumerated\":\n $q = \"select code from \".$group[\"gtype\"].\"_group_members, \"\n .$group[\"gtype\"].\"s where \".$group[\"gtype\"]\n .\"_group_members.ao_group = \".$groupID.\" and \"\n .$group[\"gtype\"].\"s.id = \".$group[\"gtype\"].\"_group_members.\".$group[\"gtype\"];\n $res = dbQuery($db, $q); \n while ($tup = dbNext($res)) {\n array_push($codes, $tup[\"code\"]);\n }\n break;\n /* Pattern Codes */ \n case \"pattern\":\n $def = str_replace(\"{\", \"\", $group[\"definition\"]);\n $def = str_replace(\";\", \",\", $def);\n $def = str_replace(\"}\", \"\", $def);\n foreach (explode(\",\", $def) as $pat) {\n if (preg_match(\"/^(GENG|GEN#|FREE|####|all|ALL)/\", $pat)) {\n array_push($codes, $pat);\n } else {\n $pat = str_replace(\"#\", \".\", $pat);\n // lookup codes using pat\n $q = \"select code from \".$group[\"gtype\"].\"s where code ~ %s\";\n $res = dbQuery($db, mkSQL($q, $pat));\n while ($tup = dbNext($res)) {\n array_push($codes, $tup[\"code\"]);\n }\n }\n }\n break;\n /* Query Codes */\n case \"query\":\n $q = $group[\"definition\"];\n $res= dbQuery($db, mkSql($q));\n while ($tup = dbNext($res)) {\n array_push($codes, $tup[\"code\"]);\n }\n }\n\n // Recursively collect subgroups\n $q = \"select id from acad_object_groups where parent = %d\";\n $res = dbQuery($db, mkSQL($q, $groupID));\n while ($tup = dbNext($res)) {\n $subcodes = membersOf($db, $tup[\"id\"]);\n $codes = array_merge($codes, $subcodes[1]);\n }\n\n sort($codes);\n return array($group[\"gdefby\"], $codes);\n}", "private function set_group_members() {\n foreach ($this->groups as $group) {\n $this->groups[$group->id]->headingname = get_string('group', 'assignsubmission_physical') .\n ': ' . $this->groups[$group->id]->name;\n $temp = '';\n $i = 0;\n if ($this->usernameformat->format === 'user') {\n $this->groups[$group->id]->membernames = groups_get_members($group->id,\n \"u.id, u.firstname, u.lastname,\n u.{$this->usernameformat->field} AS username\",\n 'lastname ASC');\n $count = count($this->groups[$group->id]->membernames);\n\n foreach ($this->groups[$group->id]->membernames as $member) {\n $temp .= \"$member->firstname $member->lastname ($member->username)\";\n $i++;\n if ($i < $count) {\n $temp .= ', ';\n }\n }\n } else if ($this->usernameformat->format === 'uif') {\n $this->groups[$group->id]->membernames = groups_get_members($group->id,\n 'u.id, u.firstname, u.lastname',\n 'lastname ASC');\n $count = count($this->groups[$group->id]->membernames);\n $userids = array_column($this->groups[$group->id]->membernames, 'id');\n $usernames = $this->get_custom_usernames($userids);\n\n foreach ($this->groups[$group->id]->membernames as $member) {\n $username = (isset($usernames[$member->id])) ? $usernames[$member->id]->username : '';\n $temp .= \"$member->firstname $member->lastname ($username)\";\n $i++;\n if ($i < $count) {\n $temp .= ', ';\n }\n }\n } else {\n $this->groups[$group->id]->membernames = groups_get_members($group->id,\n \"u.id, u.firstname, u.lastname\",\n 'lastname ASC');\n $count = count($this->groups[$group->id]->membernames);\n foreach ($this->groups[$group->id]->membernames as $member) {\n $temp .= \"$member->firstname $member->lastname\";\n $i++;\n if ($i < $count) {\n $temp .= ', ';\n }\n }\n }\n $this->groups[$group->id]->membernames = $temp;\n }\n }", "function allMembergroupsBoardAccess()\n{\n\tglobal $txt;\n\n\t$db = database();\n\n\t// Cache them so we get regular members too.\n\t$rows = array(\n\t\tarray(\n\t\t\t'id_group' => -1,\n\t\t\t'group_name' => $txt['membergroups_guests'],\n\t\t\t'online_color' => '',\n\t\t\t'min_posts' => -1,\n\t\t\t'max_messages' => null,\n\t\t\t'icons' => ''\n\t\t),\n\t\tarray(\n\t\t\t'id_group' => 0,\n\t\t\t'group_name' => $txt['membergroups_members'],\n\t\t\t'online_color' => '',\n\t\t\t'min_posts' => -1,\n\t\t\t'max_messages' => null,\n\t\t\t'icons' => ''\n\t\t),\n\t);\n\n\t$db->fetchQuery('\n\t\tSELECT \n\t\t\tmg.id_group, mg.group_name, mg.online_color, mg.min_posts, mg.max_messages, mg.icons,\n\t\t\tCASE WHEN bp.permission IS NOT NULL OR mg.id_group = {int:admin_group} THEN 1 ELSE 0 END AS can_moderate\n\t\tFROM {db_prefix}membergroups AS mg\n\t\t\tLEFT JOIN {db_prefix}board_permissions AS bp ON (bp.id_group = mg.id_group AND bp.id_profile = {int:default_profile} AND bp.permission = {string:moderate_board})\n\t\tORDER BY mg.min_posts, CASE WHEN mg.id_group < {int:newbie_group} THEN mg.id_group ELSE 4 END, mg.group_name',\n\t\tarray(\n\t\t\t'admin_group' => 1,\n\t\t\t'default_profile' => 1,\n\t\t\t'newbie_group' => 4,\n\t\t\t'moderate_board' => 'moderate_board',\n\t\t)\n\t)->fetch_callback(\n\t\tfunction ($row) use (&$rows) {\n\t\t\t$rows[] = $row;\n\t\t}\n\t);\n\n\treturn $rows;\n}", "function on_bpge_admin_groups($bpge){\n $arg['type'] = 'alphabetical';\n $arg['per_page'] = '1000';\n bpge_view('admin_groups_list', array('arg' => $arg));\n }", "function group_member_names($gid)\n{\n\tglobal $tool_content;\n\t$start = TRUE;\n\t$names= '';\n\tforeach (group_members($gid) as $id) {\n\t\tif ($start) {\n\t\t\t$start = FALSE;\n\t\t} else {\n\t\t\t$names .= ', ';\n\t\t}\n\t\t$names .= uid_to_name($id);\n\t\tif ($am = uid_to_am($id)) {\n\t\t\t$names .= \" ($am)\";\n\t\t}\n\t}\n\treturn $names;\n}", "function membersOf($db, $groupID)\n{\n $q = \"select * from acad_object_groups where id = %d\";\n $grp = dbOneTuple($db, mkSQL($q, $groupID));\n $output = array();\n\n if ($grp[\"gdefby\"] == \"pattern\") {\n $courseList = preg_split(\"/,/\", $grp[\"definition\"]);\n $courseList = getPattern($db, $courseList, $grp[\"gtype\"], false);\n } elseif ($grp[\"gdefby\"] == \"enumerated\") {\n $courseList = getEnum($db, $grp[\"gtype\"], $grp[\"id\"]);\n } elseif ($grp[\"gdefby\"] == \"query\") {\n $courseList = getQuery($db, $grp[\"gtype\"], $grp[\"definition\"]);\n }\n return array($grp[\"gtype\"], $courseList);\n}", "public function listGroupsCommand()\n {\n $validAttributes = $this->settings['additionalAttributes']['group'];\n $headerRow = ['Name', 'Description'];\n\n foreach ($validAttributes as $attribute) {\n $headerRow[] = $this->translator->translateById('attribute.' . $attribute, [], null, null, 'CrowdApi',\n 'Neos.NeosIo');\n }\n\n $groups = $this->crowdApiConnector->fetchGroups(false);\n $tableRows = array_map(function ($item) use ($validAttributes) {\n $attributes = [\n $item['name'],\n $item['description'],\n ];\n\n foreach ($validAttributes as $attribute) {\n $attributes[] = array_key_exists($attribute, $item) ? $item[$attribute] : '';\n }\n return $attributes;\n }, $groups);\n\n $this->output->outputTable($tableRows, $headerRow);\n }", "function get_list() {\n\t\t$query = \"select cg_id, cg_name from \".$this->_db_table;\n\t\t$cloudusergroup_name_array = array();\n\t\t$cloudusergroup_name_array = htvcenter_db_get_result_double ($query);\n\t\treturn $cloudusergroup_name_array;\n\t}", "private function get_group_members()\n {\n if ($this->main_page->get_submitter_type() ==\n \\Chamilo\\Application\\Weblcms\\Integration\\Chamilo\\Core\\Tracking\\Storage\\DataClass\\AssignmentSubmission::SUBMITTER_TYPE_COURSE_GROUP\n )\n {\n $group_members =\n CourseGroupDataManager::retrieve_course_group_users($this->main_page->get_target_id())->as_array();\n }\n else\n {\n $group_members = \\Chamilo\\Core\\User\\Storage\\DataManager::retrieves(\n \\Chamilo\\Core\\User\\Storage\\DataClass\\User::class_name(),\n new DataClassRetrievesParameters(\n new InCondition(\n new PropertyConditionVariable(User::class_name(), User::PROPERTY_ID),\n \\Chamilo\\Core\\Group\\Storage\\DataManager::retrieve_by_id(\n Group::class_name(),\n $this->main_page->get_target_id()\n )->get_users()\n )\n )\n )->as_array();\n }\n\n $group_member_names = array();\n\n foreach ($group_members as $member)\n {\n $group_member_names[$member->get_lastname()] = $member->get_fullname();\n }\n\n ksort($group_member_names);\n\n return implode(\", \", $group_member_names);\n }", "function MembergroupIndex()\n{\n\tglobal $txt, $context;\n\n\t$context['page_title'] = $txt['membergroups_title'];\n\n\t// The first list shows the regular membergroups.\n\t$listOptions = array(\n\t\t'id' => 'regular_membergroups_list',\n\t\t'title' => $txt['membergroups_regular'],\n\t\t'base_href' => '<URL>?action=admin;area=membergroups' . (isset($_REQUEST['sort2']) ? ';sort2=' . urlencode($_REQUEST['sort2']) : ''),\n\t\t'default_sort_col' => 'name',\n\t\t'get_items' => array(\n\t\t\t'file' => 'Subs-Membergroups',\n\t\t\t'function' => 'list_getMembergroups',\n\t\t\t'params' => array(\n\t\t\t\t'regular',\n\t\t\t),\n\t\t),\n\t\t'columns' => array(\n\t\t\t'name' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_name'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\t// Since the moderator group has no explicit members, no link is needed.\n\t\t\t\t\t\tif ($rowData['id_group'] == 3)\n\t\t\t\t\t\t\t$group_name = $rowData['group_name'];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$group_name = sprintf('<a href=\"<URL>?action=admin;area=membergroups;sa=members;group=%1$d\" class=\"group%1$s\">%2$s</a>', $rowData['id_group'], $rowData['group_name']);\n\n\t\t\t\t\t\t// Add a help option for moderator and administrator.\n\t\t\t\t\t\tif ($rowData['id_group'] == 1)\n\t\t\t\t\t\t\t$group_name .= ' (<a href=\"<URL>?action=help;in=membergroup_administrator\" onclick=\"return reqWin(this);\">?</a>)';\n\t\t\t\t\t\telseif ($rowData['id_group'] == 3)\n\t\t\t\t\t\t\t$group_name .= ' (<a href=\"<URL>?action=help;in=membergroup_moderator\" onclick=\"return reqWin(this);\">?</a>)';\n\n\t\t\t\t\t\treturn $group_name;\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, group_name',\n\t\t\t\t\t'reverse' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, group_name DESC',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'stars' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_stars'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\t$stars = explode('#', $rowData['stars']);\n\n\t\t\t\t\t\t// In case no stars are setup, return with nothing\n\t\t\t\t\t\tif (empty($stars[0]) || empty($stars[1]))\n\t\t\t\t\t\t\treturn '';\n\n\t\t\t\t\t\t// Otherwise repeat the image a given number of times.\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$image = sprintf('<img src=\"%1$s/%2$s\">', ASSETS, $stars[1]);\n\t\t\t\t\t\t\treturn str_repeat($image, $stars[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'stars',\n\t\t\t\t\t'reverse' => 'stars DESC',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'members' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_members_top'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\tglobal $txt;\n\n\t\t\t\t\t\t// No explicit members for the moderator group.\n\t\t\t\t\t\treturn $rowData['id_group'] == 3 ? $txt['membergroups_guests_na'] : $rowData['num_members'];\n\t\t\t\t\t},\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, 1',\n\t\t\t\t\t'reverse' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, 1 DESC',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'modify' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['modify'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'sprintf' => array(\n\t\t\t\t\t\t'format' => '<a href=\"<URL>?action=admin;area=membergroups;sa=edit;group=%1$d\">' . $txt['membergroups_modify'] . '</a>',\n\t\t\t\t\t\t'params' => array(\n\t\t\t\t\t\t\t'id_group' => false,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\t'additional_rows' => array(\n\t\t\tarray(\n\t\t\t\t'position' => 'below_table_data',\n\t\t\t\t'value' => '<form action=\"<URL>?action=admin;area=membergroups;sa=add;generalgroup\" method=\"post\"><input type=\"submit\" class=\"new\" value=\"' . $txt['membergroups_add_group'] . '\"></form>',\n\t\t\t),\n\t\t),\n\t);\n\n\tloadSource('Subs-List');\n\tcreateList($listOptions);\n\n\t// The second list shows the post count based groups.\n\t$listOptions = array(\n\t\t'id' => 'post_count_membergroups_list',\n\t\t'title' => $txt['membergroups_post'],\n\t\t'base_href' => '<URL>?action=admin;area=membergroups' . (isset($_REQUEST['sort']) ? ';sort=' . urlencode($_REQUEST['sort']) : ''),\n\t\t'default_sort_col' => 'required_posts',\n\t\t'request_vars' => array(\n\t\t\t'sort' => 'sort2',\n\t\t\t'desc' => 'desc2',\n\t\t),\n\t\t'get_items' => array(\n\t\t\t'file' => 'Subs-Membergroups',\n\t\t\t'function' => 'list_getMembergroups',\n\t\t\t'params' => array(\n\t\t\t\t'post_count',\n\t\t\t),\n\t\t),\n\t\t'columns' => array(\n\t\t\t'name' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_name'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\treturn sprintf('<a href=\"<URL>?action=moderate;area=viewgroups;sa=members;group=%1$d\" class=\"group%1$d\">%2$s</a>', $rowData['id_group'], $rowData['group_name']);\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'group_name',\n\t\t\t\t\t'reverse' => 'group_name DESC',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'stars' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_stars'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'function' => function ($rowData) {\n\t\t\t\t\t\t$stars = explode('#', $rowData['stars']);\n\n\t\t\t\t\t\tif (empty($stars[0]) || empty($stars[1]))\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$star_image = sprintf('<img src=\"%1$s/%2$s\">', ASSETS, $stars[1]);\n\t\t\t\t\t\t\treturn str_repeat($star_image, $stars[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, stars',\n\t\t\t\t\t'reverse' => 'CASE WHEN id_group < 4 THEN id_group ELSE 4 END, stars DESC',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'members' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_members_top'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'db' => 'num_members',\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => '1 DESC',\n\t\t\t\t\t'reverse' => '1',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'required_posts' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['membergroups_min_posts'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'db' => 'min_posts',\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t\t'sort' => array(\n\t\t\t\t\t'default' => 'min_posts',\n\t\t\t\t\t'reverse' => 'min_posts DESC',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'modify' => array(\n\t\t\t\t'header' => array(\n\t\t\t\t\t'value' => $txt['modify'],\n\t\t\t\t),\n\t\t\t\t'data' => array(\n\t\t\t\t\t'sprintf' => array(\n\t\t\t\t\t\t'format' => '<a href=\"<URL>?action=admin;area=membergroups;sa=edit;group=%1$d\">' . $txt['membergroups_modify'] . '</a>',\n\t\t\t\t\t\t'params' => array(\n\t\t\t\t\t\t\t'id_group' => false,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'style' => 'text-align: center',\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\t'additional_rows' => array(\n\t\t\tarray(\n\t\t\t\t'position' => 'below_table_data',\n\t\t\t\t'value' => '<form action=\"<URL>?action=admin;area=membergroups;sa=add;postgroup\" method=\"post\"><input type=\"submit\" class=\"new\" value=\"' . $txt['membergroups_add_group'] . '\"></form>',\n\t\t\t),\n\t\t),\n\t);\n\n\tcreateList($listOptions);\n}", "public function getMembers()\r\n {\r\n $group = $this;\r\n return array_column(array_filter($this->parent->person_group_relations, function ($relation) use ($group) {\r\n return $relation[\"group\"] == $group;\r\n }), \"person\");\r\n }", "public function getMemberGroups()\n {\n return \\Database::getInstance()\n ->prepare(\"SELECT * FROM `tl_member_group`\")\n ->execute()\n ->fetchAllAssoc();\n }", "private function listClubMembers() {\n $memberList = $this->connect()->query(\"SELECT * FROM club_members\");\n echo \"\n <div class='dbContent'>\n <table class='dbList'>\n <caption><strong>Club Members List</strong></caption>\n <thead>\n <tr>\n <th abbr='ID' scope='col' title='ID'>Member ID</th>\n <th abbr='First Name' scope='col' title='First Name'>First Name</th>\n <th abbr='Last Name' scope='col' title='Last Name'>Last Name</th>\n <th abbr='Email' scope='col' title='Email'>Email</th>\n <th abbr='Availability' scope='col' title='Availability'>Availability</th>\n <th abbr='Receive Email' scope='col' title='Receive Email'>Receive Email</th>\n <th abbr='Become Leader' scope='col' title='Become Leader'>Become Leader</th>\n </tr>\n </thead>\n <tbody>\";\n while ($row = $memberList->fetch()) {\n echo \"\n <tr>\n <td>$row[id]</td>\n <td>$row[first_name]</td>\n <td>$row[last_name]</td>\n <td>$row[email]</td>\n <td>$row[availability]</td>\n <td>$row[receive_email]</td>\n <td>$row[become_leader]</td>\n </tr>\";\n }\n echo \"\n </tbody>\n </table>\n </div>\";\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if this model must use slugs as an identifier for when recording audit trail entries
public function useSlugAsIdentifier(): bool { return $this instanceof Sluggable || in_array(Slugs::class, class_uses_recursive($this)); }
[ "public function canGenerateSlug();", "public function isAutoSetSlugs()\n {\n // @todo (Pablo - 2019-04-15) - Phase out support for $this->tableAutoSetSlugs\n return $this->tableAutoSetSlugs ?? (defined('static::AUTO_SET_SLUG') ? static::AUTO_SET_SLUG : false);\n }", "public function hasSluggable()\n {\n return $this->sluggable ?: false;\n }", "public function get_hasUniqueSlug()\n {\n return $this->_hasUniqueSlug;\n }", "public function isSluggableHistoryEnabled()\n {\n return config('admin.sluggable_history', false);\n }", "public function getSlugKey()\n {\n return 'slug';\n }", "private function _isSluggable($Model) {\n\t\t$return = false;\n\t\tif (array_key_exists('Sluggable', $Model->actsAs)) {\n\t\t\t$return = !empty($Model->actsAs['Sluggable']['slugColumn']) ? $Model->actsAs['Sluggable']['slugColumn'] : 'slug';\n\t\t}\n\t\treturn $return;\n\t}", "function isSluggable() {\n\t\treturn $this->table->hasTemplate('Doctrine_Template_Sluggable');\n\t}", "protected static function getSlugKey(): string\n {\n return 'slug';\n }", "private function isSlugTranslatable()\n {\n return !empty($this->translatable)\n && in_array($this->slugOptions->generateSlugFrom[0], $this->translatable)\n && method_exists($this, 'getTranslations');\n }", "public function shouldRegisterRouteSlug(): bool\n {\n return true;\n }", "protected function needsSlugging()\n {\n $config = $this->getSluggableConfig();\n $save_to = $config['save_to'];\n $on_update = $config['on_update'];\n\n if (empty($this->attributes[$save_to])) {\n return true;\n }\n\n if ($this->isDirty($save_to)) {\n return false;\n }\n\n return (!$this->exists || $on_update);\n }", "public function slugs();", "public function getSlugKey();", "public function getSlug();", "public function generateSlug()\n {\n if ( $this->getRegenerateSlugOnUpdate() || empty( $this->slug ) ) {\n $fields = $this->getSluggableFields();\n $values = [];\n\n foreach ($fields as $field) {\n if (property_exists($this, $field)) {\n $val = $this->{$field};\n } else {\n $methodName = 'get' . ucfirst($field);\n if (method_exists($this, $methodName)) {\n $val = $this->{$methodName}();\n } else {\n $val = null;\n }\n }\n\n $values[] = $val;\n }\n\n $this->slug = $this->generateSlugValue($values);\n }\n }", "protected function determineIfModelIsSluggable()\n {\n $this->context->modelIsSluggable = false;\n $this->context->modelIsParentOfSluggableTranslation = false;\n\n // if the model is sluggable and not translated, or this is the actual translation\n if ($this->data['sluggable']) {\n\n if ( ! isset($this->data->sluggable_setup['translated'])\n || ! $this->data->sluggable_setup['translated']\n || $this->data->is_translation\n ) {\n\n $this->context->modelIsSluggable = true;\n\n } else {\n // this is the parent of a translated sluggable model\n\n $this->context->modelIsParentOfSluggableTranslation = true;\n }\n }\n }", "public function hasSlug() : bool\n {\n return isset($this->slug);\n }", "protected function generateNonUniqueSlug()\n {\n if ($this->hasCustomSlugBeenUsed()) {\n\n return $this->getAttribute($this->slugOptions['slug_field']);\n }\n\n return str_slug($this->getSlugSourceString());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to set the value of field opid
public function setOpid($opid) { $this->opid = $opid; return $this; }
[ "public function setOpId($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if ($this->op_id !== $v) {\n $this->op_id = $v;\n $this->modifiedColumns[] = OperationsPeer::OP_ID;\n }\n\n if ($this->aGedelogOperationParams !== null && $this->aGedelogOperationParams->getOpId() !== $v) {\n $this->aGedelogOperationParams = null;\n }\n\n if ($this->aOperationsExt !== null && $this->aOperationsExt->getOpId() !== $v) {\n $this->aOperationsExt = null;\n }\n\n\n return $this;\n }", "public function setOpId($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if ($this->op_id !== $v) {\n $this->op_id = $v;\n $this->modifiedColumns[] = OperationPrestationsPeer::OP_ID;\n }\n\n if ($this->aOperations !== null && $this->aOperations->getOpId() !== $v) {\n $this->aOperations = null;\n }\n\n\n return $this;\n }", "public function setOp( $op )\n {\n $this->op = $op;\n }", "public function setOpId($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if ($this->op_id !== $v) {\n $this->op_id = $v;\n $this->modifiedColumns[] = OperationPrimesPeer::OP_ID;\n }\n\n if ($this->aOperations !== null && $this->aOperations->getOpId() !== $v) {\n $this->aOperations = null;\n }\n\n\n return $this;\n }", "public function getOpId()\n {\n\n return $this->op_id;\n }", "function setOpShowId( $opShowId ) {\t$this->opShowId = $opShowId; }", "public function setOpd($key, $value) {\n\t\t\n\t\t$this -> op[] = $key.'-'.$value;\n\t\t$this -> opd[$key] = $value;\n\t}", "function setItemOp($op) {\r\r\n $this->_itemOp = $op;\r\r\n }", "public function setOpActId($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if ($this->op_act_id !== $v) {\n $this->op_act_id = $v;\n $this->modifiedColumns[] = OperationsPeer::OP_ACT_ID;\n }\n\n if ($this->aRCustomActivites !== null && $this->aRCustomActivites->getActId() !== $v) {\n $this->aRCustomActivites = null;\n }\n\n\n return $this;\n }", "function set_id($id){\n $this->id->value = $id;\n }", "public function setOperated($id)\n {\n $sql = \"UPDATE hotel_update SET operated=1 WHERE id=:id AND operated=0\";\n $this->_wdb->query($sql,array('id' => $id));\n }", "public function setOpCtId($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if ($this->op_ct_id !== $v) {\n $this->op_ct_id = $v;\n $this->modifiedColumns[] = OperationsPeer::OP_CT_ID;\n }\n\n if ($this->aContactClient !== null && $this->aContactClient->getCtId() !== $v) {\n $this->aContactClient = null;\n }\n\n\n return $this;\n }", "function set_idObjeto( $idObjeto ) {\n // sets the value of idObjeto\n $this->idObjeto = $idObjeto;\n }", "public function setJdvlOpId($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if ($this->jdvl_op_id !== $v) {\n $this->jdvl_op_id = $v;\n $this->modifiedColumns[] = JournalDeVenteLignePeer::JDVL_OP_ID;\n }\n\n\n return $this;\n }", "function setOpDeselectId( $opDeselectId ) { $this->opDeselectId = $opDeselectId; }", "public function setId($value) { $this->_id = $value; }", "public function set_order_id($value)\n {\n }", "public function setId($value) { $this->id = $value;}", "function setId_orbix($iid_orbix = '')\n {\n $this->iid_orbix = $iid_orbix;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ajax to delete a device
public function deleteDevice(){ $this->autoRender = false; $this->layout = 'ajax'; $id = $this->request->data['id']; $this->Device->delete($id); }
[ "public function deleteDevice(){\n }", "public function ajax_delete() {\n\t\t$request = $this->request;\n\t\tif ($request->isAJAX()) {\n\t\t\t$id = $request->getPost('id');\n\t\t\tif ($id != '') {\n\t\t\t\t$halamanModel = new \\App\\Models\\HalamanModel();\n\t\t\t\t$halaman = $halamanModel->find($id);\n\n\t\t\t\tif ($halaman['daftar_gambar'] != '') {\n\t\t\t\t\t$data_gambar = explode('|', $halaman['daftar_gambar']);\n\t\t\t\t\tforeach ($data_gambar as $gambar) {\n\t\t\t\t\t\t$base_length = strlen(base_url());\n\t\t\t\t\t\t$file_url = substr($gambar, $base_length);\n\t\t\t\t\t\tif (file_exists('.' . $file_url)) {\n\t\t\t\t\t\t\tunlink('.' . $file_url);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($halaman['file_artikel'] != '') {\n\t\t\t\t\tif (file_exists('./files/postingan/halaman/' . $halaman['file_artikel'])) {\n\n\t\t\t\t\t\tunlink('./files/postingan/halaman/' . $halaman['file_artikel']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$halamanModel->delete($id);\n\t\t\t\t$json = [\n\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t'message' => [\n\t\t\t\t\t\t'text' => 'Artikel berhasil di hapus',\n\t\t\t\t\t\t'icon' => 'fas fa-thumbs-up',\n\t\t\t\t\t\t'color' => 'default'\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t\techo json_encode($json);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$json = [\n\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t'message' => [\n\t\t\t\t\t\t'text' => 'Tidak dapat menghapus artikel, ID tidak ada',\n\t\t\t\t\t\t'icon' => 'fas fa-times',\n\t\t\t\t\t\t'color' => 'danger'\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t\techo json_encode($json);\n\t\t\t}\n\t\t}\n\t}", "public function action_ajax_delete() {\n $d=array();\n if (Input::method() == 'POST') {\n $id = $_POST['value'];\n if ($e = Model_Todo::find($id)) {\n $d['result'] = 1;\n $d['message'] = \"La tâche a été supprimée.\";\n $e->delete();\n } else {\n $d['result'] = 0;\n $d['message'] = \"Impossible de supprimer la tâche.\";\n }\n } \n return json_encode($d);\n }", "public function actionDelete($id)\n {\n \ttry{\n $model = $this->findModel($id);\n $hostname = $model->hostname;\n\t $data['host_name'] = $hostname;\n\t\t\n\t $nso = new Nso();\n\t $data = $nso->deleteDevice($data);\n\t $this->findModel($id)->delete();\n\t\t\n\t\t/*\n\t\tif (!empty($data)) {\n $xml = xmlToArray($data);\n if (isset($xml['result']) && isset($xml['info'])) {\n return $this->response_status($code = 200, $status = 'fail', $xml['info']);\n }\n if (isset($xml['result']) && $xml['result'] != 'error') {\n return $this->response_status($code = 200, $status = 'success', '', ['delete' => $xml['result']]);\n }\n }\n **/\n\t\t\n\t\t\\Yii::$app->getSession()->setFlash('success', 'Device deleted succesfully');\n return $this->redirect(['index']);\n\n } catch (ErrorException $e) {\n AuditLog::saveLog($e->getMessage() . \"\\n\" . $e->getTraceAsString());\n return $this->render('/site/error', ['message' => $e->getMessage(), 'name' => 'Oops! Something went wrong!!']);\n }\n }", "function delete(){\n\t//\tif($this->obj->Delete())\n\t//\t\t$this->ajax(\"ok\");\n\n\t//\telse\n\t//\t\t $this->ajax($_SESSION[\"errors\"]);\n\t}", "public function delete()\n {\n\n $models = App::get('database')->selectDataCondition('id,name', 'model',\"manufacturer_id='{$_POST[\"manufacturer_id\"]}'\");\n if( !empty( $models ) ){\n echo json_encode(['status' => 'failed', 'msg' => 'Can not delete since already been used by model.']);\n die;\n }\n\n if( empty( $models ) ){\n $arrData = [\n 'deleted_flag' => '1'\n ];\n $catCondition = \"id=\". $_POST['manufacturer_id'];\n App::get('database')->UpdateQuery('manufacturer', $arrData,$catCondition);\n echo json_encode(['status' => 'success']);\n die;\n }\n \n }", "public function ajaxDelete( Request $request ) {\n\t\t$id = $request->get( 'id' );\n\t\t// Remove debt\n\t\t$this->mdDebt->delete( $id );\n\n\t\t$message['status'] = true;\n\t\tif( empty( $request->get( 'id' ) ) ) {\n\t\t\t$message['status'] = false;\n\t\t}\n\t\techo json_encode( $message );\n\t}", "public function ajax_delete() {\n\t\t$errors = array();\n\t\t$event_id = isset($_POST['event_id']) ? $_POST['event_id'] : null;\n\n\t\t$event = Event::query()\n\t\t\t->where('id', $event_id)\n\t\t\t->first();\n\n\t\tif ($event == null) {\n\t\t\t$errors[0] = $GLOBALS['lang']['error_event_not_found'];\n\t\t\techo json_encode($errors);\n\t\t\texit();\n\t\t}\n\n\t\tif (!$event->creator_id == SessionHelper::get_session_user_id()) {\n\t\t\t$errors[0] = $GLOBALS['lang']['error_not_allowed_to_delete'];\n\t\t\techo json_encode($errors);\n\t\t\texit();\n\t\t}\n\n\t\t$successful = $event->delete();\n\n\t\tif (!$successful) {\n\t\t\t$errors[0] = $GLOBALS['lang']['error_event_could_not_be_deleted'];\n\t\t}\n\n\t\techo json_encode($errors);\n\t}", "public function removeDevice(Request $request) {\n $device = Device::deviceid($request->device_id)->first();\n $device->shares()->detach();\n $device->delete();\n $mqttUser = new mqtt_user;\n $mqttUser = $mqttUser->deviceID($request->device_id);\n $mqttUser->delete();\n $mqttAcl = new acl;\n $mqttAcl = $mqttAcl->deviceID($request->device_id);\n $mqttAcl->delete();\n return response()->json('success',200);\n }", "public function common_delete_ajax() {\n\t\t$table_name = $this->input->post(\"table\");\n\t\t$where = $this->input->post(\"id\");\n\t\t$record_id = $this->input->post(\"record_id\");\n\t\t$order_field = $this->input->post(\"order_field\");\n\t\t$image_field = $this->input->post(\"img_field\");\n\t\t$app_screen_field = $this->input->post(\"app_screen_field\");\n\t\t$folder_field = $this->input->post(\"folder_field\");\n\t\t$app_screen_folder = $this->input->post(\"app_screen_folder\");\n\t\t$data['response'] = '';\t\t\n\t\t$array = array($where => $record_id);\n\t\t\n\t\t//////////////////////// Get deleted order and maximum order from the table /////////////////////\n\t\tif($order_field != '') {\n\t\t\t$get_order = $this->Common_model->common_select_single_row($order_field, $table_name, $array);\n\t\t\t$get_order2 = $this->Common_model->common_select_max_single_row($order_field, '', $table_name);\n\t\t\t\n\t\t\t$deleted_order = $get_order[$order_field];\n\t\t\t$max_order = $get_order2[$order_field];\n\t\t}\n\n\t\t////////////////////////////////// Delete image from the folder //////////////////////////////////////\n\t\t/* Only for the app delete (Delete app screens data form the folder and the databse) */\n\t\tif($app_screen_field != '' && $app_screen_folder != '') {\n\t\t\t$data['app_screen_data'] = $this->Common_model->common_select($app_screen_field, 'screenshots', $array, array());\n\t\t\tforeach($data['app_screen_data'] as $key) {\n\t\t\t\tunlink($app_screen_folder.$key->image);\n\t\t\t}\n\t\t\t$this->Common_model->common_delete('screenshots', array('app_id'=>$record_id));\n\t\t}\n\n\t\t/* Common delete file */\n\t\tif($image_field != '') {\n\t\t\t$delete_file = $this->delete_file($folder_field, $image_field, $table_name, $array);\n\t\t}\n\t\t////////////////////////////// End of Delete image from the folder ////////////////////////////////////\n\n\t\t$delete_status = $this->Common_model->common_delete($table_name, array($where=>$record_id));\n\t\tif($delete_status) {\n\t\t\t///////// Decrease order to 1 for all next records who comes later after deleted record ////////////\n\t\t\tif($order_field != '') {\n\t\t\t\tfor($i = $deleted_order; $i < $max_order; $i++) {\n\t\t\t\t\t$this->Common_model->common_update($table_name, array($order_field=>$i), array($order_field=>$i+1));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data['response'] = \"success\";\n\t\t} \n\t\telse $data['response'] = \"failed\";\n\t\t\n\t\techo json_encode($data);\n\t}", "public function deleteDevicePermanently()\n\t{\n\t\t$input = Input::all();\n\t\ttry {\n\t\t\tif (!empty($input['id'])) {\n\t\t\t\t\t$devDelete = DB::table('devices')->where('id',$input['id'])->delete();\n\t\t\t\t\treturn Redirect::to('/devices-list')->with('message','Successfully deleted device.' );\n\t\t\t\t}\t\n }catch(Exception $e){\n \treturn Redirect::to('/devices-list')->with('error','Error deleting the device. '. $e->getMessage() );\n\t\t}\n\n\t}", "public function testDeleteDevice()\n {\n $device = Device::orderBy('created_at', 'desc')->first();\n\n $response = $this->delete(\"/api/device/{$device['id']}\");\n\n $response->assertStatus(200)->assertJson([\n \"status\" => 200,\n \"message\" => \"Success, device removed.\"\n ])->assertJsonCount(2);\n }", "function ajax_delete_link()\n {\n $this->dashboard_model->delete_linkinfo_table($this->uri(3));\n $this->jsonMsgReturn(true,'Delete Success');\n }", "public function deleteProduct()\n\t{\n\t\tif ( Request::ajax() ){\n\t\t\t$this->product_factory->deleteProduct(Input::get('id'));\n\t\t\treturn Response::json(['status'=>'success']);\n\t\t}\n\t}", "public function ajax_delete()\r\n {\r\n $mssv_array=$this->input->post(\"mssv_array\");\r\n $khoa=$this->input->post(\"khoa\");\r\n $this->msinhvien->delete_sinhvien($mssv_array,$khoa);\r\n }", "public function action_ajax_remove_gadget()\n\t{\n\t\t$this->auto_render = FALSE;\n\t\t$gadget = ORM::factory('Dashboards_Gadget', $this->request->param('id'));\n\n\t\t$dashboard = new Model_Dashboard($gadget->dashboard_id);\n\t\tif ( ! $dashboard->user_has_edit_permission())\n\t\t{\n\t\t\t$saved = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$gadget->set('deleted', 1);\n\t\t\t$saved = $gadget->save();\n\t\t}\n\n\t\techo $saved ? 1 : 0;\n\t}", "public function ajaxDeleteAppointment() {\n $this->db->where('id', $this->input->post('id'));\n $result = $this->db->delete('appointment');\n echo $result;\n }", "function deleteEntireMvt() {\n if (!$this->isAuthenticated())\n exit;\n\n $lpcid = $this->input->post('element');\n echo json_encode($this->adminmodel->deleteMvtLPC($lpcid));\n }", "public function delete_delete(){\n \t\t$id = $this->uri->segment(3);\n \t\t// $r = $this->delete('id');\n \t\t// $this->response($id);\n\t $response = $this->PersonM->delete_person(\n\t $id\n\t );\n\t $this->response($response);\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compare a given value to the total inclusive value of this instance
public function compareTo($value) { return $this->compareMonies( $this->inclusive(), $this->valueToMoney($value) ); }
[ "public function compareValue();", "public function evaluate($value)\n {\n return $value < $this->value;\n }", "public function compareTo($value) { return $this === $value ? 0 : 1; }", "function lowcomp($a, $b) {\n if ((double)$a->getTotal() == (double)$b->getTotal()) {return 0; }\n if ((double)$a->getTotal() > (double)$b->getTotal()) {\n //echo \"jackpot\";\n return 1;\n } else {\n // echo \"meh\";\n return -1;\n }\n\n\n\n }", "public function hasMinimumOrderValue()\n {\n return $this->supplier()->min_order_value <= $this->subtotal();\n }", "public function meetsThreshold($value)\n {\n $value = (float) $value;\n\n return $this->getType() === static::TYPE_INCLUDING\n ? $value >= $this->getStart() && $value <= $this->getEnd()\n : $value < $this->getStart() || $value > $this->getEnd();\n }", "public function getTotalValue()\n {\n return $this->totalValue;\n }", "public function neq(self $value): bool\n {\n return 0 !== \\bccomp($this->getAmount(), $value->getAmount());\n }", "public function AJAX_checkQty($id, $value) {\n // then stock qty - reserved qty.\n if (parent::backendIsLogged()) {\n if (RoleService::getInstance()->hasRolePermission($_SESSION[\"roleID\"], __CLASS__ . \":\" . __FUNCTION__)) {\n // first check\n $element = DetalleRepository::getInstance()->getByID($id);\n $margin = $element->getStock() - $element->getReservado();\n if ($value <= $margin) {\n echo 1;\n }\n else {\n echo 0;\n }\n }\n \n }\n }", "private function evallessthanorequal($value, $data){\n\t\t\treturn (bool) $passed = ($data <= $value) ? true : false;\n\t\t}", "function TotalPriceCompare(iOrder $order1, iOrder $order2): int {\n if ($order1->getTotalPrice() < $order2->getTotalPrice()) \n return 1; \n else if ($order1->getTotalPrice() > $order2->getTotalPrice()) \n return -1; \n else\n return 0; \n }", "public function compareTo($value) {\n return $value instanceof self\n ? Objects::compare(([$this->test, $this->elapsed]), [$value->test, $value->elapsed])\n : 1\n ;\n }", "public function contains($value)\n {\n $this->validateValue($value);\n $contained = 0;\n\n if ($value < $this->start) {\n $contained--;\n } elseif ($value > $this->end) {\n $contained++;\n }\n\n return $contained;\n }", "abstract protected function compare($mValue);", "public function totalValue()\n {\n $result = $this->attributes['money'];\n\n $result += $this->garages()->leftJoin('garage_models', 'garages.garage_model_id', '=', 'garage_models.id')->sum('garage_models.price');\n $result += $this->trucks()->leftJoin('truck_models', 'trucks.truck_model_id', '=', 'truck_models.id')->sum('truck_models.price');\n $result += $this->trailers()->leftJoin('trailer_models', 'trailers.trailer_model_id', '=', 'trailer_models.id')->sum('trailer_models.price');\n\n $bankLoans = $this->bankLoans()->with('bankLoanType')->get();\n\n $result -= $bankLoans->reduce(function ($carry, $item) {\n /** @var BankLoanType $bankLoanType */\n $bankLoanType = $item->bankLoanType;\n return $carry += ($bankLoanType->period - $item->paid) * $bankLoanType->payment;\n }, 0);\n\n return $result;\n }", "private function hasEnoughTotal()\n {\n $oCheckoutSession = Mage::getSingleton('checkout/session');\n if ($oCheckoutSession->getQuote()->getBaseGrandTotal() < $this->getMinTotal()) {\n return false;\n }\n return true;\n }", "public function total() {\n\t\tif ($this->getConditions()->isEmpty())\n\t\t\treturn $this->subTotal();\n\n\t\t$subTotal = $this->subTotal()->amount();\n\n\t\t$condTotal = $this->getConditions()->sum(function ($cond) use ($subTotal) {\n\t\t\treturn $cond->getTarget() === 'cart'\n\t\t\t\t? $cond->applyCondition($subTotal)\n\t\t\t\t: 0;\n\t\t});\n\n\t\treturn new Money((int)($subTotal + $condTotal), $this->currency);\n\t}", "public function setTotalDistance($value) {\n return $this->set(self::TOTALDISTANCE, $value);\n }", "public function calculate(Valuable $value);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of the TransportStatus property.
public function getTransportStatus() { return $this->_fields['TransportStatus']['FieldValue']; }
[ "public function getTransactionStatus() \n {\n return $this->_fields['TransactionStatus']['FieldValue'];\n }", "public function getTransportType()\r\n {\r\n return $this->transportType;\r\n }", "public function getTicketStatus()\n\t{\n\t\treturn $this->ticket_status;\n\t}", "public function getServiceStatus()\n {\n return $this->service_status;\n }", "public function getStatus()\n {\n return $this->txn_status;\n }", "public function getTFMShipmentStatus() \n {\n return $this->_fields['TFMShipmentStatus']['FieldValue'];\n }", "public function getTransportCode()\n\t{\n\t\treturn $this->transportCode;\n\t}", "private function __getDeliveryStatus() {\n return $this->data->TrackDetails->StatusDescription;\n }", "public function get_status()\n {\n return $this->_status;\n }", "public function getTransactionStatus() \n {\n return $this->transaction_status;\n }", "function GetStatus()\r\n\t{\r\n\t\treturn $this->m_status;\r\n\t}", "public function getTransferredStatus()\n\t{\n\t\treturn self::TRANSFERRED_STATUS;\n\t}", "public function getDeliveryStatus()\n {\n return $this->deliveryStatus;\n }", "public function getTransportType();", "public function isSetTransportStatus()\n {\n return !is_null($this->_fields['TransportStatus']['FieldValue']);\n }", "public function getTpcStatus()\n {\n return $this->tpcStatus;\n }", "public function getTicketStatus()\n {\n switch ($this->status) {\n case TicketStatus::open:\n return 'open';\n break;\n case TicketStatus::close:\n return 'close';\n break;\n case TicketStatus::pending:\n return 'pending';\n break;\n case TicketStatus::solved:\n return 'solved';\n break;\n default:\n return 'invalid status';\n break;\n }\n }", "public function getTransportServiceCode()\n {\n return $this->transportServiceCode;\n }", "public function getStatus()\r\n {\r\n return $this->fields['Status']['value'];\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Releases an existing savepoint.
public function releaseSavepoint($name);
[ "public function releaseSavepoint($savepoint)\n {\n $this->doctrine->releaseSavepoint($savepoint);\n }", "public function releaseSavepoint($name) {}", "public function releaseSavepoint($savepoint)\n {\n if (! $this->getDatabasePlatform()->supportsSavepoints()) {\n throw ConnectionException::savepointsNotSupported();\n }\n\n if (! $this->platform->supportsReleaseSavepoints()) {\n return;\n }\n\n $this->getWrappedConnection()->exec($this->platform->releaseSavePoint($savepoint));\n }", "public function releaseSavepoint($name)\n\t{\n\t\t$this->db->pdo->exec(\"RELEASE SAVEPOINT $name\");\n\t}", "public function releaseSavepoint($name)\n {\n $this->db->createCommand(\"RELEASE SAVEPOINT $name\")->execute();\n }", "public function releaseSavepoint($name)\n {\n try {\n parent::releaseSavepoint($name);\n } catch (Exception $e) {\n // Specifically look for a \"No such savepoint\" error.\n if ($e->getCode() == 3 && isset($e->errorInfo[0]) && isset($e->errorInfo[1]) && $e->errorInfo[0] === '3B001' && $e->errorInfo[1] == 7) {\n Craft::warning('Tried to release a savepoint, but it does not exist: ' . $e->getMessage(), __METHOD__);\n } else {\n throw $e;\n }\n }\n }", "public function release() {\n\t\tif($this->isReleased())\n\t\t\treturn;\n\t\t$this->released = true;\n\t\t$this->update();\n\t}", "public function release()\n {\n $this->update(['reserved_at' => null]);\n }", "public function rollbackTo($savepoint);", "function savepoint($name)\n\t{\n\t\tatkdebug(get_class($this).\"::savepoint $name\");\n\t\t$this->query('SAVEPOINT '.$name);\n\t}", "public function commit(string $savepoint, string $parentSavepoint): void;", "public function supportsReleaseSavepoints()\n {\n return false;\n }", "public function release() : void;", "public static function commit($savepoint = NULL)\n\t{\n\t\tself::getConnection()->commit($savepoint);\n\t}", "public function rollbackSavepoint($savepoint)\n {\n $this->doctrine->rollbackSavepoint($savepoint);\n }", "public function createSavepoint($savepoint)\n {\n $this->doctrine->createSavepoint($savepoint);\n }", "public function release($pokemonid);", "function savepoint($name)\n {\n atkdebug(get_class($this).\"::savepoint $name\");\n $this->query('SAVEPOINT '.$name);\n }", "public function releaseSlot(): void;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Print the standard footer, currently very simple. Pass $and_exit as TRUE to exit afterwards
function print_footer($and_exit) { global $theme; // Load the print_theme_footer function appropriate to the theme. If there // isn't one then fall back to the default footer. if (is_readable("Themes/$theme/footer.inc")) { include_once "Themes/$theme/footer.inc"; } if (!function_exists(__NAMESPACE__ . "\\print_theme_footer")) { require_once "Themes/default/footer.inc"; } print_theme_footer(); if ($and_exit) { exit(0); } }
[ "public function printFooter() {\n\t\ttemplate( 'footer', $this->args );\n\t}", "public function footer()\r\n {\r\n print file_get_contents(_HTML_TEMPLATE_FOLDER_.'footer.html');\r\n }", "public function printFooter() {\n echo \"</body></html>\\n\";\n }", "public function printFooter() {\n\t\techo \"</body></html>\\n\";\n\t}", "public static function printFooter()\n { \n echo ' \n </div>';\n Navi::printFooNavi();\n \n echo '\n </div> \n </body>\n</html>';\n }", "public function footer() {\n $output = $this->opencontainers->pop_all_but_last(true);\n\n $footer = $this->opencontainers->pop('header/footer');\n\n // Provide some performance info if required\n $performanceinfo = '';\n if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {\n $perf = get_performance_info();\n if (defined('MDL_PERFTOLOG') && !function_exists('register_shutdown_function')) {\n error_log(\"PERF: \" . $perf['txt']);\n }\n if (defined('MDL_PERFTOFOOT') || debugging() || $CFG->perfdebug > 7) {\n $performanceinfo = $perf['html'];\n }\n }\n $footer = str_replace(self::PERFORMANCE_INFO_TOKEN, $performanceinfo, $footer);\n\n $footer = str_replace(self::END_HTML_TOKEN, $this->page->requires->get_end_code(), $footer);\n\n $this->page->set_state(moodle_page::STATE_DONE);\n\n\n return $output . $footer;\n }", "function printFooter() {\n\tglobal $lang;\n\n\techo(\" <TR>\\n\");\n\techo(\" <TD CLASS=\\\"data\\\"><CENTER>\\n\");\n\techo(\" <BR><BR><B>\" . $lang['TITLE_TAB'] . \"</B> \" . $lang['FOOTER_VERSION'] .\" \". VERSION_NO. \" | <A HREF=\\\"\" . URL_HOMEPAGE . \"\\\" TARGET=\\\"_blank\\\">\" . $lang['FOOTER_HOMEPAGE_LINK'] . \"</A> | <A HREF=\\\"\" . URL_SOURCEFORGE . \"\\\" TARGET=\\\"_blank\\\">\". $lang['FOOTER_SOURCEFORGE_LINK'] .\"</A> \\n\");\n\techo(\" <BR>\" . $lang['FOOTER_COPYRIGHT'] . \"\\n\");\n\techo(\" <BR>\\n\");\n\techo(\" </CENTER></TD>\\n\");\n\techo(\" </TR>\\n\");\n}", "abstract function footer();", "function SendFooter()\n{\n print(\"</body>\\n\");\n print(\"</html>\\n\");\n}", "function footer($body, $options = array())\n{\n\tglobal $site;\n\n\t// check to see if it should display the footer\n\tif (is_array($options)){\n\t\t\n\t\t$body .= '';\n\t}\n\n\t// Finalize the output\n\tob_start();\t\n\t$site->start();\n\t// Print the page\n\t$contentos1 = ob_get_contents();\n\tob_end_clean();\t\t\n\t$contentos1 .= $body;\n\t\n\tob_start();\n\t$site->finish();\n\t$contentos2 = ob_get_contents();\n\tob_end_clean();\n\t\t\t\t\n\t$body = $contentos1.$contentos2;\n\techo $body;\n\t// stop the remaining script\n\texit;\n}", "protected function generatePageFooter() {\r\n\r\necho <<< HTML\r\n <footer>\r\n <p>&copy; 2019 by Julian Segeth &amp; Bican Gül. All Rights Reserved. Praktikum Entwicklung webbasierter Anwendungen.</p>\r\n </footer>\r\n</body>\r\n</html>\r\nHTML;\r\n }", "public function footer() {\n\t\twp_footer();\n\t\techo '</body></html>';\n\t}", "public static function printReportFooter()\r\n {\r\n $build = OSATSVER;\r\n\r\n // FIXME: LOCAL TIME ZONE!\r\n $date = date('l, F jS, Y \\a\\t h:i:s A T');\r\n\r\n if ($build > 0)\r\n {\r\n $buildString = ' build ' . $build;\r\n }\r\n else\r\n {\r\n $buildString = '';\r\n }\r\n\r\n echo '<div class=\"footerBlock\">', \"\\n\";\r\n echo '<p id=\"footerText\">Report generated on ', $date, '.<br />', \"\\n\";\r\n\r\n echo '<span id=\"footerCopyright\">', COMPANYNAME_HTML, '</span>', \"\\n\";\r\n echo '</div>', \"\\n\";\r\n\r\n echo '</body>', \"\\n\";\r\n echo '</html>', \"\\n\";\r\n }", "public function DisplayFooter(){\n\t\t\n\t\t\techo \"<p class='ftext'>&copy; \". date(\"Y\") .\" \". $this->name .\" <span class='status'><a href='http://www.ryanpriebe.com/' target='_blank'>ryanpriebe.com</a></span>\";\n\t\t\t\n\t\t}", "function print_footer() {\n\n $args = '';\n $output = '';\n\n $output .= print_paging_bar($this->numrecs, $this->page, $this->perpage,\n \"{$this->baseurl}&amp;sort={$this->sort}&amp;dir={$this->dir}&amp;\" .\n \"perpage={$this->perpage}\" . $args . \"&amp;\", 'page', false, true);\n\n return $output;\n }", "function printFooter($args_raw = array()) {\n\t\tglobal $Config;\n\t\t\n\t\t$args = array_map('print_html', $args_raw);\n?>\n\n</div>\n</div>\n\n<div id=\"footer\">\n\t<a href=\"<?php echo $Config['URLPath'] ?>/legal.php\">View legal disclaimer</a><br />\n\t&copy; 2006 Jain Foundation Inc. All Rights Reserved\n</div>\n\n</div>\n</body>\n</html>\n<?php\n\t}", "function createPageFooter(){\n\t\t\techo $this->displayPageFooter = \"</body></html>\";\n\t\t}", "function _dw_footer()\n{\n global $_DW_CONF;\n $finalPage = '';\n $ptitle = tpl_pagetitle(null,1);\n $wikiPage = ob_get_clean();\n \n switch( $_DW_CONF['displayblocks'] ) {\n case 0 :\n case 2 :\n $what = 'menu';\n break;\n case 1 :\n case 3 :\n $what = 'none';\n break;\n default :\n $what = 'menu';\n break;\n }\n \n switch( $_DW_CONF['displayblocks'] ) {\n case 0 :\n case 3 :\n $rightblock = false;\n break;\n case 1 :\n case 2 :\n $rightblock = true;\n break;\n default :\n $rightblock = false;\n break;\n }\n \n $display = COM_createHTMLDocument(\n $wikiPage,\n array(\n 'what' => $what, \n 'pagetitle' => $ptitle,\n 'rightblock' => $rightblock,\n )\n );\n \n COM_output($display);\n \n exit;\n\n}", "function _upg_footer()\n{\n $lang = ZLanguage::getLanguageCode();\n echo '</div></div>' . \"\\n\";\n echo '<div id=\"footer\">' . \"\\n\";\n echo '<p id=\"notice\">' . __f('For more information about the upgrade process, please read the <a href=\"docs/%1$s/UPGRADING\">upgrade documentation</a>, visit our <a href=\"http://community.zikula.org/Wiki.htm\">wiki</a> or the <a href=\"http://community.zikula.org/module-Forum.htm\">support forum</a>.', $lang) . '</p>';\n echo '</div>' . \"\\n\";\n echo '</div></body>' . \"\\n\";\n echo '</html>';\n exit();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
shorten a string to a custom length
function _shortenString($str, $maxLength) { if (strlen($str) > $maxLength) { return substr($str, 0, $maxLength-3).'...'; } return $str; }
[ "function wpseed_shorten($string,$length,$append=\"...\") {\n $string = trim($string);\n if(strlen($string) > $length) {\n $string = substr($string, 0, $length);\n $string .= $append;\n }\n return $string;\n }", "function shortenString($str, $length)\r\n\t{\r\n\t\treturn substr($str, 0, $length) . (strlen($str) > $length ? \"....\" : \"\");\r\n\t}", "function shorten_string ($name){\n if (strlen($name) > 24){\n $name = substr($name, 0, 24).'...';\n return $name;\n }\n return $name;\n }", "function shorten ($var, $len = 30) {\n if (empty ($var)) {\n return \"\";\n }\n if (strlen ($var) < $len) {\n return $var;\n }\n return substr ($var, 0, $len);\n}", "public static function shortenThis($str, int $length = null): string\r\n {\r\n if (!$length) {\r\n $length = 255;\r\n }\r\n\r\n if ($length > 255) {\r\n throw new \\ErrorException('The length argument should be 255 or less.');\r\n }\r\n\r\n /**\r\n * [:space:] removes \\t as well\r\n * http://stackoverflow.com/questions/2326125/remove-multiple-whitespaces\r\n * http://www.php.net/manual/en/regexp.reference.character-classes.php\r\n */\r\n $str = mb_ereg_replace(\r\n '[[:space:]]+',\r\n ' ',\r\n strip_tags($str),\r\n 'ms'\r\n );\r\n $length = abs((int)$length - 1);\r\n\r\n /**\r\n * allow to only remove all special chars and html entities without shortening the string\r\n */\r\n if ($length === null) {\r\n return $str;\r\n }\r\n\r\n if (\\strlen($str) > $length) {\r\n $str = mb_ereg_replace(\r\n '^(.{1,' . $length . '})([^\\s]+)(\\s.*|$)',\r\n '\\\\1\\\\2…',\r\n $str, 'ms'\r\n );\r\n }\r\n\r\n return $str;\r\n }", "public static function ag_shrinkString($string,$stringLength,$add=''){\n if(strlen($string)>$stringLength){\n $string = substr($string,0,$stringLength);\n $string.=\"...\";\n }\n return $string;\n }", "function reduce_word_length($word,$length=9)\r\n{\r\n return substr_replace($word,'',0,($length));\r\n}", "function truncate40($string) {\n return truncate($string, 40);\n}", "function funcs_cutLength($string, $length, $word_length = null,$act_length = null){\n\t$string = (!is_null($string))?trim($string):'';\n\t//do not check the size of the string if we already know it\n\tif (is_null($act_length))$act_length=mb_strlen($string);\n\tif (!is_null($word_length) && !empty($string)){\n\t\t//in the future use this instead of calling this whole function\n\t\t$string = wordwrap($string,$word_length,\"\\n\",1);\n\t}\n\tif (!is_null($length) && $act_length>$length && $length>4){\n\t\t$string = mb_substr($string,0,$length-3).'...';\n\t}\n\treturn $string;\n}", "function shorten_subject($subject, $len)\n{\n\tglobal $func;\n\n\t// It was already short enough!\n\tif ($func['strlen']($subject) <= $len)\n\t\treturn $subject;\n\n\t// Shorten it by the length it was too long, and strip off junk from the end.\n\treturn $func['substr']($subject, 0, $len) . '...';\n}", "function url_shorten($url, $length = 35)\n{\n}", "function truncate_str($str, $length = 20)\n{\n if (strlen($str) > $length) {\n return substr($str, 0, $length - 3) . '...';\n }\n return $str;\n}", "function shorten($keep, $short, $max, $min = 9, $char = '…') {\n $max = $max - utf8_strlen($keep);\n if($max < $min) return $keep;\n $len = utf8_strlen($short);\n if($len <= $max) return $keep.$short;\n $half = floor($max / 2);\n return $keep.utf8_substr($short, 0, $half - 1).$char.utf8_substr($short, $len - $half);\n}", "public function shortenString($string)\n {\n if (strlen($string) > 60)\n {\n $string = mb_substr($string, 0, 57) . \"...\";\n }\n return $string;\n }", "private function shorten($string, $max){\n if(strlen($string) > $max){\n return substr($string,0,$max-3) . \"...\";\n }\n return $string;\n }", "public static function string_shrink($string, $len, $astr)\n {\n $string = self::gen_mysql_desanitize($string);\n $strlen = strlen($string);\n if ($strlen <= $len) {\n return $string;\n }\n return self::gen_mysql_sanitize(mb_substr($string, 0, $len, 'UTF-8') . $astr);\n }", "function adjustLength($string, $max)\r\n\t\t{\r\n\t\t\tif (strlen($string) <=$max)\r\n\t\t\t{\r\n\t\t\t \treturn $string;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn substr($string, 0, $max) . '..';\r\n\t\t\t}\r\n\t\t}", "function shorten( $text ) {\n\t\t\t$chars = 32; \n\t\t\tif(strlen($text) <= $chars)\n\t\t\t\treturn $text;\n\t\t\t\n\t\t\t$text = $text . \" \"; \n\t\t\t$text = substr($text,0,$chars); \n\t\t\t$text = substr($text,0,strrpos($text,' ')); \n\t\t\t$text = $text . \"...\"; \n\n\t\t\treturn $text;\n}", "function TruncateStr($text, $maxLength = 500) {\n $short = $text;\n $col = strlen(substr( $short , 0 , $maxLength ));\n if($col >= $maxLength ) {\n $pos = strrpos(substr( $short , 0 , $maxLength) ,\" \");\n $short = substr( $short , 0 , $pos).'...';\n }\n return $short;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves the musicWorks object on edit
function musicEditSave() { $this->save(); try { //$this->setTags($this->getTags(). " ".$this->getArtistID()." ". $this->getTrackName()); //momusicTag::getInstance(momusicTags::getInstance($this->getID())->getTagID())->setName($this->getTags())->save();; } catch ( Exception $e) { systemLog::message($e); } }
[ "function save()\r\n {\r\n $album \t= JRequest::get('POST'); \r\n $model \t= $this->getModel('album');\r\n \r\n $model->saveAlbum($album);\r\n $this->setRedirect('index.php?view=album&option='.JRequest::getVar('option'), 'Saved!');\r\n }", "public function saves()\n {\n // Data\n $this->data['page_info']['title'] = SITE_NAME . ' - Playlist (@' . $_SESSION['username'] . ')';\n $this->data['lovely_posts'] = $this->post->getTopPosts();\n $this->data['saved_posts'] = $this->post->playList();\n // Load view\n $this->view('home/saves.php', $this->data);\n }", "private function save()\n {\n if (!isset($_REQUEST['show'])) {\n return;\n }\n\n $updated_term = wp_update_term(\n $_REQUEST['show'],\n 'shows',\n [\n 'name' => $_POST['podlove_show']['title'],\n 'description' => $_POST['podlove_show']['summary'],\n 'slug' => $_POST['podlove_show']['slug'],\n ]\n );\n\n // Add meta entries\n if (is_wp_error($updated_term)) {\n return;\n }\n\n foreach (self::show_meta_data_fields() as $meta_data) {\n update_term_meta($_REQUEST['show'], $meta_data, $_POST['podlove_show'][$meta_data]);\n }\n\n if (isset($_POST['submit_and_stay'])) {\n $this->redirect('edit', $_REQUEST['show']);\n } else {\n $this->redirect('index', $_REQUEST['show']);\n }\n }", "public function saved()\n\t{\n\t\tforeach ( $this->_object as $value)\n\t\t{\n\t\t\tif ( $value instanceof Mango_Interface)\n\t\t\t{\n\t\t\t\t$value->saved();\n\t\t\t}\n\t\t}\n\n\t\t$this->_changed = array();\n\t}", "public function saveAction() {\n if(EDIT_MODE) {\n $postObj = json_decode(\n json_encode(\n filter_input_array(INPUT_POST)\n ), false\n );\n \n \\Mappers\\BuildDBMapper::updateMeta($postObj);\n \\Mappers\\BuildDBMapper::saveCube($postObj);\n \\Mappers\\BuildDBMapper::saveItems($postObj);\n \\Mappers\\BuildDBMapper::saveActiveSkills($postObj);\n \\Mappers\\BuildDBMapper::savePassiveSkills($postObj);\n \\Mappers\\BuildDBMapper::saveScope($postObj);\n $this->redirect('build/edit/'.$postObj->id);\n } else {\n $this->redirect('build');\n }\n }", "public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }", "public function save(Song $song);", "public function save()\n\t{\n\t\t// Base logic\n\t\tparent::save();\n\t\t\n\t\t// Perform request for additional field metadata\n\t\t/*if( dbQuery('materialfield')->join('field')->exec( $db_fields ))\n\t\t{\n\t\t\t// Iterate fields and if field metadata has been found\n\t\t\tforeach ( $db_fields as & $db_field ) if( isset( $db_field->onetoone['_field'] ) )\n\t\t\t{\n\t\t\t\t// Save field value to db\t\t\t\t\t\n\t\t\t\t$db_field->Value = $this[ $db_field->onetoone['_field']->Name ];\t\t\t\n\t\t\t\t$db_field->save();\n\t\t\t}\t\t\t\n\t\t}*/\t\t\t\n\t\t// TODO: Add logic for gallery saving\n\t}", "function save() {\n\t\t\treturn $this->API->updatePlaylistItem($this->ID,$this->PlaylistID,$this->VideoID,$this->Position,$this->Note,$this->API->timeJoin($this->VideoStartAt),$this->API->timeJoin($this->VideoEndAt));\n\t\t}", "public function saveExperiment();", "public function saveEdit() {\n\t\t$user = $this->authentication->getUser();\n\n\t\t$quiz = $_POST['quiz'];\n\t\t$quiz['quizdate'] = new \\DateTime();\n\n\t\t$quizEntity = $user->addQuiz($quiz);\n\n\t\t$quizEntity->clearCategories();\n\n\t\tforeach ($_POST['category'] as $categoryId) {\n\t\t\t$quizEntity->addCategory($categoryId);\n\t\t}\n\n\t\theader('location: index.php?quiz/list'); \t\n\n\t}", "function onair_PlaylistSave() {\n global $xoopsDB,$pl_timetype,$numbers2days;\n\n $xoopsDB->query(\"UPDATE \".$xoopsDB->prefix('oa_playlist').\" SET pl_day = \"\n\t\t.$xoopsDB->quoteString($_POST['pl_day']).\", pl_station = \".$xoopsDB->quoteString($_POST['pl_station'])\n\t\t.\", pl_title = \".$xoopsDB->quoteString($_POST['pl_title']).\", pl_name = \"\n\t\t.$xoopsDB->quoteString($_POST['pl_name']).\", pl_start = \".$xoopsDB->quoteString($_POST['pl_start'])\n\t\t.\", pl_stop = \".$xoopsDB->quoteString($_POST['pl_stop']).\", pl_image = \"\n\t\t.$xoopsDB->quoteString($_POST['pl_image']).\", pl_description = \"\n\t\t.$xoopsDB->quoteString($_POST['pl_description']).\", pl_date = \"\n\t\t.$xoopsDB->quoteString($_POST['pl_date']).\" WHERE pl_id = \".intval($_POST['pl_id']).\"\");\n redirect_header(\"playlist.php\",2,_AM_ONAIR_PLAYLISTMOD.$_POST['approved']);\n\t\texit();\n\t\t}", "public function save() {\n\n\t\tTQB_Post_meta::update_quiz_progress_settings_meta( $this->_quiz_id, $this->_quiz_style_settings );\n\t\tTQB_Post_meta::update_quiz_progress_general_settings( $this->_quiz_id, $this->_general_settings );\n\t}", "abstract public function save_item();", "public function testUpdateArtwork()\n {\n }", "public function save() {\n if (db_result(db_query('SELECT tid FROM {dsc_tracks} WHERE tid = %d', $this->tid))) {\n drupal_write_record('dsc_tracks', $this, array('tid'));\n }\n else {\n drupal_write_record('dsc_tracks', $this);\n }\n }", "public function save() {\n foreach ($this->items as $model) {\n $model->save();\n }\n }", "function save()\r\n\t{\r\n\t\t$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);\r\n\t\t$TBL_EXERCICES_EXAMS = Database::get_course_table(TABLE_QUIZ_TEST_EXAM);\r\n $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);\r\n\r\n\t\t$id=$this->id;\r\n\t\t$exercise=addslashes($this->exercise);\r\n\t\t$description=addslashes($this->description);\r\n\t\t$sound=addslashes($this->sound);\r\n\t\t$type=$this->type;\r\n\t\t$random=$this->random;\r\n\t\t$active=$this->active;\r\n\t\t$results_disabled = intval($this->results_disabled);\r\n\r\n\t\t//campos propios de un examen\r\n\t\t$intentos=$this->intentos;\r\n\t\t$minimo=$this->minimo;\r\n\r\n\t\t// exercise already exists\r\n\t\tif($id)\r\n\t\t{\r\n\t\t\t$sql=\"UPDATE $TBL_EXERCICES SET title='$exercise',description='$description',sound='$sound',type='$type',random='$random',active='$active',results_disabled='$results_disabled' WHERE id='$id'\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\r\n\t\t\t$sql=\"UPDATE $TBL_EXERCICES_EXAMS SET intentos='$intentos', minimo='$minimo' WHERE id='$id'\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\t\t}\r\n\t\t// creates a new exercise\r\n\t\telse\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO $TBL_EXERCICES(title,description,sound,type,random,active, results_disabled) VALUES('$exercise','$description','$sound','$type','$random','$active',$results_disabled)\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\r\n\t\t\t$this->id=mysql_insert_id();\r\n\r\n\t\t\t$sql=\"INSERT INTO $TBL_EXERCICES_EXAMS(id, intentos, minimo) VALUES('$this->id','$intentos','$minimo')\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\t\t}\r\n\r\n\t\t// updates the question position\r\n\t\tforeach($this->questionList as $position=>$questionId)\r\n\t\t{\r\n\t\t\t$sql=\"UPDATE $TBL_QUESTIONS SET position='$position' WHERE id='$questionId'\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\t\t}\r\n\t}", "function onSave()\n {\n try\n {\n // open a transaction with database\n TTransaction::open($this->database);\n\n // get the form data\n $object = $this->form->getData($this->activeRecord);\n\n // validate data\n $this->form->validate();\n\n // stores the object\n $object->store();\n\n // fill the form with the active record data\n $this->form->setData($object);\n\n // close the transaction\n TTransaction::close();\n\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'));\n // reload the listing\n }\n catch (Exception $e) // in case of exception\n {\n // get the form data\n $object = $this->form->getData($this->activeRecord);\n\n // fill the form with the active record data\n $this->form->setData($object);\n\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n\n // undo all pending operations\n TTransaction::rollback();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get fake instance of Space
public function fakeSpace($spaceFields = []) { return new Space($this->fakeSpaceData($spaceFields)); }
[ "public function getSpace(): Space;", "protected function createSpaceModel()\n {\n $model = new Space();\n $model->scenario = 'create';\n $model->visibility = Setting::Get('defaultVisibility', 'space');\n $model->join_policy = Setting::Get('defaultJoinPolicy', 'space');\n return $model;\n }", "function shipox()\r\n {\r\n return Shipox::instance();\r\n }", "public function testGetGatewayNewSpace(Space $space) : void\n {\n $actual = $space->getGateway(Direction::NORTH());\n\n $this->assertNull($actual);\n }", "public static function get_instance() {}", "public function getSpace()\n {\n return $this->hasOne(Space::className(), ['id' => 'space_id']);\n }", "public function testNewSpaceEmptyDescription() : void\n {\n $space = new Space(\"\");\n }", "function spaces()\n {\n return new Spaces($this->accessToken, $this->spaceId, $this->cacher);\n }", "function get_space(string $id): JKNSpace {\r\n return $this->spaces[$id];\r\n }", "public function make(): object\n {\n return $this->reflected->newInstanceWithoutConstructor();\n }", "public static function createSystem()\n {\n $numArgs = func_num_args(); // must be own line for PHP < 5.3.0\n Splunk_Namespace::ensureArgumentCountEquals(0, $numArgs);\n \n static $system = NULL;\n if ($system === NULL)\n $system = new Splunk_Namespace('nobody', 'system', 'system');\n return $system;\n }", "public static function init_sphere() {\n\t\t$sphere = new mys\\grid();\n\t\tshared_toolbox::init_sphere($sphere);\n\t\t$sphere->\n\t\t\tset_script('system_sysctl_info');\n\t\treturn $sphere;\n\t}", "public function createFake();", "public static function Instance();", "public function getSpace()\n {\n return $this->decorated->getSpace();\n }", "private function createTestObject() {\n\t\tif ( isset($this->gff2wd) ) return $this->gff2wd ;\n\t\t$this->gff2wd = new GFF2WD ;\n\t\t$this->setOrganismConfig ( 'Pfalciparum' , $this->gff2wd ) ;\n\t\treturn $this->gff2wd ;\n\t}", "static function get() {\n\t\tif (static::$box === null) {\n\t\t\tstatic::$box = new static();\n\t\t}\n\t\treturn static::$box;\n\t}", "public static function create()\n {\n return new Fake();\n }", "public function set_default_spaceapi()\n {\n $spaceapi = new stdClass;\n $spaceapi->api = HACKERSPACE_SPACE_API_VERSION;\n $spaceapi->space = get_option('blogname');\n $spaceapi->logo = '';\n $spaceapi->url = get_option('siteurl');\n $spaceapi->location->address = '';\n $spaceapi->location->lat = null;\n $spaceapi->location->lon = null;\n $spaceapi->contact->email = get_option('admin_email');\n $spaceapi->contact->phone = '';\n $spaceapi->contact->sip = '';\n $spaceapi->contact->irc = '';\n $spaceapi->contact->twitter = '';\n $spaceapi->contact->facebook = '';\n $spaceapi->contact->identica = '';\n $spaceapi->contact->foursquare = '';\n $spaceapi->contact->ml = '';\n $spaceapi->contact->jabber = '';\n $spaceapi->issue_report_channels = array('email');\n $spaceapi->cache->schedule = 'm.05';\n\n return $spaceapi;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test Holidays for 2005
function testHolidays2005() { $drv = Date_Holidays::factory('UNO', 2005, 'en_EN'); $this->assertFalse(Date_Holidays::isError($drv)); foreach ($this->testDates2005 as $name => $dateInfo) { $day = $drv->getHoliday($name); $this->assertFalse(Date_Holidays::isError($day)); $this->assertEquals($name, $day->getInternalName()); $date = $day->getDate(); $this->assertEquals($dateInfo['day'], $date->format('d'), $name); $this->assertEquals($dateInfo['month'], $date->format('m'), $name); $this->assertEquals($dateInfo['year'], $date->format('Y'), $name); } }
[ "function testHolidays2005()\n {\n $drv = Date_Holidays::factory('PHPdotNet', 2005, 'en_EN');\n $this->assertFalse(Date_Holidays::isError($drv));\n\n foreach ($this->testDates2005 as $name => $dateInfo) {\n\n $day = $drv->getHoliday($name);\n $this->assertFalse(Date_Holidays::isError($day));\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testHolidays2007()\n {\n $drv = Date_Holidays::factory('UNO', 2007, 'en_EN');\n $this->assertFalse(Date_Holidays::isError($drv));\n\n foreach ($this->testDates2007 as $name => $dateInfo) {\n\n $day = $drv->getHoliday($name);\n $this->assertFalse(Date_Holidays::isError($day));\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testHolidays2007()\n {\n $drv = Date_Holidays::factory('Ireland', 2007);\n $this->assertFalse(Date_Holidays::isError($drv), \"Driver construction\");\n\n foreach ($this->testDates2007 as $name => $dateInfo) {\n $day = $drv->getHoliday($name);\n if (Date_Holidays::isError($day)) {\n $this->fail(helper_get_error_message($day));\n }\n $this->assertFalse(Date_Holidays::isError($day));\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testHolidays2007()\n {\n $drv = Date_Holidays::factory('Ukraine', 2007, 'C');\n if (Date_Holidays::isError($drv)) {\n $this->fail(helper_get_error_message($drv));\n }\n\n foreach ($this->testDates2007 as $name => $dateInfo) {\n $day = $drv->getHoliday($name);\n if (Date_Holidays::isError($day)) {\n $this->fail(helper_get_error_message($day));\n }\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testHolidays2007()\n {\n $drv = Date_Holidays::factory('PHPdotNet', 2007, 'en_EN');\n $this->assertFalse(Date_Holidays::isError($drv));\n\n foreach ($this->testDates2007 as $name => $dateInfo) {\n\n $day = $drv->getHoliday($name);\n $this->assertFalse(Date_Holidays::isError($day));\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testHolidays2008()\n {\n $drv = Date_Holidays::factory('UNO', 2008, 'en_EN');\n $this->assertFalse(Date_Holidays::isError($drv));\n\n foreach ($this->testDates2008 as $name => $dateInfo) {\n\n $day = $drv->getHoliday($name);\n $this->assertFalse(Date_Holidays::isError($day));\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testHolidays2005()\n {\n\n $holidays = Date_Holidays::factory('Turkey', 2005, 'en_EN');\n if (Date_Holidays::isError($holidays)) {\n die('Factory was unable to produce driver-object');\n }\n\n // Test New Year Day -- it comes a day early this year\n $day = $holidays->getHolidayDate('newYearsDay');\n if (Date_Holidays::isError($day)) {\n die('Factory was unable to make newYearsDay');\n }\n $this->assertEquals(12, $day->format('m'));\n $this->assertEquals(31, $day->format('d'));\n $this->assertEquals(2004, $day->format('Y'));\n\n // Test Ulusal Egemenlik ve Çocuk Bayramı\n $day = $holidays->getHolidayDate('egemenlikDay');\n if (Date_Holidays::isError($day)) {\n die('Factory was unable to create egemenlikDay');\n }\n\n $this->assertEquals(4, $day->format('m'));\n $this->assertEquals(23, $day->format('d'));\n\n // Test Atatürk'ü Anma Gençlik ve Spor Bayramı\n $day = $holidays->getHolidayDate('genclikDay');\n if (Date_Holidays::isError($day)) {\n die('Factory was unable to create genclikDay day');\n }\n $this->assertEquals(5, $day->format('m'));\n $this->assertEquals(19, $day->format('d'));\n\n // Test Zafer Bayramı\n $day = $holidays->getHolidayDate('zaferDay');\n if (Date_Holidays::isError($day)) {\n die('Factory was unable to create zaferDay day');\n }\n $this->assertEquals(8, $day->format('m'));\n $this->assertEquals(30, $day->format('d'));\n\n // Test Cumhuriyet Bayramı\n $day = $holidays->getHolidayDate('cumhuriyetDay');\n if (Date_Holidays::isError($day)) {\n die('Factory was unable to create cumhuriyetDay day');\n }\n $this->assertEquals(10, $day->format('m'));\n $this->assertEquals(29, $day->format('d'));\n\n }", "function testHolidays2006()\n {\n $drv = Date_Holidays::factory('Ireland', 2006);\n if (Date_Holidays::isError($drv)) {\n $this->fail(helper_get_error_message($drv));\n }\n $this->assertFalse(Date_Holidays::isError($drv));\n\n foreach ($this->testDates2006 as $name => $dateInfo) {\n\n $day = $drv->getHoliday($name);\n if (Date_Holidays::isError($day)) {\n $this->fail(helper_get_error_message($day));\n }\n $this->assertFalse(Date_Holidays::isError($day));\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testHolidays2006()\n {\n $drv = Date_Holidays::factory('Finland', 2006, 'en_EN');\n if (Date_Holidays::isError($drv)) {\n $this->fail(helper_get_error_message($drv));\n }\n\n foreach ($this->testDates2006 as $name => $dateInfo) {\n $day = $drv->getHoliday($name);\n if (Date_Holidays::isError($day)) {\n $this->fail(helper_get_error_message($day));\n }\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testBug12807()\n {\n $drv = Date_Holidays::factory('Denmark');\n if (Date_Holidays::isError($drv)) {\n $this->fail(helper_get_error_message($drv));\n }\n\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 12, 25, 2007)));\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 1, 1, 2007)));\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 1, 1, 2009)));\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 12, 25, 2007)));\n $this->assertTrue($drv->isHoliday('@' . mktime(1, 1, 1, 12, 25, 2009)));\n\n }", "function testHolidays2010()\n {\n $drv = Date_Holidays::factory('EnglandWales', 2010);\n $this->assertFalse(Date_Holidays::isError($drv));\n foreach ($this->testDates2010 as $name => $dateInfo) {\n $day = $drv->getHoliday($name);\n $this->assertFalse(Date_Holidays::isError($day));\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testHolidays2006()\n {\n $drv = Date_Holidays::factory('UNO', 2006, 'en_EN');\n $this->assertFalse(Date_Holidays::isError($drv));\n\n foreach ($this->testDates2006 as $name => $dateInfo) {\n\n $day = $drv->getHoliday($name);\n $this->assertFalse(Date_Holidays::isError($day));\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "function testHolidays2012()\n {\n $drv = Date_Holidays::factory('Russia', 2012, 'en_EN');\n $this->assertFalse(Date_Holidays::isError($drv));\n if (Date_Holidays::isError($drv)) {\n $this->fail($drv->getMessage());\n }\n\n foreach ($this->testDates2012 as $name => $dateInfo) {\n $day = $drv->getHoliday($name);\n $this->assertFalse(Date_Holidays::isError($day));\n if (Date_Holidays::isError($day)) {\n die($day->getMessage());\n }\n $this->assertEquals($name, $day->getInternalName());\n $date = $day->getDate();\n $this->assertEquals($dateInfo['day'], $date->format('d'), $name);\n $this->assertEquals($dateInfo['month'], $date->format('m'), $name);\n $this->assertEquals($dateInfo['year'], $date->format('Y'), $name);\n }\n }", "public function testOfficialHolidays(): void\n {\n $officialHolidays = [];\n if ($this->year >= 1949) {\n $officialHolidays[] = 'independenceMovementDay';\n $officialHolidays[] = 'liberationDay';\n $officialHolidays[] = 'nationalFoundationDay';\n $officialHolidays[] = 'christmasDay';\n if (ArborDayTest::YEAR_NOT_CELEBRATED !== $this->year && $this->year < ArborDayTest::REMOVED_YEAR + 1) {\n $officialHolidays[] = 'arborDay';\n }\n if ($this->year <= 1990 || $this->year > 2012) {\n $officialHolidays[] = 'hangulDay';\n }\n if ($this->year < 2008) {\n $officialHolidays[] = 'constitutionDay';\n }\n }\n if ($this->year >= 1950) {\n $officialHolidays[] = 'newYearsDay';\n if ($this->year <= 1990) {\n $officialHolidays[] = 'twoDaysLaterNewYearsDay';\n }\n if ($this->year <= 1998) {\n $officialHolidays[] = 'dayAfterNewYearsDay';\n }\n }\n if ($this->year >= 1956 && $this->year <= 1990) {\n $officialHolidays[] = 'armedForcesDay';\n }\n if ($this->year >= 1966) {\n $officialHolidays[] = 'memorialDay';\n }\n\n // specific cases (Seollal, Buddha's Birthday and Chuseok)\n if ($this->year >= 1949 && isset(SouthKorea::LUNAR_HOLIDAY['chuseok'][$this->year])) {\n $officialHolidays[] = 'chuseok';\n if ($this->year >= 1986) {\n $officialHolidays[] = 'dayAfterChuseok';\n }\n if ($this->year >= 1989) {\n $officialHolidays[] = 'dayBeforeChuseok';\n }\n }\n if ($this->year >= 1975 && isset(SouthKorea::LUNAR_HOLIDAY['buddhasBirthday'][$this->year])) {\n $officialHolidays[] = 'buddhasBirthday';\n }\n if ($this->year >= 1985 && isset(SouthKorea::LUNAR_HOLIDAY['seollal'][$this->year])) {\n $officialHolidays[] = 'seollal';\n if ($this->year > 1989) {\n $officialHolidays[] = 'dayBeforeSeollal';\n $officialHolidays[] = 'dayAfterSeollal';\n }\n }\n\n $this->assertDefinedHolidays($officialHolidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL);\n }", "public function testOfficialHolidays(): void\n {\n $officialHolidays = [];\n if ($this->year >= 1994) {\n $officialHolidays[] = 'swissNationalDay';\n }\n $this->assertDefinedHolidays($officialHolidays, self::REGION, $this->year, Holiday::TYPE_OFFICIAL);\n }", "function Date_Holidays_Driver()\n {\n }", "public function testGreeneryDayOnAfter2007()\n {\n $year = 2112;\n $this->assertHoliday(self::COUNTRY, self::HOLIDAY, $year,\n new DateTime(\"$year-5-4\", new DateTimeZone(self::TIMEZONE)));\n }", "public function testRespectForTheAgedDayOnAfter2003(): void\n {\n $year = $this->generateRandomYear(2004);\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"third monday of september {$year}\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function testIsHoliday()\n {\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-31'));\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-23'));\n $this->assertTrue($this->getCalculator()->isHoliday('2019-05-24'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the api configuration section.
public function addApiSection(ArrayNodeDefinition $node) { $node ->children() ->arrayNode('api') ->addDefaultsIfNotSet() ->children() ->enumNode('mode') ->isRequired() ->values([Api::MODE_TEST, Api::MODE_PRODUCTION]) ->end() ->scalarNode('tpe') ->isRequired() ->cannotBeEmpty() ->end() ->scalarNode('key') ->isRequired() ->cannotBeEmpty() ->end() ->scalarNode('company') ->isRequired() ->cannotBeEmpty() ->end() ->booleanNode('debug') ->defaultValue('%kernel.debug%') ->end() ->end() ->end() ->end(); }
[ "protected function addApiSettingsSection()\n {\n if (false == get_option('satoshipay_api')) {\n add_option('satoshipay_api', $this->defaultApiSettings);\n }\n\n add_settings_section(\n 'satoshipay_api_settings_section',\n __('API Settings', $this->textdomain),\n array($this, 'onRenderApiSectionDescription'),\n 'satoshipay_options_page'\n );\n\n add_settings_field(\n 'auth_key',\n 'API Key',\n array($this, 'onRenderApiKeyField'),\n 'satoshipay_options_page',\n 'satoshipay_api_settings_section'\n );\n\n add_settings_field(\n 'auth_secret',\n 'API Secret',\n array($this, 'onRenderApiSecretField'),\n 'satoshipay_options_page',\n 'satoshipay_api_settings_section'\n );\n\n register_setting(\n 'satoshipay_settings_section',\n 'satoshipay_api',\n array($this, 'onSanitizeApiSettings')\n );\n\n return $this;\n }", "public function addApiSection(ArrayNodeDefinition $node)\n {\n $hex = '[0-9a-fA-F]{6}';\n $image = '[0-9a-zA-Z-_]+\\.(jpe?g|gif|png)';\n\n $validation = array(\n 'language' => '[a-z]{2}',\n// 'payment_means' => null,\n 'header_flag' => 'yes|no',\n 'bgcolor' => $hex,\n 'block_align' => 'left|center|right',\n 'block_order' => '[1-9](,[1-9]){8}',\n 'textcolor' => $hex,\n\n // Pre/Production only\n 'normal_return_logo' => $image,\n 'cancel_return_logo' => $image,\n 'submit_logo' => $image,\n 'logo_id' => $image,\n 'logo_id2' => $image,\n 'advert' => $image,\n 'background_id' => $image,\n 'templatefile' => $image,\n );\n\n $api = $node->children()->arrayNode('api')->addDefaultsIfNotSet()->children();\n\n foreach ($validation as $key => $regex) {\n $api\n ->scalarNode($key)\n ->validate()\n ->ifTrue(function ($value) use ($regex) {\n return !(null === $value || preg_match('~^'.$regex.'$~', $value));\n })\n ->thenInvalid('Invalid '.$key.' %s')\n ->end()\n ->end()\n ;\n }\n\n $api->end()->end()->end();\n }", "public function api()\n {\n $this->response->html($this->helper->layout->admin('admin/setting/api', [\n 'title' => t('Admin').' &raquo; '.t('API'),\n ]));\n }", "public function getApiConfig()\n {\n return $this->getNamedConfig('api', 'API', 'url');\n }", "public function setApiConfig(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Appengine\\V1\\ApiConfigHandler::class);\n $this->api_config = $var;\n }", "public function configuration()\n {\n $this->force_api_type('application');\n\n $this->requester->get(\"/nodes/{$this->id}/configuration\");\n }", "public function setApi($api);", "public function getApiConfig()\n {\n return $this->api_config;\n }", "public static function the_dropbox_api_settings_section() {\n\t\tadd_settings_section(\n\t\t\t'dropbox_api',\n\t\t\t__('<p>You will need to create an <a href=\"https://www.dropbox.com/developers/apps\" target=\"_blank\">application</a> on the <a href=\"https://www.dropbox.com/developers\" target=\"_blank\">Dropbox developer page</a> if you haven\\'t already.</p>', DUW_Plugin::I18N),\n\t\t\t'__return_null',\n\t\t\tstatic::OPTION_NAME\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'app_key',\n\t\t\t__( 'App key', DUW_PLUGIN::I18N ),\n\t\t\tarray(get_called_class(), 'the_setting_text_field'),\n\t\t\tstatic::OPTION_NAME,\n\t\t\t'dropbox_api',\n\t\t\tarray('app_key')\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'app_secret',\n\t\t\t__( 'App secret', DUW_PLUGIN::I18N ),\n\t\t\tarray(get_called_class(), 'the_setting_text_field'),\n\t\t\tstatic::OPTION_NAME,\n\t\t\t'dropbox_api',\n\t\t\tarray('app_secret')\n\t\t);\n\n\t\tadd_settings_field(\n\t\t\t'app_token',\n\t\t\t__( 'App token', DUW_PLUGIN::I18N ),\n\t\t\tarray(get_called_class(), 'the_setting_text_field'),\n\t\t\tstatic::OPTION_NAME,\n\t\t\t'dropbox_api',\n\t\t\tarray('app_token')\n\t\t);\n\t}", "protected function configure()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../../config/logging-api.php', 'logging-api'\n );\n }", "public function update_api_app() {\n \n (new MidrubBaseAdminCollectionSettingsHelpers\\Oauth)->update_api_app();\n \n }", "abstract protected function loadConfiguration(): Swagger;", "public function setApi(Api $api);", "protected function defineApiRoutes()\n {\n $this->app->make('router')->prefix('api')->middleware('api')\n ->namespace(AcachaForgeServiceProvider::NAMESPACE)\n ->group(ACACHA_FORGE_PATH .'/routes/api.php');\n }", "function api_init()\n\t{\n\t\t// Register a page handler, so we can have nice URLs\n\t\tregister_page_handler('api','api_endpoint_handler');\n\t}", "private function setApiEndpoint()\n {\n $this->apiEndPoint = sprintf($this->apiUrl, explode('-', $this->apiKey)[1]);\n }", "public function getAPIConfig() {\n\t\treturn $this->_apiconfiguration;\n\t}", "public function initializeApi()\n {\n $api = new BasicApi(true);\n $api->setShop($this->apiDomain);\n $api->setApiKey($this->apiKey);\n $api->setApiPassword($this->apiPassword);\n $this->api = $api;\n }", "public function appendApi($value)\n {\n return $this->append(self::API, $value);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build an absolute repository resource locator
public function getAbsoluteResourcePath(RepositoryLocatorInterface $repositoryLocator) { return $this->root.str_replace( '/', DIRECTORY_SEPARATOR, $repositoryLocator->withExtension(getenv('OBJECT_RESOURCE_EXTENSION')) ); }
[ "public function locate_resources();", "public function getRepositoryPath();", "function testAssetWithAbsoluteBasePath() {\n $asset = new binarypool_asset($this->getDummyStorage());\n $asset->setBasePath('http://bin.staticlocal.ch/', true);\n $asset->setOriginal('http://bin.staticlocal.ch/vw_golf.jpg');\n $xml = $asset->getXML();\n \n // Load XML\n $dom = DOMDocument::loadXML($xml);\n $xp = new DOMXPath($dom);\n \n // Test\n $this->assertXPath($xp, '/registry/@version', '3.0');\n $this->assertXPath($xp, '/registry/items/item/location', 'http://bin.staticlocal.ch/vw_golf.jpg');\n $this->assertXPath($xp, '/registry/items/item/location/@absolute', 'true');\n return $asset;\n }", "protected function buildBaseRepoReplacement()\n {\n return [\n \"{{ BaseRepoPath }}\" => $this->rootNameSpace().'Repository\\\\'.config('starry.starry_repository_path')\n ];\n }", "public function getRepositoryLocator()\n {\n return $this->locator;\n }", "public function createRepository()\n {\n if (!interface_exists('Puli\\Repository\\Api\\ResourceRepository')) {\n throw new RuntimeException('Please install puli/repository to create ResourceRepository instances.');\n }\n\n $repo = new JsonRepository(__DIR__.'/path-mappings.json', __DIR__.'/..', true);\n\n return $repo;\n }", "abstract public function getRepository();", "private function setRepository(): self\n {\n $this->repository = base_dir();\n\n return $this;\n }", "abstract public function initRepositories();", "public function get_root_path($rep){\n //temporaney disabled\n //return $this->projects->getRootPath($repository);\n //if only name else get info repository\n $path = '';\n //$repository = \\is_string($rep) ? $this->repositories($rep) : $rep;\n $repository = \\is_string($rep) ? $this->repository($rep) : $rep;\n if ( (!empty($repository) && is_array($repository)) &&\n !empty($repository['path']) &&\n !empty($repository['root']) &&\n !empty($repository['code'])\n ){\n switch( $repository['root'] ){\n case 'app':\n $path = $this->getAppPath();\n break;\n /* case 'cdn':\n die(var_dump('cdn'));\n break;*/\n case 'lib':\n $path = $this->getLibPath();\n $path .= $repository['path'];\n if ( $repository['alias_code'] === 'bbn-project' ){\n $path .= '/src/';\n }\n break;\n }\n }\n return $path;\n }", "function loadRepository($respository);", "abstract protected function getRepoNameSpace();", "public function getFromFullPath($full_path) {\n $repo = $this->getByRepositoryRootMatch('gitolite/repositories', $full_path);\n if (!$repo) {\n $repo = $this->getByRepositoryRootMatch('gitroot', $full_path);\n }\n return $repo;\n }", "protected function getFileLocatorService()\n {\n return $this->services['file_locator'] = new \\Symfony\\Component\\HttpKernel\\Config\\FileLocator(${($_ = isset($this->services['kernel']) ? $this->services['kernel'] : $this->get('kernel')) && false ?: '_'}, ($this->targetDirs[2].'/Resources'), array(0 => $this->targetDirs[2]));\n }", "public function getRepositoryAlias(ResourceRepository $resource);", "protected function getLocalRepoPath()\n {\n return sfConfig::get('sf_data_dir').'/'.str_replace(array('/',':'), '_', $this->getScm()->getHost()).'/'.str_replace(array('/'), '_', $this->getScm()->getPath());\n }", "public function resourceBaseUrl();", "function getRepository();", "public static function CLASSPATH_RESOURCE_LOCATOR() {\n if ( self::$CLASSPATH_RESOURCE_LOCATOR_INSTANCE === null ) {\n require_once('substrate_ClasspathResourceLocator.php');\n self::$CLASSPATH_RESOURCE_LOCATOR_INSTANCE = new substrate_ClasspathResourceLocator();\n }\n return self::$CLASSPATH_RESOURCE_LOCATOR_INSTANCE;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Confirm the requested invite, requiring authentication precondition: $invite must exist, be valid, and attached to a valid CO person postcondition: CO Person status set to 'Active' and/or CO Petition updated postcondition: $inviteid deleted postcondition: Session flash message updated (HTML)
public function authconfirm($inviteid) { // This behaves just like confirm(), except that authentication is required to get here. $this->process_invite($inviteid, true, $this->Session->read('Auth.User.username')); }
[ "function confirm($inviteid) {\n $this->process_invite($inviteid, true);\n }", "public function action_accept_invite($event_id = null)\n {\n // chekc if user has access to accepting invite\n if (Auth::has_access('participant.accept_invite'))\n {\n is_null($event_id) and Response::redirect('/');\n\n // check if current user has invite for given event\n $user_id = Auth::instance()->get_user_id();\n $user_id = $user_id[1];\n\n $query = Model_Orm_Invite::query()\n ->where('event_id', $event_id)\n ->and_where_open()\n ->where('recipient_id', $user_id)\n ->and_where_close();\n $invite_obj = $query->get_one();\n\n // if invite found, make user organizator for this event\n if ( ! empty($invite_obj))\n {\n // give this user organizer status\n $organizator = array(\n 'event_id' => $event_id,\n 'user_id' => $user_id,\n 'role' => 1\n );\n $new_organizator = Model_Orm_Participant::forge($organizator);\n\n if ($new_organizator and $new_organizator->save())\n {\n // users is now organizer, delete accepted invite\n $query->delete();\n\n Session::set_flash('success', 'Apsveicu, tu esi veiksmīgi pievienots kā organizators.');\n Response::redirect('event/view/'.$event_id);\n }\n }\n else\n {\n // user has no invites\n $error[] = 'Piedod, bet tev nav neviena uzaicinājuma.';\n Session::set_flash('errors', $error);\n Response::redirect('user/view');\n }\n }\n else\n {\n Response::redirect('/');\n }\n }", "public function processReply($inviteId, $confirm, $loginIdentifier=null) {\n // Start a transaction\n $dbc = $this->getDataSource();\n $dbc->begin();\n \n $args = array();\n $args['conditions']['CoInvite.invitation'] = $inviteId;\n $args['contain'] = array('CoPerson', 'CoPetition', 'EmailAddress');\n \n $invite = $this->find('first', $args);\n \n if(!empty($invite)) {\n $verifyEmail = !empty($invite['CoInvite']['email_address_id']);\n \n // Check invite validity\n \n if(time() < strtotime($invite['CoInvite']['expires'])) {\n if($verifyEmail) {\n // Verifying an email address\n \n try {\n // XXX Note we're passing a bunch of stuff just so verify() can create a history record,\n // which we do below anyway. Refactor as part of CO-753.\n $this->CoPerson->EmailAddress->verify($invite['EmailAddress']['org_identity_id'],\n $invite['EmailAddress']['co_person_id'],\n $invite['CoInvite']['mail'],\n $invite['EmailAddress']['co_person_id']);\n }\n catch(Exception $e) {\n $dbc->rollback();\n throw new RuntimeException($e->getMessage());\n }\n } elseif(isset($invite['CoPetition']['id'])) {\n // Before we can delete the invitation, we need to unlink it from the petition\n \n $this->CoPetition->id = $invite['CoPetition']['id'];\n $this->CoPetition->saveField('co_invite_id', null);\n } else {\n // Default (ie: non-enrollment flow) behavior: update CO Person\n \n $this->CoPerson->id = $invite['CoPerson']['id'];\n \n if(!$this->CoPerson->saveField('status', $confirm ? StatusEnum::Active : StatusEnum::Declined)) {\n $dbc->rollback();\n throw new RuntimeException(_txt('er.cop.nf', array($invite['CoPerson']['id'])));\n }\n }\n \n // Mark the email address associated with this invite as verified.\n \n if($confirm) {\n // For historical reasons, we don't attach the email_address_id to the invite\n // when we're in a petition context. (That's how we distinguish petition\n // vs not, above.) This all needs to get rewritten (currently scheduled\n // for v4.0.0), but in the mean time we have to check both Org Identity\n // and CO Person attached Email Addresses, since we might have confirmed\n // either one.\n \n $orgId = null;\n \n if(isset($invite['CoPetition']['enrollee_org_identity_id'])) {\n $orgId = $invite['CoPetition']['enrollee_org_identity_id'];\n } elseif(empty($invite['CoPetition'])) {\n // Try to find the org identity associated with this invite\n \n $args = array();\n $args['conditions']['CoOrgIdentityLink.co_person_id'] = $invite['CoPerson']['id'];\n $args['conditions']['EmailAddress.mail'] = $invite['CoInvite']['mail'];\n $args['joins'][0]['table'] = 'cm_email_addresses';\n $args['joins'][0]['alias'] = 'EmailAddress';\n $args['joins'][0]['type'] = 'INNER';\n $args['joins'][0]['conditions'][0] = 'CoOrgIdentityLink.org_identity_id=EmailAddress.org_identity_id';\n $args['contain'] = false;\n \n // This *should* generate one result...\n $link = $this->CoPerson->CoOrgIdentityLink->find('first', $args);\n \n if(!empty($link['CoOrgIdentityLink']['org_identity_id'])) {\n $orgId = $link['CoOrgIdentityLink']['org_identity_id'];\n }\n }\n \n try {\n $this->CoPerson->EmailAddress->verify($orgId,\n $invite['CoPetition']['enrollee_co_person_id'],\n $invite['CoInvite']['mail'],\n $invite['CoPetition']['enrollee_co_person_id']);\n }\n catch(Exception $e) {\n $dbc->rollback();\n throw new RuntimeException($e->getMessage());\n }\n }\n \n // Toss the invite\n $this->delete($invite['CoInvite']['id']);\n } else {\n if(!empty($invite['CoPetition']['id'])) {\n // Before we can delete the invitation, we need to unlink it from the petition\n \n $this->CoPetition->id = $invite['CoPetition']['id'];\n $this->CoPetition->saveField('co_invite_id', null);\n }\n \n $this->delete($invite['CoInvite']['id']);\n \n // Record a history record that the invitation expired\n try {\n $this->CoPerson->HistoryRecord->record($invite['CoInvite']['co_person_id'],\n null,\n null,\n null,\n ActionEnum::InvitationExpired,\n _txt('er.inv.exp.use'));\n }\n catch(Exception $e) {\n $dbc->rollback();\n throw new RuntimeException($e->getMessage());\n }\n \n // Commit here, don't roll back!\n $dbc->commit();\n throw new OutOfBoundsException(_txt('er.inv.exp'));\n }\n \n // Create a history record\n \n if($verifyEmail) {\n // XXX Note that EmailAddress->verify() will also record almost the same history message on success.\n // This should probably be refactored as part of CO-753.\n $hcopid = $invite['EmailAddress']['co_person_id'];\n $hcoprid = null;\n $horgid = $invite['EmailAddress']['org_identity_id'];\n $hactorid = $hcopid; // XXX Should it be mapped from $loginidentifier instead? (review as part of CO-753)\n $hop = $confirm ? ActionEnum::EmailAddressVerified : ActionEnum::EmailAddressVerifyCanceled;\n $htxt = _txt(($confirm ? 'rs.ev.ver-a' : 'rs.ev.cxl-a'),\n array($invite['EmailAddress']['mail'], $loginIdentifier));\n } else {\n $hcopid = $invite['CoInvite']['co_person_id'];\n $hcoprid = isset($invite['CoPetition']['enrollee_co_person_role_id']) ? $invite['CoPetition']['enrollee_co_person_role_id'] : null;\n $horgid = isset($invite['CoPetition']['enrollee_org_identity_id']) ? $invite['CoPetition']['enrollee_org_identity_id'] : null;\n $hactorid = $invite['CoPetition']['enrollee_co_person_id'];\n $hop = $confirm ? ActionEnum::InvitationConfirmed : ActionEnum::InvitationDeclined;\n $htxt = _txt(($confirm ? 'rs.inv.conf-a' : 'rs.inv.dec-a'),\n array($invite['CoInvite']['mail']));\n }\n \n try {\n $this->CoPerson->HistoryRecord->record($hcopid,\n $hcoprid,\n $horgid,\n $hactorid,\n $hop,\n $htxt);\n }\n catch(Exception $e) {\n $dbc->rollback();\n throw new RuntimeException($e->getMessage());\n }\n } else {\n $dbc->rollback();\n throw new InvalidArgumentException(_txt('er.inv.nf'));\n }\n \n $dbc->commit();\n }", "public function accept_invite_() {\n\t\teval(USER);\n\t\t$this->assign('waitSecond',1);\n\n\t\t$cond['team_id'] = $_GET['team'];\n\t\t$cond['user_id'] = session('userid');\n\t\t$data['statecode'] = 1;\n\n\t\ttry {\n\t\t\t$res = DBModel::updateDB('cernet_teammate', $cond, $data);\n\t\t\tunset($cond['team_id']);\n\t\t\t$cond['statecode'] = 0;\n\t\t\t$data['statecode'] = -1;\n\t\t\t$res = DBModel::updateDB('cernet_teammate', $cond, $data);\n\t\t\t$this->move2state3();\n\n\t\t\t$this->success('','__ROOT__/User/currentstage');\n\t\t}catch(Exception $e){\n\t\t\tthrow_exception($e->getMessage());\n\t\t}\t\n\t}", "function testConfirmMember_UserCanConfirmInvitation()\n {\n // Arrange\n $member = $this->createInvitedMember();\n $invitation = $this->createMemberInvitation($member);\n $user = \\App\\User::find($member->user_id);\n $url = \"/api/invitations/{$invitation->id}/team-member/{$member->id}/confirm\";\n\n // Act\n $response = $this->actingAs($user, 'api')->getJson($url);\n\n // Assert\n $response->assertStatus(200);\n\n $this->assertDatabaseHas('team_members', [\n 'id' => $member->id,\n 'membership_type' => \\App\\TeamMember::MEMBER,\n 'user_id' => $member->user_id,\n ]);\n\n $this->assertDatabaseHas((new \\App\\Message())->getTable(), [\n 'id' => $invitation->id,\n 'payload' =>\n '{\"from_team_name\":\"' . $invitation->payload['from_team_name'] .\n '\",\"from_user_name\":\"' . $invitation->payload['from_user_name'] .\n '\",\"member_id\":' . $invitation->payload['member_id'] .\n ',\"completed\":true}',\n ]);\n }", "public function userHasAcceptedInvitation()\n {\n $this->member->acceptInvitation($this->team_id);\n }", "protected function process_invite($inviteid, $confirm, $loginIdentifier=null) {\n // Grab the invite info in case we need it later (we're about to delete it)\n $args = array();\n $args['conditions']['CoInvite.invitation'] = $inviteid;\n $args['contain'] = array('CoPetition');\n \n $invite = $this->CoInvite->find('first', $args);\n \n if(!$this->request->is('restful')) {\n // Set page title\n $this->set('title_for_layout', _txt('op.inv.reply'));\n }\n \n try {\n $this->CoInvite->processReply($inviteid, $confirm, $loginIdentifier);\n }\n catch(InvalidArgumentException $e) {\n if($this->request->is('restful')) {\n if($e->getMessage() == _txt('er.inv.nf')) {\n $this->Api->restResultHeader(404, \"CoInvite Unknown\");\n } else {\n $this->Api->restResultHeader(400, \"CoPerson Unknown\");\n }\n } else {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n $this->redirect(\"/\");\n return;\n }\n }\n catch(OutOfBoundsException $e) {\n if($this->request->is('restful')) {\n $this->Api->restResultHeader(403, \"Expired\");\n } else {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n $this->redirect(\"/\");\n return;\n }\n }\n catch(Exception $e) {\n if($e->getMessage() == _txt('er.auth')) {\n // This invitation requires authentication, so issue a redirect\n $this->redirect(array('action' => 'authconfirm', $inviteid));\n return;\n } else {\n if($this->request->is('restful')) {\n $this->Api->restResultHeader(500, \"Other Error\");\n } else {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n $this->redirect(\"/\");\n return;\n }\n }\n }\n \n if($this->request->is('restful')) {\n $this->Api->restResultHeader(200, \"Deleted\");\n } else {\n // If the invite was attached to a CO petition, re-enter the enrollment flow\n \n if(!empty($invite['CoPetition']['id'])) {\n $redirect = array(\n 'controller' => 'co_petitions',\n 'action' => 'processConfirmation',\n $invite['CoPetition']['id'],\n 'confirm' => ($confirm ? \"true\" : \"false\")\n );\n \n // For now, we always create an enrollee token. Pretty much every currently\n // supported enrollment flow involves a new Org Identity for the CO, so\n // there won't be an existing CO Person identity linked to use instead.\n // At some point (ie: additional Role enrollment; CO-310) this will change.\n \n $token = Security::generateAuthKey();\n \n $this->CoInvite->CoPetition->id = $invite['CoPetition']['id'];\n $this->CoInvite->CoPetition->saveField('enrollee_token', $token);\n \n $redirect['token'] = $token;\n \n $this->redirect($redirect);\n } elseif(!empty($invite['CoInvite']['email_address_id'])) {\n $this->Flash->set($confirm ? _txt('rs.ev.ver') : _txt('rs.ev.cxl'), array('key' => 'success'));\n } else {\n $this->Flash->set($confirm ? _txt('rs.inv.conf') : _txt('rs.inv.dec'), array('key' => 'success'));\n }\n \n // If a login identifier was provided, force a logout\n if($loginIdentifier) {\n $this->redirect(\"/auth/logout\");\n } else {\n $this->redirect(\"/\");\n }\n }\n }", "public function authverify($inviteid) {\n // We basically do the same thing as authconfirm().\n \n $this->process_invite($inviteid, true, $this->Session->read('Auth.User.username'));\n }", "function invite()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t\n\t\t# user has submitted the invitation\n\t\tif(!empty($_POST)){\n\t\t\t$response = $this->_tender->invite($_POST);\n\t\t\t$msg = (!empty($response) && $response['boolean'])? 'The Invitation for Bids/Quotations has been sent.' :'ERROR: The Invitation for Bids/Quotations could not be sent.';\n\t\t\t\n\t\t\t$this->native_session->set('__msg',$msg);\n\t\t}\n\t\telse if(!empty($data['a'])){\n\t\t\t$data['msg'] = $this->native_session->get('__msg');\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t\telse {\n\t\t\t$data['tender'] = $this->_tender->details($data['d']);\n\t\t\t$data['invited'] = $this->_tender->invitations($data['d']);\n\t\t\t$this->load->view('tenders/invite', $data);\n\t\t}\n\t}", "public function invite(){\n $this->validate(request(),[\n 'task_id' => 'required',\n 'user_id'=> 'required'\n ]);\n $task=Task::find(request('task_id'));\n\n $user=User::find(request('user_id'));\n if (\\Gate::denies('taskOwner', $task)) {\n return response()->json(\"Task doesn't Belong To you\");\n }\n \\Mail::to($user)->send(new TaskInvitation($user,$task));\n return response()->json(\"Invitation Mail Sent Successfully\");\n }", "public function testUpdateInviteWithCreatedUser()\n {\n\n $response = $this->loginAs($this->createUser([ 'email' => 'invited.user@mailinator.com' ]))\n ->put($this->url('invites/1'), [\n 'message' => 'Okay, do not come anymore'\n ]);\n\n $response->assertStatus(200);\n }", "public function invite()\n {\n $this->setInvitedFlag()->save();\n\n // :TODO: Fire an event here\n }", "public function invite()\n\t{\n\t\t$userTo = User::findOrFail(Input::get('user_id'));\n\t\t$startup = Startup::findOrFail(Input::get('startup_id'));\n\t\t$userFrom = Auth::user();\n\t\tThreadRepository::notification('startup.join.invite.talent', $userTo, array('startup' => $startup, 'fromUser' => $userFrom));\n\n\t\tFlash::message('You have successfully invited ' . $userTo->profile->first_name);\n\n\t\treturn Redirect::intended('/users/' . $userTo->id);\n\t}", "public function testInviteAccept()\n {\n $senderUser = factory(User::class)->create();\n\n $event = factory(Event::class)->create([\n 'title'=>'test',\n 'description'=>'teste',\n 'user_id'=>$senderUser->id,\n ]);\n\n $receiverUser = factory(User::class)->create();\n\n $response = $this\n ->actingAs($senderUser)\n ->post('/api/v1/invite/'.$event->id . '/send',[\n 'email'=>$receiverUser->email\n ]);\n\n $response->assertStatus(200);\n\n $invite = Invite::where([\n ['event_id', $event->id],\n ['sender_user_id', $senderUser->id],\n ['receiver_user_id', $receiverUser->id]\n ])->first();\n\n\n $response = $this\n ->actingAs($senderUser)\n ->post('/api/v1/invite/'.$invite->id . '/accept',[\n 'accept'=>'yes'\n ]);\n\n $response->assertStatus(200);\n\n\n $invite = Invite::where([\n ['event_id', $event->id],\n ['sender_user_id', $senderUser->id],\n ['receiver_user_id', $receiverUser->id]\n ])->first();\n\n $this->assertEquals('yes',$invite->is_accept);\n\n }", "public static function approveParticipant()\n {\n global $wpdb;\n\n if (! current_user_can('manage_options')) {\n print json_encode([\n 'error' => 'You are not the coordinator for this challenge (access denied)'\n ]);\n wp_die();\n }\n\n $chal_id = filter_input(INPUT_POST, 'chal-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE);\n $user_id = filter_input(INPUT_POST, 'user-id', FILTER_VALIDATE_INT, FILTER_NULL_ON_FAILURE);\n\n $res = $wpdb->update(\"{$wpdb->prefix}pt_participants\", [\n 'approved' => 1\n ], [\n 'challenge_id' => $chal_id,\n 'user_id' => $user_id\n ]);\n\n if ($res) {\n $email = $wpdb->get_var($wpdb->prepare(\n \"SELECT email FROM {$wpdb->prefix}pt_participants \n WHERE user_id = %d AND challenge_id = %d\",\n $user_id,\n $chal_id\n ));\n if ($email) {\n wp_mail($email, 'Approved for Team Challenge', PT_USER_APPROVED);\n }\n\n print json_encode([\n 'success' => 'Participant has been approved for the challenge'\n ]);\n } else {\n print json_encode([\n 'error' => $wpdb->last_error\n ]);\n }\n\n wp_die();\n }", "public function getConfirmInvite()\n {\n $user = Auth::user();\n if ($user->hasInvite()) {\n $tempRole = TempRole::where('fb_user_staff', $user->user_fb_id)->get();\n $accounts = [];\n if (count($tempRole)) {\n $userArr = [];\n foreach ($tempRole as $item) {\n array_push($userArr, $item->user_parent);\n }\n $userArr = array_unique($userArr);\n foreach ($userArr as $key => $acc) {\n $arrTg = [];\n foreach ($tempRole as $k => $item) {\n if ($item->user_parent == $acc) {\n array_push($arrTg, $item);\n }\n $lastInd = $k;\n }\n $ind = count($accounts);\n $accounts[$ind]['pages'] = $arrTg;\n $accounts[$ind]['role'] = optional(Role::find($arrTg[0]->role_id))->display_name;\n }\n }\n return response()->json([\n 'accounts' => $accounts\n ]);\n }\n return response()->json([\n 'message' => 'not has invite to confirm'\n ], ERR_CODE);\n }", "function acceptInvitation($projectId, $userId, $invitationId) {\n global $dbConn, $logger, $baseUrl;\n\n if (!$projectId || !$userId || !$invitationId) {\n redirectToError($baseUrl);\n }\n\n $dao = new ShowcaseProjectsDao($dbConn, $logger);\n $ok = $dao->acceptInvitationToCollaborateOnProject($projectId, $userId, $invitationId);\n if (!$ok) {\n redirectToError($baseUrl);\n }\n\n $redirect = $baseUrl . \"projects/invite/accepted?pid=$projectId\";\n echo \"<script>window.location.replace('$redirect');</script>\";\n die();\n}", "public function rejectInvitaion()\n\t{\n\t\t$data = $this->request->data;\n\t\t$id = $data['id'];\n\t\t\n\t\t//update the request as accepted\n\t\t$invite['Chat']['id'] = $id;\n\t\t\n\t\t//set status 1 as denied\n\t\t$invite['Chat']['status'] = 1;\n\t\t$invite['Chat']['pis_read'] = 1;\n\t\t$invite['Chat']['dis_read'] = 0;\n\t\t$result = $this->Chat->save($invite);\n\t\t\n\t\t//check for response\n\t\tif (!$result) {\n\t\t\techo \"false\";\n\t\t\texit;\n\t\t}\n\t\techo \"true\";\n\n\t\t//set notification\n\t\t$oldCount = $this->Session->read('oldCount');\n\t\tif ($oldCount>0) {\n\t\t\t$newCount = $oldCount-1;\n\t\t\t$this->Session->write('oldCount',$newCount);\n\t\t}\n\t\texit;\n\t}", "public function cancelOneinviteAction()\n\t{\n\t\t// Check auth\n\t\tif (!$this -> _helper -> requireUser() -> isValid())\n\t\t\treturn;\n\t\tif (!$this -> _helper -> requireSubject() -> isValid())\n\t\t\treturn;\n\t\t$subject = $group = Engine_Api::_() -> core() -> getSubject();\n\n\t\t// Get user\n\t\tif (0 === ($user_id = (int)$this -> _getParam('user_id')))\n\t\t{\n\t\t\treturn $this -> _helper -> requireSubject -> forward();\n\t\t}\n\t\tif (null === ($user = Engine_Api::_() -> getItem('user', $user_id)))\n\t\t{\n\n\t\t}\n\n\t\t$owner = $subject -> getOwner();\n\t\tif (!$subject -> membership() -> isMember($user))\n\t\t{\n\t\t\tthrow new Group_Model_Exception('Cannot remove a non-invite');\n\t\t}\n\n\t\t// Make form\n\t\t$this -> view -> form = $form = new Advgroup_Form_Member_CancelInvite( array(\n\t\t\t'group' => $subject -> getIdentity(),\n\t\t\t'user' => $user_id,\n\t\t));\n\n\t\t// Process form\n\t\tif ($this -> getRequest() -> isPost() && $form -> isValid($this -> getRequest() -> getPost()))\n\t\t{\n\t\t\t$db = $subject -> membership() -> getReceiver() -> getTable() -> getAdapter();\n\t\t\t$db -> beginTransaction();\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Remove membership\n\t\t\t\t$subject -> membership() -> removeMember($user);\n\t\t\t\tif ($subject -> membership() -> isResourceApprovalRequired())\n\t\t\t\t{\n\t\t\t\t\tEngine_Api::_() -> getDbtable('notifications', 'activity') -> addNotification($user, $group, $owner, 'advgroup_cancel_invite', array('group_title' => $group -> getTitle()));\n\t\t\t\t}\n\t\t\t\t$notification = Engine_Api::_() -> getDbtable('notifications', 'activity') -> getNotificationByObjectAndType($user, $subject, 'advgroup_invite');\n\t\t\t\tif ($notification)\n\t\t\t\t{\n\t\t\t\t\t$notification -> mitigated = true;\n\t\t\t\t\t$notification -> save();\n\t\t\t\t}\n\t\t\t\t$db -> commit();\n\t\t\t}\n\t\t\tcatch( Exception $e )\n\t\t\t{\n\t\t\t\t$db -> rollBack();\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t\treturn $this -> _forward('success', 'utility', 'core', array(\n\t\t\t\t'messages' => array(Zend_Registry::get('Zend_Translate') -> _('Group invite canceled.')),\n\t\t\t\t'layout' => 'default-simple',\n\t\t\t\t'parentRefresh' => true,\n\t\t\t));\n\t\t}\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Scope a query to only include admin roles.
public function scopeAdmin($query) { return $query->where('admin', true); }
[ "public function scopeAdmin($query)\n \t{\n \t\treturn $query->join('role_user', 'users.id', '=', 'role_user.user_id')\n ->where('role_user.role_id','=',Config::get('auth.roles.admin'));\n \t}", "public function scopeAdmin($query)\n {\n return $query->where('role_id', Role::ADMIN_ROLE);\n }", "public function scopeAdmin($query)\n {\n return $query->where('role', '=', 'admin');\n }", "public function scopeAdmin($query)\n\t{\n\t\treturn $query->where('name','=','admin');\n\t}", "public function scopeAdministrator($query)\n {\n return $query->where('name', static::NAME_ADMINISTRATOR);\n }", "public function scopeAllWithoutAdmin(): Collection\n {\n return self::all()->reject(function ($role){\n return $role->slug === 'admin';\n });\n }", "public function scopeExemptSuperAdmin($query)\n {\n return $query->whereHas('roles', function ($query) {\n $query->where('user_role.role_id', '!=', 1);\n });\n }", "public function scopeNonAdmin($query)\n {\n return $query->whereHas('role',function (Builder $query) {\n $query->whereNotIn('libelle',['ADMIN','SUPADMIN']);\n });\n }", "public function scopeUserRole($query) {\n\t\treturn $query->where('eUserRole',USER_ROLE);\n\t}", "public function scopeRole(Builder $query, Collection $roles): Builder;", "public function whereNameAdministrator()\n {\n return $this->where('name', Role::NAME_ADMINISTRATOR);\n }", "public function scopeAdminGuard(Builder $query): Builder\n {\n return $query->where('guard_name', 'admin');\n }", "public function get_all_administrators()\n\t{\n\t\t$this->db->from('customers');\n\t\t$this->db->select('*');\n\t\t$this->db->where('customer_level_id = 1');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "public function getAdmin(): Query\n {\n return $this->admin;\n }", "function get_roles_with_permanent_access() {\n\n\treturn apply_filters( app()->namespace . '/get_roles_with_permanent_access', [ 'administrator' ] );\n}", "public function scopeByRole($query, $role = null) {\n $user = \\Auth::user();\n\n if($user->isAdmin()) {\n return $query->where('school_id', $user->ownSchool->id);\n } else {\n return $query->whereNotIn('id', [$user->id])\n ->where('school_id', $user->school_id)\n ->where('role', $role ?? $user->role);\n }\n }", "public static function getAllAdmins(){\n return User::select('users.*')\n ->join('role_user', 'role_user.user_id', '=', 'users.id')\n ->join('roles', 'roles.id', '=', 'role_user.role_id')\n ->where('roles.slug', 'admin')\n ->where('roles.level', 1)\n ->get();\n }", "public function scopeStudents($query)\n {\n return $query->where('admin', 0);\n }", "public function admins()\n {\n return $this->belongsToMany(Config::get('guardian.admin_user'), Config::get('guardian.role_admin_user_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.admin_user_foreign_key'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Abstract method to add wp shortcodes
abstract public function addShortcode();
[ "protected function register_shortcodes() {}", "public function addShortcodes() {\n\t\t// Nothing to do here now, adding class so method exists for child classes\n\t}", "function initShortCode()\n {\n }", "public function initShortcodes()\n {\n add_shortcode($this->tag, array($this, 'shortcode'));\n add_shortcode('op_' . $this->tag, array($this, 'shortcode'));\n }", "function WordpressConnectShortCodes(){\n\n\t\t$this->addInitHooks();\n\n\t}", "public function shortcodes() {\n\t\trequire_once($this->get_filepath('includes').'shortcodes.php');\n\t}", "function register_shortcodes() { }", "public static function init_shortcode() {\n\t\tadd_shortcode( self::shortcode_tag, array( __CLASS__, 'shortcode' ) );\n\t}", "private function loadShortcodes() {\r\r\n\r\r\n WD_ASP_Shortcodes::registerAll();\r\r\n\r\r\n }", "public abstract function register_shortcode( $atts, $content = null );", "function hybrid_addons_add_shortcodes() {\n \n\tadd_shortcode( 'sidebar', 'hybrid_addons_get_sidebar' );\n\tadd_shortcode( 'widget','hybrid_addons_widget' );\n\n\tadd_shortcode( 'site-title','hybrid_addons_site_title' );\n\tadd_shortcode( 'rss','hybrid_addons_subscribe_rss' );\n\t\n\t// Allow [SHORTCODES] in Widgets\n\tadd_filter( 'widget_text', 'do_shortcode' );\n}", "public function register_shortcode() {\n add_shortcode( 'dynavic-content', array( $this, 'parse_dynavic_content' ) );\n add_filter( 'widget_text', 'do_shortcode' );\n add_filter( 'the_excerpt', 'do_shortcode');\n }", "public function getShortcodeReplace();", "static function add_shortcodes(): void {\r\n add_shortcode('mjk_current_volume_archive',\r\n\t [__CLASS__, 'render_current_volume_archives']);\r\n\r\n add_shortcode('mjk_past_volume_archive',\r\n\t [__CLASS__, 'render_past_volume_archives']);\r\n\r\n add_shortcode('mjk_erindalian_archive',\r\n\t [__CLASS__, 'render_erindalian_archives']);\r\n\r\n add_shortcode('mjk_all_volume_archive',\r\n\t [__CLASS__, 'render_all_volume_archives']);\r\n\r\n add_shortcode('mjk_website_archive',\r\n\t [__CLASS__, 'render_website_archive']);\r\n }", "function bbp_register_shortcodes()\n{\n}", "function mits_shortcode_resource() {\n\twp_register_script(\"mits-shortcode-script\", plugin_dir_url(__FILE__).\"js/jadwal.js\", array('jquery'));\n\twp_register_style(\"mits-shortcode-style\", plugin_dir_url(__FILE__).\"css/jadwal.css\", array());\n}", "private function define_shortcode_hooks() {\n\n $plugin_shortcodes = new WPF_Shortcode(\n $this->get_plugin_name(), \n $this->get_version(),\n $this->get_post_type_name()\n );\n\n $this->loader->add_action( 'wp_enqueue_scripts', $plugin_shortcodes, 'enqueue_styles' );\n $this->loader->add_action( 'wp_enqueue_scripts', $plugin_shortcodes, 'enqueue_scripts' );\n\n /**\n * Add hook for shortcode tag.\n * \n * @param string $tag Shortcode tag to be searched in post content.\n * @param callable $func Hook to run when shortcode is found.\n */\n $this->loader->add_shortcode( 'WPF', $plugin_shortcodes, 'add_shortCode' );\n }", "function Smart_AddOn_ShortcodeRegister() {\n require_once USAEV_SHORTCODES . 'smart-shortcodes.php';\n }", "function initialize_shortcode() {\n\tif ( ! ( shortcode_exists( shortcode_slug ) ) ) {\n\t\tadd_shortcode( shortcode_slug, __NAMESPACE__ . '\\\\replacement' );\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if this session contains this attribute.
public function hasAttribute($name) { return isset($_SESSION[$name]); }
[ "public function hasAttribute($name)\n\t{\n\t\treturn isset($_SESSION[SESSION_NAMESPACE][$name]);\n\t}", "private function has_attribute($attribute){\n $object_vars=$this->attributes();\n return array_key_exists($attribute,$object_vars);\n }", "public function hasAttributes()\n {\n if (phpCAS::isAuthenticated()) {\n return phpCAS::hasAttributes();\n }\n\n return false;\n }", "public static function hasAttributes() {\n\t return (!empty($_SESSION));\n\t}", "private function has_attribute($attribute){\n //this fetchs all the variables(attributes)of the object [private or public]\n $object_vars= $this->attributes();\n //checks if the attribute is part of the object_vars\n return array_key_exists($attribute, $object_vars);\n }", "public function hasAttr($attr) {\n return $this->$attr;\n }", "public function __isset( $attribute ){\n return isset( $this->_attributes[ $attribute ] );\n }", "public function has_attr( $attr )\n\t{\n\t\treturn isset( $this->_attrs[$attr] );\n\t}", "public function hasData()\n {\n return isset($_SESSION[$this->varname]);\n }", "public function isAttribute($key)\n {\n return $this->getMetadata()->hasAttribute($key);\n }", "public function has_attributes() {\n foreach ( $this->get_attributes() as $attribute ) {\n if ( $attribute->get_visible() ) {\n return true;\n }\n }\n return false;\n }", "public function hasAttributes();", "public function hasAttribute($name)\n\t{\n\t\treturn $this->getWrappedElement()->hasAttribute($name);\n\t}", "protected function hasAttribute($model, $attribute){\n return array_key_exists($attribute, $model->getAttributes());\n }", "public function attributeExists(string $attrName): bool;", "public function hasAttribute(string $qname): bool\n {\n return $this->attributes->hasNamedItem($qname);\n }", "public function hasAttributes () {}", "function has_attribute($name)\n {\n return $this->node->hasAttribute($name);\n }", "public function hasAttribute($identifier)\n {\n if (!$this->exists()) {\n $idText = $this->identifierText();\n throw new ObjectDoesNotExist(\"$idText does not exist, cannot check if attribute exists\");\n }\n // If attribute is meant to be removed, return false\n if (isset($this->attributesRemove[$identifier])) {\n return false;\n }\n if (isset($this->attributesNew[$identifier]) || isset($this->attributesChange[$identifier]) || isset($this->_attributes[$identifier])) {\n return true;\n }\n $this->loadAttributeMap();\n return isset($this->_attributes[$identifier]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the max modified time among the given files. Note: it doesn't support microseconds.
protected function maxFileModifiedTime($files) { $max = 0; foreach ($files as $file) { $lastModifiedTime = @filemtime($file); if (false === $lastModifiedTime) { throw new Exception('Unable to get last modification time of file: '.$file); } if ($lastModifiedTime > $max) { $max = $lastModifiedTime; } } return $max; }
[ "protected static function _get_last_modified($files)\n\t{\n\t\t$last_modified = 0;\n\n\t\tforeach ($files as $file) \n\t\t{\n\t\t\t$modified = filemtime($file);\n\t\t\tif ($modified !== false and $modified > $last_modified) $last_modified = $modified;\n\t\t}\n\n\t\treturn $last_modified;\n\t}", "protected static function _get_last_modified($files)\n {\n $last_modified = 0;\n\n foreach ($files as $file)\n {\n $modified = filemtime($file);\n\n if ($modified !== false AND $modified > $last_modified)\n {\n $last_modified = $modified;\n }\n }\n\n return $last_modified;\n }", "protected static function _getLatestModyficationDate($files)\n\t{\n\t\t$last_modified = 0;\r\n\t\t\r\n\t\tforeach ($files as $file)\r\n\t\t{\r\n\t\t\t$modified = filemtime($file);\r\n\t\t\tif ($modified !== false and $modified > $last_modified) $last_modified = $modified;\r\n\t\t}\r\n\t\t\r\n\t\treturn $last_modified;\r\n\t\t\n\t}", "public function getLastModificationTime(string $filename);", "private function getMaxModificationTime($theSourceFilename, $theContent)\n {\n $times = [];\n\n $time = filemtime($theSourceFilename);\n if ($time===false) $this->logError(\"Unable to get mtime of file '%s'.\", $theSourceFilename);\n $times[] = $time;\n\n $resource_files_info = $this->getResourceFilesInSource($theContent);\n foreach ($resource_files_info as $resource_file_info)\n {\n $info = $this->getResourceInfoByHash($resource_file_info['full_path_name_with_hash']);\n $time = $info['mtime'];\n if ($time===false) $this->logError(\"Unable to get mtime for file '%s'.\", $resource_file_info);\n $times[] = $time;\n }\n\n return max($times);\n }", "public function getLastModifiedFile() {\n $loader = new JavaScriptLoader();\n $loader->addNameSpaceFiles();\n $files = $loader->getAllFiles();\n $mod = array();\n foreach($files as $file) {\n $mod[] = filemtime($file);\n }\n asort($mod);\n return end($mod);\n }", "public function getMaxTimeElapsedSinceLastModification()\n {\n return $this->max_time_elapsed_since_last_modification;\n }", "function get_page_mod_time() { \n\tdate_default_timezone_set('America/Los_Angeles');\n\n $incls = get_included_files(); \n $incls = array_filter($incls, \"is_file\"); \n $mod_times = array_map('filemtime', $incls); \n $mod_time = max($mod_times); \n\n return $mod_time; \n}", "function getYoungestFileTimeCode( $inFolder, $inPattern )\n {\n $maxTimeCode = 0;\n // echo \"scanning for files \\\"{$inFolder}\\\"\\n\";\n $fileListing = scandir( $inFolder );\n foreach ( $fileListing as $key => $file ) {\n if ( !isHiddenFile( $file ) ) {\n $fullName = \"{$inFolder}/{$file}\";\n $thisTimeCode = filemtime( $fullName );\n if ( !is_dir( $fullName ) ) {\n if ( $thisTimeCode > $maxTimeCode ) {\n $maxTimeCode = $thisTimeCode;\n }\n }\n }\n }\n return $maxTimeCode;\n }", "public function getLastUpdated(){\n $t = 0;\n $file = $this->getPot();\n if( $file && $file->exists() ){\n $t = $file->modified();\n }\n /* @var $file Loco_fs_File */\n foreach( $this->findLocaleFiles('po') as $file ){\n $t = max( $t, $file->modified() );\n }\n return $t;\n }", "public function getLastModified() \n {\n $obj = Directory::getObject($this->path);\n return strtotime($obj[\"last_modified\"]);\n }", "function Java_java_io_WinNTFileSystem_getLastModifiedTime($file) {\n\tif (!file_exists(\"$file\")) {\n\t\treturn filemtime(\".\");\n\t\tvar_dump(\"$file\");\n\t\tvar_dump(\"Java_java_io_WinNTFileSystem_getLastModifiedTime\");\n\t\tvar_dump(\"file does not exist\");\n\t\texit;\n\t}\n\treturn filemtime(\"$file\");\n}", "function filemtime_compare($a, $b) {\n\n return filemtime($a) - filemtime($b);\n \n}", "public function getLastModifiedTime() : int\n {\n return filemtime( $this->path );\n }", "public static function getArchiveTimeRange()\n {\n $files = scandir(Config::$webcam_archive_path);\n $earliest = time();\n $latest = time();\n foreach ($files as $file) {\n //Files are stored in the format yyyymmddhh-cam.mpg, if it doesn't match that pattern, skip it\n if (!preg_match('/^[0-9]{10}\\-[a-zA-Z0-9\\-]+\\.mpg$/', $file)) {\n continue;\n }\n //Get a nicer timestamp format PHP can work with\n $str = preg_replace('/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2}).*$/', '$1-$2-$3 $4:00:00', $file);\n $time = strtotime($str);\n if ($time < $earliest) {\n $earliest = $time;\n }\n if ($time > $latest) {\n $latest = $time;\n }\n }\n echo $earliest.'='.$latest;\n }", "public function getLastModifiedTime(): int\n {\n return $this->getDirectoryLastModifiedTime($this->path);\n }", "function get_filemtime()\n {\n if (file_exists($this->cache_path))\n {\n if ($mtime = @filemtime($this->cache_path))\n {\n\t\t\t\t//return $mtime;\n\n\t\t\t\t$time = gmmktime(\n gmdate(\"H\", $mtime),\n gmdate(\"i\", $mtime),\n gmdate(\"s\", $mtime),\n gmdate(\"m\", $mtime),\n gmdate(\"d\", $mtime),\n gmdate(\"Y\", $mtime)\n );\n return $time;\n\n }\n }\n\n return;\n }", "private function filemtime_diff( $a, $b ) {\n\t\treturn filemtime( $a ) - filemtime( $b );\n\t}", "public function getLastModified() {\n\n $obj = Sabre_DAV_DOCMGR_Directory::getObj($this->path);\n\n return strtotime($obj[\"last_modified\"]);\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the notifyLevel of the logger, as defined in Psr\Log\LogLevel.
public function setNotifyLevel(string $notifyLevel): void { if (!in_array($notifyLevel, $this->getLogLevelOrder())) { syslog(LOG_WARNING, 'Bugsnag Warning: Invalid notify level supplied to Bugsnag Logger'); } else { $this->notifyLevel = $notifyLevel; } }
[ "public function setLogLevel($logLevel);", "protected function update_logging_level( $level ) {\n\t\t$this->log_manager()->set_level( $level );\n\t}", "public function setLogLevel($level)\n {\n $this->logLevel = $level;\n }", "public function setLevel($level)\n {\n switch ($level)\n {\n case \"error\": $this->logLevel = Project::MSG_ERR; break;\n case \"warning\": $this->logLevel = Project::MSG_WARN; break;\n case \"info\": $this->logLevel = Project::MSG_INFO; break;\n case \"verbose\": $this->logLevel = Project::MSG_VERBOSE; break;\n case \"debug\": $this->logLevel = Project::MSG_DEBUG; break;\n }\n }", "public static function setLogLevel($level) {\n\t self::validateLogLevel($level);\n self::$logLevel = $level;\n }", "function logging_set_level($min_severity = \"INFO\")\n{\n if(is_string($min_severity))\n $min_severity = @constant(\"\\\\ScavixWDF\\\\Logging\\\\Logger::\".$min_severity);\n if(!$min_severity)\n return false;\n\tforeach( Wdf::$Logger as $l )\n\t\t$l->min_severity = $min_severity;\n return true;\n}", "public function setNotificationLevel(?string $value): void {\n $this->getBackingStore()->set('notificationLevel', $value);\n }", "public function setLogThreshold($level)\n {\n if (!isset($this->levelSeverity[$level])) {\n throw new InvalidArgumentException('invalid log level ' . $level);\n }\n\n $this->thresholdLevel = $this->levelSeverity[$level];\n }", "public function setNotify($notify)\n {\n foreach ($this->criteria as $criteria) {\n $criteria->setNotify($notify);\n }\n }", "public function setNotifyMethod( $notifyMethod )\r\n {\r\n $this->notify = $notifyMethod;\r\n }", "private function setLogEntryLevel($level = 'ERROR'){\n $this->level = strtoupper($level);\n }", "public function setNotifyMethod($notifyMethod);", "public function setLevel($level)\n {\n $this->level = null === $level ? error_reporting() : $level;\n }", "public function level($level) {\n\t\t$this->_level = $level;\n\t}", "static public function setLogLevel($level)\n {\n if (strpos($level,'ERROR') !== FALSE) { self::$_level = 10; }\n else if (strpos($level,'WARNING') !== FALSE) { self::$_level = 20; }\n else if (strpos($level,'INFO') !== FALSE) { self::$_level = 30; }\n else if (strpos($level,'DEBUG') !== FALSE) { self::$_level = 40; }\n else if (strpos($level,'TRACE') !== FALSE) { self::$_level = 50; }\n else { self::$_level = 10; }\n }", "public function setLevel( $level )\r\n {\r\n $this->level = $level;\r\n }", "public static function setLogLevel()\r\n {\r\n self::$logLevel = isset($_POST['logging']) ? $_POST['logging'] : DUPX_Log::LV_DEFAULT;\r\n }", "public function setDebugLevel ($level = self::FATAL)\r\n\t{\r\n\t\t$this->_level = $level;\r\n\t}", "public function setMinLogLevel($level)\n {\n $this->m_minLogLevel = $level;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieve posts identifiers ordered by creation date DESC, for the given limit and offset
public function paginateByDate($limit, $offset = 0) { $builder = $this->createQueryBuilder('post'); $builder ->select('post.identifier') ->orderBy('post.createdAt', 'DESC') ->setFirstResult($offset) ->setMaxResults($limit) ; $arrayResult = $builder->getQuery()->getScalarResult(); $result = []; foreach ($arrayResult as $array) { $result[] = (int)$array['identifier']; } return $result; }
[ "protected function getPosts($offset, $limit)\n\t{\n\t\t// Construts a query criteria\n\t\t$criteria=new TActiveRecordCriteria;\n\t\t$criteria->OrdersBy['create_time']='desc';\n\t\t$criteria->Limit=$limit;\n\t\t$criteria->Offset=$offset;\n\t\t// query for the posts with the above criteria and with author information\n\t\treturn PostRecord::finder()->withAuthor()->findAll($criteria);\n\t}", "public static function getOrderByCreatedOn($limit = 10)\n\t{\n\t\t$data = (array) Site::getDB()->getRecords(\n\t\t\t'SELECT c.*, SUM(i.like_count) AS like_count\n\t\t\t FROM collections AS c\n\t\t\t INNER JOIN items AS i ON c.id = i.collection_id\n\t\t\t GROUP BY c.id\n\t\t\t ORDER BY c.created_on DESC\n\t\t\t LIMIT ?',\n\t\t\tarray($limit)\n\t\t);\n\n\t\t$items = array();\n\n\t\tforeach($data as $row)\n\t\t{\n\t\t\t$collection = new Collection();\n\t\t\t$collection->initialize($row);\n\n\t\t\t$items[] = $collection;\n\t\t}\n\n\t\treturn $items;\n\t}", "function get_sorted_ids($mode = 'createdtime', $count = 10, $offset = 0) {\n \n \t// define redis key\n \t$key = '';\n \tswitch($mode) {\n \t\t\n \t\tcase 'createdtime' \t: \t$key = $this->_createdtime_rank_key;\n \t\t\t\t\t\t\t\tbreak;\n \t\tcase 'like' \t\t: \t$key = $this->_like_rank_key;\n \t\t\t\t\t\t\t\tbreak;\n \t\tcase 'comment' \t\t: \t$key = $this->_comment_rank_key;\n \t\t\t\t\t\t\t\tbreak;\n \t\tdefault\t\t\t\t: \t$key = $this->_createdtime_rank_key;\n \t\n \t}\n \t//\n \t\n \t// fix offset_score for sort desc\n \tif ($offset == 0) {\n \t\t$offset = '+inf';\n \t} else {\n \t\t$offset = '('.$offset;\n \t}\n \t//\n \t\n \t// get from redis\n \t$ids = Redis::zrevrangebyscore($key, $offset, '-inf', array('limit'=> array(0,$count)));\n \t\n \treturn $ids;\n }", "function postsByPages( $bID, $offset = 0, $limit = 20 )\r\n { \r\n $return = array();\r\n \r\n $sql = 'SELECT SQL_CALC_FOUND_ROWS bp.bp_id AS BP_ID, bp.bp_b_id AS BP_BID, bp.bp_u_id AS BP_UID, bp.bp_title AS BP_TITLE, UNIX_TIMESTAMP(bp.bp_dateCreated) AS BP_DATECREATED, bp.bp_replies AS BP_REPLIES, '\r\n . ' bp.bp_lastPostID AS BP_LASTPOSTID, bp.bp_views AS BP_VIEWS, bp.bp_lastViewID AS BP_LASTVIEWID, bp.bp_sticky AS BP_STICKY, bp.bp_active AS BP_ACTIVE'\r\n . ' FROM board_post AS bp'\r\n . \" WHERE bp.bp_visible = 'Y'\"\r\n . \" AND bp.bp_parentID = '0'\"\r\n . \" AND bp.bp_b_id = '\" . $bID . \"'\"\r\n . ' ORDER BY bp.bp_STICKY ASC, bp.bp_dateCreated DESC'\r\n . ' LIMIT ' . $limit . ''\r\n . ' OFFSET ' . $offset . '';\r\n \r\n $result = $this->dbh->query_all($sql);\r\n \r\n $return = $result;\r\n \r\n return $return;\r\n }", "function get_display_posts($sortable_posts, $offset = null, $ppp = null) { \n \n global $post;\n $display_posts = array();\n $post_authors = array();\n $max_posts_per_author = 4;\n $max_posts = ( $offset != null && $ppp != null ) ? 300 : 20 ;\n $previous_post_author = '';\n $i = 0;\n\n foreach ( $sortable_posts as $post ) {\n\n if ($i == $max_posts) { break; }\n //setup_postdata($post);\n\n if ( $previous_post_author != $post->post_author ) {\t\t \n\t\t if ( array_key_exists($post->post_author, $post_authors) ) {\n\t\t if ( $post_authors[$post->post_author] < $max_posts_per_author ) {\n\t\t $display_posts[] = $post;\n\t\t $post_authors[$post->post_author]++;\n\t\t $i++;\n\t\t } else {\n\t\t continue;\n\t\t }\n\t\t } else {\n\t\t $display_posts[] = $post;\n\t\t $post_authors[$post->post_author] = 1;\n\t\t $i++;\n\t\t } \n\t\t} \n\t\t \n\t\t$previous_post_author = $post->post_author;\n }\n \n if ( $offset != null && $ppp != null ) { $display_posts = array_slice($sortable_posts, $offset, $ppp, true); } \n\n return $display_posts;\n}", "function getAllMoviesLimitBy($offset, $limit = 25){\n global $pdo;\n\n $sql = \"SELECT * FROM movies_full\n ORDER BY id\n LIMIT $limit OFFSET $offset\";\n\n $query = $pdo->prepare($sql);\n $query->execute();\n\n return $query->fetchALL();\n}", "public function getLatestPosts($limit)\n {\n $select = $this->tableGateway->getSql()->select();\n $select->limit($limit);\n $select->order('post_created DESC');\n \n return $this->selectWith($select);\n }", "public function showPosts($offset, $id){\n\t\t$post = $this->_db->query(\"\n\t\t\t\t(SELECT users_info.user_id, users_info.user_firstname, users_info.user_lastname, users_info.user_profile_picture, posts.post_created, posts.post_content, posts.post_id\n\t\t\t\tFROM users_info \n\t\t\t\tINNER JOIN friends \n\t\t\t\tON users_info.user_id = friends.user_friend_id\n\t\t\t\tINNER JOIN posts\n\t\t\t\tON users_info.user_id = posts.user_id\n\t\t\t\tWHERE friends.user_id = $id\n\t\t\t\t)\n\t\t\t\tUNION\n\t\t\t\t(SELECT users_info.user_id, users_info.user_firstname, users_info.user_lastname, users_info.user_profile_picture, posts.post_created, posts.post_content, posts.post_id\n\t\t\t\tFROM users_info \n\t\t\t\tINNER JOIN friends \n\t\t\t\tON users_info.user_id = friends.user_id\n\t\t\t\tINNER JOIN posts\n\t\t\t\tON users_info.user_id = posts.user_id\n\t\t\t\tWHERE friends.user_friend_id = $id)\n\t\t\t\tUNION\n\t\t\t\t(SELECT users_info.user_id, users_info.user_firstname, users_info.user_lastname, users_info.user_profile_picture, posts.post_created, posts.post_content, posts.post_id\n\t\t\t\tFROM users_info\n\t\t\t\tINNER JOIN posts\n\t\t\t\tON users_info.user_id = posts.user_id\n\t\t\t\tWHERE posts.user_id = $id ) \n\t\t\t\tORDER BY post_created DESC LIMIT 3 OFFSET \" . $offset . \";\n\t\t\t\t\t\t\t\t\t\");\n\t\t$posts = array();\n\t\twhile ($row = mysqli_fetch_assoc ($post)){\n\t\t\t$row['comments'] = $this->getFirstComments($row[\"post_id\"]);\n\t\t\t$row['likes'] = $this->getLikes($row[\"post_id\"]);\n\t\t\t$posts[] = $row;\n\t\t}\n\t\t\n\t\tif ( $posts ){\n\t\t\tforeach($posts as $value){\n\t\t\t\t$value['post_time_ago'] = $this->timeAgo( $value['post_created'] );\n\t\t\t\t$postsWithTimeAgo[] = $value;\n\t\t\t}\n\t\t\treturn $postsWithTimeAgo;\t\n\t\t}\n\t\telse return $posts;\n\t\t\n\t\t\n\n\t}", "public function getWallPosts ( $offset, $id ){\n\t\t$post = $this->_db->query(\"\n\t\t\t\t(SELECT users_info.user_id, users_info.user_firstname, users_info.user_lastname, users_info.user_profile_picture, posts.post_created, posts.post_content, posts.post_id\n\t\t\t\tFROM users_info \n\t\t\t\tINNER JOIN posts\n\t\t\t\tON users_info.user_id = posts.user_id\n\t\t\t\tWHERE users_info.user_id = $id\n\t\t\t\t)\n\t\t\t\tUNION\n\t\t\t\t(SELECT users_info.user_id, users_info.user_firstname, users_info.user_lastname, users_info.user_profile_picture, posts.post_created, posts.post_content, posts.post_id\n\t\t\t\tFROM users_info \n\t\t\t\tINNER JOIN posts\n\t\t\t\tON users_info.user_id = posts.user_id\n\t\t\t\tINNER JOIN posts_relations\n\t\t\t\tON posts.post_id = posts_relations.post_id\n\t\t\t\tWHERE posts_relations.post_to_friend_id = $id)\n\t\t\t\tORDER BY post_created DESC LIMIT 3 OFFSET \" . $offset . \";\n\t\t\t\t\t\t\t\t\t\");\n\t\t\t\t$posts = array();\n\t\t\t\twhile ($row = mysqli_fetch_assoc ($post)){\n\t\t\t\t\t$row['comments'] = $this->getFirstComments($row[\"post_id\"]);\n\t\t\t\t\t$row['likes'] = $this->getLikes($row[\"post_id\"]);\n\t\t\t\t\t$posts[] = $row;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $posts ){\n\t\t\t\t\tforeach($posts as $value){\n\t\t\t\t\t\t$value['post_time_ago'] = $this->timeAgo( $value['post_created'] );\n\t\t\t\t\t\t$postsWithTimeAgo[] = $value;\n\t\t\t\t\t}\n\t\t\t\t\treturn $postsWithTimeAgo;\n\t\t\t\t}\n\t\t\t\telse return $posts;\n\t\t\t\t\n\t\t\n\t}", "function select_entries ($offset=0, $limit=DEFAULT_LIMIT)\n{\n\t// cast to make sure that these are integer values\n\t$limit = (int)$limit;\n\t$offset = (int)$offset;\n\n\t$query = <<<EOQ\nselect *, date_format(created,'%e %M, %Y %h:%i %p') as entry_date\nfrom guestbook\norder by created desc\nlimit ?, ?\nEOQ;\n\t$result = safe_mysql_query($query);\n\t\n\t$result->bindParam(1, $offset, PDO::PARAM_INT);\n\t$result->bindParam(2, $limit, PDO::PARAM_INT);\n\t$result->execute();\n\treturn $result;\n\n}", "function getLimitedPost($userId, $limitStart, $limit)\n{\n\n $sqlPost = \"SELECT * FROM `post` WHERE `userId` = '$userId' AND `deleted` = 0 ORDER BY `creationTime` DESC LIMIT $limitStart,$limit \";\n $resultPost = mysqli_query($GLOBALS[\"conn\"], $sqlPost);\n return $resultPost;\n}", "public function get_posts($offset = NULL, $owner_id = NULL, $user_id = NULL, $paged = NULL, $pinned = FALSE, $limit = 1, $post_id = 0, $search = NULL, $search_mode = 'exact')\n\t{\n\t\t$this->owner_id = $this->user_id = 0;\n\n\t\tif (NULL === $owner_id) {\n\t\t\t// use the current user's id\n\t\t\t$user = get_current_user_id();\n\t\t} else {\n\t\t\t$user = $owner_id;\n\t\t}\n\n\t\t$this->owner_id = $user;\n\n\t\tif (NULL === $user_id) {\n\t\t\t// use the current user'd id\n\t\t\t$user = get_current_user_id();\n\t\t} else {\n\t\t\t$user = $user_id;\n\t\t}\n\n\t\t$this->user_id = $user;\n\n\t\tif( NULL == $limit ) {\n\t\t\t$limit = 1;\n\t\t}\n\n\t\t$args = array(\n\t\t\t'post_type' => $this->query_type = PeepSoActivityStream::CPT_POST,\n\t\t\t'orderby' => 'post_date_gmt',\n\t\t\t'order' => 'DESC',\n\t\t\t'posts_per_page' => $limit,\n\t\t\t'paged' => (NULL === $paged ? NULL : $paged), // used to default to zero\n\t\t\t'offset' => (NULL === $offset ? NULL : $offset),// used to default to zero\n\t\t);\n\n\t\tif(TRUE == $pinned) {\n $args['pinned'] = TRUE;\n\t\t}\n\n\t\tif(0 < $post_id) {\n\t\t $args['p'] = $post_id;\n }\n\n\t\t// Negative page number indicates we want all posts newer than a given ID\n\t\tif($paged < 0) {\n\t\t\t$args['posts_per_page'] = -1;\n\t\t\tunset($args['paged']);\n\t\t\tunset($args['offset']);\n\t\t\t$args['post__not_in'] = range(1, abs($paged));\n\t\t}\n\n\t\tif(0==$this->_input->int('stream_filter_show_my_posts', 1)) {\n $args['author__not_in'] = array(get_current_user_id());\n }\n\n // extends the clause so, other plugins like groups / page / event can filters the activity\n $args = apply_filters('peepso_activity_meta_query_args', $args, $this->stream_id);\n\n\n\t\t// perform the query, with a filter to add the peepso_activity table\n\t\tadd_filter('posts_join', array(&$this, 'filter_act_join'));\n\t\tadd_filter('posts_clauses_request', array(&$this, 'filter_post_clauses'), 10, 2);\n if (PeepSo::get_option('slow_query_fix', 0) === 1) {\n $args['suppress_filters'] = FALSE;\n add_filter('posts_request', function ($query) use ($args) {\n return $this->filter_posts_request($query, $args);\n });\n }\n\n if('core_scheduled' == $this->stream_id) {\n $args['post_status'] = 'future';\n if(!PeepSo::is_admin()) {\n $args['author'] = get_current_user_id();\n unset($args['author__not_in']);\n }\n }\n\n // prevent duplicate activity on wordpress.com\n if (class_exists('Advanced_Post_Cache')) {\n wp_cache_flush();\n }\n\n $this->post_query = new WP_Query($args);\n\n if (PeepSo::get_option('slow_query_fix', 0) === 1) {\n remove_filter('posts_request', function(){});\n }\n\t\tremove_filter('posts_join', array(&$this, 'filter_act_join'));\n\t\tremove_filter('posts_clauses_request', array(&$this, 'filter_post_clauses'), 10);\n\n\t\treturn ($this->post_query);\n }", "function getObjectList($inOffset = null, $inLimit = 30);", "public function getPageList($limit, $offset);", "function recent_posts($pageSize)\n{\n global $WPGLOBAL, $loop;\n $prismic = $WPGLOBAL['prismic'];\n\n $pageSize = $pageSize ? $pageSize->getValue() : 5;\n\n $posts = $prismic->form()\n ->query(Predicates::at('document.type', 'post'))\n ->pageSize($pageSize)\n ->fetchLinks(\n 'post.date',\n 'category.name',\n 'author.full_name',\n 'author.first_name',\n 'author.surname',\n 'author.company'\n )\n ->orderings('my.post.date desc')\n ->submit();\n\n $loop->setResponse($posts);\n}", "public function getPosts($topicId, $offset = 0, $limit = 20)\r\n {\r\n $postModel = \\Pi::model('post', 'discourse');\r\n $topicUserModel = \\Pi::model('topic_user', 'discourse');\r\n $userModel = \\Pi::model('user', 'discourse');\r\n $postReplyModel = \\Pi::model('post_reply', 'discourse');\r\n \r\n $postTable = $postModel->getTable();\r\n $postReplyTable = $postReplyModel->getTable();\r\n \r\n $select = $postModel->select()\r\n ->where(array('topic_id' => intval($topicId)))\r\n ->order(array('post_number'))\r\n ->offset(intval($offset))\r\n ->limit(intval($limit))\r\n ->join(array('postReplyTable' => $postReplyTable),\r\n 'postReplyTable.post_id = ' . $postTable . '.id', \r\n array('reply_to_post_id'), \r\n 'left'\r\n );\r\n \r\n $rowset = $postModel->selectWith($select);\r\n $posts = $rowset->toArray();\r\n \r\n if (empty($posts)) {\r\n return array( 'err_msg' => \"No more posts.\" );\r\n }\r\n \r\n foreach($posts as &$post) {\r\n $post['time_from_created'] = $this->timeFromNow($post['time_created']);\r\n $post['time_created'] = date('Y-m-d h:i:s', $post['time_created']);\r\n $post['time_updated'] = date('Y-m-d h:i:s', $post['time_updated']);\r\n $post['post_number'] = intval($post['post_number']);\r\n }\r\n unset($post);\r\n \r\n \r\n /**\r\n * if logged in, add some info.\r\n */\r\n $userData = Pi::service('api')->discourse(array('user', 'getCurrentUserInfo'));\r\n if(!$userData['isguest']) {\r\n /**\r\n * add post action info(like, bookmark, etc.)\r\n */\r\n $postIds = array();\r\n foreach($posts as $post) {\r\n array_push($postIds, $post['id']);\r\n }\r\n $postActionModel = \\Pi::model('post_action', 'discourse');\r\n $select = $postActionModel->select()\r\n ->where(array(\r\n 'user_id' => intval($userData['id']),\r\n 'post_id' => $postIds,\r\n ));\r\n $rowset = $postActionModel->selectWith($select);\r\n $postActionResults = $rowset->toArray();\r\n foreach ($postActionResults as $postAction) {\r\n switch ($postAction['post_action_type_id']) {\r\n case static::POST_ACTION_BOOKMARK:\r\n foreach ($posts as &$post) {\r\n if ($post['id'] == $postAction['post_id']) {\r\n $post['isBookmarked'] = 1;\r\n }\r\n }\r\n unset($post);\r\n case static::POST_ACTION_LIKE:\r\n foreach ($posts as &$post) {\r\n if ($post['id'] == $postAction['post_id']) {\r\n $post['isLiked'] = 1;\r\n }\r\n }\r\n unset($post);\r\n }\r\n }\r\n \r\n /**\r\n * update topic user info(last read post, last view time, etc.)\r\n */\r\n $topicUserModel = \\Pi::model('topic_user', 'discourse');\r\n\r\n $lastPost = end($posts);\r\n \r\n $select = $topicUserModel->select()\r\n ->where(array('topic_id' => $topicId, 'user_id' => $userData['id'] ));\r\n $topicUserRowset = $topicUserModel->selectWith($select);\r\n $topicUserRow = $topicUserRowset->toArray();\r\n \r\n if(!$topicUserRow[0]) {\r\n $topicUserData = array(\r\n 'topic_id' => $topicId,\r\n 'user_id' => $userData['id'],\r\n 'time_last_visited' => time(),\r\n );\r\n $topicUserRow = $topicUserModel->createRow($topicUserData);\r\n $topicUserRow->save();\r\n } else {\r\n $topicUserModel->update(\r\n array(\r\n 'time_last_visited' => time(),\r\n ),\r\n array(\r\n 'topic_id' => $topicId,\r\n 'user_id' => $userData['id'],\r\n )\r\n );\r\n }\r\n }\r\n \r\n /**\r\n * add user info\r\n */\r\n $users = array();\r\n \r\n foreach($posts as $post) {\r\n if(!in_array($post['user_id'], $users)) {\r\n array_push($users, $post['user_id']);\r\n }\r\n }\r\n $select = $userModel->select()\r\n ->where(array( 'id' => $users ))\r\n ->columns(array('id', 'username', 'name', 'avatar'));\r\n\r\n $rowset = $userModel->selectWith($select);\r\n $users = $rowset->toArray();\r\n \r\n foreach($users as &$user) {\r\n if(empty($user['name'])) {\r\n $user['name'] = $user['username'];\r\n }\r\n unset($user['username']);\r\n }\r\n unset($user);\r\n\r\n return array( 'posts' => $posts, 'users' => $users );\r\n }", "public function findPublishedOrderedByNewest(int $limit)\n {\n return $this->createQueryBuilder('c')\n ->andWhere('c.publishedAt IS NOT NULL')\n ->orderBy('c.id', 'ASC')\n ->setMaxResults($limit)\n ->getQuery()\n ->getResult()\n ;\n }", "function getMostVisitedPostIDs( $days = 365, $limit = 10, $cats = false, $return_array = false )\r\n{\r\n\tglobal $wpdb;\r\n\t$date = date_i18n('Y-m-d', current_time('timestamp') - 86400 * $days);\r\n\tif ( is_array($cats) )\r\n\t{\r\n\t\tif ( is_object($cats[0]) )\r\n\t\t{\r\n\t\t\t$catIDs = array();\r\n\t\t\tforeach( $cats as $cat )\r\n\t\t\t\t$catIDs[] = $cat->term_id;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$catIDs = (array) $cats;\r\n\t\t$cats = implode(',', $catIDs);\r\n\t}\r\n\t$cat_filter = ($cats) ? 'AND x.term_id IN ('.$cats.')' : '';\r\n\t\r\n\t$q1 = ($return_array) ? ', p.post_title' : '';\r\n\t$q2 = ($return_array) ? ' LEFT JOIN '.$wpdb->posts.' p ON p.ID = c.page ' : '';\r\n\t\r\n\t$sql = \"\r\n\tSELECT\tCOUNT(c.id) count,\r\n\t\t\tc.page post_id\r\n\t\t\t$q1\r\n\tFROM\t$wpdb->cpd_counter c\r\n\t$q2\r\n\tLEFT\tJOIN $wpdb->term_relationships r \r\n\t\t\tON r.object_id = c.page\r\n\tLEFT\tJOIN $wpdb->term_taxonomy x\r\n\t\t\tON x.term_taxonomy_id = r.term_taxonomy_id\r\n\tWHERE\tc.date >= '$date'\r\n\t$cat_filter\r\n\tGROUP\tBY c.page\r\n\tORDER\tBY count DESC\r\n\tLIMIT\t$limit\";\r\n\t$res = $this->mysqlQuery('rows', $sql, 'getMostVisitedPostIDs '.__LINE__);\r\n\r\n\t$ids = array();\r\n\tif ($res)\r\n\t\tforeach ( $res as $row )\r\n\t\t{\r\n\t\t\tif ($return_array)\r\n\t\t\t\t$ids[] = array('id' => $row->post_id, 'title' => $row->post_title, 'count' => $row->count);\r\n\t\t\telse\r\n\t\t\t\t$ids[] = $row->post_id;\r\n\t\t}\r\n\tif ($return_array)\r\n\t\treturn $ids;\r\n\telse\r\n\t\treturn implode(',', $ids);\r\n}", "public function get_paginated_scheduled_posts($per_page, $offset)\n {\n $this->filter_posts();\n $this->db->where('posts.status', 1);\n $this->db->where('posts.created_at > CURRENT_TIMESTAMP()');\n $this->db->order_by('posts.created_at', 'DESC');\n $this->db->limit($per_page, $offset);\n $query = $this->db->get('posts');\n return $query->result();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ reIndex For an array of assoc rays, return a new array of assoc rays using a certain field for keys
public static function reIndex() { $fields = func_get_args(); $array = array_shift($fields); $array = (array) $array; $R = array(); foreach ($array as $obj) { $target =& $R; foreach ($fields as $field) { if (! array_key_exists($field, $obj)) die("reIndex: array doesn't have requested field\n"); $nextkey = $obj[$field]; $target =& $target[$nextkey]; } $target = $obj; } return $R; }
[ "public static function reIndex() {\r\n $fields = func_get_args();\r\n $array = array_shift($fields);\r\n $array = (array) $array;\r\n \r\n $R = array();\r\n foreach ($array as $obj) {\r\n $target =& $R;\r\n \r\n foreach ($fields as $field) {\r\n if (! array_key_exists($field, $obj)) die(\"reIndex: array doesn't have requested field\\n\");\r\n \r\n $nextkey = $obj[$field];\r\n $target =& $target[$nextkey];\r\n }\r\n $target = $obj;\r\n }\r\n return $R;\r\n }", "public static function reIndex() {\n $fields = func_get_args();\n $array = array_shift($fields);\n $array = (array) $array;\n \n $R = array();\n foreach ($array as $obj) {\n $target =& $R;\n \n foreach ($fields as $field) {\n if (! array_key_exists($field, $obj)) die(\"reIndex: array doesn't have requested field\\n\");\n \n $nextkey = $obj[$field];\n $target =& $target[$nextkey];\n }\n $target = $obj;\n }\n return $R;\n }", "function reindex_array($arr) {\n\tforeach ($arr as $val) {\n\t\t$ret_arr[] = $val;\n\t} \n\treturn $ret_arr;\n}", "static function field2key($arr,$keyfield=0,$remove=TRUE){\n $res = array();\n foreach($arr as $key=>$val){\n $nkey = $val[$keyfield];\n if($remove) unset($val[$keyfield]);\n $res[$nkey] = $val;\n }\n return($res);\n }", "public static function makeIndex(&$arr, $field)\n {\n $mapping = array();\n foreach ( $arr as $val ) {\n $key = $val[$field];\n $mapping[\"{$key}\"] = &$val;\n unset($val);\n }\n\n return $mapping;\n }", "function index($keys, $records) {\n $keys = (array) $keys;\n $final_key = array_pop($keys);\n\n $result = [];\n foreach ($records as $record) {\n $node = &$result;\n foreach ($keys as $key) {\n if (is_array($record)) {\n $keyvalue = isset($record[$key]) ? $record[$key] : NULL;\n }\n else {\n $keyvalue = isset($record->{$key}) ? $record->{$key} : NULL;\n }\n if (isset($node[$keyvalue]) && !is_array($node[$keyvalue])) {\n $node[$keyvalue] = [];\n }\n $node = &$node[$keyvalue];\n }\n if (is_array($record)) {\n $node[$record[$final_key]] = $record;\n }\n else {\n $node[$record->{$final_key}] = $record;\n }\n }\n return $result;\n}", "public function setArrayKeysFromSubArraysFields($arr, $newKeyValFieldName) {\n $result = array();\n foreach($arr as $key => $subarr) {\n //unset ($arr[$key]);\n //$arr[$subarr[$newKeyValFieldName]] = $subarr;\n $result[$subarr[$newKeyValFieldName]] = $subarr;\n }\n return $result;\n }", "function reindex(callable $fn, $coll)\n{\n $result = [];\n\n foreach ($coll as $key => $value) {\n $result[$fn($value, $key)] = $value;\n }\n\n return $result;\n}", "static function change_key( $array ) {\n $new_index = array();\n if(!empty($array) && count($array) > 0){\n for($i=0;$i<count($array);$i++){\n $new_index[$i] = $i;\n }\n return array_combine( $new_index, $array );\n }else{\n return array();\n }\n }", "function refactor(array $source, string ...$keys): array\n{\n $result = [];\n $kvp = array_keys($source);\n if (count($keys)) {\n $kvp = array_intersect($kvp, $keys);\n }\n\n while ($key = array_shift($kvp)) {\n foreach ($source[$key] as $index => $value) {\n if (!isset($result[$index])) {\n $result[$index] = [];\n }\n $result[$index][$key] = $value;\n }\n }\n\n return $result;\n}", "function ac($arr,$newkeys=NULL){\n if(!is_array($arr)) qk();\n if(is_null($newkeys)) return array_combine($arr,$arr);\n $res = array();\n foreach($newkeys as $key=>$val) $res[$val] = def($arr,$key);\n return $res;\n}", "function ReplaceArrayKeys($data,$fields)\n {\n foreach ($data as $array){\n for($i=0; $i < count($array); $i++){\n $new_key = $fields[$i];\n $array[$new_key] = $array[$i];\n unset($array[$i]);\n }\n\n $insert[] = $array;\n }\n return $insert;\n }", "function reindexById ($input, $column_name = 'id')\n{\n\t$ret = array();\n\tforeach ($input as $item)\n\t{\n\t\tif (! array_key_exists ($column_name, $item))\n\t\t\tthrow new InvalidArgException ('input', '(array)', 'ID column missing');\n\t\tif (array_key_exists ($item[$column_name], $ret))\n\t\t\tthrow new InvalidArgException ('column_name', $column_name, 'duplicate ID value ' . $item[$column_name]);\n\t\t$ret[$item[$column_name]] = $item;\n\t}\n\treturn $ret;\n}", "function array_reset_index($array)\n {\n $array = $array instanceof Collection\n ? $array->toArray()\n : $array;\n\n foreach ($array as $key => $val) {\n if (is_array($val)) {\n $array[$key] = array_reset_index($val);\n }\n }\n\n if (isset($key) && is_numeric($key)) {\n return array_values($array);\n }\n\n return $array;\n }", "function &active_record_array_to_associative(&$arr, $key_name = 'id'){\r\n\t$result = array();\r\n\tforeach($arr as &$record){\r\n\t\t$result[(string)$record->$key_name] = &$record;\r\n\t}\r\n\treturn $result;\r\n}", "private static function multiArrayKeyReset($array){\n\t\t$array = array_values($array);\n\t\tforeach($array as $key => $array_2){\n\t\t\t$array[$key] = array_values($array_2);\n\t\t}\n\t\treturn $array;\n\t}", "function toArrayIndexedBy($field_or_getter) {\n $result = array();\n \n foreach($this as $row) {\n if($this->return_mode == DB::RETURN_ARRAY) {\n $result[$row[$field_or_getter]] = $row;\n } else {\n $result[$row->$field_or_getter()] = $row;\n } // if\n } // foreach\n \n return $result;\n }", "function array_rename_keys(array &$array, array $new_keys)\r\n{\r\n foreach ($new_keys as $old_key => $new_key) {\r\n\r\n if (isset($array[$old_key])) {\r\n\r\n $array[$new_key] = $array[$old_key];\r\n\r\n unset($array[$old_key]);\r\n }\r\n }\r\n\r\n return $array;\r\n}", "public function array_set_index($ary, $key) {\r\n $temp = array();\r\n foreach($ary as $row) {\r\n $index = $row[$key];\r\n $temp[$index] = $row;\r\n }\r\n return $temp;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tells whether the Topology entity should be excluded because of feature flags.
private function isFeatureFlagExcluded(Topology $entity): bool { $flag = (string) $entity->getTopologyFeatureFlag(); if ('' === $flag) { return false; } return ! in_array($flag, $this->enabledFeatureFlags, true); }
[ "public function isExcluded(): bool\n {\n return $this->exclude ?? false;\n }", "public function isExcluded();", "private function exclude(): bool\n {\n return ($this->testAnnotations['class']['PostmanExclude'] ?? false)\n || ($this->testAnnotations['method']['PostmanExclude'] ?? false);\n }", "public function off(string $feature): bool;", "public function testDisableForDoesNothingIfFeatureIsGloballyEnabled()\n {\n $this->createTestEntityTable();\n\n $entity = $this->addTestEntity();\n $feature = $this->addTestFeature('test.feature', true);\n\n $this->repository->disableFor('test.feature', $entity);\n\n $this->assertDatabaseMissing('featurables', [\n 'feature_id' => $feature->id,\n 'featurable_id' => $entity->id,\n 'featurable_type' => get_class($entity)\n ]);\n\n $this->dropTestEntityTable();\n }", "public function isExcludeAll(): bool;", "public function exclude():bool {\n $exclude = data_get($this->yamlData, 'exclude', false);\n $exclude = $exclude === null ? false : $exclude;\n return $exclude;\n }", "public function isExcluded()\n {\n return $this->excluded;\n }", "public function isExcludeGroupsEnabled()\n {\n return $this->getConfigFlag('exclude_groups_enable');\n }", "public function isNegated()\n {\n return $this->_isNegated();\n }", "protected function hasExclude()\n {\n return $this->input->getOption('exclude');\n }", "public function isNot(string $mode): bool;", "public function getIsNegated()\n {\n return $this->isNegated;\n }", "public static function prevent_forumngfeature_discussion() {\n $removedfeatures = array('move', 'lock', 'merge', 'flagdiscussion', 'edittags', 'options');\n return $removedfeatures;\n }", "public function isNotFeatured ()\n {\n return !$this->featured;\n }", "public function isNegated()\n {\n return $this->_negated;\n }", "public function isNegated()\n {\n return $this->_negation;\n }", "public static function exclude_visitor() {\n return call_user_func(\\App::make('split_config')->ignore_filter) || self::is_ignored_ip_address() || self::is_robot();\n }", "public function hasExcludeByType();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }