query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Set the cache (if any) on the asset, and return the new AssetCache.
public function setCache($path, AssetInterface $asset) { $caching = null; $config = $this->getConfig (); if (! empty ( $config [$path] )) { $caching = $config [$path]; } elseif (! empty ( $config ['default'] )) { $caching = $config ['default']; } if (null === $caching) { return $asset; } if (empty ( $caching ['cache'] )) { return $asset; } $cacher = null; if (is_callable ( $caching ['cache'] )) { $cacher = $caching ['cache'] ( $path ); } else { // @codeCoverageIgnoreStart $factories = array ( 'FilesystemCache' => function ($options) { if (empty ( $options ['dir'] )) { throw new Exception\RuntimeException ( 'FilesystemCache expected dir entry.' ); } $dir = $options ['dir']; return new Cache\FilesystemCache ( $dir ); }, 'ApcCache' => function ($options) { return new Cache\ApcCache (); }, 'FilePathCache' => function ($options) use($path) { if (empty ( $options ['dir'] )) { throw new Exception\RuntimeException ( 'FilePathCache expected dir entry.' ); } $dir = $options ['dir']; return new FilePathCache ( $dir, $path ); } ); // @codeCoverageIgnoreEnd $type = $caching ['cache']; $type .= (substr ( $type, - 5 ) === 'Cache') ? '' : 'Cache'; if (! isset ( $factories [$type] )) { return $asset; } $options = empty ( $caching ['options'] ) ? array () : $caching ['options']; $cacher = $factories [$type] ( $options ); } if (! $cacher instanceof CacheInterface) { return $asset; } $assetCache = new AssetCache ( $asset, $cacher ); $assetCache->mimetype = $asset->mimetype; return $assetCache; }
[ "public function cache()\n {\n if ($this->cache) {\n return $this->cache;\n }\n\n // If the developer has requested a particular store, we'll use it.\n // If the config value is null, the default cache will be used.\n return Cache::store($this->config('cache'));\n }", "public function get_cache() {\n\t\tif ( is_null( $this->_cache ) ) {\n\t\t\t$this->_cache = new Caching\\ImageCache();\n\t\t\t$this->_cache->set_ttl( $this->get_cache_ttl() );\n\t\t\t$this->_cache->set_download_request_timeout( $this->get_cache_download_request_timeout() );\n $this->_cache->set_cache_orig_filename_length( $this->get_cache_orig_filename_length() );\n\t\t}\n\n\t\treturn $this->_cache;\n\t}", "private function _cache(){\n \n //get the live data\n $data = $this->_getLiveData();\n \n //store the live data\n $cacheObject = $this->_storeData($data);\n \n //return the fresh cache \n return $cacheObject;\n \n }", "public static function cache()\r\n {\r\n return \\Cache::getInstance();\r\n }", "public function setToCache();", "public function setCache(Cache $cache);", "private function importCache() {\r\n\r\n // Read the cache and parse the JSON.\r\n if( is_readable($this->cacheFile) ) {\r\n\r\n $this->status = json_decode(file_get_contents($this->cacheFile), true);\r\n }\r\n return $this;\r\n\r\n }", "protected function cache(): CacheManager\n {\n $cache = cache();\n if ($cache->supportsTags()) {\n $cache->tags($this->tags);\n }\n\n return $cache;\n }", "public static function group($group)\n\t{\n\t\treturn new Asset_Cache(new Asset_Group($group));\n\t}", "protected function getCache() {\n if ($this->cache === NULL) {\n $this->cache = new DiskCache($this->cacheFolder(), $this->cacheLifetime, TRUE);\n $this->cache->setSuffix('.cache');\n $this->cache->preserveFormat();\n }\n \n return $this->cache;\n }", "public function applicationCache()\n {\n return new ApplicationCache($this->url . '/application_cache');\n }", "protected function getAssetic_CacheService()\n {\n return $this->services['assetic.cache'] = new \\Assetic\\Cache\\FilesystemCache('C:/wamp/www/TestProject/app/cache/dev/assetic/assets');\n }", "protected function getCache(): CacheInterface\n {\n return $this->t3faCache;\n }", "public function getCache();", "public function _cache() {\n list($type, $host, $port, $compress) = @explode(':', SQ_TEMPLATE_CACHE_TYPE) + array(null, null, null, null);\n $cache = new DALMP_Cache($type);\n return $cache->host($host)->port($port)->compress($compress);\n }", "protected function cache()\n {\n if (! method_exists($this->cache, 'tags')) {\n return $this->cache;\n }\n\n return $this->cache->tags($this->tag);\n }", "public function cache()\n\t{\n\t\t/*\n\t\t * This is an empty implementation so that cacheing capability is not\n\t\t * required, but may be implemented.\n\t\t */\n\t}", "public function setAsseticCache(AssetCache $cache)\n\t{\n\t\t$this->asseticCache = $cache;\n\t}", "private function _get_cache() {\n\t\treturn $this->_cache;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ An user has many attendances
public function user_attendances() { return $this->hasMany(UserAttendance::class) ->with('user_attendance_breaks'); }
[ "public function attendance()\n {\n return $this->hasManyThrough('App\\Models\\Attendance', 'App\\Models\\Event');\n }", "public function attendances()\n {\n return $this->hasMany('App\\Models\\Attendance', 'personnel_no', 'personnel_no');\n }", "public function attendance(){\n\n return $this->hasMany('App\\Models\\Attendance','employee_id','id');\n\n }", "public function attendances()\n {\n return $this->hasMany('App\\Invitee', 'first_timer_id');\n }", "public function attendanceDetails(){\n return $this->hasMany(AttendanceDetail::class, 'student_id');\n }", "public function dailyAttendance()\n {\n return $this->hasMany('App\\AttendanceDay', 'student_id');\n }", "public function attendance(){\n return $this->belongsTo('App\\Attendance','attendance_id');\n }", "public function dailyClassAttendance()\n {\n return $this->hasMany('App\\AttendanceClass', 'student_id');\n }", "public function details(){\n return $this->hasMany(AttendanceDetail::class);\n }", "public function attendanceApprovals()\n {\n return $this->hasMany('App\\Models\\AttendanceApproval', 'regno', 'personnel_no');\n }", "function getAttend() {\n\t$alluser = new Attend();\n\t$alluser->getAllAttendance($_SESSION['userid']);\n}", "public function attendanceType()\n {\n return $this->belongsTo(AttendanceType::class, 'attendance_type_id');\n }", "public function PlannedAttendance()\n {\n return $this->hasMany('App\\Models\\PlannedAttendance');\n }", "public function recordAttendance($classroomId, $userIdList, $date) {\n //TODO : use transactions for integrity\n /**\n * if attendance taken before\n * updateAll to present\n * else\n * createAll\n * endif\n * updateAll in usersIdList to absent\n */\n\n $conditions = array(\n 'classroom_id' => $classroomId,\n 'date' => $date\n );\n $attendanceTaken = $this->hasAny($conditions);\n\n if ($attendanceTaken) {\n $status = $this->updateAll(\n array('is_present' => true),\n array(\n 'classroom_id' => $classroomId,\n 'date' => $date\n )\n );\n } else {\n $options = array(\n 'conditions' => array(\n 'UsersClassroom.classroom_id' => $classroomId,\n 'UsersClassroom.is_teaching' => false\n ),\n 'fields' => array(\n 'id', 'user_id', 'classroom_id'\n ),\n 'recursive' => -1\n );\n\n $data = $this->AppUser->UsersClassroom->find('all', $options);\n $ids = Hash::extract($data, '{n}.UsersClassroom.user_id');\n $saveData = array();\n\n foreach ($ids as $id) {\n array_push($saveData, array(\n 'user_id' => $id,\n 'classroom_id' => $classroomId,\n 'date' => $date,\n 'is_present' => true\n )\n );\n }\n $status = !empty($this->saveMany($saveData));\n }\n\n if ($status) {\n $status = $this->updateAll(\n array('is_present' => false),\n array(\n 'user_id' => $userIdList,\n 'classroom_id' => $classroomId,\n 'date' => $date\n )\n );\n }\n $this->log($this->getDataSource()->getLog(false, false));\n return $status;\n }", "public function getAttendanceByShift()\n {\n $business_id = request()->session()->get('user.business_id');\n $is_admin = $this->moduleUtil->is_admin(auth()->user(), $business_id);\n\n if (!(auth()->user()->can('superadmin') || $this->moduleUtil->hasThePermissionInSubscription($business_id, 'essentials_module') || $is_admin)) {\n abort(403, 'Unauthorized action.');\n }\n\n $date = $this->moduleUtil->uf_date(request()->input('date'));\n\n $attendance_data = EssentialsAttendance::where('business_id', $business_id)\n ->whereDate('clock_in_time', $date)\n ->whereNotNull('essentials_shift_id')\n ->with(['shift', 'shift.user_shifts', 'shift.user_shifts.user', 'employee'])\n ->get();\n $attendance_by_shift = [];\n $date_obj = \\Carbon::parse($date);\n foreach ($attendance_data as $data) {\n if (empty($attendance_by_shift[$data->essentials_shift_id])) {\n //Calculate total users in the shift\n $total_users = 0;\n $all_users = [];\n foreach ($data->shift->user_shifts as $user_shift) {\n if (!empty($user_shift->start_date) && !empty($user_shift->end_date) && $date_obj->between(\\Carbon::parse($user_shift->start_date), \\Carbon::parse($user_shift->end_date))) {\n $total_users ++;\n $all_users[] = $user_shift->user->user_full_name;\n }\n }\n $attendance_by_shift[$data->essentials_shift_id] = [\n 'present' => 1,\n 'shift' => $data->shift->name,\n 'total' => $total_users,\n 'present_users' => [$data->employee->user_full_name],\n 'all_users' => $all_users\n ];\n } else {\n if (!in_array($data->employee->user_full_name, $attendance_by_shift[$data->essentials_shift_id]['present_users'])) {\n $attendance_by_shift[$data->essentials_shift_id]['present'] ++;\n $attendance_by_shift[$data->essentials_shift_id]['present_users'][] = $data->employee->user_full_name;\n }\n }\n }\n return view('essentials::attendance.attendance_by_shift_data')->with(compact('attendance_by_shift'));\n }", "public function getAttendance($date = NULL);", "public function getAttendanceSheet($id)\n {\n $events = Event::find($id);\n if( $events->organization_id == null ){\n $users = OrganizationGroup::with('user')->get();\n } else {\n $users = OrganizationGroup::with('user')\n ->where('organization_id', $events->organization_id)\n ->get();\n }\n\n $attendance = Attendance::where('event_id', $id)\n ->with('user')\n ->get();\n\n # remove duplication\n foreach ($users as $ukey => $user) {\n foreach ($attendance as $key => $att) {\n if ($user->user_id == $att->user_id) {\n unset($users[$ukey]);\n }\n }\n }\n\n return view('attendees')\n ->with([\n 'events' => $events,\n 'users' => isset($users) ? $users : [],\n 'expected' => true,\n 'creator' => ($events->user_id == Auth::id()) ? true: false,\n 'attendance' => $attendance,\n ]);\n }", "public function scopeHasAttendance($query)\n {\n $query->whereHas('course', function ($q) {\n $q->active()->hasAttendance();\n });\n }", "public function getAttendanceByDate()\n {\n $business_id = request()->session()->get('user.business_id');\n $is_admin = $this->moduleUtil->is_admin(auth()->user(), $business_id);\n\n if (!(auth()->user()->can('superadmin') || $this->moduleUtil->hasThePermissionInSubscription($business_id, 'essentials_module') || $is_admin)) {\n abort(403, 'Unauthorized action.');\n }\n\n $start_date = request()->input('start_date');\n $end_date = request()->input('end_date');\n\n $attendance_data = EssentialsAttendance::where('business_id', $business_id)\n ->whereDate('clock_in_time', '>=', $start_date)\n ->whereDate('clock_in_time', '<=', $end_date)\n ->select(\n 'essentials_attendances.*',\n DB::raw(\"(SELECT COUNT(eus.id) from essentials_user_shifts as eus join essentials_shifts as es ON es.id=essentials_shift_id WHERE es.business_id=$business_id AND start_date <= clock_in_time AND end_date >= clock_in_time) as total_users_allocated\"),\n DB::raw(\"COUNT(DISTINCT essentials_attendances.user_id) as total_present\"),\n DB::raw('CAST(clock_in_time AS DATE) as clock_in_date')\n )\n ->groupBy(DB::raw('CAST(clock_in_time AS DATE)'))\n ->get();\n\n $attendance_by_date = [];\n foreach ($attendance_data as $data) {\n $total_users_allocated = !empty($data->total_users_allocated) ? $data->total_users_allocated : 0;\n $total_present = !empty($data->total_present) ? $data->total_present : 0;\n $attendance_by_date[] = [\n 'present' => $total_present,\n 'absent' => $total_users_allocated - $total_present,\n 'date' => $data->clock_in_date\n ];\n }\n return view('essentials::attendance.attendance_by_date_data')->with(compact('attendance_by_date'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the height for the nth image of the list
protected function get_image_height($index){ if(isset($this->timthumb_opts['h'])){ return $this->timthumb_opts['h']; } elseif(is_int($this->images[$index])){ $image = wp_get_attachment_image_src($this->images[$index], $this->media_dimension); if(!empty($image[2])){ return $image[2]; } } elseif(is_object($this->images[$index])){ $image = wp_get_attachment_image_src($this->images[$index]->ID, $this->media_dimension); if(!empty($image[2])){ return $image[2]; } } elseif(is_array($this->images[$index])){ if(isset($this->images[$index]['height'])) return $this->images[$index]['height']; } return '100%'; }
[ "public function getImageHeight();", "public function getImageHeight()\n\t{\n\t\treturn $this->info['height'];\n\t}", "public function getHeight() {\n return $this->imageInfo['height'];\n }", "function get_height($image) {\r\n\t$size = getimagesize($image);\r\n\t$height = $size[1];\r\n\treturn $height;\r\n }", "public function getHeight() {\n\t\treturn $this->image['height'];\n\t}", "protected function getImageHeight()\n\t\t{\n\t\t\treturn $this->image_height;\n\t\t}", "public function getImageHeight()\n {\n return $this->image_height;\n }", "public function getHeight(){\n\t\tif(file_exists($this->pathOrigin)){\n\t\t\t$size=getimagesize($this->pathOrigin);\n\t\t\treturn $size[1];\n\t\t}\n\t\telse\n\t\t\t return 0;\n\t}", "function get_height_by_number($number)\n\t{\n\t\treturn $this->call(\"Image.GetHeightByNumber?number=\".urlencode($number));\n\t}", "public function getMaxImageHeight();", "public function getThumbnailHeight(): int\n {\n return $this->thumbnailHeight;\n }", "function getHeight() {\n return $this->thumbHeight;\n }", "public function get_height();", "public function getThumbnailHeight() {\n\t\treturn $this->getStoreConfig(\"titan/category/image_height\");\n\t}", "public function getImageHeight()\n {\n return ['minheight' => $this->_minheight, 'maxheight' => $this->_maxheight];\n }", "function get_smiley_height($src)\n{\n\treturn get_smiley_dim($src, 1);\n}", "function ofn_learnable_tile_height($image_meta) {\n $tile_width = 364;\n $ratio = $image_meta['height'] / $image_meta['width'];\n\n return round($tile_width * $ratio);\n}", "public function get_thumbnail_h()\r\n\t{\r\n\t\treturn $this->thumbnail_height;\r\n\t}", "public function get_thumbnail_height()\r\n\t{\r\n\t\treturn $this->thumbnail_height;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the setNoConvEuro() method.
public function testSetNoConvEuro() { $obj = new Historiquehpnl(); $obj->setNoConvEuro(true); $this->assertEquals(true, $obj->getNoConvEuro()); }
[ "public function getNoConvEuro(): ?bool {\n return $this->noConvEuro;\n }", "public function testSetCurrencyInvalid() {\n\t\tShopCurrencyLib::setCurrency('invalid');\n\t}", "public function testProcessWithEuroSignWithDisabledReplace()\n {\n $oOutput = oxNew('oxOutput');\n\n $this->assertEquals('�someting', $oOutput->process('�someting', 'something'));\n }", "public function setNoConvEuro(?bool $noConvEuro): Historiquehpnl {\n $this->noConvEuro = $noConvEuro;\n return $this;\n }", "public function testConvertMethodWrongAmount()\n {\n \t$currencyExchangeRateMock = $this->getMockBuilder(\"App\\Models\\CurrencyExchangeRateService\")->getMock();\n\t\t$currencyExchangeRateMock->expects($this->any())\n \t\t->method(\"getExchangeRate\")\n \t\t->will($this->returnValue(1.0));\n\n\t\t$currencyConverter = new DefaultCurrencyConverter($currencyExchangeRateMock);\n\n\t\t$this->assertFalse($currencyConverter->convert('€','any'));\n\n }", "public function testSetComptePerteEuro() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setComptePerteEuro(\"comptePerteEuro\");\n $this->assertEquals(\"comptePerteEuro\", $obj->getComptePerteEuro());\n }", "public function testConvertEuroToEuro()\n {\n $webService = new CurrencyWebservice();\n $converter = new CachedCurrencyConverter($webService);\n $amount = 100.23;\n\n $this->assertEquals(\n $amount,\n $converter->convert($amount, Currency::EUR,Currency::EUR, '19/03/2019')\n );\n }", "public function testResetCurrency()\n {\n }", "public function test_get_bad_currency(){\n\n\t\t$this->assertFalse( APP_Currencies::get_currency( 'not-a-real-currency' ) );\n\n\t}", "public function testSetValeurEuros() {\n\n $obj = new CreditsBails();\n\n $obj->setValeurEuros(10.092018);\n $this->assertEquals(10.092018, $obj->getValeurEuros());\n }", "public function testTransferCurrency()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testSetCptaElitEuros() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setCptaElitEuros(true);\n $this->assertEquals(true, $obj->getCptaElitEuros());\n }", "public function testSetNoChronoPreparation() {\n\n $obj = new CompteurEcritures();\n\n $obj->setNoChronoPreparation(10);\n $this->assertEquals(10, $obj->getNoChronoPreparation());\n }", "public function testSetCrValeurEuros() {\n\n $obj = new CreditsBails();\n\n $obj->setCrValeurEuros(10.092018);\n $this->assertEquals(10.092018, $obj->getCrValeurEuros());\n }", "public function testConvertKunaToEuro()\n {\n $webService = new CurrencyWebservice();\n $converter = new CachedCurrencyConverter($webService);\n $amount = 100.23;\n\n $result = $converter->convert($amount, 'HKR',Currency::EUR, '19/03/2019');\n $this->assertEquals(-1, $result);\n }", "public function testWithoutCurrencyCodeIsValid(): void\n {\n self::assertTrue(Currency::isValidCode(Currencies::WITHOUT_CURRENCY_CODE_GGP));\n }", "public function FilterUserByCurrencyFalse()\n {\n $expected = $this->usersFilter->filterByCurrency(\"AED\",\"USD\");\n $this->assertFalse($expected);\n }", "public function testSetDucsFrancEuro() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setDucsFrancEuro(\"ducsFrancEuro\");\n $this->assertEquals(\"ducsFrancEuro\", $obj->getDucsFrancEuro());\n }", "public function testNoCurrencyExchange()\n {\n $extension = new PriceExtension('', '.', '', '', '', 'EUR', null, []);\n\n $this->assertEquals('', $extension->getFormattedPrice(2, 0, 'a', 'b'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets stat information about the file descriptor fd
function dio_stat($fd) { }
[ "function dio_stat($fd) {}", "public function getStat()\n {\n return fstat($this->stream);\n }", "function fstat($fp) {}", "function stream_stat() \n {\n // we already have collected the needed information \n // in stream_open() :)\n return $this->stat;\n }", "public function getStat()\n {\n if ($this->exists()) {\n $flags = $this->getFlags();\n $stats = @stat($this->getRealPath());\n if ($stats) {\n foreach ($stats as $i=>$val) {\n if (!is_string($i)) {\n unset($stats[$i]);\n } else {\n if ((self::STAT_DATETIME_FIELD & $this->flags) && in_array($i, array('atime', 'mtime', 'ctime'))) {\n $stats[$i.'DateTime'] = WebFilesystem::getDateTimeFromTimestamp($val);\n } elseif ((self::STAT_SIZE_FIELD & $this->flags) && $i==='size') {\n $stats[$i.'Transformed'] = WebFilesystem::getTransformedFilesize($val);\n }\n }\n }\n }\n return $stats;\n }\n return null;\n }", "public function getStat($fileName);", "public function getStat(): array\n {\n return stat($this->pathName);\n }", "function stat()\n {\n $stats = fstat($this->stream);\n return new Stat($stats);\n }", "public function getFd() {\n\t\treturn $this->_fd;\n\t}", "public function testFstatReturnsSizeInformation()\n {\n $handle = fopen($this->stream, 'rb+');\n $info = fstat($handle);\n fclose($handle);\n $this->assertInternalType('array', $info);\n $expectedSize = strlen(self::INITIAL_CONTENT);\n $this->assertArrayHasKey(7, $info, 'Missing numerical key.');\n $this->assertArrayHasKey('size', $info, 'Missing associative key.');\n $this->assertEquals($expectedSize, $info[7]);\n $this->assertEquals($expectedSize, $info['size']);\n }", "public function fd () {\n return $this->fd;\n }", "public function getFileStat(string $path): stdClass;", "public function stat($path)\n {\n return ssh2_sftp_stat($this->getResource(), $path);\n }", "function link_stat ($filename)\n{\n return lstat($filename);\n}", "public function url_stat($uri,$flags,$fstat=false)\n{\n\\PHK\\Tools\\Util::trace(\"Entering url_stat($uri,$flags,$fstat)\");//TRACE\n\ntry\n{\n$this->raiseErrors=!($flags & STREAM_URL_STAT_QUIET);\n\n// If we are coming from stream_fstat(), the uri is already parsed.\n\nif (!$fstat)\n\t{\n\tself::parseURI($uri,$this->command,$this->params,$this->mnt\n\t\t,$this->path);\n\n\tif (!is_null($this->mnt)) \\PHK\\Mgr::validate($this->mnt);\n\t}\n\n$cacheID=\\PHK\\Cache::cacheID('stat',$uri);\nif (is_null($data=\\PHK\\Cache::get($cacheID)))\t// Miss - Slow path\n\t{\n\t\\PHK\\Tools\\Util::trace(\"url_stat($uri): not found in cache\");//TRACE\n\ttry\n\t\t{\n\t\t$cache=true;\n\t\t$mode=$size=$mtime=null;\n\t\tBackend::getStatData($this->mnt,$this->command\n\t\t\t,$this->params,$this->path,$cache,$mode,$size,$mtime);\n\t\t$data=array($mode,$size,$mtime);\n\t\t}\n\tcatch (\\Exception $e) // Mark entry as non-existent\n\t\t{\n\t\t\\PHK\\Tools\\Util::trace(\"url_stat($uri): lookup failed\");//TRACE\n\t\t$data='';\n\t\t}\n\n\tif ($cache && (!is_null($this->mnt)) && \\PHK\\Mgr::cacheEnabled($this->mnt\n\t\t,$this->command,$this->params,$this->path))\n\t\t{\n\t\t\\PHK\\Cache::set($cacheID,$data);\n\t\t}\n\t}\n\nif (is_array($data))\n\t{\n\tlist($mode,$size,$mtime)=$data;\n\treturn self::statArray($mode,$size,$mtime);\n\t}\nelse throw new \\Exception('File not found');\t// Negative hit\n}\ncatch (\\Exception $e)\n\t{\n\t$msg=$uri.': PHK Stat error - '.$e->getMessage();\n\t$this->raiseWarning($msg);\n\treturn false;\n\t}\n}", "public function getStatisticsFileInfo()\n {\n // $result = fread($fp, filesize(dirname(__FILE__) . '/statistics.txt'));\n // fclose($fp);\n // return $result;\n }", "private function getStat(File $file) {\n clearstatcache();\n\n $path = $this->getLocalPath($file);\n\n return @ssh2_sftp_lstat($this->getConnection(), $path);\n }", "function stat_fn( $filename ) {\n echo \"\\n-- File '$filename' --\\n\";\n echo \"-- File access time is => \"; \n echo fileatime($filename).\"\\n\";\n clearstatcache();\n echo \"-- File modification time is => \"; \n echo filemtime($filename).\"\\n\";\n clearstatcache();\n echo \"-- inode change time is => \"; \n echo filectime($filename).\"\\n\";\n clearstatcache();\n \n\n}", "public function url_stat($path, $flags)\n\t{\n\t\t//throw new Exception(\"url_stat\");\n\n\t\t$logErrors = !($flags & STREAM_URL_STAT_QUIET);\n\n\t\t$linkInfoOnly = $flags & STREAM_URL_STAT_LINK;\n\n\t\t$isFile = FALSE;\n\t\t$isDir = FALSE;\n\n\t\t$urlParts = self::parseURL($path);\n\t\tif (!$urlParts) return FALSE;\n\t\tif (!is_int($urlParts[self::FDBP_URL_RESOURCE_ID]) && !is_int($urlParts[self::FDBP_URL_EFFECTIVE_DATE]))\n\t\t{\n\t\t\t$isDir = TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$isFile = TRUE;\n\t\t}\n\n\t\t$isReadable = TRUE;\n\t\t$isWritable = TRUE;\n\n\t\t$size = 0;\n\n\t\tif ($isFile)\n\t\t{\n\t\t\t$file = new Flex_Database_Protocol();\n\t\t\t$p = \"\";\n\t\t\t$isReadable = $file->stream_open($path, \"r\", 0, $p);\n\t\t\tif (!$isReadable)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$stat = $file->stream_stat();\n\t\t\t$urlParts[self::FDBP_URL_EFFECTIVE_DATE] = $stat[\"mtime\"];\n\t\t\t$size = $stat[\"size\"];\n\t\t\t$urlParts[self::FDBP_URL_RESOURCE_ID] = $stat[\"resource_id\"];\n\n\t\t\t$file->stream_close();\n\t\t\t$isWritable = $file->stream_open($path, \"r+\", 0, $p);\n\t\t\t$file->stream_close();\n\t\t}\n\n\t\t$mode = 0;\n\t\tif ($isFile)\n\t\t{\n\t\t\t$mode = 0100000 | 0444 | ($isWritable ? 0200 : 0);\n\t\t}\n\t\tif ($isDir)\n\t\t{\n\t\t\t$mode = 040000 | 0444 | 0200 | 0100;\n\t\t}\n\n\t\t$return = array\n\t\t(\n\t\t\t\"customer_group_id\" => $urlParts[self::FDBP_URL_CUSTOMER_GROUP_ID],\n\t\t\t\"effective_date\" => $urlParts[self::FDBP_URL_EFFECTIVE_DATE],\n\t\t\t\"resource_id\" => $urlParts[self::FDBP_URL_RESOURCE_ID],\n\n\t\t\t//*** WIP *** See http://au.php.net/manual/en/function.stat.php for more details on what is required here!\n\n\t\t\t// device number\n\t\t\t0\t\t=> 0,\n\t\t\t\"dev\"\t=> 0,\n\n\t\t\t// inode number\n\t\t\t1\t\t=> 0,\n\t\t\t\"ino\"\t=> 0,\n\n\t\t\t// inode protection mode\n\t\t\t2\t\t=> $mode,\n\t\t\t\"mode\"\t=> $mode,\n\n\t\t\t// number of links\n\t\t\t3\t\t=> 0,\n\t\t\t\"nlink\"\t=> 0,\n/*\t\t\tSeemed to cause errors with is_readable (uses real user and group ids against psuedos)\n\t\t\t// userid of owner\n\t\t\t4\t\t=> $urlParts[self::FDBP_URL_RESOURCE_ID],\n\t\t\t\"uid\"\t=> $urlParts[self::FDBP_URL_RESOURCE_ID],\n\n\t\t\t// groupid of owner\n\t\t\t5\t\t=> $urlParts[self::FDBP_URL_CUSTOMER_GROUP_ID],\n\t\t\t\"gid\"\t=> $urlParts[self::FDBP_URL_CUSTOMER_GROUP_ID],\n*/\n\t\t\t// userid of owner\n\t\t\t4\t\t=> 0,\n\t\t\t\"uid\"\t=> 0,\n\n\t\t\t// groupid of owner\n\t\t\t5\t\t=> 0,\n\t\t\t\"gid\"\t=> 0,\n\n\t\t\t// device type, if inode device *\n\t\t\t6\t\t=> -1,\n\t\t\t\"rdev\"\t=> -1,\n\n\t\t\t// size in bytes\n\t\t\t7\t\t=> $size,\n\t\t\t\"size\"\t=> $size,\n\n\t\t\t// time of last access (Unix timestamp)\n\t\t\t8\t\t=> $urlParts[self::FDBP_URL_EFFECTIVE_DATE],\n\t\t\t\"atime\"\t=> $urlParts[self::FDBP_URL_EFFECTIVE_DATE],\n\n\t\t\t// time of last modification (Unix timestamp)\n\t\t\t9\t\t=> $urlParts[self::FDBP_URL_EFFECTIVE_DATE],\n\t\t\t\"mtime\"\t=> $urlParts[self::FDBP_URL_EFFECTIVE_DATE],\n\n\t\t\t// time of last inode change (Unix timestamp)\n\t\t\t10\t\t=> $urlParts[self::FDBP_URL_EFFECTIVE_DATE],\n\t\t\t\"ctime\"\t=> $urlParts[self::FDBP_URL_EFFECTIVE_DATE],\n\n\t\t\t// blocksize of filesystem IO *\n\t\t\t11\t\t\t=> -1,\n\t\t\t\"blksize\"\t=> -1,\n\n\t\t\t// number of blocks allocated *\n\t\t\t12\t\t\t=> -1,\n\t\t\t\"blocks\"\t=> -1,\n\t\t);\n\n\t\t//var_dump($return);\n\n\t\treturn $return;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Build a card for a page in the results of an autocomplete field.
public static function onPageAutocompleteCard(AbstractPage $page, string $query = null): array { $name = $page->name(); $url = $page->url(); if ($query) { $words = preg_split('/ +/', trim($query)); foreach ($words as $word) { $word = preg_quote($word, '/'); $name = preg_replace('/' . $word . '/i', '<strong>$0</strong>', $name); } } return [ 'html' => '<div class="title">' . $name . '</div><div class="url">' . $url . '</div>', 'value' => $page->uuid(), 'class' => 'page' ]; }
[ "abstract public function buildPage();", "abstract function buildPage();", "private function generateCards(){\n $name = ['Prof. Day', 'Prof. Enbody', 'Prof. McCullen', 'Prof. Onsay', 'Prof. Owen', 'Prof. Plum',\n 'Beaumont Tower', 'Breslin Center', 'Engineering Building', 'International Center',\n 'Library', 'Art Museum', 'Spartan Stadium', 'University Union', 'Wharton Center',\n 'Final Exam', 'Midterm Exam', 'Programming Assignment', 'Project', 'Quiz', 'Writing Assignment'];\n\n\n $image = ['day', 'enbody', 'mccullen', 'onsay', 'owen', 'plum',\n 'beaumont', 'breslin', 'engineering', 'international',\n 'library', 'museum', 'stadium', 'union', 'wharton',\n 'final', 'midterm', 'programming', 'project', 'quiz', 'written'];\n\n for ($i = 0; $i < 21; $i++) {\n if ($i < 6) {\n $type = 'Person';\n } else if ($i < 15) {\n $type = 'Place';\n } else {\n $type = 'Weapon';\n }\n $newCard = new Card($type, $name[$i],\"images/\".$image[$i].\".jpg\");\n $this->addCard($newCard);\n }\n }", "function cardLoaderHelper(stdClass $quote, int $i, stdClass $author) : void {\n if (strlen($quote->quote) >= 100) { //if quote is too long\n $quote->quote = substr($quote->quote, 0, 100).\"...\"; //truncate it to make the card look better\n }\n ?> <a href=\"detail.php?id=<?=$i?>\" class=\"text-decoration-none\" style=\"max-width: 540px;\">\n <div class=\"card mb-3 w-100\">\n <div class=\"row g-0\">\n <div class=\"col-md-4 py-md-2 d-flex justify-content-center align-items-center\">\n <!--placeholder for initials, to be intro\\'d later-->\n <img src=\"<?=$author->img?>\" class=\"img-fluid ml-md-3 rounded-start img-thumbnail my-img-class\" alt=\"...\">\n </div>\n <div class=\"col-md-8\">\n <div class=\"card-body\">\n <p class=\"card-text text-dark\"><?=$quote->quote?></p>\n <h5 class=\"card-title text-dark\"><?=$author->fName?> <?=$author->lName?></h5>\n </div>\n </div>\n </div>\n </div>\n </a>\n <?php\n}", "function make_ui_card($options, $generic_content, $cardtype)\r\n {\r\n\r\n if ($this->card[$this->number_of_cards-1][\"type\"] == HAW_HDML_DISPLAY)\r\n {\r\n // current card is display card\r\n\r\n // ==> make an entry/choice card out of it\r\n $this->card[$this->number_of_cards-1][\"type\"] = $cardtype;\r\n\r\n // append options to the already existing ones\r\n if (!isset($this->card[$this->number_of_cards-1][\"options\"]))\r\n $this->card[$this->number_of_cards-1][\"options\"] = \"\";\r\n\r\n $this->card[$this->number_of_cards-1][\"options\"] .= $options;\r\n\r\n // append received content to the already existing one\r\n if (!isset($this->card[$this->number_of_cards-1][\"display_content\"]))\r\n $this->card[$this->number_of_cards-1][\"display_content\"] = \"\";\r\n\r\n $this->card[$this->number_of_cards-1][\"display_content\"] .= $generic_content;\r\n }\r\n else\r\n {\r\n // current card is already entry or choice card\r\n // ==> create new entry/choice card\r\n // ==> link current card to this new entry/choice card\r\n\r\n $this->card[$this->number_of_cards][\"type\"] = $cardtype;\r\n\r\n $cardname = sprintf(\" name=\\\"%d\\\"\", $this->number_of_cards+1);\r\n\r\n if (!isset($this->card[$this->number_of_cards][\"options\"]))\r\n $this->card[$this->number_of_cards][\"options\"] = \"\";\r\n\r\n $this->card[$this->number_of_cards][\"options\"] .= $cardname;\r\n\r\n if ($this->title)\r\n $this->card[$this->number_of_cards][\"options\"] .= \" title=\\\"$this->title\\\"\";\r\n\r\n $this->card[$this->number_of_cards][\"options\"] .= $options;\r\n\r\n $this->card[$this->number_of_cards][\"display_content\"] = $generic_content;\r\n\r\n $action = sprintf(\"<action type=\\\"accept\\\" task=\\\"go\\\" dest=\\\"#%d\\\">\\n\",\r\n $this->number_of_cards+1);\r\n $this->card[$this->number_of_cards-1][\"action\"] = $action;\r\n\r\n $this->number_of_cards++;\r\n }\r\n }", "private static function addAutoComplete(){\n\t\tSMWOutputs::requireResource( 'jquery.ui.autocomplete' );\n\n\t\t$javascript_autocomplete_text = <<<END\n<script type=\"text/javascript\">\njQuery(document).ready(function(){\n\tjQuery(\"#page_input_box\").autocomplete({\n\t\tminLength: 3,\n\t\tsource: function(request, response) {\n\t\t\tjQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace=0&format=jsonfm&search='+request.term, function(data){\n\t\t\t\tresponse(data[1]);\n\t\t\t});\n\t\t}\n\t});\n});\n</script>\n\nEND;\n\n\t\tSMWOutputs::requireScript( 'smwAutocompleteSpecialBrowse', $javascript_autocomplete_text );\n\t}", "public function loadCardList()\n\t {\n\t \t$sql = \"SELECT * FROM cards LIMIT 3\";\n\t\t\n\t\tforeach ($this->_db->query($sql) as $row)\n\t\t{\n\t\t\t$imgSrc = \"img/cards/\".$row['EdNumber'].\".jpg\";\n\t\t\t$textToEnter = <<<CARTA\n<li>\n\t<img src=\"$imgSrc\" width=\"100\" height=\"144\" />\n\t<span class=\"text-content_a\">\n\t\t<span>\n\t\t\t<a href=\"#\"><i class=\"fa fa-plus\"></i></a>\n\t\t</span>\n\t\t<span>\n\t\t\t<a href=\"#\"><i class=\"fa fa-minus\"></i></a>\n\t\t</span>\n\t\t<span>\n\t\t\t<a data-toggle=\"modal\" data-target=\"#myModal\"><i class=\"fa fa-info\"></i></a>\n\t\t</span>\n\t</span>\n</li>\nCARTA;\n\t\t\t\n\t\t\techo $textToEnter;\n\t\t}\n\t }", "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}", "public function makeCard() {\n echo '<div class=\"gameCard\">\n <div class=\"thumbnailContainer\">\n <img class=\"thumbnail\" src=\"'. htmlentities($this->imgSource) .'\" alt=\"Picture of the Game\" />\n </div>\n <div class=\"cardInfo\">\n <h3 class=\"gameTitle\">'. htmlentities($this->gameName) .'</h3>\n <p class=\"publisher\">'. htmlentities($this->publisher) .'</p>\n <div class=\"crudIcon\">\n <a class=\"icon-link\" href=\"../lib/delete.php?id='.$this->id.'&image-src='.$this->imgSource.'\"><img class=\"icon\" src=\"../public/images/bin.png\" alt=\"delete icon\" /></a>\n <a class=\"icon-link\" href=\"../view/edit.php?name='.urlencode($this->gameName).'&publisher='.urlencode($this->publisher).'\"><img class=\"icon\" src=\"../public/images/penIcon.png\" alt=\"edit icon\" /></a>\n </div>\n </div>\n </div>';\n }", "public static function ajaxSearchCards () {\n $args = [\n 'post_type' => 'travelcard',\n 'post_status' => 'publish',\n 'numberposts' => -1\n ];\n\n $category = isset($_GET['category']) ? $_GET['category'] : null;\n $tag = isset($_GET['tag']) ? $_GET['tag'] : null;\n if ($tag && $category) {\n $args['tax_query'] = array(\n 'relation' => 'AND',\n array(\n 'taxonomy' => 'card_category',\n 'field' => 'slug',\n 'terms' => $category,\n ),\n array(\n 'taxonomy' => 'card_tag',\n 'field' => 'slug',\n 'terms' => $tag,\n )\n );\n } elseif ($tag) {\n \n $args['tax_query'] = array(\n array(\n 'taxonomy' => 'card_tag',\n 'field' => 'slug',\n 'terms' => $tag,\n )\n );\n } elseif ($category) {\n $args['tax_query'] = array(\n array(\n 'taxonomy' => 'card_category',\n 'field' => 'slug',\n 'terms' => $category,\n )\n );\n }\n $search = isset($_GET['search']) ? $_GET['search'] : null;\n if ($search) {\n $args['s'] = $search;\n }\n\n $posts = get_posts($args);\n \n include __DIR__ . '/templates/cards-ajax.php';\n wp_die();\n }", "function getAlbumCards($userId){\n $albums = getAllUserAlbums($userId);\n if(count($albums) == 0){\n return \"<br><p class='text-center'>You do not currently have any albums. Click <a href='AddAlbum.php'>here</a> to create one.</p>\"; \n }\n \n $returnHTML = \"<p class='text-muted'>Click an Album's title to view its photos.</p><div class='controlHolder'><a href='AddAlbum.php'>Create an album</a><button class='updateAccessibilitiesBtn btn-sm btn-primary' \"\n . \"type='submit' name='updateAccessibilities'>Update Accessibilities</button></div><div class='card-deck justify-content-center'>\";\n foreach($albums as $album){\n $albumId = $album->getAlbumId();\n $pictures = getAlbumPictures($album->getAlbumId());\n \n $albumTitle = $album->getTitle();\n $albumDescription = $album->getDescription() == null ? \"<em>No description</em>\" : $album->getDescription();\n $photoCount = count($pictures) == 1 ? count($pictures) . \" photo\" : count($pictures) . \" photos\";\n $uploadDate = $album->getDateUpdated();\n $accessibilityDropdown = getAccessibilityDropdown($album->getAccessibilityCode());\n \n $card = <<<HEREDOC\n <div class=\"col-lg-4 col-sm-6 col-xs-12 d-flex\">\n <div class='card bg-light mb-3 mt-3 mx-auto' id='$albumId'>\n <div class=\"card-body\">\n <h5 class=\"card-title\"><button class='linkButton' type='submit' name='view' value='$albumId'</button>$albumTitle</h5>\n <p class=\"card-text\">$albumDescription</p>\n </div>\n <div class=\"card-footer\">\n <p class=\"card-text\">$photoCount</p>\n <p class=\"card-text\"><b>Uploaded:</b> $uploadDate</p>\n <p class=\"card-text\"><b>Accessible by:</b> \n <select type='text' class='form-control smallSelect' name='accessibility$albumId'>\n $accessibilityDropdown\n </select>\n </p>\n <div class=\"buttonCardContainer\">\n <button class=\"btn-danger btn-sm deleteAlbumBtn\" OnClick=\"confirmDelete('$albumTitle', $albumId)\" type=\"button\" value=\"$albumId\">Delete Album</button>\n </div>\n </div>\n </div>\n </div>\nHEREDOC;\n $returnHTML .= $card;\n }\n \n $returnHTML .= \"<input type='hidden' id='deleteAlbumIdInput' name='delete' value=''</div>\";\n return $returnHTML;\n}", "function get_location_card($location_id = null, $distance = null) {\n $html = '';\n \n if ($location_id) {\n $img = get_field('mobile_image', $location_id) ? get_field('mobile_image', $location_id) : get_field('image', $location_id);\n $is_coming_soon = (get_field('location_status', $location_id) == 'coming_soon') ? true : false;\n ob_start();\n ?>\n <a class=\"location-card <?php if ($is_coming_soon) { echo 'is-coming-soon'; } ?> d-block\" href=\"<?php echo get_the_permalink($location_id); ?>\" title=\"<?php echo get_the_title($location_id); ?>\">\n <div class=\"location-card__inner u-rel\">\n <div class=\"u-border-img\">\n <div class=\"u-border-img__img-container\">\n <img class=\"location-card__img\" src=\"<?php echo $img['sizes']['medium']; ?>\" srcset=\"<?php echo generate_srcset($img['sizes']); ?>\" alt=\"<?php echo $img['alt']; ?>\" loading=\"lazy\">\n </div>\n <div class=\"location-card__img-gradient\"></div>\n <span class=\"line-border\"></span>\n </div>\n \n <h2><span class=\"title-bg\"><?php echo get_the_title($location_id); ?>&nbsp; &nbsp;\n <div class=\"arrow d-inline-block u-rel\">\n <img class=\"arrow-1\" src=\"<?php echo get_icon('arrow--red.svg'); ?>\" alt=\"Arrow\">\n <img class=\"arrow-2\" src=\"<?php echo get_icon('arrow--red.svg'); ?>\" alt=\"Arrow\">\n </div>\n </h2>\n <h2><span class=\"title-text\"><?php echo get_the_title($location_id); ?>&nbsp; &nbsp;\n <div class=\"arrow d-inline-block u-rel\">\n <img class=\"arrow-1\" src=\"<?php echo get_icon('arrow--red.svg'); ?>\" alt=\"Arrow\">\n <img class=\"arrow-2\" src=\"<?php echo get_icon('arrow--red.svg'); ?>\" alt=\"Arrow\">\n </div>\n </h2>\n \n <?php if ($is_coming_soon) : ?>\n <span class=\"location-card__overlay | u-fluid d-flex flex-center\">\n <p class=\"location-card__overlay__text d-flex flex-center t-center\"><?php echo $coming_soon_text = (get_field('coming_soon_text', $location_id)) ? get_field('coming_soon_text', $location_id) : 'Coming Soon'; ?></p>\n </span>\n <?php endif; ?>\n\n <?php if ($distance && ! $is_coming_soon) : \n $distance_text = ($distance < 1) ? round($distance, 1) : round($distance, 0);\n $distance_text .= ($distance < 1.5) ? ' mile away' : ' miles away'\n ?>\n <p class=\"location-card__distance\"><?php echo $distance_text; ?></p>\n <?php endif; ?>\n </div>\n </a>\n <?php\n $html = ob_get_clean();\n }\n\n return $html;\n}", "public function fetchNewCards()\n {\n $user = Auth::user();\n $html = '';\n $cardData = $this->user->fetchNewCards(['type' => Input::get('type')]);\n switch (Input::get('type')) {\n case 'idea':\n $ideas = $cardData;\n foreach ($ideas as $idea):\n $html .= View::make('user.dashboard.partials.idea.idea-card', compact('idea', 'user'));\n endforeach;\n break;\n case 'challenge':\n $challenges = $cardData;\n foreach ($challenges as $challenge):\n $html .= View::make('user.dashboard.partials.challenge.challenge-card',\n compact('challenge', 'user'));\n endforeach;\n\n break;\n default:\n break;\n }\n return Response::json([\n 'status' => 'success',\n 'html' => $html\n ]);\n }", "private function front_page()\n {\n $this->crud->addField([\n 'name' => 'meta_title',\n 'label' => trans('backpack::pagemanager.meta_title'),\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => 'Meta informatie',\n ]);\n $this->crud->addField([\n 'name' => 'meta_description',\n 'label' => trans('backpack::pagemanager.meta_description'),\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => 'Meta informatie',\n ]);\n $this->crud->addField([\n 'name' => 'meta_keywords',\n 'type' => 'textarea',\n 'label' => trans('backpack::pagemanager.meta_keywords'),\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => 'Meta informatie',\n ]);\n $this->crud->addField([\n 'name' => 'content',\n 'label' => trans('backpack::pagemanager.content'),\n 'type' => 'wysiwyg',\n 'placeholder' => trans('backpack::pagemanager.content_placeholder'),\n 'tab' => 'Header',\n ]);\n $this->crud->addField([\n 'name' => 'image',\n 'label' => 'Afbeelding header',\n 'type' => 'image',\n 'crop' => 'true',\n 'aspect_ratio' => 0,\n 'upload' => true,\n 'disk' => 'uploads',\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => 'Header',\n ]);\n $this->crud->addField([ // CustomHTML\n 'name' => 'title_usp1',\n 'label' => 'USP 1',\n 'type' => 'text',\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"USP's\",\n ]);\n $this->crud->addField([ // CustomHTML\n 'name' => 'title_usp2',\n 'label' => 'USP 2',\n 'type' => 'text',\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"USP's\",\n ]);\n $this->crud->addField([ // CustomHTML\n 'name' => 'title_usp3',\n 'label' => 'USP 3',\n 'type' => 'text',\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"USP's\",\n ]);\n $this->crud->addField([\n 'name' => 'content_text_title',\n 'label' => trans('Titel'),\n 'type' => 'text',\n 'placeholder' => trans('backpack::pagemanager.content_placeholder'),\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"Content blok 1\",\n ]);\n $this->crud->addField([\n 'name' => 'content_text_block',\n 'label' => trans('backpack::pagemanager.content'),\n 'type' => 'wysiwyg',\n 'placeholder' => trans('backpack::pagemanager.content_placeholder'),\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"Content blok 1\",\n ]);\n $this->crud->addField([\n 'name' => 'content_text_block_grey_title',\n 'label' => trans('Titel'),\n 'type' => 'text',\n 'placeholder' => trans('backpack::pagemanager.content_placeholder'),\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"Content blok 2\",\n ]);\n $this->crud->addField([\n 'name' => 'content_text_block_grey',\n 'label' => trans('backpack::pagemanager.content'),\n 'type' => 'wysiwyg',\n 'placeholder' => trans('backpack::pagemanager.content_placeholder'),\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"Content blok 2\",\n ]);\n\n $this->crud->addField([\n \t'name' => 'goal_1',\n\t 'label' => 'Doel 1',\n\t 'type' => 'select2',\n\t 'entity' => 'page',\n\t 'attribute' => 'title',\n\t 'model' => 'App\\Models\\Page',\n\t 'tab' => 'Doelen',\n\t 'fake' => true,\n\t 'store_in' => 'extras',\n ]);\n\t $this->crud->addField([\n 'name' => 'goal_1_title',\n 'label' => 'Titel doel 1',\n 'type' => 'text',\n 'placeholder' => 'Titel doel 1',\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => 'Doelen',\n ]);\n $this->crud->addField([\n 'name' => 'goal_1_img',\n 'label' => 'Afbeelding doel 1',\n 'type' => 'image',\n 'upload' => true,\n 'crop' => true,\n 'aspect_ratio' => 2,\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => 'Doelen',\n ]);\n\t $this->crud->addField([\n 'name' => 'separator_1',\n 'type' => 'custom_html',\n 'value' => '<hr>',\n 'tab' => 'Doelen',\n ]);\n\n\t $this->crud->addField([\n\t\t 'name' => 'goal_2',\n\t\t 'label' => 'Doel 2',\n\t\t 'type' => 'select2',\n\t\t 'entity' => 'page',\n\t\t 'attribute' => 'title',\n\t\t 'model' => 'App\\Models\\Page',\n\t\t 'tab' => 'Doelen',\n\t\t 'fake' => true,\n\t\t 'store_in' => 'extras',\n\t ]);\n\t $this->crud->addField([\n\t\t 'name' => 'goal_2_title',\n\t\t 'label' => 'Titel doel 2',\n\t\t 'type' => 'text',\n\t\t 'placeholder' => 'Titel doel 1',\n\t\t 'fake' => true,\n\t\t 'store_in' => 'extras',\n\t\t 'tab' => 'Doelen',\n\t ]);\n\t $this->crud->addField([\n\t\t 'name' => 'goal_2_img',\n\t\t 'label' => 'Afbeelding doel 2',\n\t\t 'type' => 'image',\n\t\t 'upload' => true,\n\t\t 'crop' => true,\n\t\t 'aspect_ratio' => 2,\n\t\t 'fake' => true,\n\t\t 'store_in' => 'extras',\n\t\t 'tab' => 'Doelen',\n\t ]);\n\t $this->crud->addField([\n\t\t 'name' => 'separator_2',\n\t\t 'type' => 'custom_html',\n\t\t 'value' => '<hr>',\n\t\t 'tab' => 'Doelen',\n\t ]);\n\n\t $this->crud->addField([\n\t\t 'name' => 'goal_3',\n\t\t 'label' => 'Doel 3',\n\t\t 'type' => 'select2',\n\t\t 'entity' => 'page',\n\t\t 'attribute' => 'title',\n\t\t 'model' => 'App\\Models\\Page',\n\t\t 'tab' => 'Doelen',\n\t\t 'fake' => true,\n\t\t 'store_in' => 'extras',\n\t ]);\n\t $this->crud->addField([\n\t\t 'name' => 'goal_3_title',\n\t\t 'label' => 'Titel doel 3',\n\t\t 'type' => 'text',\n\t\t 'placeholder' => 'Titel doel 3',\n\t\t 'fake' => true,\n\t\t 'store_in' => 'extras',\n\t\t 'tab' => 'Doelen',\n\t ]);\n\t $this->crud->addField([\n\t\t 'name' => 'goal_3_img',\n\t\t 'label' => 'Afbeelding doel 3',\n\t\t 'type' => 'image',\n\t\t 'upload' => true,\n\t\t 'crop' => true,\n\t\t 'aspect_ratio' => 2,\n\t\t 'fake' => true,\n\t\t 'store_in' => 'extras',\n\t\t 'tab' => 'Doelen',\n\t ]);\n\t $this->crud->addField([\n\t\t 'name' => 'separator_3',\n\t\t 'type' => 'custom_html',\n\t\t 'value' => '<hr>',\n\t\t 'tab' => 'Doelen',\n\t ]);\n\n\t $this->crud->addField([\n\t\t 'name' => 'goal_4',\n\t\t 'label' => 'Doel 4',\n\t\t 'type' => 'select2',\n\t\t 'entity' => 'page',\n\t\t 'attribute' => 'title',\n\t\t 'model' => 'App\\Models\\Page',\n\t\t 'tab' => 'Doelen',\n\t\t 'fake' => true,\n\t\t 'store_in' => 'extras',\n\t ]);\n\t $this->crud->addField([\n\t\t 'name' => 'goal_4_title',\n\t\t 'label' => 'Titel doel 4',\n\t\t 'type' => 'text',\n\t\t 'placeholder' => 'Titel doel 4',\n\t\t 'fake' => true,\n\t\t 'store_in' => 'extras',\n\t\t 'tab' => 'Doelen',\n\t ]);\n\t $this->crud->addField([\n\t\t 'name' => 'goal_4_img',\n\t\t 'label' => 'Afbeelding doel 4',\n\t\t 'type' => 'image',\n\t\t 'upload' => true,\n\t\t 'crop' => true,\n\t\t 'aspect_ratio' => 2,\n\t\t 'fake' => true,\n\t\t 'store_in' => 'extras',\n\t\t 'tab' => 'Doelen',\n\t ]);\n\n// $this->crud->addField([\n// \t'name' => 'goal_1_title',\n//\t 'label' => 'Titel doel 1',\n//\t 'type' => 'text',\n//\t 'placeholder' => 'Titel doel 1',\n//\t 'fake' => true,\n//\t 'store_in' => 'extras',\n//\t 'tab' => 'Doelen',\n// ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_1_img',\n//\t\t 'label' => 'Afbeelding doel 1',\n//\t\t 'type' => 'image',\n//\t\t 'upload' => true,\n//\t\t 'crop' => true,\n//\t\t 'aspect_ratio' => 2,\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_1_url',\n//\t\t 'label' => 'Link doel 1',\n//\t\t 'type' => 'page_or_link',\n//\t\t 'page_model' => 'App\\Models\\Page',\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t \t'name' => 'separator_1',\n//\t\t 'type' => 'custom_html',\n//\t\t 'value' => '<hr>',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_2_title',\n//\t\t 'label' => 'Titel doel 2',\n//\t\t 'type' => 'text',\n//\t\t 'placeholder' => 'Titel doel 2',\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_2_img',\n//\t\t 'label' => 'Afbeelding doel 2',\n//\t\t 'type' => 'image',\n//\t\t 'upload' => true,\n//\t\t 'crop' => true,\n//\t\t 'aspect_ratio' => 2,\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_2_url',\n//\t\t 'label' => 'Link doel 2',\n//\t\t 'type' => 'page_or_link',\n//\t\t 'page_model' => 'App\\Models\\Page',\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'separator_2',\n//\t\t 'type' => 'custom_html',\n//\t\t 'value' => '<hr>',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_3_title',\n//\t\t 'label' => 'Titel doel 3',\n//\t\t 'type' => 'text',\n//\t\t 'placeholder' => 'Titel doel 3',\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_3_img',\n//\t\t 'label' => 'Afbeelding doel 3',\n//\t\t 'type' => 'image',\n//\t\t 'upload' => true,\n//\t\t 'crop' => true,\n//\t\t 'aspect_ratio' => 2,\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_3_url',\n//\t\t 'label' => 'Link doel 3',\n//\t\t 'type' => 'page_or_link',\n//\t\t 'page_model' => 'App\\Models\\Page',\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'separator_3',\n//\t\t 'type' => 'custom_html',\n//\t\t 'value' => '<hr>',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_4_title',\n//\t\t 'label' => 'Titel doel 4',\n//\t\t 'type' => 'text',\n//\t\t 'placeholder' => 'Titel doel 4',\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_4_img',\n//\t\t 'label' => 'Afbeelding doel 4',\n//\t\t 'type' => 'image',\n//\t\t 'upload' => true,\n//\t\t 'crop' => true,\n//\t\t 'aspect_ratio' => 2,\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n//\t $this->crud->addField([\n//\t\t 'name' => 'goal_4_url',\n//\t\t 'label' => 'Link doel 4',\n//\t\t 'type' => 'page_or_link',\n//\t\t 'page_model' => 'App\\Models\\Page',\n//\t\t 'fake' => true,\n//\t\t 'store_in' => 'extras',\n//\t\t 'tab' => 'Doelen',\n//\t ]);\n\n $this->crud->addField([\n 'name' => 'content_text_block_goals_title',\n 'label' => trans('Titel'),\n 'type' => 'text',\n 'placeholder' => trans('backpack::pagemanager.content_placeholder'),\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"Content blok 3\",\n ]);\n $this->crud->addField([\n 'name' => 'content_text_block_goals',\n 'label' => trans('backpack::pagemanager.content'),\n 'type' => 'wysiwyg',\n 'placeholder' => trans('backpack::pagemanager.content_placeholder'),\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"Content blok 3\",\n ]);\n $this->crud->addField([\n 'name' => 'image2',\n 'label' => 'Afbeelding feiten',\n 'type' => 'image',\n 'crop' => 'true',\n 'aspect_ratio' => 0,\n 'upload' => true,\n 'disk' => 'uploads',\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => 'Feiten',\n ]);\n $this->crud->addField([\n 'name' => 'facts',\n 'label' => 'Feiten',\n 'type' => 'table',\n 'entity_singular' => 'feit',\n 'columns' => [\n 'name' => 'Naam',\n ],\n 'fake' => true,\n 'store_in' => 'extras',\n 'tab' => \"Feiten\",\n ]);\n }", "public function printCards()\n {\n $this->createCards();\n $this->renderCards();\n }", "function landtalk_conversation_cards_shortcode( $atts ) {\n\n $a = shortcode_atts( array(\n 'slugs' => null,\n ), $atts );\n\n $slugs = preg_split( '/\\s*,\\s*/', $a['slugs'] );\n $conversations = array();\n foreach ( $slugs as $slug ) {\n $conversation = get_page_by_path( $slug, 'OBJECT', CONVERSATION_POST_TYPE );\n if ( ! empty ( $conversation ) ) {\n array_push( $conversations, $conversation );\n }\n }\n\n $json_props = landtalk_encode_json_for_html_attr( array(\n 'conversations' => array_map( 'landtalk_prepare_conversation_for_rest_response', $conversations ),\n ) );\n\n ob_start();\n\n ?>\n\n<div class=\"conversation-cards-shortcode\">\n <div class=\"react-component\" data-component-name=\"ExcerptGallery\" data-component-props=\"<?php echo $json_props; ?>\"></div>\n</div>\n\n <?php\n\n return ob_get_clean();\n\n}", "function build_page(){\r\n\t\t$title='Default '.$this->custom_page->page_name;\r\n\t\t$category = get_term_by('name', $this->default, $this->custom_page->post_type.$this->suffix)->term_id;\r\n\t\t$this->templater=new Hana_Templater();\r\n\t\t$this->taxonomy=$this->custom_page->post_type.$this->suffix;\r\n\t\t$terms=get_terms($this->taxonomy, array('hide_empty'=>false, 'orderby'=>'id', 'order'=>'desc'));\r\n\t\t\r\n\t\techo '<div class=\"custom-page-wrapper\">';\r\n\t\t$this->print_heading();\r\n\r\n\t\t//display all the instances of the page\r\n\t\tforeach($terms as $term){\r\n\t\t\techo $this->templater->get_before_custom_section($term->name);\r\n\t\t\t$this->print_custom_section($term->name, $term->term_id);\r\n\t\t\techo $this->templater->get_after_custom_section();\r\n\t\t}\r\n\r\n\t\techo '<input type=\"hidden\" value=\"'.$this->taxonomy.'\" id=\"taxnonomy_id\" />\r\n\t\t\t <input type=\"hidden\" value=\"'.$this->custom_page->post_type.'\" id=\"post_type\" />\r\n\t\t\t <input type=\"hidden\" value=\"'.wp_create_nonce(HANA_NONCE).'\" id=\"hana_nonce\" />\r\n\t\t </div>';\r\n\t}", "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 }", "function get_about_us_cards() {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$about_us_image_one_title = get_theme_mod( 'about_us_image_one_title', 'Hope and opportuneties' );\n\t\t\t\t\t\t$about_us_image_one_text = get_theme_mod( 'about_us_image_one_text', 'We believe in the future. Togehter we have the power to make it bright.' );\n\t\t\t\t\t\t$about_us_image_one_image = get_theme_mod( 'about_us_image_one_image', get_bloginfo('template_url').'/img/about_us_image_one.jpg' );\n\n\t\t\t\t\t\t$about_us_image_two_title = get_theme_mod( 'about_us_image_two_title', 'A future for everyone' );\n\t\t\t\t\t\t$about_us_image_two_text = get_theme_mod( 'about_us_image_two_text', 'We believe in the future. Togehter we have the power to make it bright.' );\n\t\t\t\t\t\t$about_us_image_two_image = get_theme_mod( 'about_us_image_two_image', get_bloginfo('template_url').'/img/about_us_image_two.jpg' );\n\n\t\t\t\t\t\t$about_us_image_three_title = get_theme_mod( 'about_us_image_three_title', 'Shared experiences' );\n\t\t\t\t\t\t$about_us_image_three_text = get_theme_mod( 'about_us_image_three_text', 'We believe in the future. Togehter we have the power to make it bright.' );\n\t\t\t\t\t\t$about_us_image_three_image = get_theme_mod( 'about_us_image_three_image', get_bloginfo('template_url').'/img/about_us_image_three.jpg' );\n\n\t\t\t\t\t\t$data = [\n\t\t\t\t\t\t\t'card_one' => [\n\t\t\t\t\t\t\t\t'heading' => $about_us_image_one_title,\n\t\t\t\t\t\t\t\t'text' => $about_us_image_one_text,\n\t\t\t\t\t\t\t\t'image' => $about_us_image_one_image\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'card_two' => [\n\t\t\t\t\t\t\t\t'heading' => $about_us_image_two_title,\n\t\t\t\t\t\t\t\t'text' => $about_us_image_two_text,\n\t\t\t\t\t\t\t\t'image' => $about_us_image_two_image\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'card_three' => [\n\t\t\t\t\t\t\t\t'heading' => $about_us_image_three_title,\n\t\t\t\t\t\t\t\t'text' => $about_us_image_three_text,\n\t\t\t\t\t\t\t\t'image' => $about_us_image_three_image\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\tif (empty($data)) {\n\t\t\t\t\t\t\treturn new WP_Error( 'empty_category', 'there is no data in the custom about us.', array('status' => 404) );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$response = new WP_REST_Response($data);\n\t\t\t\t\t\t$response->set_status(200);\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn $response;\n\t\t\t\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CC this email to all assigned series editors in the given stage
function ccAssignedSeriesEditors($monographId, $stageId) { return $this->_addUsers($monographId, ROLE_ID_SERIES_EDITOR, $stageId, 'addCc'); }
[ "public function sendCc()\n\t{\n\t\t$this->objMessage->setCc($this->compileRecipients(func_get_args()));\n\t}", "public function addCC( $email );", "public function setCC()\n {\n }", "public function addCc($email);", "public function setCc($email);", "public function getCCs(){\n return $this->cc;\n }", "private function readCc(EmailComposer $composer): void\n {\n $cc = $this->convertMailableAddresses(\n $composer->getData('mailable')->cc\n );\n\n $composer->cc($cc);\n }", "public function getCcList(): string {\n\t\treturn $this->createEMailList($this->getCc());\n\t}", "private function _getAdminEmailCC () {\n\n\t\t\t$cc = trim( get_option( 'wwlc_emails_cc' ) );\n\n\t\t\tif ( $cc )\n\t\t\t\t$cc = explode( ',' , $cc );\n\n\t\t\tif ( !is_array( $cc ) )\n\t\t\t\t$cc = array();\n\n\t\t\treturn $cc;\n\n\t\t}", "function set_CC( $arrayCC ) {\n\t\tforeach( $arrayCC as $CC ) {\n\t\t\t$this->mail->AddCC($CC[\"email\"], $CC[\"name\"]);\n\t\t}\n\t}", "public abstract function AddCc($email, $name = \"\");", "public function getCC() : array {\n return $this->receiversArr['cc'];\n }", "public function getCcNames() {\n return $this->ccName;\n }", "function addCC($cc)\n\t{\n\t\t//If the carbon copy recipient is an aray, add each recipient... otherwise just add the one\n\t\tif (isset ($cc))\n\t\t{\n\t\t\tif (is_array($cc)) {\n\t\t\t\tforeach ($cc as $to) {\n\t\t\t\t\t$to = JMailHelper::cleanLine( $to );\n\t\t\t\t\tparent::AddCC($to);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$cc = JMailHelper::cleanLine( $cc );\n\t\t\t\tparent::AddCC($cc);\n\t\t\t}\n\t\t}\n\t}", "public final function addCc ($email) {\n\t\tif (is_array($email) && count($email) > 0) {\n\t\t\tif (!is_array($this->mail_content['cc'])) { $this->mail_content['cc'] = array(); }\n\t\t\t$this->mail_content['cc'] = array_merge($this->mail_content['cc'],$email);\n\t\t}\n\t\telse if (strlen(trim($email)) > 0) { $this->mail_content['cc'][] = $email; }\n\t}", "public function process_tracker_cc($data) {\n\n\t\t$instanceid = $data['id'];\n\t\t$issueid = $data['issueid'];\n\n \t// process data\n\n\t\t// store data within temp structure\n\t\t$nestedelm = new StdClass;\n\t\t$nestedelm->nodename = 'cc';\n\t\t$nestedelm->data = $data;\n\t\t$nestedelm->subs = array();\n \t$this->tmp->subs['issues'][$issueid]->subs['ccs'][$instanceid] = $nestedelm;\n }", "function bccAssignedSeriesEditors($submissionId, $stageId) {\n\t\treturn $this->bccAssignedSubEditors($submissionId, $stageId);\n\t}", "public function getCC()\n {\n if (! is_object($this->SupportTicket) || ! is_object($this->EmailTemplate)) {\n return false;\n }\n\n return (! empty($this->EmailTemplate->cc)) ? $this->EmailTemplate->cc : false;\n }", "function setCcCustomerEmail($cc_customer_email);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/$socio=Socio::findOrFail($id); $socio>nombre_socio=$request>get('nombre_socio'); $socio>apellido_socio=$request>get('apellido_socio'); $socio>fecha_de_nacimiento_socio=$request>get('fecha_de_nacimiento_socio'); $socio>tipo_documento_socio=$request>get('tipo_documento_socio'); $socio>num_documento_socio=$request>get('num_documento_socio'); $socio>estado_socio='1'; $socio>update();
public function update(SocioFormRequest $request, $id) { //Usando Eloquent: /*$socio=Socio::findOrFail($id); $socio->nombre_socio = $request->get('nombre_socio'); $socio->apellido_socio = $request->get('apellido_socio'); $socio->fecha_de_nacimiento_socio = $request->get('fecha_de_nacimiento_socio'); $socio->tipo_documento_socio = $request->get('tipo_documento_socio'); $socio->num_documento_socio = $request->get('num_documento_socio'); $socio->estado_socio='1'; $socio->save(); $familia=Familia::findOrFail($id); $familia->nombre_padre_familia = $request->get('nombre_padre_familia'); $familia->nombre_madre_familia = $request->get('nombre_madre_familia'); $familia->nombre_tutor_familia = $request->get('nombre_tutor_familia'); $familia->telefono_familia = $request->get('telefono_familia'); $familia->celular_familia = $request->get('celular_familia'); $familia->estado_familia='1'; $socio->Familia()->save($familia); $domicilio=Domicilio::findOrFail($id); $domicilio->direccion_domicilio = $request->get('direccion_domicilio'); $domicilio->nombre_provincia_domicilio = $request->get('nombre_provincia_domicilio'); $domicilio->nombre_localidad_domicilio = $request->get('nombre_localidad_domicilio'); $domicilio->codigo_postal_domicilio = $request->get('codigo_postal_domicilio'); $domicilio->estado_domicilio='1'; $socio->Domicilio()->save($domicilio); $institucion=Institucion::findOrFail($id); $institucion->nombre_institucion = $request->get('nombre_institucion'); $institucion->domicilio_institucion = $request->get('domicilio_institucion'); $institucion->grado_institucion = $request->get('grado_institucion'); $institucion->estado_institucion='1'; $socio->Institucion()->save($institucion);*/ $socio=Socio::with('Familia','Institucion','Domicilio'/*, 'Descuento'*/) ->where('id_socio', $id)->firstOrFail(); $socio->nombre_socio = $request->get('nombre_socio'); $socio->apellido_socio = $request->get('apellido_socio'); $socio->fecha_de_nacimiento_socio = $request->get('fecha_de_nacimiento_socio'); $socio->tipo_documento_socio = $request->get('tipo_documento_socio'); $socio->num_documento_socio = $request->get('num_documento_socio'); $socio->estado_socio='1'; $socio->familia->nombre_padre_familia = $request->get('nombre_padre_familia'); $socio->familia->nombre_madre_familia = $request->get('nombre_madre_familia'); $socio->familia->nombre_tutor_familia = $request->get('nombre_tutor_familia'); $socio->familia->telefono_familia = $request->get('telefono_familia'); $socio->familia->celular_familia = $request->get('celular_familia'); $socio->familia->estado_familia='1'; $socio->domicilio->direccion_domicilio = $request->get('direccion_domicilio'); $socio->domicilio->nombre_provincia_domicilio = $request->get('nombre_provincia_domicilio'); $socio->domicilio->nombre_localidad_domicilio = $request->get('nombre_localidad_domicilio'); $socio->domicilio->codigo_postal_domicilio = $request->get('codigo_postal_domicilio'); $socio->domicilio->estado_domicilio='1'; $socio->institucion->nombre_institucion = $request->get('nombre_institucion'); $socio->institucion->domicilio_institucion = $request->get('domicilio_institucion'); $socio->institucion->grado_institucion = $request->get('grado_institucion'); $socio->institucion->estado_institucion='1'; //$socio->descuento->valor_descuento=null; //$socio->descuento->fecha_inicio_descuento=null; //$socio->descuento->fecha_fin_descuento=null; $socio->push(); return Redirect::to('asociados\socio'); }
[ "public function update($id, UpdateAspiranteSocioecomicoRequest $request)\n {\n $aspiranteSocioecomico = $this->aspiranteSocioecomicoRepository->findWithoutFail($id);\n\n if (empty($aspiranteSocioecomico)) {\n Flash::error('Aspirante Socioecomico not found');\n return redirect(route('aspiranteSocioecomicos.index'));\n }\n \n $aspiranteSocioecomico = $this->aspiranteSocioecomicoRepository->update($request->all(), $id);\n $aspiranteGeneral=AspiranteGeneral::find($aspiranteSocioecomico->aspirantes_generales_id);\n //Se busca el AspiranteGeneral para su actualizacion de estatus\n $status=$aspiranteGeneral->status_asp;\n\n if($status==1 or $status==null){\n $aspiranteGeneral->status_asp=13;\n\n }else if (str_contains($status, '3')==false) {\n $aspiranteGeneral->status_asp=str_finish($status,'3');\n\n }\n $aspiranteGeneral->update();\n //Redirecciona a registro de salud\n $asp_sal=AspiranteSalud::where('aspirantes_generales_id',$aspiranteSocioecomico->aspirantes_generales_id)->first();\n\n Flash::success('Datos Socioeconómicos actualizados con éxito');\n return redirect(route('aspiranteSaluds.edit',['aspiranteSalud'=> $asp_sal->id]));\n\n\n\n\n\n/*\n\n\n\n\n\n\n\n\n\n\n\n //Actualiza el status del aspirante \"Datos - Socioeconómicos capturados\"\n $aspiranteGeneral=AspiranteGeneral::where('id',$aspiranteSocioecomico->aspirantes_generales_id)->first();\n $status=$aspiranteGeneral->status_asp;\n $v=$status;\n if($status==1 or $status==null){\n $v=13;\n }else\n {\n $value = str_contains($v, '3');\n if($value==false){\n $v = str_finish($v,'3');\n }\n }\n DB::table('aspirantes_generales')\n ->where('id',$aspiranteSocioecomico->aspirantes_generales_id)\n ->update(['status_asp' =>$v]);\n\n if (empty($aspiranteSocioecomico)) {\n Flash::error('Aspirante Socioecomico not found');\n\n return redirect(route('aspiranteSocioecomicos.index'));\n }\n\n $aspiranteSocioecomico = $this->aspiranteSocioecomicoRepository->update($request->all(), $id);\n\n //Redirecciona a registro de salud\n $asp_sal=AspiranteSalud::where('aspirantes_generales_id',$aspiranteSocioecomico->aspirantes_generales_id)->first();\n $idSal=$asp_sal->id;\n Flash::success('Aspirante Socioecomico updated successfully.');\n return redirect(route('aspiranteSaluds.edit',[$idSal]));\n */\n }", "public function update(Request $request)\n {\n \n\n // para no volver vulnerable el sitio, accedera solo con la peticion ajax\n if (!$request->ajax()) return redirect('/'); // determina si la peticion es diferente , si es asi redirije a la ruta raiz \n $documental = Documentales::findOrFail($request->id); // busco en la tabla codigo\n $documental->idusuario = \\Auth::user()->id; // para capturar el usuario que hizo la accion y despues con trigger guardarlo en la tabla bitacora de movimientos\n $documental->nombre_documental = $request->nombre_documental; // le enviamos los datos\n $documental->codigo_diminutivo = $request->codigo_diminutivo; \n $documental->descripcion = $request->descripcion;\n $documental->vigencia = $request->vigencia;\n //$documental->estado = '1';\n $documental->save();\n\n\n }", "public function update($id, UpdatesociocomercialRequest $request)\n {\n $sociocomercial = $this->sociocomercialRepository->findWithoutFail($id);\n\n if (empty($sociocomercial)) {\n Flash::error('Socio comercial no encontrado');\n Alert::error('Socio Comercial no encontrado');\n\n return redirect(route('sociocomercials.index'));\n }\n $rules = [\n 'nombre' => 'required',\n 'RFC' => 'max:15|required',\n 'CURP' => 'max:18|nullable',\n 'estado_id' => 'required',\n 'municipio_id' => 'required',\n 'codpostal' => 'nullable|numeric',\n ];\n\n $messages = [\n 'RFC.unique' => 'El RFC escrito ya existe en la base de datos de clientes',\n 'RFC.required' => 'El RFC es un valor requerido',\n 'CURP.unique' => 'La CURP que escribió ya esta en uso.',\n 'estado_id.required' => 'Es requerido el Estado',\n 'municipio_id.required' => 'Es requerido el Municipio',\n 'codpostal.numeric' => 'El Código postal debe ser numerico',\n\n ];\n\n $this->validate($request, $rules,$messages);\n\n $sociocomercial = $this->sociocomercialRepository->update($request->all(), $id);\n\n if(isset($sociocomercial->direcciones->id))\n {\n $direccion = direcciones::find($sociocomercial->direcciones->id);\n }\n else {\n $direccion = new direcciones();\n $direccion->sociocom_id = $sociocomercial->id;\n }\n $input = $request->all();\n \n $direccion->calle = $input['calle'];\n $direccion->RFC = $input['RFC'];\n $direccion->numeroExt = $input['numeroExt'];\n $direccion->numeroInt = $input['numeroInt'];\n $direccion->estado_id = $input['estado_id'];\n $direccion->municipio_id = $input['municipio_id'];\n $direccion->colonia = $input['colonia'];\n $direccion->codpostal = $input['codpostal'];\n $direccion->referencias = $input['referencias'];\n $direccion->save();\n\n Flash::success('Socio Comercial actualizado correctamente.');\n Alert::success('Socio Comercial actualizado correctamente.');\n\n return redirect(route('sociocomercials.index'));\n }", "public function updateOrm(){ //CREATE/INSERT\n // $flight = Mata_Kuliah::find(1);\n // $flight -> sks = 21;\n // $flight -> save();\n\n //atau\n\n $flight = Mata_Kuliah::where('id', 1) //update banyak data, bs pke yg ini\n ->update([\n 'sks'=> 20\n ]);\n return $flight;\n }", "function updateApotikHidup (Request $request) {\n$id=Crypt::decrypt($request->input('id'));\n$tanggal=$request->input('tanggal');\n$nama_tanaman_apotik_hidup=$request->input('nama_tanaman_apotik_hidup');\n$luas_produksi_ha=$request->input('luas_produksi_ha');\n$hasil_produksi_ha=$request->input('hasil_produksi_ha');\n$jumlah_produksi_ton=$request->input('jumlah_produksi_ton');\n$record = ApotikHidup::find($id);\nif($record){\n$record->tanggal = tanggalSystem($tanggal);\n$record->nama_tanaman_apotik_hidup = $nama_tanaman_apotik_hidup;\n$record->luas_produksi_ha = system_numerik($luas_produksi_ha);\n$record->hasil_produksi_ha = system_numerik($hasil_produksi_ha);\n$record->jumlah_produksi_ton = $jumlah_produksi_ton;\n$record->save();\n$request->session()->flash('notice', \"Update Data Berhasil!\");\nreturn redirect(URLGroup('potensi/sda/apotik-hidup'));\n}else{\nthrow new HttpException(404);\n}\n}", "public function update($car_id){\n $car=Car::findorFail($car_id);\n $car->make =request()->input(\"make\");\n $car->model =request()->input(\"model\");\n $car->produced_on =request()->input(\"produced_on\");\n $car->update();\n return redirect()->route(\"cars.show\");\n}", "public function updateSocietyData (Request $request){\n\n $approval;\n if($request->input('approval_need')){\n $approval = 1;\n }\n else{\n $approval = 0;\n }\n\n Society::where('id', $request->socId)\n ->update(['name_of_society' => $request->input('name_of_society'),\n 'place_of_office' => $request->input('place_of_office'),\n 'whole_of_the_objects' => $request->input('whole_of_the_objects'),\n 'funds' => $request->input('funds'),\n 'terms_of_admission' => $request->input('terms_of_admission'),\n 'condition_under_which_any' => $request->input('condition_under_which_any'),\n 'fines_and_foreitures' => $request->input('fines_and_foreitures'),\n 'mode_of_holding_meetings' => $request->input('mode_of_holding_meetings'),\n 'manner_of_rules' => $request->input('manner_of_rules'),\n 'investment_of_funds' => $request->input('investment_of_funds'),\n 'keeping_accounts' => $request->input('keeping_accounts'),\n 'audit_of_the_accounts' => $request->input('audit_of_the_accounts'),\n 'annual_returns' => $request->input('annual_returns'),\n 'number_of_members' => $request->input('number_of_members'),\n 'inspection_of_the_books' => $request->input('inspection_of_the_books'),\n 'appointment_and_removal_committee' => $request->input('appointment_and_removal_committee'),\n 'disputes_manner' => $request->input('disputes_manner'),\n 'case_of_society' => $request->input('case_of_society'),\n 'name' => $request->input('name'),\n 'name_si' => $request->input('sinhalaName'),\n 'name_ta' => $request->input('tamilname'),\n 'address' => $request->input('address'),\n 'address_si' => $request->input('adsinhalaName'),\n 'address_ta' => $request->input('adtamilname'),\n 'abbreviation_desc' => $request->input('abreviations'),\n 'approval_need' => $approval]);\n \n \n\n return response()->json([\n 'message' => 'Sucess!!!',\n 'status' =>true,\n ], 200);\n\n\n\n }", "public function editarComent(){\n\t\t \n$sql=\"Update usuarios set id_usuario=$this->id_usuario,observaciones='$this->observaciones' where id_usuario=\".$this->id_usuario;\n\t\t $this->con->query($sql);\n\t\t \n\t\t \n\t\t }", "public function update_offence(Request $request, $id) //modifed update function\n {\n //\n $update_offence_name = Offence::find($id);\n $update_offence_name->name = $request->input('rename_offence');\n $update_offence_name->created_at = date('Y-m-d h:i:s');\n $update_offence_name->updated_at = date('Y-m-d h:i:s');\n\n $update_offence_name->save();\n }", "public function update($id, UpdateDepartamentosProseRequest $request)\n {\n $input = $request->all();\n //$departamentosO = $input['Departamento_OnePeople'];\n $departamentosP = $input['Departamento_PROSE'];\n\n if (isset($input['Habilitado'])) \n {\n $Habilitado = '1';\n }\n else\n {\n $Habilitado = '0';\n }\n $idioma ='2';\n\n $departamentosProses = DB::statement(\"EXEC [dbo].[sc_DepartamentosProse_Actualiza]\n '\".$id.\"',\n '\".$departamentosP.\"',\n '1',\n '\".$idioma.\"'\");\n\n if ($departamentosProses) \n {\n Flash::success('Registro Guardado Corectamente.');\n }\n else \n {\n Flash::error('Revise Sus Datos');\n }\n\n return redirect(route('departamentosProses.index'));\n }", "public function update($id, UpdateNegocioRequest $request)\n {\n $input = $request->all();\n\n $negocio = $this->negocioRepository->findWithoutFail($id);\n if ($negocio->pessoa()->first() != null) {\n $negocio->pessoa()->update($input);\n if (is_null($negocio->pessoa()->first()->enderecos()->first())) {\n $input['pessoa_id'] = $negocio->pessoa_id;\n $endereco = $this->enderecoRepository->create($input);\n $negocio->pessoa()->first()->enderecos()->saveMany([$endereco]);\n } else {\n $endereco = $negocio->pessoa()->first()->enderecos()->first();\n }\n }\n if ($negocio->organizacao()->first() != null) {\n $negocio->organizacao()->update($input);\n if (is_null($negocio->organizacao()->first()->enderecos()->first())) {\n $input['organizacao_id'] = $negocio->organizacao_id;\n $endereco = $this->enderecoRepository->create($input);\n $negocio->organizacao()->first()->enderecos()->saveMany([$endereco]);\n } else {\n $endereco = $negocio->organizacao()->first()->enderecos()->first();\n }\n }\n\n if (empty($negocio) || empty($endereco)) {\n Flash::error('Negócio não enontrado.');\n\n return redirect(route('negocios.index'));\n }\n\n DB::beginTransaction();\n try {\n $negocio = $this->negocioRepository->update($input, $id);\n $endereco = $this->enderecoRepository->update($input, $endereco->id);\n\n DB::commit();\n //Flash::success('Negócio atualizao com sucesso.');\n } catch (\\Exception $e) {\n DB::rollBack();\n //Flash::error('Erro ao tentar atualizao Negócio');\n }\n Flash::success('Negócio atualizao com sucesso.');\n\n return redirect(route('negocios.index'));\n }", "public function update() {\n //GETS NOTEPAD, DEPENDING ON NOTEPADID (ID)\n $data=Notepad::find(request('NotepadID'));\n\n //GETS REQUEST AND REPLACES NOTEPAD TITLE, FULLNAME & COMPLELTION BY\n $data->title=request('title');\n $data->fullname=request('fullname');\n $data->compeletion_by=request('compeletion_by');\n\n //SAVES DB\n $data->save();\n\n //REDIRECTS TO HOME\n return redirect ('/');\n }", "public function editSave()\n {\n oeuvreModel::updateOeuvre();\n Redirect::to('oeuvre');\n }", "public function update()\n { \n $this->model->load('BinhLuan');\n $binhluan = $this->model->BinhLuan->findById($_POST['id']);\n $binhluan->baihat_id = $_POST['baihat_id'];\n $binhluan->user_id = $_POST['user_id'];\n $binhluan->noi_dung = $_POST['noi_dung']; \n $binhluan->update();\n go_back();\n }", "public function updateEsitoPrivato(Request $request)\n {\n\n $prenotazioneprivato = Prenotazione_Privato::where('id',$request->id)->first();\n\n $prenotazioneprivato->esito = $request['esito'];\n \n $prenotazioneprivato->save();\n\n return redirect('laboratorio/home');\n \n }", "public function observacionRechazar(Request $request){\n $prospecto= Prospecto::find($request->prospecto_id);\n $prospecto->observaciones=$request->observaciones;\n $prospecto->estatus=3;\n if($prospecto->save()){\n return redirect('listado');\n }\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 }", "public function getUpdate($id,$NUCLEO_id)\n {\n\n $TESIS = TESIS::lists('TES_NOMBRE', 'id');\n $PROFESOR = PROFESOR::lists('id', 'id');\n\n\n $dirige = dirige::where('id', '=', $id)\n ->where('NUCLEO_id', '=', $NUCLEO_id)\n ->first();\n\n\n \n return view('dirige8.update',compact('dirige','TESIS','PROFESOR','id','NUCLEO_id'));\n }", "public function update($id, Updateestanque_familiaRequest $request)\n {\n $estanqueFamilia = $this->estanqueFamiliaRepository->findWithoutFail($id);\n\n if (empty($estanqueFamilia)) {\n Flash::error('Estanque Familia no se ha encontrado');\n\n return redirect(route('estanqueFamilias.index'));\n }\n\n $datosNuevos = $request->all();\n\n $id_de_la_especie = $datosNuevos['id_especie'];\n $id_del_estanque = $datosNuevos['id_estanque'];\n\n //se iguala al id que entra por parámetros.\n $id_del_estanqueFamilias = $id;\n\n /**\n * Creado por Jeniffer Hernández.\n *El objetivos es contar los registros\n *\n */\n\n $resultado = DB::table('estanque_familias')\n ->where('id', '!=', $id_del_estanqueFamilias)\n ->where('id_estanque', '=', $id_del_estanque) \n ->where('id_especie', '=', $id_de_la_especie) \n ->whereNull('deleted_at')\n ->count();\n\n /* Recolecta el nombre de la especie, mediante el ID que el usuario manda. */\n $nombreEspecie = DB::table('especies')\n ->select('nombre_comun')\n ->where('id', '=', $id_de_la_especie)\n ->whereNull('deleted_at')\n ->first(); \n\n /* Recolecta el numero del estanque, mediante el ID que le usuario manda. */\n $numeroEstanque = DB::table('estanques')\n ->select('num_estanque')\n ->where('id', '=', $id_del_estanque)\n ->whereNull('deleted_at')\n ->first();\n\n // Si la variable resultado guarda mas de un registro, quiere decir que existe al menos uno que coincida\n // con lo que el usuario ingreso.\n if($resultado > 0) {\n /* Muestra el mensaje advirtiendo que el regsitro no se puede modificar a la BD. */\n Flash::error('No puedes modificar la especie '.$nombreEspecie->nombre_comun.' al estanque '.$numeroEstanque->num_estanque.', porque ya se encuentra agregada.');\n }\n else {\n /* Actualiza el registro elegido por el usuario en la BD. */\n $estanqueFamilia = $this->estanqueFamiliaRepository->update($request->all(), $id);\n\n /* Mensaje de exito al modificar */\n Flash::success('La especie '.$nombreEspecie->nombre_comun.' se ha modificado al estanque '.$numeroEstanque->num_estanque.' con éxito.');\n }\n\n return redirect(route('estanqueFamilias.index'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the [upa_code] column value.
public function getUpaCode() { return $this->upa_code; }
[ "public function getArcuusercode()\n {\n return $this->arcuusercode;\n }", "public function getCodeApe()\n {\n return $this->codeApe;\n }", "public function getCodeCol(): ?string {\n return $this->codeCol;\n }", "public function getCode()\n {\n return isset($this->Code) ? $this->Code : null;\n }", "function GetCode()\r\n\t{\r\n\t\treturn $this->m_code;\r\n\t}", "public function getCode_cour()\n {\n return $this->code_cour;\n }", "public function getCode()\n\t{\n\t\treturn $this->code;\n\t}", "private function get_kubun_code() {\n $res = $this->db->select('SELECT code FROM kubun', array());\n return $res;\n }", "public function getValueByCode($code);", "public function getCodeUnite() {\n return $this->codeUnite;\n }", "public function getUserCode()\n {\n return $this->user_code;\n }", "public function getAgbCode()\n {\n\n return $this->agb_code;\n }", "public function getCodeUser() {\n return $this->codeUser;\n }", "public function getCode()\n\t{\n\t\tif( isset( $this->values['coupon.code.code'] ) ) {\n\t\t\treturn (string) $this->values['coupon.code.code'];\n\t\t}\n\t}", "public function getCodeUnite(): ?string {\n return $this->codeUnite;\n }", "public function getCodeInscription()\n {\n return $this->code_inscription;\n }", "public function getCarCode(){\r\n\t\t\t$this->car_code = getValue(\"SELECT car_code FROM tbl_car WHERE car_id=\".$this->car_id);\r\n\t\t\treturn $this->car_code;\r\n\t}", "public function getCodeUser(): ?string {\n return $this->codeUser;\n }", "protected static function localized_code(): mixed\n\t{\n\t\treturn self::$query->localized_code;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the OptnForce column Example usage: $query>filterByOptnforce('fooValue'); // WHERE OptnForce = 'fooValue' $query>filterByOptnforce('%fooValue%', Criteria::LIKE); // WHERE OptnForce LIKE '%fooValue%'
public function filterByOptnforce($optnforce = null, $comparison = null) { if (null === $comparison) { if (is_array($optnforce)) { $comparison = Criteria::IN; } } return $this->addUsingAlias(MsaSysopCodeTableMap::COL_OPTNFORCE, $optnforce, $comparison); }
[ "public function filterByOptnForce($optnForce = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($optnForce)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(OptnsTableMap::COL_OPTN_FORCE, $optnForce, $comparison);\n }", "public function getFilteredOptions();", "public function setCriteria($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Monitoring\\V3\\Snooze\\Criteria::class);\n $this->criteria = $var;\n\n return $this;\n }", "abstract protected function getAnalyticsFilterCriteriaByAppOwner(AppInterface $app): string;", "public function filterName()\n {\n return config('query-filter.key.where');\n }", "public function setForce($var)\n {\n GPBUtil::checkBool($var);\n $this->force = $var;\n\n return $this;\n }", "public function applyColumnFilterGuesses($class, $property, $type, array &$columnOptions)\n {\n $columnGuess = $this->getColumnOptionsGuesser()->guessFilter($class, $property, $type);\n if ($columnGuess) {\n if (isset($columnOptions[self::FILTER])) {\n $columnOptions[self::FILTER] = array_merge($columnGuess->getOptions(), $columnOptions[self::FILTER]);\n } else {\n $columnOptions[self::FILTER] = $columnGuess->getOptions();\n }\n }\n }", "public function filterByOptionValue($optionValue = null, $comparison = null)\n {\n if (null === $comparison)\n {\n if (is_array($optionValue))\n {\n $comparison = Criteria::IN;\n }\n elseif (preg_match('/[\\%\\*]/', $optionValue))\n {\n $optionValue = str_replace('*', '%', $optionValue);\n $comparison = Criteria::LIKE;\n }\n }\n return $this->addUsingAlias(wpOptionPeer::OPTION_VALUE, $optionValue, $comparison);\n }", "function setSearchFilter($alias=null,$prop_name=null,$prop_value=null,\n $search_type='=') {\n\tif (!($this->_searchEnabled === true)) { return false; }\n\tif (!$this->isProperty($alias,$prop_name)) {\n\t\treturn $this->_searchDisable();\n\t\t}\n\tif (!is_array($this->_searchFilters)) {\n\t\treturn $this->_searchDisable();\n\t\t}\n\t$q = $this->getPropertyQuoted($alias,$prop_name);\n\tif (!is_bool($q)) { return $this->_searchDisable(); }\n\tif ($this->getPropertyIsDate($alias,$prop_name) === true) {\n\t\tif ($prop_value == 'now()') { $q = false; }\n\t\t}\n\t($q) ? $d = '\"' : $d = '';\n\tswitch($search_type) {\n\t\tcase '!=':\n\t\tcase '=':\n\t\tcase '>':\n\t\tcase '<':\n\t\tbreak;\n\t\tcase 'not in':\n\t\tcase 'in':\n\t\t\tif (!is_array($prop_value) or count($prop_value) < 1) {\n\t\t\t\treturn $this->_searchDisable();\n\t\t\t\t}\n\t\tbreak;\n\t\tcase 'not like':\n\t\tcase 'like':\n\t\t\tif (!$q) { return $this->_searchDisable(); }\n\t\tbreak;\n\t\t}\n\tif ($search_type == 'in' or $search_type == 'not in') {\n\t\tfor($j=0; $j < count($prop_value); $j++) {\n\t\t\t$prop_value[$j] = $d . addslashes($prop_value[$j]) . $d;\n\t\t\t}\n\t\t$this->_searchFilters[] = $alias . '.'\n\t\t. $this->getPropertyField($alias,$prop_name)\n\t\t. ' ' . $search_type . '(' . $d . implode(',',$prop_value) . $d . ')';\n\t\t} else {\n\t\t$this->_searchFilters[] = $alias . '.'\n\t\t. $this->getPropertyField($alias,$prop_name)\n\t\t. ' ' . $search_type . ' ' . $d . addslashes($prop_value) . $d;\n\t\t}\n\treturn true;\n\t}", "public function filterByCorrect($correct = null, $comparison = null)\n {\n if (is_string($correct)) {\n $correct = in_array(strtolower($correct), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n }\n\n return $this->addUsingAlias(OptionsTableMap::COL_CORRECT, $correct, $comparison);\n }", "public function getCriteria();", "private function setSearchCriteriaText()\n {\n $criteriaText = '';\n\n /**\n * Gender filtering if defined\n * We have array from $_SESSION and we un-pack it\n */\n\n if(!empty($_SESSION['FilterForm']['gender']))\n {\n if(array_search('M', $_SESSION['FilterForm']['gender']) !== FALSE)\n {\n $criteriaText .= ' AND Male ';\n }\n\n if(array_search('F', $_SESSION['FilterForm']['gender']) !== FALSE)\n {\n $criteriaText .= ' AND Female ';\n }\n }\n\n /**\n * Filter by country if defined\n */\n\n if(!empty($_SESSION['FilterForm']['country.id']))\n {\n $criteriaText .= ' AND ' . CitizenType::model()->findByPk($_SESSION['FilterForm']['country.id'])->name . ' ';\n }\n\n /**\n * Filter by state if defined\n * Also decline state if country != USA or country != Any Country\n */\n\n if(!empty($_SESSION['FilterForm']['states.id']) && $_SESSION['FilterForm']['country.id'] <= 1)\n {\n $criteriaText .= ' AND ' . States::model()->findByPk($_SESSION['FilterForm']['states.id'])->name . ' ';\n }\n\n /**\n * Filter by Focus if defined\n */\n\n if(!empty($_SESSION['FilterForm']['focus']))\n {\n foreach(BasicProfile::$ProfileTypeArray as $key => $type)\n {\n if(array_search($key, $_SESSION['FilterForm']['focus']) !== FALSE)\n {\n $criteriaText .= ' AND ' . BasicProfile::$ProfileTypeArray[$key] . ' ';\n }\n }\n }\n\n /**\n * Filter by Race if defined\n */\n\n if(!empty($_SESSION['FilterForm']['race_id']))\n {\n $criteriaText .= ' AND ' . RaceType::model()->findByPk($_SESSION['FilterForm']['race_id'])->name . ' ';\n }\n\n /**\n * Filter By SAT I Combined Score of defined\n * We filter it if the max Score value is less than 2400 (5 key from array)\n */\n\n $SATUsed = false;\n\n if(!empty($_SESSION['FilterForm']['SATMax']) && $_SESSION['FilterForm']['SATMax'] <= 4)\n {\n $min = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMin']];\n $max = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMax']];\n\n $criteriaText .= ' AND ' . $min . '-' . $max . ' SAT I Combined Score ';\n $SATUsed = true;\n }\n\n /**\n * Filter By SAT I Combined Score of defined\n * We filter it if the max Score value is less than 600 (0 key from array)\n */\n\n if(!$SATUsed && !empty($_SESSION['FilterForm']['SATMin']) && $_SESSION['FilterForm']['SATMin'] > 0)\n {\n $min = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMin']];\n $max = BasicProfile::$SATRanges[$_SESSION['FilterForm']['SATMax']];\n\n $criteriaText .= ' AND ' . $min . '-' . $max . ' SAT I Combined Score ';\n }\n\n /**\n * If we haven't defined university then cut off extra 'AND' from result string\n */\n if(empty($_SESSION['search_q']))\n {\n $criteriaText = substr($criteriaText, 4);\n }\n /*\n * If we still have no text then simply define this text as 'None'\n */\n\n if(empty($criteriaText) && empty($_SESSION['search_q'])) \n {\n $criteriaText = 'None';\n }\n\n /**\n * Actual criteria text defining\n */\n\n if(!empty($_SESSION['search_q']))\n \n $this->searchCriteriaText = 'SEARCH CRITERIA: ' . $_SESSION['search_q'] . $criteriaText;\n \n else \n \n \n {\n $this->searchCriteriaText = 'SEARCH CRITERIA: ' . $criteriaText;;\n }\n }", "public function getCriteriaOptions() {\n\t\treturn $this->criteriaOptions;\n\t}", "public function applyOptionFilters()\n {\n if (is_main_site()) {\n return;\n }\n\n $options = $this->getLiteSpeedOptionKeys();\n\n if ($options && !empty($options)) {\n foreach ($options as $option) {\n $optionValue = $option->option_value;\n $optionName = $option->option_name;\n\n add_filter('option_' . $optionName, function ($value, $option) use ($optionValue) {\n return $optionValue;\n }, 10, 2);\n }\n }\n }", "function getFilter($col, $criteria) {\r\n\t$filter = \"\";\r\n\t\r\n\tswitch($col) {\r\n\t\tcase \"ID\":\r\n\t\t\t$filter = \"WHERE UserID=\".$criteria;\r\n\t\t\tbreak;\r\n\t\tcase \"EML\":\r\n\t\t\t$filter = \"WHERE email='\".$criteria.\"'\";\r\n\t\t\tbreak;\r\n\t\tcase \"SCN\":\r\n\t\t\t$filter = \"WHERE screenName='\".$criteria.\"'\";\r\n\t\t\tbreak;\r\n\t\tcase \"ROLE\":\r\n\t\t\t$filter = \"WHERE role=\".$criteria;\r\n\t\t\tbreak;\r\n\t\tcase \"ACT\":\r\n\t\t\t$filter = \"WHERE activated=\".$criteria;\r\n\t\t\tbreak;\r\n\t\tcase \"MOD\":\r\n\t\t\t$filter = \"WHERE moderated=\".$criteria;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t$filter = \"\";\r\n\t}\r\n\t\r\n\treturn $filter;\r\n}", "public function getWhereField()\n {\n return $this->options['where_field'];\n }", "protected function filterOptionsBySearch($options, $query)\n {\n $filteredOptions = [];\n\n $optionMatchesSearch = function ($words, $option) {\n foreach ($words as $word) {\n $word = trim($word);\n if (!strlen($word)) {\n continue;\n }\n\n if (!Str::contains(Str::lower($option), $word)) {\n return false;\n }\n }\n\n return true;\n };\n\n /*\n * Exact\n */\n foreach ($options as $index => $option) {\n if (Str::is(Str::lower($option), $query)) {\n $filteredOptions[$index] = $option;\n unset($options[$index]);\n }\n }\n\n /*\n * Fuzzy\n */\n $words = explode(' ', $query);\n foreach ($options as $index => $option) {\n if ($optionMatchesSearch($words, $option)) {\n $filteredOptions[$index] = $option;\n }\n }\n\n return $filteredOptions;\n }", "public function sortByOption($opt, $way) {\n $food = $this->foodManager->sortByOption($opt, $way);\n $favs = $this->getFavs(); \n if ( !($data = $food->fetch_assoc()) ) $data = [];\n require('view/frontend/listFood.php');\n }", "public function GetQueryRestrictionForActiveFilter()\n {\n $sQuery = '';\n $sValue = $this->GetActiveValue();\n if ('1' == $sValue) {\n $sQuery = '`shop_article_stock`.`'.MySqlLegacySupport::getInstance()->real_escape_string($this->sItemFieldName).'` > 0';\n }\n\n return $sQuery;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of solde
public function getSolde() { return $this->solde; }
[ "public function getSolde()\n {\n return $this->solde;\n }", "public function getSolde()\n {\n return $this->solde;\n }", "public function getSolde()\n {\n return $this->solde;\n }", "public function getValue();", "public function getSolde()\n {\n $solde = $this->getSoldeInitial();\n\n $mouvements = $this->getMouvements();\n\n foreach ($mouvements as $mouvement) {\n $montant = $mouvement->getMontant();\n $solde += $montant;\n }\n\n return $solde;\n }", "public function getSoldeInitial()\n {\n return $this->soldeInitial;\n }", "public function get_solde()\r\n {\r\n return $this->_solde;\r\n }", "public function getSoldeCptaOd() {\n return $this->soldeCptaOd;\n }", "public function getSoldeFin() {\n return $this->soldeFin;\n }", "public function getValue()\n\t{\n\t\treturn $this->amount * $this->unit->getUnit();\n\t}", "public function getValue()\n\t\t{\n\t\t\treturn $this->trade_value;\n\t\t}", "public function getSolMur() {\n return $this->solMur;\n }", "public function get_valor() {\n\t\t\n\t\t# Real matrix dato timestamp\n\t\treturn $this->get_dato();\n\t}", "public function getresistanceValue()\n {\n return $this->value;\n }", "public function getArcurfmlvalu()\n {\n return $this->arcurfmlvalu;\n }", "public function getValue()\n {\n return $this->price;\n }", "public function getVal()\n {\n return $this->val;\n }", "public function getValorLecturaEvotranspiracion(){\n return $this->valorLecturaEvotranspiracion;\n }", "public function getDoubleValue() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test $a+= $b; is optimized to $a= $b;
#[@test] public function timesAssignAndUnaryMinusNotOptimized() { $assignment= new AssignmentNode([ 'variable' => new VariableNode('a'), 'op' => '*=', 'expression' => new UnaryOpNode(['op' => '-', 'postfix' => false, 'expression' => new VariableNode('b')]) ]); $this->assertEquals($assignment, $this->optimize($assignment)); }
[ "#[@test]\n public function notOptimizedIfRHS() {\n $assignment= new AssignmentNode([\n 'variable' => new VariableNode('a'), \n 'op' => '=', \n 'expression' => new BinaryOpNode(['lhs' => new VariableNode('b'), 'op' => '+', 'rhs' => new VariableNode('a')])\n ]);\n $this->assertEquals($assignment, $this->optimize($assignment));\n }", "#[@test]\n public function concatAssign() {\n $this->assertSourcecodeEquals(\n '$a.= $b;',\n $this->emit('$a~= $b;')\n );\n }", "#[@test]\n public function minusAssignAndUnaryMinus() {\n $this->assertEquals(\n new AssignmentNode([\n 'variable' => new VariableNode('a'), \n 'op' => '+=', \n 'expression' => new VariableNode('b')\n ]),\n $this->optimize(new AssignmentNode([\n 'variable' => new VariableNode('a'), \n 'op' => '-=', \n 'expression' => new UnaryOpNode(['op' => '-', 'postfix' => false, 'expression' => new VariableNode('b')])\n ]))\n );\n }", "#[@test]\n public function conditionalAssignment() {\n $this->compile('$a && $b+= 1;');\n }", "function tinh_tong_hai_so($a,$b){\n\t\treturn $a + $b;\n\t}", "function add($a, $b) {\n $a = func_get_arg(0);\n for ($i=1,$n=func_num_args(); $i<$n; $i++) { \n $b = func_get_arg($i);\n\n if (!is_array($a)) {\n if (!is_array($b)) {\n // compare single a value to single b value\n $a += $b;\n continue;\n }\n // Prepare single a value as an array, keyed like b\n $a = self::combine(array_keys($b), array_fill(0, count($b), $a));\n }\n\n if( !is_array($b) ) { \n // Prepare a single b value as an array, keyed like a\n $b = self::combine(array_keys($a), array_fill(0, count($a), $b));\n }\n\n foreach (array_keys($a) as $j) { \n $a[$j] += $b[$j];\n }\n }\n return $a;\n }", "function sum($a, $b){\n return $a+$b;\n}", "function sum ($a,$b) {\n\treturn $a + $b;\n}", "#[@test]\n public function modulo() {\n $this->assertEquals(\n new AssignmentNode(['variable' => new VariableNode('a'), 'op' => '%=', 'expression' => new VariableNode('b')]),\n $this->optimize(new AssignmentNode([\n 'variable' => new VariableNode('a'), \n 'op' => '=', \n 'expression' => new BinaryOpNode(['lhs' => new VariableNode('a'), 'op' => '%', 'rhs' => new VariableNode('b')])\n ]))\n );\n }", "function sum ($a, $b) { return ($a ^ $b); }", "public function addValues($a,$b)\n\t{\n\t\treturn $a+$b;\n\t}", "#[@test]\n public function conditionalAssignmentWithBraces() {\n $this->compile('$a && ($b+= 1);');\n }", "public function testAppendAssignmentAdd()\n {\n $generator = new ezcPhpGenerator( dirname( __FILE__ ) . '/data/generator_test.php', false );\n $generator->appendValueAssignment( 'test', 41 );\n $generator->appendValueAssignment( 'test', 1, ezcPhpGenerator::ASSIGN_ADD );\n $generator->appendCustomCode( 'return $test;' . $generator->lineBreak );\n $generator->finish();\n $data = file_get_contents( dirname( __FILE__ ) . '/data/generator_test.php' );\n $this->assertEquals( 42, eval( $data ) );\n }", "function ADD64AA(&$v, $a, $b) {\n\t\t$o0 = $v[$a] + $v[$b];\n\t\t$o1 = $v[$a + 1] + $v[$b + 1];\n\t\tif ($o0 >= 4294967296) {\n\t\t\t$o1++;\n\t\t}\n\t\t$v[$a] = $o0 & 0xffffffff;\n\t\t$v[$a + 1] = $o1 & 0xffffffff;\n\t}", "#[@test]\n public function instanceMemberVariables() {\n $this->assertEquals(\n new AssignmentNode(['variable' => new MemberAccessNode(new VariableNode('this'), 'a'), 'op' => '+=', 'expression' => new VariableNode('b')]),\n $this->optimize(new AssignmentNode([\n 'variable' => new MemberAccessNode(new VariableNode('this'), 'a'), \n 'op' => '=', \n 'expression' => new BinaryOpNode(['lhs' => new MemberAccessNode(new VariableNode('this'), 'a'), 'op' => '+', 'rhs' => new VariableNode('b')])\n ]))\n );\n }", "function add($a) {\n $this->total += $a;\n }", "#[@test]\n public function logicalAnd() {\n $this->assertEquals(\n new AssignmentNode(['variable' => new VariableNode('a'), 'op' => '&=', 'expression' => new VariableNode('b')]),\n $this->optimize(new AssignmentNode([\n 'variable' => new VariableNode('a'), \n 'op' => '=', \n 'expression' => new BinaryOpNode(['lhs' => new VariableNode('a'), 'op' => '&', 'rhs' => new VariableNode('b')])\n ]))\n );\n }", "public function sum($a, $b)\n {\n return $a $b;\n }", "public function __assign_add($arg){\n return $this->plus($arg);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new dataInputAssociation
public function setDataInputAssociation(array $dataInputAssociation) { $this->dataInputAssociation = $dataInputAssociation; return $this; }
[ "public function setInput(InputInterface $input)\n {\n //Ensure the datalist and input have ids defined\n $this->id();\n $input->id();\n\n //Assign the relation to each other\n $this->input = $input;\n $input->setDatalist($this);\n }", "public function setInputData(Input $data) {\n\t\t$this->inputdata = $data;\n\t}", "public function setInput($input);", "protected function initAssociationData($association)\n {\n if (!$this->associationData) {\n $this->associationData = array();\n }\n\n if (is_string($association)) {\n if (!array_key_exists($association, $this->associations)) {\n throw new Zeal_Model_Exception('Invalid association name passed to _setAssociationData');\n }\n\n $association = $this->associations[$association];\n }\n $associationShortname = $association->getShortname();\n\n if (!array_key_exists($associationShortname, $this->associationData)) {\n $associationData = $this->associations[$associationShortname]->initAssociationData();\n\n // populate stuff it might need\n $associationData->setAssociation($association)\n ->setModel($this);\n\n $this->associationData[$associationShortname] = $associationData;\n }\n }", "public function setInput($input_object) {\n $this->input = $input_object;\n }", "function setAssociateID($affid) {\n $this->_affid = $affid;\n }", "public function setInput($input)\n {\n $this->input = $input;\n }", "function setAssocId($assocId) {\n\t\t$this->setData('assocId', $assocId);\n\t}", "final public function setInputData(array $inputData)\r\n {\r\n $this->inputData = $inputData;\r\n\r\n return $this;\r\n }", "abstract protected function setInputs();", "public function askAssociation(AssociationInterface $association);", "private function setCustomerData($customer, InputInterface $input)\n {\n foreach ($input->getOptions() as $key => $value) {\n if ($key == 'customer-password' || substr($key, 0,8) != 'customer' || $value == '') continue;\n $key = substr($key, 9);\n $customer->{\"set$key\"}($value);\n }\n }", "protected function set($data) {\n foreach ($data AS $key => $value) {\n if (is_array($value)) {\n $sub = new CampaignData();\n $sub->set($value);\n $value = $sub;\n }\n $this->{$key} = $value;\n }\n }", "public function attachAnswersetToInput($answerset_id,$input_id)\n\t{\n\t $this->c_table = 'form_inputs';\n\t $post['answerset_id'] = $answerset_id;\n\t $post['id'] = $input_id;\n\t \n\t parent::insertOrUpdate($post);\n\t}", "abstract public function set($data);", "public function setAssociation($var)\n {\n GPBUtil::checkString($var, True);\n $this->association = $var;\n\n return $this;\n }", "function setAssociatedRecord($record)\n {\n if ($this->row['idtype'] == self::IDTYPE_INDIV &&\n $record instanceof Person)\n {\n $this->associatedRecord = $record;\n $this->row['idir'] = $record['idir'];\n }\n else\n if ($this->row['idtype'] == self::IDTYPE_MAR &&\n $record instanceof Family)\n {\n $this->associatedRecord = $record;\n $this->row['idir'] = $record['idmr'];\n }\n else\n if ($this->row['idtype'] == self::IDTYPE_CHILD &&\n $record instanceof Child)\n {\n $this->associatedRecord = $record;\n $this->row['idir'] = $record['idcr'];\n }\n else\n {\n $parminfo = gettype($record);\n if (is_object($record))\n $parminfo .= \" instance of \" . get_class($record);\n throw new Exception(\"Event.inc:: setAssociatedRecord: \" .\n \"Invalid parameter \" . $parminfo);\n }\n }", "public function keyPartySetPropertiesFromData($data);", "public function setAttributeInputTypeId($data)\n {\n $this->_AttributeInputTypeId=$data;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the log/grid type on the base of XML Layout
public function renderView() { $type = $this->getLogType(); $this->_headerText = Mage::helper('googletrustedstores')->__('Feed Log - ' . $type . ' orders'); $this->getLayout()->getBlock($this->_controller . '.grid')->setLogType($type); return parent::renderView(); }
[ "public function initLayout();", "protected function setupLayout()\n\t{\n\t\tif ( ! is_null($this->layout))\n\t\t{\n\t\t\t$this->layout = View::make($this->layout);\n\n $identity = Auth::user()->identity;\n\n $sety = SetType::all();\n $si = 0;\n $setar=array();\n $title='';\n $this->layout->title='';\n $this->layout->content='';\n foreach($sety as $setyop){\n $setar[$si]['id'] = $setyop->id;\n $setar[$si]['name'] = $setyop->type_name;\n $si++;\n }\n if($identity === 1){\n $this->layout->nav = View::make('_layouts.headnav');\n $this->layout->nav->yy=Auth::user()->name;\n\n $this->layout->nav->type = $setar;\n }else{\n $this->layout->nav = View::make('_layouts.headnav2');\n $this->layout->nav->yy=Auth::user()->name;\n\n }\n\n\n\t\t}\n\t}", "public function setLayout($value);", "protected function setLogEntryType($type) {\r\n $this->log_entry_type = $type;\r\n }", "private function setDefaultLayout() : void\n {\n $this->reflection = new ReflectionClass($this);\n $namespace = $this->reflection->getNamespaceName();\n\n $module = strstr($namespace, '\\Pages', true);\n $module = str_replace('\\\\', '/', $module);\n\n // let's load a default template for each module by default\n //\n $this->layout->setTemplate($module.'/Pages/Templates/DefaultLayout');\n }", "public function setType($type)\n\t{\n\t\t$name = self::$layout_dir . 'layout.' . $type . '.php';\n\t\tif ( ! file_exists($name) )\n\t\t{\n\t\t\tthrow new TPLLayoutNotExistsException($name);\n\t\t}\n\t\t$this->layout = $name;\n\t\t$this->type = $type;\n\t}", "function setLayout($value) {\n $this->layout = $value;\n }", "public function changeLayout() {\n $this->defaultLayout = \"layouts/student\";\n $this->setLayout();\n $session = Registry::get(\"session\");\n $this->student = $session->get(\"student\");\n $this->user = $session->get('user');\n }", "public function _initDocType()\n {\n $this->bootstrap('layout');\n $this->getResource('layout')\n ->getView()\n ->doctype('HTML5');\n }", "public function _initDocType()\n {\n $this->bootstrap('layout');\n $this->getResource('layout')->getView()->doctype('HTML5');\n }", "public function setLayout($layout);", "public function testNormalLoggingWithLayout()\n {\n list(, , $log) = $this->_getSimpleLogger(true);\n $log->info('an info message');\n $log->warn('a warning message');\n }", "public function testSetLayout()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function setLayout() {\n $this->layout()->setTemplate('social/layout');\n }", "protected function initLayout()\n {\n $showLabels = $this->hasLabels();\n $showErrors = $this->getConfigParam('showErrors');\n $this->mergeSettings($showLabels, $showErrors);\n $this->buildLayoutParts($showLabels, $showErrors);\n }", "public function setLayout($name): void\n {\n if (sfConfig::get('sf_logging_enabled'))\n {\n $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Change layout to \"%s\"', $name))));\n }\n\n sfConfig::set('symfony.view.'.$this->getModuleName().'_'.$this->getActionName().'_layout', $name);\n }", "function createDefaultLayout()\n {\n $forms = array();\n $it =& new ArrayIterator($this->getProperty('forms'));\n for ( ; $it->isValid(); $it->next())\n {\n if (strpos('tracker', $it->getKey()) === false)\n {\n array_push($forms, $it->getKey());\n }\n }\n $this->setProperty(\n 'layout',\n array(\n 'type' => 'flow',\n 'components' => join(', ', $forms)\n )\n );\n }", "protected function setupLayout(){\n\t\t\tif (!is_null($this->layout)){\n\t\t\t\t$this->layout = View::make($this->layout);\n\t\t\t}\n\t\t}", "function setPageLayoutInHierarchy()\n\t{\n\t\tglobal $ilCtrl;\n\t\t$ilCtrl->setParameter($this, \"hierarchy\", \"1\");\n\t\t$this->setPageLayout(true);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to create a Patient entity.
private function createCreateForm(Patient $entity) { $form = $this->createForm(new PatientType(), $entity, array( 'action' => $this->generateUrl('patients_create'), 'method' => 'POST', )); $form->add('submit', 'submit', array('label' => 'Create')); return $form; }
[ "public function createAction()\n {\n $entity = new Patient();\n $request = $this->getRequest();\n $form = $this->createForm(new PatientType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('patient_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'action' => 'create'\n );\n }", "public function actionCreate() {\n $model = new Patient();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n \"polyclinics\" => Polyclinics::find()->orderBy(\"name\")->all(),\n 'statuses' => Statuses::find()->orderBy(\"sort desc, id asc\")->all(),\n 'treatments' => Treatments::find()->orderBy(\"sort desc, id asc\")->all(),\n 'formDiseases' => FormDiseases::find()->orderBy(\"sort desc, id asc\")->all(),\n 'patients' => Patient::find()->orderBy(\"name\")->all()\n ]);\n }", "public function newAction()\n {\n $entity = new Patient();\n $form = $this->createForm(new PatientType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'action' => 'new'\n );\n }", "public function newAction() {\n $entity = new Patient();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CabinetPatientBundle:Patient:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createAction()\n {\n if (!$this->request->isPost()) { \n return $this->response->redirect('Dashboard/?err_msg=Patient+couldnt+be+created+Try+again+later');\n }\n\n $patient = new Patients();\n $patient->surname = $this->request->getPost(\"surname\");\n $patient->firstname = $this->request->getPost(\"firstname\");\n $patient->othernames = $this->request->getPost(\"lastname\");\n $patient->telephone = $this->request->getPost(\"fone\");\n $patient->email = $this->request->getPost(\"email\");\n $patient->address = $this->request->getPost(\"address\");\n $patient->dob = $this->request->getPost(\"age\");\n $patient->gender = $this->request->getPost(\"gender\");\n// $patient->stateoforigin = $this->request->getPost(\"stateoforigin\");\n $patient->profession = $this->request->getPost(\"profession\");\n $patient->marital_status = $this->request->getPost(\"marital_status\");\n/* $patient->father_name = $this->request->getPost(\"father_name\");\n $patient->mother_name = $this->request->getPost(\"mother_name\"); */\n $patient->nok = $this->request->getPost(\"nok\");\n $patient->nok_tel = $this->request->getPost(\"nok_tel\");\n $patient->nok_rel = $this->request->getPost(\"nok_rel\");\n $patient->status = \"out\";\n\n if (!$patient->save()) {\n foreach ($patient->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->response->redirect('/modules/Receptionist/addPatient?err_msg=There+is+an+error+in+your+form+fill+it+and+try+again');\n }\n\n return $this->response->redirect('/modules/Receptionist/addPatient?msg=Patient+Added+Successfully');\n }", "public function create()\n\t{\n\t\treturn view('patients.create');\n\t}", "public function SubmittedPatientAdd(AppForm $form)\r\n {\r\n Storage::getInstance()->createPatient($form->values);\r\n Graphs::model()->clearAll();\r\n\r\n $this->flashMessage('Novy pacient bol úspešne pridaný', 'info');\r\n $this->redirect('default'); // redirect to listing\r\n }", "public function create()\n\t{\n\t\treturn View::make('patients.create');\n\t}", "private function createCreateForm(DossierMedical $entity)\n {\n $form = $this->createForm(new DossierMedicalType(), $entity, array(\n 'action' => $this->generateUrl('dossiermedical_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(EstadoPatentamiento $entity)\n {\n $form = $this->createForm(new EstadoPatentamientoType(), $entity, array(\n 'action' => $this->generateUrl('estado_patentamiento_create'),\n 'method' => 'POST',\n 'attr' => array('class' => 'box-body')\n ));\n\n $form->add('submit', 'submit', array(\n 'label' => 'Crear',\n 'attr' => array('class' => 'btn btn-primary pull-right')\n ));\n\n return $form;\n }", "public function create(Patient $patient)\n {\n return view('medical_records/create', compact('patient'));\n }", "public function actionCreate()\n {\n $model = new Patient();\n \n\n if ($model->load(Yii::$app->request->post())) {\n $model->organization_id = Yii::$app->session['medicalCenter']; \n //if(substr($model->birth_date, 2,1)=='-'){\n $model->birth_date = substr($model->birth_date, 6).'-'.\n substr($model->birth_date, 3,2).'-'.\n substr($model->birth_date, 0,2);\n //}\n if($model->save())\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n \n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "private function createCreateForm(Planta $entity)\n {\n $form = $this->createForm(new PlantaType(), $entity, array(\n 'action' => $this->generateUrl('planta_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Registrant $entity)\n {\n $form = $this->createForm(new RegistrantType(), $entity, array(\n 'action' => $this->generateUrl('registrant_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Correspondant $entity)\n {\n $form = $this->createForm(new CorrespondantType(), $entity, array(\n 'action' => $this->generateUrl('correspondant_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(Appointment $entity)\n {\n $form = $this->createForm(new AppointmentType(), $entity, array(\n 'action' => $this->generateUrl('appointment_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "private function createCreateForm(DataLegal $entity)\r\n {\r\n $form = $this->createForm(new DataLegalType, $entity, array(\r\n 'action' => $this->generateUrl('operadora_new'),\r\n 'method' => 'POST',\r\n ));\r\n\r\n //$form->add('submit', 'submit', array('label' => 'Guardar'));\r\n\r\n return $form;\r\n }", "private function createCreateForm(Personapotencial $entity) {\n $form = $this->createForm(new PersonapotencialType(), $entity, array(\n 'action' => $this->generateUrl('PersonaPotencial_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function addPatientAction(Request $request)\n {\n\n date_default_timezone_set('Europe/Paris');\n $time = (new \\DateTime())->format('d-m-Y H:i:s');\n\n /*\n * Calling the table User in order to choose the right Evaluator (médecin soignant)\n * If the user is a doctor (ROLE_MEDICAL) he we will be automatically chosen as an Evaluator (médecin soignant)\n * Otherwise if the user has a secretary Role he shall choose the doctor with whom the patient will be associated with.\n * Choosing an evaluator means that the chosen one will own the record.\n * A secretary creating and associating a record to a doctor is equivalent to a doctor creating the record.\n */\n $em = $this->getDoctrine()->getManager();\n $repository = $em->getRepository('AppBundle:User');\n\n $user = $this->getUser();\n\n \n // Liste contenant tous les utilisateurs (médecins, paramédicaux, secrétaires) sauf l'utilisateur courant\n $listPro = $repository->findByRoles('ROLE_MEDICAL');\n if (in_array($user, $listPro)) {\n unset($listPro[array_search($user, $listPro)]);\n }\n\n /*\n * Creating a new patient object and a new PatientFormType form with extraData allowed.\n * PatientFormType is defined in src/Form/Type\n * Extradata is used in order to allow adding data (comments, pictures, videos...) dynamically.\n */\n $patient = new Patient();\n $form = $this->createForm(PatientFormType::class, $patient, [\"allow_extra_fields\" => true]);\n $form->handleRequest($request);\n if ($form->isSubmitted() && $form->isValid()) {\n\n /*\n * The patient Id field must be filled with the \"real\" patient ID\n * Since in this particular case (@IEM) the patient ID is not defined\n * The patient ID is filled with : initial + a random value.\n *\n */\n $nom = $form[\"nom\"]->getData();\n $prenom = $form[\"prenom\"]->getData();\n $randomID = $this->generateIdAction();\n $patient->setPatientId($nom[0] . $prenom[0] . '_' . $randomID);\n\n /*\n * Setting archived value into false\n * The record once created is not archived.\n */\n $patient->setArchived(false);\n\n // Les extraData du formulaire, contiennent les images/vidéos/fichiers à uploader\n $extraData = $this->get('file.uploader')->upload($form->getExtraData());\n $nbr_extra_datas = $this->countExtraDatas($extraData);\n\n /*\n * Si l'utilisateur courant est la secrétaire, on affecte le dossier patient à un médecin en particulier\n * Si l'utilisateur courant est un médecin, il s'approprie le dossier du patient\n */\n if ($user->getRoles()[0] == 'ROLE_MEDICAL') {\n $patient->setOwner($user);\n } else if ($user->getRoles()[0] == 'ROLE_SECRETARY') {\n $patient->setOwner($repository->findOneById($extraData['proId']));\n }\n\n /*\n * Initialisation du tableau contenant toutes les données relatives à un patient\n */\n $data = [\n \"comments\" => extractExtraDatas($extraData, \"comment\", $nbr_extra_datas[\"comments\"], $time, $patient, $user),\n \"images\" => extractExtraDatas($extraData, \"image\", $nbr_extra_datas[\"images\"], $time, $patient, $user),\n \"videos\" => extractExtraDatas($extraData, \"video\", $nbr_extra_datas[\"videos\"], $time, $patient, $user),\n \"files\" => extractExtraDatas($extraData, \"file\", $nbr_extra_datas[\"files\"], $time, $patient, $user)\n ];\n\n $patient->setData($data);\n\n $em = $this->getDoctrine()->getManager();\n $em->persist($patient);\n $em->flush();\n $this->addFlash('notice', \"Le dossier a été ajouté avec succès !\");\n return $this->render(\"patient/addPatient.html.twig\", [\n 'form' => NULL,\n ]);\n }\n\n return $this->render(\"patient/addPatient.html.twig\", [\n 'form' => $form->createView(),\n 'listPro' => $listPro,\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
(PECL imagick 2.0.0) Separates a channel from the image
public function separateImageChannel ($channel) {}
[ "function separateImageChannel($channel){}", "public function separateImageChannel($channel) {\n\t}", "public function getImageAlphaChannel () {}", "function Flatten(&$img, $color_channel){\n // Get the size info from the input image\n $width = imagesx($img);\n $height = imagesy($img);\n // the flattened pixel data is stored here\n $pixels = array();\n \n // Loop through pixels\n for($row = 0; $row < $width; $row++){\n for($col = 0; $col < $height; $col++){\n \n // Get pixel color channels \n $p = imagecolorat($img, $row, $col);\n $colors = imagecolorsforindex($img, $p);\n // Extract desired channel\n if($color_channel == RED){\n $pixels[] = ColorToFloat($colors['red']);\n }\n elseif($color_channel == GREEN){\n $pixels[] = ColorToFloat($colors['green']);\n }\n elseif($color_channel == BLUE){\n $pixels[] = ColorToFloat($colors['blue']);\n }\n else{\n $pixels[] = 0.00;\n }\n }\n }\n \n return $pixels;\n}", "function levelImage($blackPoint, $gamma, $whitePoint, $channel){}", "public function getImageChannelExtrema ($channel) {}", "public function get_rgb_channels()\r\n\t{\r\n\t\t$width=imageSX($im);\r\n\t\t$height=imageSY($im);\r\n\t\t$red_channel = imagecreatetruecolor($width, $height);\r\n\t\timagecopy($red_channel,$im,0,0,0,0,$width,$height);\r\n\t\t$green_channel = imagecreatetruecolor($width, $height);\r\n\t\timagecopy($green_channel,$im,0,0,0,0,$width,$height);\r\n\t\t$blue_channel = imagecreatetruecolor($width, $height);\r\n\t\timagecopy($blue_channel,$im,0,0,0,0,$width,$height);\r\n\t\tfor ($x = 0; $x < $width; $x++)\r\n\t\t{\r\n\t\t\tfor ($y = 0; $y < $width; $y++)\r\n\t\t\t{\r\n\t\t\t\t$index = imagecolorat($this->im, $x, $y);\r\n\t\t\t\t$color = imagecolorsforindex($this->im, $index);\r\n\t\t\t\t$red = $color['red'];\r\n\t\t\t\t$green = $color['green'];\r\n\t\t\t\t$blue = $color['blue'];\r\n\t\t\t\t$red_index = imagecolorat($red_channel, $x, $y);\r\n\t\t\t\t$green_index = imagecolorat($green_channel, $x, $y);\r\n\t\t\t\t$blue_index = imagecolorat($blue_channel, $x, $y);\r\n\t\t\t\t$red_color = imagecolorallocate($red_channel, $red, 0, 0);\r\n\t\t\t\t$green_color = imagecolorallocate($green_channel, 0, $green, 0);\r\n\t\t\t\t$blue_color = imagecolorallocate($blue_channel, 0, 0, $blue);\r\n\t\t\t\timagesetpixel($red_channel,$x,$y,$red_color);\r\n\t\t\t\timagesetpixel($green_channel,$x,$y,$green_color);\r\n\t\t\t\timagesetpixel($blue_channel,$x,$y,$blue_color);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array('red'=>new ImageManipulation($red_channel),'green'=>new ImageManipulation($green_channel),'blue'=>new ImageManipulation($blue_channel));\r\n\t}", "public function setImageChannelMask ($channel) {}", "public function getImageChannelKurtosis ($channel = Imagick::CHANNEL_DEFAULT) {}", "function getImageChannelStatistics(){}", "function getImageChannelDistortions($reference, $metric, $channel){}", "public function getImageColorspace () {}", "public function getImageChannelKurtosis($channel){}", "function getImageChannelRange($channel){}", "public function setimagechanneldepth($channel, $depth){}", "public function levelImage($blackPoint, $gamma, $whitePoint, $channel = false) {\n\t}", "public function getimagechanneldepth($channel_type){}", "public function fxImage ($expression, $channel = Imagick::CHANNEL_ALL) {}", "public function negateImage ($gray, $channel = Imagick::CHANNEL_ALL) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get data by id join with m_dat
function get_by_id_join($id) { $this->db->join('m_dat', 'kegiatan_rektorat.kode_m_dat=m_dat.kode'); $this->db->where($this->id, $id); return $this->db->get($this->table)->row(); }
[ "function ambil_data_id($id)\n\t\t{\n\t\t\t$this->db->where($this->id,$id);\n\t\t\treturn $this->db->get($this->nama_table)->row();\n\t\t}", "function ambil_data_id($id)\n\t{\n\t\t$this->db->where($this->id,$id);\n\t\treturn $this->db->get($this->nama_table)->row();\n\n\t}", "public function selectDataByID($id){\n $sql = \"SELECT t1.*, t2.title as property_title, t2.id as property_id, t2.house_number as property_number, t2.address_1 as property_address_1, t2.address_2 as property_address_2, t2.address_3 as property_address_3, t2.address_4 as property_address_4, t2.postcode as property_postcode, t2.image as property_image, t3.firstname as lord_firstname, t3.surname as lord_surname, t3.id as lord_id, t3.email as lord_email, t4.firstname as tenant_firstname, t4.surname as tenant_surname, t4.id as tenant_id, t4.email as tenant_email, GROUP_CONCAT(DISTINCT t5.id separator ',') as check_in_room_ids, GROUP_CONCAT(DISTINCT t6.id separator ',') as check_out_room_ids, GROUP_CONCAT(DISTINCT t7.user_id separator ',') as user_ids\n\t\t\t\tFROM reports t1\n LEFT JOIN properties t2 ON t1.property_id = t2.id\n LEFT JOIN users t3 ON t1.lord_id = t3.id\n LEFT JOIN users t4 ON t1.lead_tenant_id = t4.id\n LEFT JOIN check_in_rooms t5 ON t1.id = t5.report_id\n LEFT JOIN check_out_rooms t6 ON t1.id = t6.report_id\n LEFT JOIN user_reports t7 ON t1.id = t7.report_id\n WHERE t1.id = :id\n\t\t\t\tGROUP BY t1.id\";\n\n\t\treturn $this->_db->select($sql, array(':id' => $id));\n\t}", "public function getDataById($id) {\n\t\treturn $this->simu !== null ? $this->simu->getDataById($id) : null;\n\t}", "function useSqlJoins($id)\n{\n\t$dataset = new DataHandler();\n\t$dataset->setTablename('items');\n\n\t// Values to read\n\t$dataset->set(\n\t\t 'name'\t\t\t\t\t// Field to select\n\t\t, null\t\t\t\t\t\t// Ignore the value\n\t\t, null\t\t\t\t\t\t// Default table\n\t\t, array('name' => array('name'))\t// Use an alias (\"AS\")\n\t\t, array('match' => array(DBMATCH_NONE))\t// Don't use it in the WHERE clause\n\t);\n\n\t$dataset->set(\t\t\t\t\t// Same for the value\n\t\t 'value'\n\t\t, null\n\t\t, null\n\t\t, array('name' => array('value'))\n\t\t, array('match' => array(DBMATCH_NONE))\n\t);\n\n\t$dataset->set(\n\t\t 'name'\t\t\t\t\t// Select the section name\n\t\t, null\n\t\t, 'sections'\t\t\t\t// This comes from the sections tables\n\t\t, array('name' => array('section'))\n\t\t, array('match' => array(DBMATCH_NONE))\n\t);\n\n\t// Searches\n\t$dataset->set('id', $id);\t\t// Item ID to select\n\n\t// Joins\n\t$dataset->setJoin(\t\t\t\t// Create an implicit inner join\n\t\t 'section_id'\t\t\t\t// Match the section_id field\n\t\t, array('sections', 'id')\t// Join with the id field in the sections table\n\t);\n\t$dataset->prepare (); // Default prepare action is DATA_READ\n\t// The following query is prepared (assuming the MySQL driver and using backticks):\n\t// SELECT `exa_items`.`name` AS name\n\t// , `exa_items`.`value` AS value\n\t// , `exa_sections`.`name` AS section\n\t// FROM `exa_items`\n\t//, `exa_sections`\n\t// WHERE `exa_items`.`id` = $id\n\t// AND ``exa_items`.`section_id` = `exa_sections`.`id`\n\n\t$dataset->db ($_list, __LINE__, __FILE__); // Execute the query\n\tprint_r($_list); // Show the results\n}", "function getData($id,$field='stat_id')\n\t{\n\t\t$sql=\"select \n\t\t `stat_id` id, `stat_name` name, `stat_code` code, `stat_created` created,\n\t\t `stat_modified` modified\n\t\tfrom {$this->table} where {$field}='$id'\";\n\t\tif($field=='stat_id'){\n\t\t\t$data=dbFetchOne($sql);\n\t\t}else{ \n\t\t\t$result=dbQuery($sql,1);\n\t\t\t$data=array();\n\t\t\t$i=0;\n\t\t\tforeach ($result->result_array() as $row){\n\t\t\t\t$data[]=$row;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function getSolrData($id){\n\t$persons = $this->getAdapter();\n\t$select = $persons->select()\n\t\t->from($this->_name,array(\n\t\t\t'identifier' => 'CONCAT(\"people-\",people.id)','people.id',\n\t\t\t'fullname', 'surname','forename',\n\t\t\t'longitude' => 'lon','latitude' => 'lat',\n\t\t\t'email','created','updated',\n\t\t\t'coordinates' => 'CONCAT(lat,\",\",lon)', \n\t\t\t'place' => 'CONCAT(address,\" \",town_city,\" \",county)'\n\t\t\t ))\n\t\t->joinLeft('primaryactivities',$this->_name . '.primary_activity = primaryactivities.id',\n\t\tarray('activity' => 'term'))\n\t\t->where('people.id = ?',(int)$id);\n\treturn\t$persons->fetchAll($select);\t\n\t}", "public function getJoinDownloadDataKaryawan($id)\n {\n $this->db->select('*');\n $this->db->from('karyawan');\n $this->db->join('perusahaan', 'perusahaan.id=karyawan.perusahaan_id');\n $this->db->join('penempatan', 'penempatan.id=karyawan.penempatan_id');\n $this->db->join('jabatan', 'jabatan.id=karyawan.jabatan_id');\n $this->db->join('jam_kerja', 'jam_kerja.id_jam_kerja=karyawan.jam_kerja_id');\n $this->db->where('penempatan_id ', $id);\n $this->db->order_by('nama_karyawan');\n $query = $this->db->get();\n return $query->result();\n }", "public function selectDataByID($id){\n $sql = \"SELECT t1.id, t1.trainer_id, t1.image, t1.text, t1.sort, t1.is_active\n\t\t\t\tFROM results t1\n\t\t\t\tWHERE t1.id = :id\n \";\n\n return $this->_db->select($sql, array(':id' => $id));\n }", "public function consultByIdGameData($id){\n\treturn $this->gameDataCO->_consultByIdGameData($id);\n }", "public function get_data_id($id){\n $this->db->where('tj_id',$id);\n return $this->db->get(self::$table_tunjangan);\n }", "function getData()\r\n {\r\n $sql = \"SELECT * FROM mto.Test\";\r\n /*INNER JOIN nco.First_part_mto_run\r\n ON nco.Test.formID = nco.First_part_mto_run.formID\r\n ORDER BY nco.Test.formID*/\r\n\r\n $statement = $this->_dbh->prepare($sql);\r\n\r\n $statement->execute();\r\n\r\n return $statement->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function getDataById($id)\n {\n $this->db->where('CONSECUTIVO', $id);\n return $this->db->get('Dep')->result();\n }", "function getData($id,$field='ben_id')\n\t{\n\t\t$sql=\"select \n\t\t `ben_id` `id`, `ben_name` `name`, `ben_detail` `detail`, `ben_modified` `modified`, `ben_created` `created`, `ben_status` `status`, `ben_howto` `howto`,ben_pos pos\n\t\tfrom {$this->table} where {$field}='$id'\";\n\t\tif($field=='ben_id'){\n\t\t\t$data=dbFetchOne($sql);\n\t\t}else{ \n\t\t\t$result=dbQuery($sql,1);\n\t\t\t$data=array();\n\t\t\t$i=0;\n\t\t\tforeach ($result->result_array() as $row){\n\t\t\t\t$data[]=$row;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function getRecord($name, $data_id);", "private static function getDataobjectById(int $id) : Dataobject\n {\n return static::getDataobjectsTable()->get($id);\n }", "function M_tampil_data_by_id($id)\n {\n $this->db->select('a.* ,b.Category_name, c.Type_name,c.Size_type');\n $this->db->from('product as a');\n $this->db->join('category as b ','b.Id=a.Category_id');\n $this->db->join('product_type as c','c.Id=a.Product_type_id');\n $this->db->where('a.Id',$id);\n return $this->db->get()->row();\n }", "private function fetchData()\n\t{\n\t\tif (!empty($this->id_cache)) {\n\t\t\tforeach ($this->id_cache as $type=>$column_name) {\t// Example: news => news_id\n\t\t\t\tforeach ($column_name as $name=>$items) {\t// Example: news_id => array(1,3,5,6,7)\n\t\t\t\t\t// We will only fetch the Data which is in the pattern\n\t\t\t\t\t// This is to Ignore fetching the data that we do not want\n\t\t\t\t\t$column_arr = array();\n\t\t\t\t\tforeach ($this->rewrite_code[$type] as $key=>$tag) {\t// Example: news_id => array(\"%news_id%\", \"%news_title%\")\n\t\t\t\t\t\tforeach ($this->pattern_replace[$type] as $key=>$pattern) {\n\n\t\t\t\t\t\t\t// We check if the Tag exist in the Pattern\n\t\t\t\t\t\t\t// if Yes, then Find the suitable Column_name in the DB for that Tag.\n\t\t\t\t\t\t\tif (strstr($pattern, $tag)) {\n\t\t\t\t\t\t\t\tif (isset($this->dbinfo[$type]) && array_key_exists($tag, $this->dbinfo[$type])) {\n\t\t\t\t\t\t\t\t\tif (!in_array($this->dbinfo[$type][$tag], $column_arr)) {\n\t\t\t\t\t\t\t\t\t\t$column_arr[] = $this->dbinfo[$type][$tag];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// If there are any Columns to be fetch from Database\n\t\t\t\t\tif (!empty($column_arr)) {\n\t\t\t\t\t\t$column_arr[] = $name;\t// Also fetch the Unique_ID like news_id, thread_id\n\t\t\t\t\t\t$column_names = implode(\",\", $column_arr);\t// Array to String conversion for MySQL Query\n\t\t\t\t\t\t$dbname = $this->dbname[$type];\t// Table Name in Database\n\t\t\t\t\t\t$unique_col = $name;\t// The Unique Column name for WHERE condition\n\t\t\t\t\t\t$items = array_unique($items); // Remove any duplicates from the Array\n\t\t\t\t\t\t$ids_to_fetch = implode(\",\", $items);\t// IDs to fetch data of\n\t\t\t\t\t\t$fetch_query = \"SELECT \".$column_names.\" FROM \".$dbname.\" WHERE \".$unique_col.\" IN(\".$ids_to_fetch.\")\";\t// The Query\n\t\t\t\t\t\t$result = dbquery($fetch_query);\t// Execute Query\n\t\t\t\t\t\t$this->queries[] = $fetch_query;\n\t\t\t\t\t\tif (dbrows($result)) {\n\t\t\t\t\t\t\twhile ($data = dbarray($result)) {\n\t\t\t\t\t\t\t\tforeach ($column_arr as $key=>$col_name) {\n\t\t\t\t\t\t\t\t\t$this->CacheInsertDATA($type,$data[$unique_col],$col_name,$data[$col_name]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getDatas()\n {\n return $this->hasMany(Datas::className(), ['id' => 'datas_id'])->viaTable('{{%datas_aula}}', ['aula_id' => 'id']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Content data to inspect or redact. Generated from protobuf field bytes data = 2;
public function getData() { return $this->readOneof(2); }
[ "public function data($msg_data)\n {\n }", "public function getData() {\n $data = $this->_data;\n if ($this->_message !== null) {\n $data = $this->_message->getData();\n }\n\n return $data;\n }", "public function isData()\n {\n return $this->opcode & 0x0 === 0x00;\n }", "public function getData()\n {\n $data = $this->data;\n if ($this->cursor > 0) {\n $data .= $this->workingByte->getData();\n }\n return $data;\n }", "public function getDataMessage()\n {\n return $this->get(self::DATAMESSAGE);\n }", "function RawDataEntry($data) {\n\t\t$this->data = $data;\n\t}", "public function getContents() {\n return substr($this->data, 0, $this->getPayloadStartingByte() + $this->getPayloadLength());\n }", "public function __construct($data) {\n \n // Data N = LENGTH - 18 bytes\n \n //file_put_contents(\"/var/tmp/rawPacket\", $data);\n\n $s = &$this->sections;\n $s['bs'] = new binarySection($data);\n $s['stx'] = new binarySection($data);\n $s['length'] = new binaryLengthSection($data);\n $s['tid'] = new binaryTidSection($data);\n $s['result'] = new binarySection($data);\n $s['command'] = new binarySection($data);\n $s['mac'] = new binaryMacSection($data);\n $s['data'] = new binaryDataSection($data, $s['length']->decode()-18);\n $s['checksum'] = new binarySection($data);\n $s['etx'] = new binarySection($data);\n }", "private function socketGetMessage()\n {\n $data = $head = $this->streamGetContent(1);\n $head = unpack('C*', $head);\n\n //extract opcode from first byte\n $isBinary = (($head[1] & 15) == 2) && $this->_acceptDiffResponseFormat;\n\n $data .= $maskAndLength = $this->streamGetContent(1);\n list($maskAndLength) = array_values(unpack('C', $maskAndLength));\n\n //set first bit to 0\n $length = $maskAndLength & 127;\n\n $maskSet = FALSE;\n if($maskAndLength & 128)\n {\n $maskSet = TRUE;\n }\n\n if($length == 126)\n {\n $data .= $payloadLength = $this->streamGetContent(2);\n list($payloadLength) = array_values(unpack('n', $payloadLength)); // S for 16 bit int\n }\n elseif($length == 127)\n {\n $data .= $payloadLength = $this->streamGetContent(8);\n //lets save it as two 32 bit integers and reatach using bitwise operators\n //we do this as pack doesn't support 64 bit packing/unpacking.\n list($higher, $lower) = array_values(unpack('N2', $payloadLength));\n $payloadLength = $higher << 32 | $lower;\n }\n else\n {\n $payloadLength = $length;\n }\n\n //get mask\n if($maskSet)\n {\n $data .= $mask = $this->streamGetContent(4);\n }\n\n // get payload\n $data .= $payload = $this->streamGetContent($payloadLength);\n\n if($maskSet)\n {\n //unmask payload\n $payload = $this->unmask($mask, $payload);\n }\n\n //ugly code but we can seperate the two errors this way\n if($head === FALSE || $payload === FALSE || $maskAndLength === FALSE\n || $payloadLength === FALSE || ($maskSet === TRUE && $mask === FALSE)\n )\n {\n $this->error('Could not stream contents', 500);\n }\n if(empty($head) || empty($payload) || empty($maskAndLength)\n || empty($payloadLength) || ($maskSet === TRUE && empty($mask)))\n {\n $this->error('Empty reply. Most likely the result of an irregular request. (Check custom Meta, or lack of in the case of a non-isolated query)', 500);\n }\n\n //now that we have the payload lets parse it\n try\n {\n $unpacked = $this->message->parse($payload, $isBinary);\n }\n catch(\\Exception $e)\n {\n $this->error($e->getMessage(), $e->getCode(), TRUE);\n }\n\n return $unpacked;\n }", "function message_content_load($data)\n\t {\n\t return $this->_get_message_by_data_id($data);\n\t }", "public function getPayloadData();", "public function getMessageData()\n\t{\n\t\treturn $this->data;\n\t}", "public function getRawData() { return $this->_data; }", "private function set_wp_data_from_http_message() {\n\n\t\t$data = \\json_decode( (string) $this->http_message->getBody() );\n\n\t\tparent::set_data( \\is_scalar( $data ) ? $data : (array) $data );\n\t}", "public function unpackData($data){\r\n return $data;\r\n }", "public function setCDATA( $data )\n {\n $this->{0} = $data;\n }", "public function provideValidMessageData()\n {\n $data[][] = \"foobar\";\n $data[][] = \"f\\0\\0bar\";\n $data[][] = null;\n\n $data[] = array(\"foobar\", \"text/plain\");\n $data[] = array(\"f\\0\\0bar\", \"application/octet-stream\");\n $data[] = array(null, \"application/xml+xhtml\");\n $data[] = array(null, null);\n\n return $data;\n }", "public function getDataControl()\n {\n return $this->readOneof(2);\n }", "public function getMessageData()\n {\n return (string) $this->response->ProcessMsgResult->MsgData;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
public function getChainTips() { return $this->__call('getchaintips'); }
[ "public function getTips();", "function InfoTips()\n\t{\n\t\treturn $this->infotips;\n\t}", "public function getTips() {\n\t\t$listEntries = Temboo_Results::getSubItemByKey(Temboo_Results::getSubArrayByKey(Temboo_Results::getSubArrayByKey(json_decode($this->get('Response'), true), \"response\"), \"tips\"), \"items\");\n\t\t$resultArray = array();\n\t\tif(!is_null($listEntries)) {\n\t\t\tforeach ($listEntries as $entry) {\n\t\t \tarray_push($resultArray, new Foursquare_Tip_output($entry));\n\t\t\t}\n\t\t}\n\t\treturn $resultArray;\n\t}", "public function getEnemyTips()\n {\n return $this->enemyTips;\n }", "public function getTipos()\n {\n return $this->tipos;\n }", "public function initTips() {\n $this->saveTipsList($this->tipsList);\n }", "public function tips()\n {\n return $this->hasMany(Tips::class);\n }", "public function tips() :int\n {\n $payments = $this->payments;\n\n $tips = 0;\n foreach ($payments as $payment) {\n $tips += $payment->tip;\n }\n\n return $tips;\n }", "public function getTip() {\n return $this->get(self::TIP);\n }", "public function getTipDetails() {\n\t\treturn new Foursquare_TipDetails_output(Temboo_Results::getSubItemByKey(Temboo_Results::getSubArrayByKey(json_decode($this->get('Response'), true), \"response\"), \"tip\"));\n\t}", "public function getTip() {\n\t\treturn new Foursquare_Tip_output(Temboo_Results::getSubItemByKey($this->base, \"tip\"));\n\t}", "function Tips()\r\n\t\t{\r\n\t\t\t$this->page_title = Language::Get('Tips and Hints');\r\n\t\t\t$this->menuItem = 'tips';\r\n//\t\t\t$this->hasLeftColumn = false;\r\n\t\t}", "function femfxmkII_filter_tips($tips, $long = FALSE, $extra = '') {\n\treturn '';\n}", "public function getTips($number);", "public function getHints() {\n return $this->hints;\n\t}", "public function getHints()\n {\n return $this->hints;\n }", "function btrTranslations_block_info() {\n // This hook returns an array, each component of which is an array of block\n // information. The array keys are the 'delta' values used in other block\n // hooks.\n\n // The required block information is a block description, which is shown\n // to the site administrator in the list of possible blocks. You can also\n // provide initial settings for block weight, status, etc.\n\n // Displays top 5 (or 10) contributors, over the last week (or month).\n $blocks['topcontrib'] = array(\n 'info' => t('B-Translator: Top contributors during the last period'),\n 'cache' => DRUPAL_CACHE_CUSTOM,\n );\n\n // Suggestion and voting statistics for the last week, month and year.\n $blocks['statistics'] = array(\n 'info' => t('B-Translator: Contribution statistics (for the last week, month and year)'),\n 'cache' => DRUPAL_CACHE_CUSTOM,\n );\n\n // Suggestions and votes submited lately.\n $blocks['latest'] = array(\n 'info' => t('B-Translator: Latest contributions'),\n 'cache' => DRUPAL_CACHE_CUSTOM,\n );\n\n return $blocks;\n}", "public function getTipus()\n {\n return $this->tipus;\n }", "function hhmiv2_breadcrumb_block_info() {\n $blocks['hhmiv2_breadcrumb'] = array(\n 'info' => t('hhmiv2_breadcrumb'),\n 'cache' => DRUPAL_CACHE_GLOBAL,\n );\n return $blocks;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ this fix lft and rgt attribute in the __categories for the created categories
public static function fixCategoryAttributes() { $db = JFactory::getDBO(); $query = "SELECT MAX(rgt) FROM #__categories"; $db->setQuery($query); $rgt = $db->loadResult(); $query = "SELECT id FROM #__categories WHERE lft = 0 AND rgt = 0 AND parent_id = 1"; $db->setQuery($query); $elements = $db->loadObjectList(); foreach($elements as $categoryToFix) { $tmpLFT = $rgt+1; $tmpRGT = $tmpLFT+1; $query = "UPDATE #__categories SET lft = $tmpLFT, rgt = $tmpRGT WHERE id = ".$categoryToFix->id; $db->setQuery($query); $db->execute(); $rgt++; } }
[ "function _make_cat_compat(&$category)\n{\n}", "protected function set_categories_map() {\n $this->partial(\"Generating categories map ... \");\n $categories = get_terms([\n 'taxonomy' => 'travel-dir-category',\n 'hide_empty'=> false,\n ]);\n foreach ($categories as $category) {\n $this->categories[$category->term_id] = $category->name;\n }\n $this->success(\"OK\");\n }", "public function _buildCustomCategories() {\n $gId = $this->addCustomGrouping();\n $cId1 = $this->addCustomCategory('Custom Level 1', $gId);\n $cId2 = $this->addCustomCategory('Custom Level 2', $cId1);\n $cId3 = $this->addCustomCategory('Custom Level 3', $cId2);\n }", "private function makeCategories()\n\t{\n\t\t$logger = true;\n\t\tJLog::add('Creating categories');\n\n\t\t$levelMap = $this->levelmap;\n\t\tforeach($levelMap as $key => $id) {\n\t\t\t$parts = explode('.',$key);\n\t\t\t$level = count($parts);\n\t\t\t$parent = ($level == 1) ? 1 : $levelMap[ implode('.', array_slice($parts, 0, count($parts) - 1)) ];\n\t\t\t$id = $this->createCategory($level, $key, $parent);\n\t\t\t$levelMap[$key] = $id;\n\n\t\t\t// Remove articles from category\n\t\t\t$db = JFactory::getDBO(); \n\n\t\t\t$query = 'DELETE FROM #__assets WHERE `id` IN (SELECT `asset_id` FROM `#__content` WHERE `catid` = '.$db->q($id).')';\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query(); // Whoosh!\n\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->delete('#__content')\n\t\t\t\t->where($db->qn('catid').' = '.$db->q($id));\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query();\n\t\t}\n\n\t\tJLog::add(\"Updating levelmap in model state\", JLog::DEBUG);\n\n\t\t$this->levelmap= $levelMap;\n\t}", "private function processCategories(){\n\t\tif ($this->m_catInfo == null){\n\t\t\t$this->m_catInfo = new EasyAsk_Impl_CategoriesInfo($this->m_doc->source);\n\t\t}\n\t}", "function setup_categories() {\n\n\t\tglobal $categories;\n\t\t$categories = array();\n\t\t$rsp = db_fetch(\"\n\t\t\tSELECT *\n\t\t\tFROM boundaryissues_categories\n\t\t\");\n\t\tforeach ($rsp['rows'] as $item) {\n\t\t\t$id = $item['id'];\n\t\t\t$categories[$id] = $item;\n\t\t}\n\t\t$rsp = db_fetch(\"\n\t\t\tSELECT *\n\t\t\tFROM boundaryissues_categories_struct\n\t\t\");\n\t\tforeach ($rsp['rows'] as $item) {\n\t\t\t$id = $item['source_id'];\n\t\t\t$categories[$id]['parent'] = intval($item['target_id']);\n\t\t}\n\t}", "function taxonomy_fix()\n{\n $query = db_select('field_data_field_category', 'gd')\n ->fields('gd', array('entity_id','field_category_tid'))\n ->condition('bundle', 'blog');\n $results = $query->execute()->fetchAll();\n \n foreach ($results as $values)\n {\n \n $nnid=$values->entity_id;\n $node1=node_load($nnid);\n taxonomy_build_node_index($node1);\ndrupal_set_message($nnid);\n\n }\n return(\"Blog category are fixed Just create a test Blog and assign to each category to rebuild Menu Block\");\n}", "function create_or_get_categories($data)\r\n{\t\r\n\t$ids = array('post' => array(),'cleanup' => array());\r\n\t$items = array_map('trim', explode(',', $data['templatic_post_category']));\r\n\t$taxonomies = get_object_taxonomies( (object) array( 'post_type' => $data['templatic_post_type'],'public' => true, '_builtin' => true ));\r\n\t\r\n foreach ($items as $item){\r\n\t\t\r\n \tif (is_numeric($item)){\r\n \tif (get_category($item) !== null){\r\n \t$ids['post'][] = $item;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$parent_id = 0;\r\n // item can be a single category name or a string such as\r\n // Parent > Child > Grandchild\r\n $categories = array_map('trim', explode('>', $item));\r\n if (count($categories) > 1 && is_numeric($categories[0])) {\r\n $parent_id = $categories[0];\r\n if (get_category($parent_id) !== null) {\r\n // valid id, everything's ok\r\n $categories = array_slice($categories, 1);\r\n } \r\n }\r\n foreach ($categories as $category) {\r\n if ($category) {\r\n $term = term_exists($category, $taxonomies[0], $parent_id);\t\t\t\t \r\n if ($term) {\r\n $term_id = $term['term_id'];\r\n } else {\r\n $term_id = wp_insert_category(array('cat_name' => $category,'category_parent' => $parent_id,'taxonomy' => $taxonomies[0]));\r\n $ids['cleanup'][] = $term_id;\r\n }\r\n $parent_id = $term_id;\r\n }\r\n }\r\n \t$ids['post'][] = $term_id;\r\n \t}\r\n\t}\r\n\treturn $ids;\r\n}", "public function createCategoryTaxonomy() {\n if ( ! taxonomy_exists( self::TAXONOMY ) ) {\n\t\t $taxonomyParams = array(\n\t 'label' => __( 'Marker category', 'basic-google-maps-placemarks' ),\n\t\t 'labels' => array(\n\t\t 'name' => __( 'Marker categories', 'basic-google-maps-placemarks' ),\n\t\t 'singular_name' => __( 'Marker category', 'basic-google-maps-placemarks' ),\n ),\n\t\t 'hierarchical' => true,\n\t\t 'rewrite' => array( 'slug' => self::TAXONOMY ),\n\t\t 'update_count_callback' => '_update_post_term_count'\n );\n\n\t\t register_taxonomy(\n\t\t self::TAXONOMY,\n\t\t self::POST_TYPE,\n\t\t apply_filters( self::PREFIX . 'category-taxonomy-params', $taxonomyParams )\n\t\t );\n\t }\n\t}", "function tx_commerce_leafCategoryData()\t{\n\t\tglobal $LANG, $BACK_PATH;\n\n\t\t$this->title='Category';//$LANG->sL('LLL:EXT:commerce/lib/locallang.php:category',1);\n\n\t\t$this->table='tx_commerce_categories';\n\t\t$this->parentTable='tx_commerce_categories';\n\t\t$this->parentField='';\n\t\t$this->mm_field='parent_category';\n\t\t$this->mm_table='tx_commerce_categories_parent_category_mm';\n\t\t$this->clause=' AND NOT deleted ORDER BY sorting,title';\n\t\t$this->fieldArray = Array('uid','title','navtitle');\n\t\t$this->defaultList = 'uid,pid,tstamp,sorting';\n\t}", "function BH_create_category() {\r\n\t\t$languages = icl_get_languages('skip_missing=0');\r\n\t\t\r\n\t\tif ($languages)\r\n\t\t\t// set category terms 'last updated' transient for each language\r\n\t\t\tforeach ($languages as $key => $val)\r\n\t\t\t\tset_transient('MC-category-' . $key . '-terms-updated', time());\r\n\t\t\r\n\t\t// set menu 'last updated' transients\r\n\t\tBH_set_cached_menus();\r\n\t}", "function sos_chapter_change_cat_object() {\n global $wp_taxonomies;\n $labels = &$wp_taxonomies['product_cat']->labels;\n $labels->name = 'Topic';\n $labels->singular_name = 'Topic';\n $labels->add_new = 'Add Topic';\n $labels->add_new_item = 'Add Topic';\n $labels->edit_item = 'Edit Topic';\n $labels->new_item = 'Topic';\n $labels->view_item = 'View Topic';\n $labels->search_items = 'Search Topics';\n $labels->not_found = 'No Topics found';\n $labels->not_found_in_trash = 'No Topics found in Trash';\n $labels->all_items = 'All Topics';\n $labels->menu_name = 'Topic';\n $labels->name_admin_bar = 'Topic';\n}", "function migrate_categories(){\n foreach ($this->migrate_categories as $old_term => $new_term) {\n $old_terms_existing = taxonomy_get_term_by_name($old_term);\n $new_terms_existing = taxonomy_get_term_by_name($new_term);\n if(!empty($old_terms_existing) && !empty($new_terms_existing)){\n $old_term_obj = array_shift($old_terms_existing);\n $new_term_obj = array_shift($new_terms_existing);\n foreach (taxonomy_select_nodes($old_term_obj->tid) as $nid) {\n $node = node_load($nid);\n foreach($node->field_category['und'] as $index => $cat){\n if($cat['tid'] == $old_term_obj->tid){\n $node->field_category['und'][$index]['tid'] = $new_term_obj->tid;\n }\n }\n // keep the old \"changed\" value\n $node->override_changed = $node->changed;\n // disable pathauto (will only uncheck the UI box if alias is different than pathauto-generated path)\n $node->path['pathauto'] = FALSE;\n node_save($node);\n }\n }else{\n drupal_set_message('The following term could not be renamed because it was not found: ' . $old_name);\n }\n }\n }", "public function initCats()\n {\n // zioigor - 20110426 missing call to tablename method for table_prfix\n $t = $this->tablename(\"catalog_category_entity\");\n $csg = $this->tablename(\"core_store_group\");\n $cs = $this->tablename(\"core_store\");\n $ccev = $t . \"_varchar\";\n $ea = $this->tablename(\"eav_attribute\");\n $result = $this->selectAll(\n \"SELECT cs.store_id,csg.website_id,cce.entity_type_id,cce.path,ccev.value as name\n FROM $cs as cs\n JOIN $csg as csg on csg.group_id=cs.group_id\n JOIN $t as cce ON cce.entity_id=csg.root_category_id\n JOIN $ea as ea ON ea.attribute_code='name' AND ea.entity_type_id=cce.entity_type_id\n JOIN $ccev as ccev ON ccev.attribute_id=ea.attribute_id AND ccev.entity_id=cce.entity_id\n \"\n );\n foreach ($result as $row) {\n $rootinfo = array(\n \"path\" => $row[\"path\"],\n \"etid\" => $row[\"entity_type_id\"],\n \"name\" => $row[\"name\"],\n \"rootarr\" => explode(\"/\", $row[\"path\"])\n );\n $this->_catroots[$row[\"store_id\"]] = $rootinfo;\n $this->_catrootw[$row[\"website_id\"]][] = $row[\"store_id\"];\n if ($this->_cat_eid == null) {\n $this->_cat_eid = $row[\"entity_type_id\"];\n }\n }\n }", "function _setCategories(){\r\n \t$categories = $this->Place->Category->find('list',array( \r\n\t\t\t\t\t\t\t\t 'fields' => array('id', 'name','parent'), \r\n\t\t\t\t\t\t\t\t 'order' => 'Category.name ASC', \r\n\t\t\t\t\t\t\t\t 'recursive' => -1)); \r\n\r\n\t\t$arrayCat = array();\r\n\t\tforeach($categories as $n => $cat):\r\n\t\t\tif($categories[$n][$n] == $cat[$n]){\r\n\t\t\t\t$arrayCat[$cat[$n]] = $categories[$n];\r\n\t\t\t}\r\n\t\tendforeach;\r\n\t\t$this->set('categories',$arrayCat);\r\n }", "public function get_categories() {\n\t\treturn [ 'atl-category' ];\n\t}", "private function update_categories() {\n\t\t\t$categories = get_categories();\n\t\t\tforeach ( $categories as $category ) {\n\t\t\t\t$this->connection->hmSet(\n\t\t\t\t\t'category:' . $category->term_id,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'term_id' => $category->term_id,\n\t\t\t\t\t\t'name' => $category->name,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}", "function fix_category_atributte($category_uid=0){\n \tif($category_uid==0){\n \t\t\treturn ;\n \t\t}\n \t\t$fieldSelected='*';\n \t\t$mm_table='tx_commerce_categories_attributes_mm';\n \t\t$where='uid_local= '.$category_uid;\n \t$rs=$GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_correlationtype,uid_foreign',$mm_table,$where,$groupBy='',$orderBy='',$limit='');\n \t$GLOBALS['TYPO3_DB']->debug('exec_SELECTquery');\n\t\t$xmlArray=array();\n\t\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($rs)){\n \t\t\tif(empty($xmlArray['data']['sDEF']['lDEF']['ct_'.$row['uid_correlationtype']]['vDEF']))\n \t\t\t\t$xmlArray['data']['sDEF']['lDEF']['ct_'.$row['uid_correlationtype']]['vDEF']=$row['uid_foreign'];\n \t\t\telse\n \t\t\t\t$xmlArray['data']['sDEF']['lDEF']['ct_'.$row['uid_correlationtype']]['vDEF'].=','.$row['uid_foreign'];\n\t\t }\n\t\t$arrayToSave=array();\n\t\t$xmlText=t3lib_div::array2xml_cs ($xmlArray, 'T3FlexForms', $options=array(), $charset='');\n\t\t$arrayToSave['attributes']=$xmlText;\n\n\t\t$rs=$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_commerce_categories','uid='.$category_uid,$arrayToSave,$no_quote_fields=false);\n\t\t$GLOBALS['TYPO3_DB']->debug('exec_UPDATEquery');\n\n }", "public function default_ads_categories()\n {\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send a notification email to each borrower reminding them to ship their items.
protected function notifyBorrowers() { $leadTime = $this->getLeadTime(); $from = Carbon::now()->addDays($leadTime - 1)->toDateString(); $to = Carbon::now()->addDays($leadTime)->toDateString(); ItemRental::with('borrower')->where('status', ItemRental::STATUS_INITIATED) ->whereNull('borrower_shipped_at') ->whereBetween('return_on', [$from, $to]) ->chunk(self::CHUNK, function($rentals) { /** @var ItemRental $rental */ foreach ($rentals as $rental) { $this->notifyUserAboutRental($rental->borrower, $rental); } }); }
[ "public function notifyOwner()\n {\n global $config, $reefless, $account_info;\n\n $reefless->loadClass('Mail');\n\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate(\n $config['listing_auto_approval']\n ? 'free_active_listing_created'\n : 'free_approval_listing_created'\n );\n\n if ($config['listing_auto_approval']) {\n $link = $reefless->getListingUrl(intval($this->listingID));\n } else {\n $myPageKey = $config['one_my_listings_page'] ? 'my_all_ads' : 'my_' . $this->listingType['Key'];\n $link = $reefless->getPageUrl($myPageKey);\n }\n\n $mail_tpl['body'] = str_replace(\n array('{username}', '{link}'),\n array(\n $account_info['Username'],\n '<a href=\"' . $link . '\">' . $link . '</a>',\n ),\n $mail_tpl['body']\n );\n $GLOBALS['rlMail']->send($mail_tpl, $account_info['Mail']);\n }", "private function notify ($itemNumberBooked) {\n\t\n\t\t$items = $this->getItems($itemNumberBooked['item']);\n\t\t\n\t\t// Send the User an email about booking\n\t\t$email = new Email();\n\t\t\n\t\t// Subject to put in for user email\n\t\t$subjectForEmail = \"Booking Request for \".$items->Item;\n\t\n\t\t$member = Member::currentUser();\t\t\t\n\t\t\n\t\t$email->setFrom($this->SendEmailAs);\n\t\t\n\t\t$email->setTo(Member::currentUser()->Email);\n\t\t\n\t\t$email->setSubject($subjectForEmail);\n\t\t\n\t\t$email->setTemplate('UserNotificationEmail');\n\t\t\n\t\t$itemNumberBooked['ItemBookedFrom'] = $itemNumberBooked['from'];\n\t\t\n\t\t$itemNumberBooked['ItemBookedTo'] = $itemNumberBooked['to'];\n\t\t\n\t\tunset($itemNumberBooked['from']);\n\t\t\n\t\tunset($itemNumberBooked['to']);\n\t\t\n\t\t$bookingDetails = new DataObject($itemNumberBooked);\n\t\t\t\t\t\n\t\t$email->populateTemplate($member);\n\t\t$email->populateTemplate($items);\n\t\t$email->populateTemplate($bookingDetails);\n\t\t\t\t\n\t\t\n\t\t// Send email\n\t\t$email->send();\n\n\t\t// Send Custodian Email about booking\n\t\t$email = new Email();\n\t\t\n\t\t// Subject to put in for custodians email \n\t\t$subjectForEmail = \"Booking Request from \".$member->FirstName.\" \".$member->Surname;\n\t\n\t\t$email->setTo($this->CustodianEmailAddress);\n\n\t\t$email->setFrom($this->SendEmailAs);\n\t\t\n\t\t$email->setSubject($subjectForEmail);\n\t\t\n\t\t$email->setTemplate('CustodianNotificationEmail');\n\t\t\n\t\t$email->populateTemplate($member);\n\t\t\n\t\t$email->populateTemplate($items);\n\t\t\n\t\t$email->populateTemplate($bookingDetails);\n\t\t\t\t\t\t\t\t\t\t\n\t\t// Send email to custodian\n\t\t$email->send();\t\t\n\t\t\n\t}", "public function email_reminder()\n {\n $remind=$this->Budget_model->get_budget_reminders();\n\n if ($remind) {\n \n foreach ($remind as $res) {\n \n echo $res->user_id;\n \n }\n }\n \n }", "public static function sendBalanceReminderEmails()\n {\n $mailer = new Self;\n return User::all()->filter(function ($user) {\n return $user->getBalance() > 0;\n })->each(function ($user) use ($mailer) {\n $mailer->sendBalanceReminderEmail($user);\n });\n }", "private function sendNotifications()\n {\n $users = $this->Public_model->getNotifyUsers();\n $myDomain = $this->config->item('base_url');\n if (!empty($users)) {\n foreach ($users as $user) {\n $this->sendmail->sendTo($user, 'Admin', 'New order in ' . $myDomain, 'Hello, you have new order. Can check it in /admin/orders');\n }\n }\n }", "public function send_pendingFriendRequestRemainderMails() {\n\n\t\t// find all users have pending request\n\t\t$pendingFriendsUserList = $this->MyFriends->find('list', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'pending_request_count >' => 0\n\t\t\t),\n\t\t\t'fields' => array(\n\t\t\t\t'my_id'\n\t\t\t)\n\t\t));\n\n\t\tforeach ($pendingFriendsUserList as $userId) {\n\t\t\t// get notification preferenece for user\n\t\t\tif ($this->NotificationSetting->isEmailNotificationOn($userId, 'friends_request_reminder')) {\n\t\t\t\t$pendingFriends = $this->MyFriends->getPendingFriendsList($userId);\n\t\t\t\tif (!empty($pendingFriends)) {\n\t\t\t\t\t$this->__send_pendingReminderMailToRegisteredUser($userId, $pendingFriends, EmailTemplateComponent::PENDING_REQUEST_REMINDER_TEMPLATE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function notify()\n {\n $users = User::findAllUsersWithAccess('contact', PERM_READ);\n\n if (! $users) {\n return;\n }\n\n Mail::send('contact::emails.notify', ['msg' => $this], function ($message) use ($users) {\n $user = $users->pop();\n\n /** @var \\Illuminate\\Mail\\Message $message */\n $message->to($user->email, $user->username);\n\n while ($user = $users->pop()) {\n $message->cc($user->email, $user->username);\n }\n\n $message->subject(trans('app.new').': '.trans('app.object_contact_message'));\n });\n }", "public function notify()\n {\n\n $senderName = $this->user->displayName;\n $senderGuid = $this->user->guid;\n\n foreach ($this->message->users as $user) {\n\n // User dont wants any emails\n #if ($user->getSetting(\"receive_email_messaging\", \"core\") == User::RECEIVE_EMAIL_NEVER) {\n # continue;\n #}\n // Ignore this user itself\n if ($user->id == $this->user_id)\n continue;\n\n $message = new HMailMessage();\n $message->view = 'application.modules.mail.views.emails.NewMessageEntry';\n $message->addFrom(HSetting::Get('systemEmailAddress', 'mailing'), HSetting::Get('systemEmailName', 'mailing'));\n $message->addTo($user->email);\n $message->subject = Yii::t('MailModule.models_MessageEntry', 'New message in discussion from %displayName%', array('%displayName%' => $senderName));\n $message->setBody(array(\n 'message' => $this->message,\n 'entry' => $this,\n 'user' => $user,\n 'sender' => $this->user,\n 'senderName' => $senderName,\n 'senderGuid' => $senderGuid,\n 'originator' => $this->message->originator,\n ), 'text/html');\n Yii::app()->mail->send($message);\n }\n }", "public function sendEmailNotificationToAdmin()\n {\n $employeeRepo = new EmployeeRepository(new Employee);\n $employee = $employeeRepo->findEmployeeById(1);\n\n Mail::to($employee)\n ->send(new sendEmailNotificationToAdminMailable($this->findOrderById($this->model->id)));\n }", "public function sendNotification()\n\t{\t\t\n\t\t\\IPS\\Email::buildFromTemplate( 'nexus', 'newInvoice', array( $this, $this->summary() ), \\IPS\\Email::TYPE_TRANSACTIONAL )\n\t\t\t->send(\n\t\t\t\t$this->member,\n\t\t\t\tarray_map(\n\t\t\t\t\tfunction( $contact )\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $contact->alt_id->email;\n\t\t\t\t\t},\n\t\t\t\t\titerator_to_array( $this->member->alternativeContacts( array( 'billing=1' ) ) )\n\t\t\t\t),\n\t\t\t\t( ( in_array( 'new_invoice', explode( ',', \\IPS\\Settings::i()->nexus_notify_copy_types ) ) AND \\IPS\\Settings::i()->nexus_notify_copy_email ) ? explode( ',', \\IPS\\Settings::i()->nexus_notify_copy_email ) : array() )\n\t\t\t);\n\t}", "public function sendVerificationMailToUnverifiedUsersAction()\n\t{\n\t\t//******************************************************************************//\n\t\t// Script to send verification mail to all unverified users\n\t\t//******************************************************************************//\n\t\t$unverified_users = \\Extended\\ilook_user::getUnverifiedUsers();\n\t\tforeach($unverified_users as $unverified_user)\n\t\t{\n\t\t\tEmail_CommonMails::verificationEmail($unverified_user['id']);\n\t\t}\n\t\tdie;\n\t}", "private function EmailUser(){\n //notifying them of the sale completion.\n }", "function sendEmail($mod=\"no\")\n\t{\n\t\tglobal $IRMName;\n\t\tif(!Config::Get('notifyassignedbyemail')\n\t\t && !Config::Get('userupdates')\n\t\t && !Config::Get('notifynewtrackingbyemail'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t// First, work out who's going to get this missive\n\t\t$recipients = array();\n\n\n\t\t// Assignee\n\t\tif(Config::Get('notifyassignedbyemail')\n\t\t && $this->Assign != $IRMName)\n\t\t{\n\t\t\t$assignUser = new User($this->Assign);\n\t\t\tif ($assignUser->getEmail())\n\t\t\t{\n\t\t\t\t$recipients[] = $assignUser->getEmail();\n\t\t\t}\n\t\t}\n\n\t\t// Author\n\t\tif(Config::Get('userupdates')\n\t\t && $this->EmailUpdatesToAuthor == \"yes\"\n\t\t && $this->AuthorEmail != \"\"\n\t\t && $IRMName != $this->Author)\n\t\t{\n\t\t\t$recipients[] = $this->AuthorEmail;\n\t\t}\n\n\t\t// E-mail addresses that get copies of all tracking e-mails\n\t\tif(Config::Get('notifynewtrackingbyemail'))\n\t\t{\n\t\t\t$recipients = array_merge($recipients, split('[^a-zA-Z0-9@_\\.]+', Config::Get('newtrackingemail')));\n\t\t}\n\n\t\t// People who have signed on to get info on this ticket\n\t\t$recipients = array_merge($recipients, split('[^a-zA-Z0-9_\\.@]', $this->OtherEmails));\n\n\t\t// Who do we send it from?\n\t\t$currentUser = new User($IRMName);\n\t\t$sender = $currentUser->getEmail();\n\n\t\t// What are we going to tell them?\n\t\t$body = $this->mailBody();\n\t\t$body = str_replace(\"<br>\", \"\\n\", $body);\n\t\t$body = str_replace(\"<p>\", \"\\n\\n\", $body);\n\t\t$body = str_replace(\"<br />\" , \"\\n\", $body);\n\n\n\t\t$body = strip_tags($body);\n\n\t\tif($mod == \"no\"){\n\t\t\t$subject = sprintf(_(\"IRM: New Job %s has been ADDED to the work request system.\"), $this->ID);\n\t\t} else if ($this->Status == \"complete\") {\n $subject = sprintf(_(\"IRM: Job %s has been COMPLETED by %s\"), $this->ID, $IRMName);\n } else {\n\t\t\t$subject = sprintf(_(\"IRM: Job %s has been MODIFIED by %s\"), $this->ID, $IRMName);\n\t\t}\n\n\t\t$headers = \"\";\n\t\t$headers .= \"From: $sender\\n\";\n\t\t$headers .= \"X-From-IRM: IRM\\n \";\n\n\t\tforeach ($recipients as $r)\n\t\t{\n\t\t\tif ($r)\n\t\t\t{\n\t\t\t\tmail($r, $subject, $body, $headers);\n\t\t\t}\n\t\t}\n\t}", "public function mailFinishedAuctionOwners()\n {\n $finishedAuctions = Auction::resultArrayToClassArray(DB::select(\"\n SELECT id,title,user_id\n FROM auctions\n WHERE auctions.end_datetime > DATEADD(MINUTE, -1, GETDATE()) AND auctions.end_datetime < GETDATE()\n \"));\n\n $endingAuctions = Auction::resultArrayToClassArray(DB::select(\"\n WITH finalInfo AS(\n SELECT *\n FROM bids\n WHERE EXISTS(\n SELECT bids.auction_id, bids.amount as amount\n FROM bids bd\n LEFT JOIN auctions\n ON bids.auction_id=auctions.id\n WHERE EXISTS (\n SELECT auctions.id\n FROM auctions\n WHERE auctions.end_datetime > DATEADD(MINUTE, -1, DATEADD(MINUTE,10,GETDATE())) AND auctions.end_datetime < DATEADD(MINUTE,10,GETDATE()) AND bids.auction_id=auctions.id\n )\n AND bids.auction_id=bd.auction_id AND bids.amount=bd.amount\n )\n )\n\n SELECT DISTINCT auction_id,title,email\n FROM (\n SELECT auction_id,user_id,amount, Rank()\n over (Partition BY auction_id\n ORDER BY amount DESC ) AS Rank\n FROM finalInfo\n ) rs\n LEFT JOIN auctions\n ON auctions.id=rs.auction_id\n LEFT JOIN users\n ON users.id=rs.user_id\n WHERE Rank <= 5\n \"));\n\n foreach ($finishedAuctions as $auction) {\n Mail::to($auction->getSeller()->email)->send(new AuctionEnded($auction->title));\n }\n foreach ($endingAuctions as $auction) {\n Mail::to($auction->email)->send(new AuctionEnding($auction->title, $auction->auction_id));\n }\n\n\n $data = [\n 'endingAuctionsCount' => count($endingAuctions),\n 'finishedAuctionsCount' => count($finishedAuctions)\n ];\n return view(\"auctions.finishedauctions\")->with($data);\n }", "public function sendRejectMail(Request $request) {\n \n $rejects = Payment::where('status','rejected')->count();\n $creators = User::where('role','1')->orwhere('role','4')->where('status','enabled')->get();\n\n foreach ($creators as $creator){\n\n Mail::to($creator->email)->queue(new rejectPV($rejects));\n }\n\n return redirect()->back();\n }", "public function actionNotify()\n {\n foreach (Task::getByDeadline(3) as $task){\n $user = Users::findOne($task['user_id']);\n if (!is_null($user)){\n \\Yii::$app->mailer->compose()\n ->setTo($user->email)\n ->setFrom([$user->email => $user->name])\n ->setSubject('Deadline is coming -- ' . $task['name'])\n ->setTextBody(Html::a('Task link', ['view', 'id' => $task['id']]))\n ->send();\n\n }\n }\n }", "public static function remindAssignedUser() {\n $unrespondedToTickets = Self::getUnrespondedToTickets(15);\n\n if($unrespondedToTickets->count() > 0) {\n foreach($unrespondedToTickets as $ticket) {\n $vendor = $ticket->assignedTo;\n\n $message = \"<p>Hello {$vendor->name}.<br/> You are yet to respond to the ticket ID <a href='{{ route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]) }}''>#{{$ticket->ticket_id}}</p>. <p>If further delayed, your unit head would be notified of your delayed response to this ticket. <br/><br/>Thank you</p>\";\n $title = \"Ticket #{$ticket->ticket_id} is yet to receive a response\";\n send_email($vendor->name, $vendor->email, $message, route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]), $title);\n\n }\n }\n }", "public static function broadcastEmailNotifications()\n {\n $activeAccounts = static::find()->active();\n foreach($activeAccounts->each(50) as $account){\n $account->sendAgentsNotificationEmail();\n }\n }", "public function send($notifiables, $notification);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get provider by hotel_id
public function getHotelProvider($hotel_id) { $hotel=$this->hotels->where('id',$hotel_id)->all(); $provider=$this->providers->where('id',$hotel[$hotel_id-1]['provider_id'])->all(); return $provider; }
[ "public function get_hotel($id);", "public function get($hotelID);", "function getHotelDetails($hotelId);", "public function getProviderId();", "public function getHotelsFromTheProvider($request)\n {\n $this->providerHotels = array(\n array(\n 'hotel'=> 'BestHotel1',\n 'hotelRate'=> 2,\n 'hotelFare'=> 200,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),array(\n 'hotel'=> 'BestHotel2',\n 'hotelRate'=> 4,\n 'hotelFare'=> 400,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),array(\n 'hotel'=> 'BestHotel3',\n 'hotelRate'=> 1,\n 'hotelFare'=> 100,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),array(\n 'hotel'=> 'BestHotel4',\n 'hotelRate'=> 5,\n 'hotelFare'=> 500,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),array(\n 'hotel'=> 'BestHotel5',\n 'hotelRate'=> 4,\n 'hotelFare'=> 300,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),array(\n 'hotel'=> 'BestHotel6',\n 'hotelRate'=> 4,\n 'hotelFare'=> 400,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),array(\n 'hotel'=> 'BestHotel7',\n 'hotelRate'=> 2,\n 'hotelFare'=> 200,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),array(\n 'hotel'=> 'BestHotel8',\n 'hotelRate'=> 1,\n 'hotelFare'=> 100,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),array(\n 'hotel'=> 'BestHotel9',\n 'hotelRate'=> 5,\n 'hotelFare'=> 400,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),array(\n 'hotel'=> 'BestHotel10',\n 'hotelRate'=> 3,\n 'hotelFare'=> 300,\n 'roomAmenities'=> 'amenity1,amenity2,amenity3'\n ),);\n }", "public function getHailProvider()\n {\n return $this->providers()->where('name', 'hail')->first();\n }", "public function getEventProviderId();", "public function getHotel()\n {\n return $this->hotel;\n }", "protected function provider() {\n if (($l = $this->newsletterList()) && ($p = $l->provider())) {\n return $p;\n }\n }", "static function hotelRoom($id){\n $query = DB::table('kamar')\n ->where('idHotel', $id)\n ->get();\n\n return $query;\n }", "abstract public function getProviderIdentifier();", "function retrieve_venue_by_id($venue_id){\n\t\t\n\t\t$sql = \"SELECT \tdv.venue \t\t\tas venue_name,\n\t\t\t\t\t\tdv.description \t\tas venue_description,\n\t\t\t\t\t\tdv.street_address\tas venue_street_address,\n\t\t\t\t\t\tdv.zip \t\t\t\tas venue_zip,\n\t\t\t\t\t\tdv.main_image\t\tas venue_main_image,\n\t\t\t\t\t\tdv.medium_image\t\tas venue_medium_image,\n\t\t\t\t\t\tdv.thumbnail_image\tas venue_thumbnail_image,\n\t\t\t\t\t\tdv.icon_image\t\tas venue_icon_image,\n\t\t\t\t\t\tdc.city\t\t\t\tas venue_city\n\t\t\n\t\t\t\tFROM\tdata_venues dv\n\t\t\t\tJOIN\tdata_cities dc\n\t\t\t\tON\t\tdv.city_id = dc.id\n\t\t\t\t\n\t\t\t\tWHERE\tdv.id = $venue_id\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->row();\n\t\t\n\t}", "public static function getProvider() {\n return self::$_idProvider;\n }", "function getHotelInfo($hotel_id) {\n global $connection;\n $sql =\n \" SELECT Hotel.name, Hotel.stars, Hotel.description\n FROM Hotel WHERE Hotel.id = $hotel_id\n \";\n $result = $connection->query($sql);\n\n if ($result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) {\n $hotel_name = $row[\"name\"];\n $hotel_stars = $row[\"stars\"];\n $hotel_description = $row[\"description\"];\n }\n }\n \n return array($hotel_name, $hotel_stars, $hotel_description);\n }", "public function getProvider($type);", "public function getProvinciaById($id){\n $this->db->query('SELECT * FROM provincia WHERE id = :id');\n $this->db->bind(':id', $id);\n\n $row = $this->db->single();\n\n return $row;\n }", "function get_products_of_provider ($id) {\n\t\tglobal $dbo;\n\t\t$result = $dbo->select(\n\t\t\tFALSE,\n\t\t\tPRODUCT_TABLE_NAME,\n\t\t\tarray(\n\t\t\t\t'id', 'product_type',\n\t\t\t\t'product_class', 'name', 'product_desc_eng',\n\t\t\t\t'log_date', 'product_desc_chn'\n\t\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'provider_id',\n\t\t\t\t\t'value' => $id,\n\t\t\t\t\t'ctype' => '='\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'column_name' => 'product_type',\n\t\t\t\t\t'asc_desc' => 'ASC'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getProviderByName($name);", "function getProvider( $type, $tag ){\n\n if( !empty( $tag ) ){\n\n // Find by tag\n\n foreach( $this->providers[$type] as $provider ){\n\n if( $tag == $provider->getTag() ) return $provider;\n\n }\n\n } else {\n\n // Returns default provider\n\n return $this->providers[$type][0] ? $this->providers[$type][0] : null;\n\n }\n\n return null;\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function Name: checkoldpasswordAction() Fuction to check the old password
public function checkoldpasswordAction() { /** * get current password */ $password = $this->getRequest ()->getPost ( 'current_password' ); /** * get customer password from session */ $oldPass = Mage::getSingleton ( 'customer/session' )->getCustomer ()->getPasswordHash (); $hashArr = explode ( ':', $oldPass ); /** * check the hash value of the password */ if (md5 ( $hashArr [1] . $password ) == $hashArr [0]) { echo 'true'; } else { echo 'false'; } }
[ "function Trigger_CheckOldPassword(&$tNG) {\r\r\n return Trigger_UpdatePassword_CheckOldPassword($tNG);\r\r\n}", "function Trigger_CheckOldPassword(&$tNG) {\n return Trigger_UpdatePassword_CheckOldPassword($tNG);\n}", "public function checkOldPassword()\n {\n if (!$this->hasErrors()) {\n $user = User::findByUsername(Yii::$app->user->username);\n if (!$user || !$user->validatePassword($this->password_old)) {\n $this->addError('password_old', 'Incorrect old password.');\n }\n }\n }", "function Trigger_CheckOldPassword(&$tNG) {\r\n return Trigger_UpdatePassword_CheckOldPassword($tNG);\r\n}", "public function checkIfPasswordMatchesOldPassword() {\n $passwordHasher = new SimplePasswordHasher();\n\n // Get the DB password\n $user = $this->requestAction('users/getUserById/' . $this->data[$this->alias]['id']);\n $dbPassword = $user[\"User\"][\"password\"];\n// print($dbPassword . \"<br/>\");\n// print($this->data[$this->alias]['oldPassword'] . \"<br/>\");\n\n // Get the old password that has been entered\n $oldPassword = $passwordHasher->hash($this->data[$this->alias]['oldPassword']);\n// \n// print($oldPassword);\n// die;\n\n // Check if they match\n if ($dbPassword == $oldPassword) {\n $this->validator()->getField('newPassword')->getRule('required')->allowEmpty = false;\n $this->validator()->getField('newPassword2')->getRule('required')->allowEmpty = false;\n return true;\n }\n\n return false;\n }", "function Trigger_CheckOldPassword(&$tNG) {\n return Trigger_UpdatePassword_CheckOldPassword($tNG);\n}", "public function verifyOldPass() {\n\t\t$userId = $this->userAuth->getUserId();\n\t\t$user = $this->findById($userId);\n\t\t$oldpass=$this->userAuth->makePassword($this->data['User']['oldpassword'], $user['User']['salt']);\n\t\treturn ($user['User']['password']===$oldpass);\n\t}", "function is_old_password($oldpass=''){ \n if($oldpass){\n $oldpass = md5($oldpass);\n $sql = \"SELECT password from customer_info WHERE cust_id = '{$_SESSION['cust_id']}' AND password = '{$oldpass}'\";\n $qry = mysql_query($sql);\n if(mysql_num_rows($qry) == 0 ){\n return FALSE;\n }\n \n return TRUE;\n }\n}", "public function verifyOldPass() {\n $userId = $this->userAuth->getUserId();\n $user = $this->find('first', array('conditions' => array('id' => $userId)));\n $oldpass = $this->userAuth->makePassword($this->data['User']['oldpassword'], $user['User']['salt']);\n return ($user['User']['password'] === $oldpass);\n }", "public function forgotPasswordOldPassword()\n {\n //Data\n $userData = $this->loadData('generic_admin_user', array('role_name' => 'Administrators'),\n array('email', 'user_name'));\n $emailData = array('email' => $userData['email']);\n $loginData = array('user_name' => $userData['user_name'], 'password' => $userData['password']);\n //Steps\n $this->loginAdminUser();\n $this->navigate('manage_admin_users');\n $this->adminUserHelper()->createAdminUser($userData);\n //Verifying\n $this->assertMessagePresent('success', 'success_saved_user');\n //Steps\n $this->logoutAdminUser();\n $this->adminUserHelper()->forgotPassword($emailData);\n //Verifying\n $this->addParameter('adminEmail', $emailData['email']);\n $this->assertMessagePresent('success', 'retrieve_password');\n //Steps\n $this->adminUserHelper()->loginAdmin($loginData);\n //Verifying\n $this->assertTrue($this->checkCurrentPage('dashboard'), $this->getParsedMessages());\n }", "protected function oldPasswordMatch()\n\t{\n\t\tif ( !Hash::check($this->data('old'), $this->user->password) ) {\n\t\t\t$this->setError(['old' => ['Det gamla lösenordet var ej korrekt.']] ,403);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function getOldPassword(){\n return $this->_oldPassword; \n }", "public function checkPassword() {}", "public function changePassword() {\n \n if($this->validatePassword($this->oldPassword))\n {\n $this->salt = $this->generateSalt();\n $this->password = $this->hashPassword($this->newPassword, $this->salt);\n return true;\n \n }\n else {\n $this->addError('oldPassword', '<b>&#10006;</b> &nbsp; Your old password does not match our records.');\n return false;\n }\n \n \n }", "public function editUserPasswordChk() {\r\n\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = array('user_id', 'user_password');\r\n $condition_to_pass = array(\"user_password\" => base64_encode($this->input->post('old_user_password')));\r\n $arr_login_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n if (count($arr_login_data)) {\r\n echo 'true';\r\n } else {\r\n echo 'false';\r\n }\r\n }", "public function isvalid_old_password($pswd)\n\t{\n\t\t$fields = array('user_id');\n\t\t$where = array('user_id' => $this->_user_id, 'pwd' => md5($pswd));\n $table = 'user_master';\n $data = $this->tbl_generic_model->get($table, $fields, $where, 0, 0, true, true);\n $user_id = ! empty($data) ? $data->user_id : null;\n\n if(empty($user_id)) {\n \t$this->form_validation->set_message('isvalid_old_password', 'The {field} does not match with saved password');\n return FALSE;\n } else {\n \treturn $user_id;\n }\n\t}", "function checkOldPassword($sUsername, $sPassword) {\n\t\t\t$sSQL = \"select * from tbl_admin where `username` = '\".$sUsername.\"' \n\t\t\tand password = '\".md5($sPassword).\"' and user_type = 'admin'\";\n\t\t\t$rs = $this->Execute($sSQL);\n\t\t\tif($rs && $rs->RecordCount() > 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function ChangePasswordAction() {\n }", "public function mustChangePassword() {\n\t\n\t\t// get a copy of the application configuration\n\t\t$conf = new AppConfiguration();\n\t\t\n\t\t$class = LS_LOGIN_TABLE;\n\t\t\n\t\t// create a new user record\n\t\t$user = new $class( $_REQUEST[LS_USERNAME_FIELDNAME], true );\n\t\n\t\t// get the age of the password in months\n\t\t$pwd_age = Utility::get_time_difference( $user->get('password_age'), date('Y-m-d',time()));\n\t\n\t\tif ( $conf->getMaxPasswordAge() && $pwd_age['days'] > ( $conf->getMaxPasswordAge() * 30))\n\t\t\treturn true;\n\t\telse return false;\n\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds a new rule for a given attribute.
public function addRule(string $attribute, $rule): void { if (empty($this->rules[$attribute])) { $this->rules[$attribute] = []; } if (!is_array($this->rules[$attribute])) { if (is_string($this->rules[$attribute])) { $this->rules[$attribute] = array_map(function ($item) { return $item; }, explode('|', $this->rules[$attribute])); } else { $this->rules[$attribute] = array($this->rules[$attribute]); } } $this->rules[$attribute][] = $rule; }
[ "abstract protected function addRule($rule);", "public function addRule(Rule\\RuleIface $rule);", "public function add($rule)\n {\n $this->_rules[] = $rule;\n }", "public function addRule(bnfRule $rule){\n\t\t$this->rules[] = $rule;\t\t\n\t}", "function _add_rule( $oRule )\n\t{\n\t\t$this->_aoRules[] = $oRule;\n\t}", "public function addRule(IRouterRule $rule) {\n $this->rules[] = $rule;\n }", "public function addAttribute($attribute) {\n $class = 'Noize\\\\Build\\\\Php\\\\Ast\\\\' . ucfirst($attribute) . 'AstAttribute';\n $this->node->addAttribute(new $class(0, $this->node));\n }", "public function addRule()\n {\n $args = func_get_args();\n $argsCount = count($args);\n\n $role = null;\n $resource = null;\n $action = null;\n\n if ( $argsCount == 4 || $argsCount == 3 ) {\n $role = $args[0];\n $resource = $args[1];\n $rule = $args[2];\n if ( $argsCount == 4) {\n $action = $args[3];\n }\n } elseif( $argsCount == 2 ) {\n $rule = $args[0];\n $action = $args[1];\n } elseif ( $argsCount == 1 ) {\n $rule = $args[0];\n } else {\n throw new InvalidArgumentException(__METHOD__ . ' accepts only one, tow, three or four arguments');\n }\n\n if ( ! is_null($role) && ! $role instanceof Role ) {\n throw new InvalidArgumentException('Role must be an instance of SimpleAcl\\Role or null');\n }\n\n if ( ! is_null($resource) && ! $resource instanceof Resource ) {\n throw new InvalidArgumentException('Resource must be an instance of SimpleAcl\\Resource or null');\n }\n\n if ( is_string($rule) ) {\n $ruleClass = $this->getRuleClass();\n $rule = new $ruleClass($rule);\n }\n\n if ( ! $rule instanceof Rule ) {\n throw new InvalidArgumentException('Rule must be an instance of SimpleAcl\\Rule or string');\n }\n\n if ( $exchange = $this->hasRule($rule) ) {\n $rule = $exchange;\n }\n\n if ( ! $exchange ) {\n $this->rules[] = $rule;\n }\n\n if ( $argsCount == 3 || $argsCount == 4 ) {\n $rule->setRole($role);\n $rule->setResource($resource);\n }\n\n if ( $argsCount == 2 || $argsCount == 4 ) {\n $rule->setAction($action);\n }\n }", "public function add(Rule $rule)\n {\n $this->rules[] = $rule;\n }", "abstract protected function buildFromToRule($attribute);", "public function add($attribute, $validator){ }", "public function addAttribute($attribute)\n {\n if ($attribute instanceof CardAttribute) {\n $this->attributes[] = $attribute;\n\n return $this;\n }\n\n if ($attribute instanceof Closure) {\n $attribute($new = new CardAttribute());\n $this->attributes[] = $new;\n\n return $this;\n }\n\n throw new InvalidArgumentException(\n 'Invalid attribute type. Expected '.CardAttribute::class.' or '.Closure::class.'.'\n );\n }", "public static function add_attribute()\n {\n }", "public function addRule(\\PricePolicyRule\\Rule $rule) {\n $this->rules[] = $rule;\n }", "public function add_rule( WP_Autoload_Rule $rule );", "public function addPropertyRule(string $property, Rule $rule): void;", "public static function add_new_attribute()\n {\n }", "public function addInputRule($input)\n\t{\n\t\tif(Object::isType($input, 'InputRule') && Text::isValidString($input->getName()))\n\t\t\t$this->inputRules[$input->getName()] = $input;\n\t}", "function addrule($x)\n {\n $x = func_get_args();\n // if (isset($this->rules) == FALSE) $this->rules = array();\n array_push($this->rules, $x);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
passing 2 6 byte publish packets
public function test_parser_handles_two_packets() { $this->parser->read(pack('C*', 0x30, 0x08, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x6b, 0x00, 0x01, 0x30, 0x08, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x6b, 0x00, 0x01)); $this->assertTrue($this->parsedPacketList[0] instanceof Packet\Publish); $this->assertTrue($this->parsedPacketList[1] instanceof Packet\Publish); $this->assertEquals(2, count($this->parsedPacketList)); $this->assertEquals(0, $this->parser->bytesRemaining()); }
[ "function sn_mqtt_process_publish_packet($mqtt_id, $pkt)\r\n{\r\n\t$qos = sn_mqtt_get_message_qos($pkt);\r\n\t$rcv_msg_id = sn_mqtt_get_message_id($pkt);\r\n\r\n\tif($qos == 2)\r\n\t{\r\n\t\t$return_val = MQTT_RETURN_MSG_NEW;\r\n\r\n\t\t$dup_flag = sn_mqtt_get_message_dup($pkt);\r\n\r\n\t\tif($dup_flag && sn_mqtt_unack_list_exist($mqtt_id, $rcv_msg_id)) // This is an duplicated packet\r\n\t\t\t$return_val = MQTT_RETURN_MSG_DUPLICATE;\r\n\t\telse\r\n\t\t\tsn_mqtt_unack_list_add($mqtt_id, $rcv_msg_id); // Put packet ID into unacknowledged list\r\n\r\n\t\t$send_pkt = sn_mqtt_create_pubrec_packet($rcv_msg_id);\r\n\t\t$pkt_id = sn_mqtt_send_wait($mqtt_id, $send_pkt, MQTT_CTRL_PUBREL, $rcv_msg_id, MQTT_TIMEOUT_PUBLISH_MS);\r\n\r\n\t\tif($pkt_id >= 0)\r\n\t\t{\r\n\t\t\t// get response message from received buffer.\r\n\t\t\t$pubrel_pkt = sn_mqtt_get_packet($mqtt_id, $pkt_id);\r\n\t\t\tsn_mqtt_process_pubrel_packet($mqtt_id, $pubrel_pkt);\r\n\t\t}\r\n\r\n\t\treturn $return_val;\r\n\t}\r\n\telse\r\n\tif($qos == 1)\r\n\t{\r\n\t\t// In case of QoS = 1, when DUP flag is 1, we cann't sure that packet is duplicate\r\n\t\t$send_pkt = sn_mqtt_create_puback_packet($rcv_msg_id);\r\n\r\n\t\tsn_mqtt_send($mqtt_id, $send_pkt);\r\n\r\n\t\treturn MQTT_RETURN_MSG_NEW;\r\n\t}\r\n\telse\r\n\tif($qos == 0)\r\n\t\treturn MQTT_RETURN_MSG_NEW;\r\n}", "function publish($topic, $content, $qos = 0, $retain = 0){\r\n\t\t$i = 0;\r\n\t\t$buffer = \"\";\r\n\t\t$buffer .= $this->strwritestring($topic,$i);\r\n\t\t//$buffer .= $this->strwritestring($content,$i);\r\n\t\tif($qos){\r\n\t\t\t$id = $this->msgid++;\r\n\t\t\t$buffer .= chr($id >> 8); $i++;\r\n\t\t \t$buffer .= chr($id % 256); $i++;\r\n\t\t}\r\n\t\t$buffer .= $content;\r\n\t\t$i+=strlen($content);\r\n\t\t$head = \" \";\r\n\t\t$cmd = 0x30;\r\n\t\tif($qos) $cmd += $qos << 1;\r\n\t\tif($retain) $cmd += 1;\r\n\t\t$head{0} = chr($cmd);\r\n\t\t$head .= $this->setmsglength($i);\r\n\t\tfwrite($this->socket, $head, strlen($head));\r\n\t\tfwrite($this->socket, $buffer, $i);\r\n\t}", "function sn_mqtt_process_pubrec_packet($mqtt_id, $pkt)\r\n{\r\n\t$rcv_msg_id = sn_mqtt_get_message_id($pkt);\r\n\r\n\t// send PUBREL\r\n\t$send_pkt = sn_mqtt_create_pubrel_packet($rcv_msg_id);\r\n\t$return_val = sn_mqtt_send_wait($mqtt_id, $send_pkt, MQTT_CTRL_PUBCOMP, $rcv_msg_id, MQTT_TIMEOUT_PUBLISH_MS);\r\n\r\n\tif($return_val >= 0)\r\n\t{\r\n\t\tsn_mqtt_delete_packet($mqtt_id, $return_val); // delete response message from received buffer.\r\n\t\treturn MQTT_RETURN_SUCCESS;\r\n\t}\r\n\r\n\treturn $return_val;\r\n}", "function sn_mqtt_process_pubrel_packet($mqtt_id, $pkt)\r\n{\r\n\t$rcv_msg_id = sn_mqtt_get_message_id($pkt);\r\n\r\n\t// send PUBCOMP\r\n\t$send_pkt = sn_mqtt_create_pubcomp_packet($rcv_msg_id);\r\n\r\n\tif(sn_mqtt_send($mqtt_id, $send_pkt) == MQTT_RETURN_CONN_LOST)\r\n\t\treturn MQTT_RETURN_CONN_LOST; // socket is closed\r\n\r\n\t// remove message id from unacknowledged list;\r\n\tsn_mqtt_unack_list_remove($mqtt_id, $rcv_msg_id);\r\n\r\n\treturn MQTT_RETURN_SUCCESS;\r\n}", "public function publish($topic, $content, $retain = 0){\n $qos = 0;\n $i = 0;\n $buffer = \"\";\n\n $buffer .= $this->strwritestring($topic,$i);\n\n //$buffer .= $this->strwritestring($content,$i);\n\n $buffer .= $content;\n $i+=strlen($content);\n\n\n $head = \" \";\n $cmd = 0x30;\n if($qos) $cmd += $qos << 1;\n if($retain) $cmd += 1;\n\n $head{0} = chr($cmd);\n $head .= $this->setmsglength($i);\n\n fwrite($this->socket, $head, strlen($head));\n fwrite($this->socket, $buffer, $i);\n\n }", "function publish($topic, $content, $qos = 0, $retain = 0){\n\n\t\t$i = 0;\n\t\t$buffer = \"\";\n\n\t\t$buffer .= $this->strwritestring($topic,$i);\n\n\t\tif($qos){\n\t\t\t$id = $this->msgid++;\n\t\t\t$buffer .= chr($id >> 8); $i++;\n\t\t \t$buffer .= chr($id % 256); $i++;\n\t\t}\n\n\t\t$buffer .= $content;\n\t\t$i+=strlen($content);\n\n\t\t$head = \" \";\n\t\t$cmd = 0x30;\n\t\tif($qos) $cmd += $qos << 1;\n\t\tif($retain) $cmd += 1;\n\n\t\t$head{0} = chr($cmd);\t\t\n\t\t$head .= $this->setmsglength($i);\n\n\t\t$this->stream->write( $head . $buffer );\n\t}", "function _send_binary_packet($data)\n {\n if (!is_resource($this->fsock) || feof($this->fsock)) {\n user_error('Connection closed prematurely');\n $this->bitmask = 0;\n return false;\n }\n\n //if ($this->compress) {\n // // the -4 removes the checksum:\n // // http://php.net/function.gzcompress#57710\n // $data = substr(gzcompress($data), 0, -4);\n //}\n\n // 4 (packet length) + 1 (padding length) + 4 (minimal padding amount) == 9\n $packet_length = strlen($data) + 9;\n // round up to the nearest $this->encrypt_block_size\n $packet_length+= (($this->encrypt_block_size - 1) * $packet_length) % $this->encrypt_block_size;\n // subtracting strlen($data) is obvious - subtracting 5 is necessary because of packet_length and padding_length\n $padding_length = $packet_length - strlen($data) - 5;\n $padding = crypt_random_string($padding_length);\n\n // we subtract 4 from packet_length because the packet_length field isn't supposed to include itself\n $packet = pack('NCa*', $packet_length - 4, $padding_length, $data . $padding);\n\n $hmac = $this->hmac_create !== false ? $this->hmac_create->hash(pack('Na*', $this->send_seq_no, $packet)) : '';\n $this->send_seq_no++;\n\n if ($this->encrypt !== false) {\n $packet = $this->encrypt->encrypt($packet);\n }\n\n $packet.= $hmac;\n\n $start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838\n $result = strlen($packet) == fputs($this->fsock, $packet);\n $stop = strtok(microtime(), ' ') + strtok('');\n\n if (defined('NET_SSH2_LOGGING')) {\n $current = strtok(microtime(), ' ') + strtok('');\n $message_number = isset($this->message_numbers[ord($data[0])]) ? $this->message_numbers[ord($data[0])] : 'UNKNOWN (' . ord($data[0]) . ')';\n $message_number = '-> ' . $message_number .\n ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)';\n $this->_append_log($message_number, $data);\n $this->last_packet = $current;\n }\n\n return $result;\n }", "function process_packet($packet)\n{\n //IP Header\n $ip_header_fmt = 'Cip_ver_len/'\n .'Ctos/'\n .'ntot_len/'\n .'nidentification/'\n .'nfrag_off/'\n .'Cttl/'\n .'Cprotocol/nheader_checksum/Nsource_add/Ndest_add/';\n\n //Unpack the IP header\n $ip_header = unpack($ip_header_fmt , $packet);\n\n if($ip_header['protocol'] == '6')\n {\n print_tcp_packet($packet);\n }\n}", "public function onUdpPacket($pct) {}", "public function decodePublish($packet) {\n if (!is_string($packet) || (strlen($packet) <= 3)) {\n return false;\n }\n $flags = ord($packet[0]) & 0x0f;\n $duplicate = ($flags == 0x80);\n $retain = ($flags == 0x01);\n $qos = ($flags>>1) & 0x03;\n $topicLength = (ord($packet[1])<<8) + ord($packet[2]);\n $topic = substr($packet, 3, $topicLength);\n\n $payload = substr($packet, 3 + $topicLength); // Get the payload of the packet\n if ($qos == 0) {\n // no packet id for QoS 0, the payload is the message\n $message = $payload;\n $packetId = NULL;\n } else {\n if (strlen($payload) >= 2) {\n $packetId = (ord($payload[0])<<8) + ord($payload[1]);\n $message = substr($payload, 2); // skip packet id (2 bytes) for QoS 1 and 2\n } else {\n // 2 byte packet id required, but not found. exit gracefully (no failure)\n $packetId = NULL;\n $message = '';\n }\n }\n return [\n 'topic' => self::convertActiveMqTopic($topic),\n 'message' => $message,\n 'retain' => $retain,\n 'duplicate' => $duplicate,\n 'qos' => $qos,\n 'packetId' => $packetId,\n ];\n }", "function packet_50($Byte)\n\t{\n\t$b1 = u_0bis65535(50,$Byte[0],$Byte[1]);\n\t$b2 = GetValueInteger(LIGHT_BUMP_FRONT_RIGHT_SIGNAL);\n\tif ( $b1 != $b2 )SetValueInteger(LIGHT_BUMP_FRONT_RIGHT_SIGNAL,$b1);\n\t}", "function print_tcp_packet($packet)\n{\n $ip_header_fmt = 'Cip_ver_len/'\n .'Ctos/'\n .'ntot_len/';\n\n $p = unpack($ip_header_fmt , $packet);\n $ip_len = ($p['ip_ver_len'] & 0x0F);\n\n if($ip_len == 5)\n {\n\n //IP Header format for unpack\n $ip_header_fmt = 'Cip_ver_len/'\n .'Ctos/'\n .'ntot_len/'\n .'nidentification/'\n .'nfrag_off/'\n .'Cttl/'\n .'Cprotocol/'\n .'nip_checksum/'\n .'Nsource_add/'\n .'Ndest_add/';\n }\n else if ($ip_len == 6)\n {\n //IP Header format for unpack\n $ip_header_fmt = 'Cip_ver_len/'\n .'Ctos/'\n .'ntot_len/'\n .'nidentification/'\n .'nfrag_off/'\n .'Cttl/'\n .'Cprotocol/'\n .'nip_checksum/'\n .'Nsource_add/'\n .'Ndest_add/'\n .'Noptions_padding/';\n }\n\n $tcp_header_fmt = 'nsource_port/'\n .'ndest_port/'\n .'Nsequence_number/'\n .'Nacknowledgement_number/'\n .'Coffset_reserved/';\n\n //total packet unpack format\n $total_packet = $ip_header_fmt.$tcp_header_fmt.'H*data';\n\n $p = unpack($total_packet , $packet);\n $tcp_header_len = ($p['offset_reserved'] >> 4);\n\n if($tcp_header_len == 5)\n {\n //TCP Header Format for unpack\n $tcp_header_fmt = 'nsource_port/'\n .'ndest_port/'\n .'Nsequence_number/'\n .'Nacknowledgement_number/'\n .'Coffset_reserved/'\n .'Ctcp_flags/'\n .'nwindow_size/'\n .'nchecksum/'\n .'nurgent_pointer/';\n }\n else if($tcp_header_len == 6)\n {\n //TCP Header Format for unpack\n $tcp_header_fmt = 'nsource_port/'\n .'ndest_port/'\n .'Nsequence_number/'\n .'Nacknowledgement_number/'\n .'Coffset_reserved/'\n .'Ctcp_flags/'\n .'nwindow_size/'\n .'nchecksum/'\n .'nurgent_pointer/'\n .'Ntcp_options_padding/';\n }\n\n //total packet unpack format\n $total_packet = $ip_header_fmt.$tcp_header_fmt.'H*data';\n\n //unpack the packet finally\n $packet = unpack($total_packet , $packet);\n\n //prepare the unpacked data\n $sniff = array(\n\n 'ip_header' => array(\n 'ip_ver' => ($packet['ip_ver_len'] >> 4) ,\n 'ip_len' => ($packet['ip_ver_len'] & 0x0F) ,\n 'tos' => $packet['tos'] ,\n 'tot_len' => $packet['tot_len'] ,\n 'identification' => $packet['identification'] ,\n 'frag_off' => $packet['frag_off'] ,\n 'ttl' => $packet['ttl'] ,\n 'protocol' => $packet['protocol'] ,\n 'checksum' => $packet['ip_checksum'] ,\n 'source_add' => long2ip($packet['source_add']) ,\n 'dest_add' => long2ip($packet['dest_add']) ,\n ) ,\n\n 'tcp_header' => array(\n 'source_port' => $packet['source_port'] ,\n 'dest_port' => $packet['dest_port'] ,\n 'sequence_number' => $packet['sequence_number'] ,\n 'acknowledgement_number' => $packet['acknowledgement_number'] ,\n 'tcp_header_length' => ($packet['offset_reserved'] >> 4) ,\n\n 'tcp_flags' => array(\n 'cwr' => (($packet['tcp_flags'] & 0x80) >> 7) ,\n 'ecn' => (($packet['tcp_flags'] & 0x40) >> 6) ,\n 'urgent' => (($packet['tcp_flags'] & 0x20) >> 5 ) ,\n 'ack' => (($packet['tcp_flags'] & 0x10) >>4) ,\n 'push' => (($packet['tcp_flags'] & 0x08)>>3) ,\n 'reset' => (($packet['tcp_flags'] & 0x04)>>2) ,\n 'syn' => (($packet['tcp_flags'] & 0x02)>>1) ,\n 'fin' => (($packet['tcp_flags'] & 0x01)) ,\n ) ,\n\n 'window_size' => $packet['window_size'] ,\n 'checksum' => $packet['checksum'] . ' [0x'.dechex($packet['checksum']).']',\n ) ,\n\n 'data' => hex_to_str($packet['data'])\n );\n\n //print the unpacked data\n print_r($sniff);\n}", "function qruqsp_sams_hooks_packetReceived(&$ciniki, $tnid, $args) {\n //\n // If no packet in args, then perhaps a packet we don't understand\n //\n if( !isset($args['packet']['data']) ) {\n error_log('no data');\n return array('stat'=>'ok');\n }\n\n //\n // Check the control and protocol are correct\n //\n if( !isset($args['packet']['control']) || $args['packet']['control'] != 0x03 \n || !isset($args['packet']['protocol']) || $args['packet']['protocol'] != 0xf0 \n ) {\n error_log('wrong control/protocol');\n return array('stat'=>'ok');\n }\n\n //\n // Check for a message packet\n //\n if( isset($args['packet']['data'][0]) && $args['packet']['data'][0] == ':'\n && preg_match(\"/^:([a-zA-Z0-9\\- ]{9}):(.*)$/\", $args['packet']['data'], $matches) \n ) {\n $to_callsign = $matches[1];\n $content = $matches[2];\n\n if( isset($args['packet']['addrs'][1]) ) {\n $from_callsign = $args['packet']['addrs'][1]['callsign'];\n } else {\n $from_callsign = '??';\n }\n error_log('Received: (' . $to_callsign . ') ' . $content);\n\n //\n // Get a UUID for use in permalink\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUUID');\n $rc = ciniki_core_dbUUID($ciniki, 'qruqsp.sams');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'qruqsp.sams.15', 'msg'=>'Unable to get a new UUID', 'err'=>$rc['err']));\n }\n $uuid = $rc['uuid'];\n $msg_id = $uuid;\n\n //\n // FIXME: Check for a message ID\n //\n\n\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'qruqsp.sams.message', array(\n 'msg_id' => $msg_id,\n 'status' => 70,\n 'from_callsign' => $from_callsign,\n 'to_callsign' => $to_callsign,\n 'path' => '',\n 'content' => $content,\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'qruqsp.sams.14', 'msg'=>'Unable to store aprs message', 'err'=>$rc['err']));\n }\n }\n\n //\n // If the packet was parsed, or no aprs data was found, success is returned\n //\n return array('stat'=>'ok');\n}", "private function assemblePacket($type) {\n\t\t// <editor-fold defaultstate=\"collapsed\" desc=\"Assemble Packet\">\n $packet = \"SAMP\";\n $packet .= chr(strtok($this->server, \".\"));\n $packet .= chr(strtok(\".\"));\n $packet .= chr(strtok(\".\"));\n $packet .= chr(strtok(\".\"));\n $packet .= chr($this->port & 0xFF);\n $packet .= chr($this->port >> 8 & 0xFF);\n $packet .= $type;\n\n return $packet;\n\t\t// </editor-fold>\n }", "public function test_send_recv_picture_2_s8bit() {\n $this->assertTrue($this->send_recv('2', pow(2,7) - 1));\n }", "private function decodePubrec()\n {\n $this->packet_id = $this->bufPop(static::FL_FIXED, 2);\n $this->ack = chr(0x62) . chr(0x02) . $this->packet_id; //pubrel\n }", "function subscribe($mid, $qos_count) {\n}", "public function publish();", "function create_magic_packet() {\n\t\t\n\t\tfor($x = 0; $x < 6; $x++) {\n\t\t\t$this->magic_packet .= chr(0xff);\n\t\t}\n\t\t\n\t\t//\tEncode the MAC address\n\t\t$split_mac = explode(':', $this->destination_mac);\n\t\t\n\t\tforeach($split_mac as $mac_part) {\n\t\t\t$encoded_mac .= chr(hexdec($mac_part));\n\t\t}\n\n\t\t//\tAdd it to the magic packet\n\t\tfor($x = 0; $x < 16; $x++) {\n\t\t\t$this->magic_packet .= $encoded_mac;\n\t\t}\n\t\t\n\t\treturn $this->magic_packet;\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/!\brief Sets $active of this object to $tmp Returns 'false' if $tmp is not of type integer (as 0 is interpreted as false and all other numbers as true) or boolean. Returns 'true' else.
public function set_active($tmp) { if(!is_int($tmp) and !is_bool($tmp)) { echo "Wrong datatype. Use Active (BOOL)"; //Durch LOG ersetzen return false; } $this->active = (BOOL)$tmp; return true; }
[ "public function setActive($var)\n {\n GPBUtil::checkInt64($var);\n $this->active = $var;\n\n return $this;\n }", "private function isASetActive()\n\t{\n\t\treturn(is_numeric($this->active_id));\n\t}", "public function set_highlight($tmp)\n\t{\n\t\tif(!is_bool($tmp))\n\t\t{\n\t\t\techo \"Wrong datatype. Use Highlight (BOOL)\";\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->highlight = $tmp;\n\t\treturn true;\n\t}", "public function testSetGetActiveTrue()\n {\n $active = true;\n $item = (new Item())->setActive($active);\n $this->assertEquals($active, $item->isActive());\n }", "public function setActive($var)\n {\n GPBUtil::checkBool($var);\n $this->active = $var;\n\n return $this;\n }", "function setActive($active, $id) {\n\t\t$project = $this->forId($id);\n\n\t\tif ($active) {\n\t\t\tif (is_null($project->thumbnail_id)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$project->active = $active;\n\t\t$project->save();\n\n\t\treturn true;\n\t}", "function activeinactive()\n\t{\n\t\t$strquery\t=\t\"UPDATE \" . DB_PREFIX . \"user SET user_active='n' WHERE user_id in(\" . $this->uncheckedids . \")\";\n\t\t$result = mysql_query($strquery) or die(mysql_error());\n\t\tif($result == false)\n\t\t\treturn ;\n\t\t$strquery\t=\t\"UPDATE \" . DB_PREFIX . \"user SET user_active='y' WHERE user_id in(\" . $this->checkedids . \")\";\n\t\treturn mysql_query($strquery) or die(mysql_error());\n\t}", "function set_user_type($user_active)\n{\n\treturn ($user_active) ? USER_NORMAL : USER_INACTIVE;\n}", "public function intToBool()\n {\n /** @var ActiveRecord $activeRecord */\n $activeRecord = $this->owner;\n\n foreach ($activeRecord->getTableSchema()->columns as $column) {\n if (\n is_int($activeRecord->{$column->name})\n && $column->size === 1\n ) {\n $activeRecord->{$column->name} = (bool)$activeRecord->{$column->name};\n }\n }\n }", "public function setActiveTag($tag_id, $active) {\n\n $query = $this->db->prepare('UPDATE `tags`\n SET active=:active\n WHERE tag_id=:tag_id');\n if ($query->execute(array(\n ':tag_id' => $tag_id))) { return true; }\n else { return true; }\n }", "public function set_block($tmp)\n\t{\n\t\tif(!is_int($tmp))\n\t\t{\n\t\t\techo \"Wrong datatype. Use Block (INT)\";\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->block = $tmp;\n\t\treturn true;\n\t}", "public function setStatus( $active )\n\t\t{\n\t\t\t$this->_active = (bool) $active;\n\t\t}", "function readActive()\r\n {\r\n if (($this->readState()==dsInactive) || ($this->readState()==dsOpening) || ($this->_rs==null))\r\n {\r\n $this->_active=0;\r\n return(0);\r\n }\r\n else\r\n {\r\n $this->_active=true;\r\n return(true);\r\n }\r\n }", "public function setTemporary(bool $temporary);", "public function setActive($value) {\n\t\t$this->_active = $value;\n\t}", "public function setActive() {\n $this->_active = true;\n }", "function is_active()\r\n {\r\n return $this->userData['user_active'];\r\n }", "public function makeActive()\n {\n $this->newQuery()->where('user_id', $this->user_id)->where('id', $this->id)->update(['is_active' => true]);\n $this->newQuery()->where('user_id', $this->user_id)->where('id', '<>', $this->id)->update(['is_active' => false]);\n }", "function activeInactive()\n\t{\n\t\t$strquery\t=\t\"UPDATE \" . DB_PREFIX . \"state_idnumber SET state_idnumber_active='n' WHERE state_idnumber_id = \". $this->uncheckedids ;\n\t\t$result = mysql_query($strquery) or die(mysql_error());\n\t\tif($result == false)\n\t\t\treturn ;\n\t\t$strquery\t=\t\"UPDATE \" . DB_PREFIX . \"state_idnumber SET state_idnumber_active='y' WHERE state_idnumber_id =\" . $this->checkedids;\n\t\treturn mysql_query($strquery) or die(mysql_error());\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to delete a favorite entity.
private function createDeleteForm(Favorite $favorite) { return $this->createFormBuilder() ->setAction($this->generateUrl('favorite_delete', array('id' => $favorite->getId()))) ->setMethod('DELETE') ->getForm() ; }
[ "private function createDeleteForm(UserFavourite $userFavourite) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('userfavourite_delete', array('id' => $userFavourite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Favoris $favori)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('favoris_delete', array('idFavoris' => $favori->getIdfavoris())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteFavorite(){\n\t\t// build FavoriteListing object from external JSON data\n\t\t$userRepo = RepositoryFactory::createRepository(\"user\");\n $arrayOfUserObjects = $userRepo->find($_SESSION[\"email\"], \"email\");\n\t\t$favoriteListing = new FavoriteListing();\n\t\t$favoriteListing->setUserId($arrayOfUserObjects[0]->getId());\n\t\t$favoriteListing->setListingId($_POST[\"listingId\"]);\n\t\t\n\t\t// remove the FavoriteListing from the DB\n $favoriteListingsRepo = RepositoryFactory::createRepository(\n\t\t\t\t\"favorite_listing\");\t\t\n\t\t$favoriteListingsRepo->remove($favoriteListing);\t\t\t\n\t}", "private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('box_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Fruits $fruit)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fruits_delete', array('id' => $fruit->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteAction(Favoris $favori)\n {\n $em = $this->getDoctrine()->getManager();\n\n $em->remove($favori);\n $em->flush();\n\n\n return $this->redirectToRoute('favoris_index');\n }", "private function createDeleteForm(Vente $vente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('vente_delete', array('id' => $vente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(RequeteFb $requeteFb)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('requetefb_delete', array('id' => $requeteFb->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "function mongo_node_page_delete($form, $form_state, $entity_type, $entity) {\n $form['#entity'] = $entity;\n $uri = entity_uri($entity_type, $entity);\n\n return confirm_form($form,\n t('Are you sure you want to delete %title', array('%title' => $entity->title)),\n $uri['path'],\n t('This action cannot be undone'),\n t('Delete'),\n t('Cancel')\n );\n}", "private function createDeleteForm(Forest $forest)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('forest_delete', array('id' => $forest->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Pizza $pizza)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pizza_delete', array('id' => $pizza->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createCreateForm(Favorite $entity)\n {\n $form = $this->createForm(new FavoriteType(), $entity, array(\n 'action' => $this->generateUrl('site_front_favorite_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function newAction()\n {\n $entity = new Favorite();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SiteFrontBundle:Favorite:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "private function createDeleteForm(Venta $ventum) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('venta_delete', array('id' => $ventum->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(TenderBookmark $tenderBookmark)\n\t{\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('tenderbookmark_delete', array('id' => $tenderBookmark->getId())))\n\t\t\t->setMethod('DELETE')\n\t\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm(FroFacTramite $froFacTramite)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('frofactramite_delete', array('id' => $froFacTramite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "function feed_item_delete_form($form, &$form_state, $feed, $feed_item) {\r\n $form_state['#feed'] = feed_defaults($feed);\r\n $form_state['#feed_item'] = feed_item_defaults($feed_item);\r\n\r\n $form['#attributes'] = array('class' => array('feed-form'));\r\n $title = feed_item_field_values_tagname_format($feed_item->fiid, 'title', 'text');\r\n \r\n return confirm_form(\r\n $form,\r\n t('Delete feed item?'),\r\n \"feed/{$feed->fid}/feed-items\",\r\n '<div class=\"messages warning\"><span class=\"feed-warning\">Warning:</span> ' . \r\n t('You are about to delete a feed item with title \":title\". This action cannot be undone.', array(':title' => $title)) . '</div>',\r\n t('Delete'), t('Cancel')\r\n );\r\n}", "function file_entity_delete_form($form, &$form_state, $file) {\n $form_state['file'] = $file;\n\n $form['fid'] = array(\n '#type' => 'value',\n '#value' => $file->fid,\n );\n\n $description = t('This action cannot be undone.');\n if ($references = file_usage_list($file)) {\n $description .= ' ' . t('This file is currently in use and may cause problems if deleted.');\n }\n\n return confirm_form($form,\n t('Are you sure you want to delete the file %title?', array(\n '%title' => entity_label('file', $file),\n )),\n 'file/' . $file->fid,\n $description,\n t('Delete')\n );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of cnpj_juridica
public function setCnpj_juridica($cnpj_juridica) { $this->cnpj_juridica = $cnpj_juridica; return $this; }
[ "public function getCnpj_juridica()\n {\n return $this->cnpj_juridica;\n }", "public function setJulians() {\n $this->jd = static::utc2Julian($this->utc, $this->timezoneName);\n $this->mjd = static::julian2Mjd($this->jd);\n if ($this->calendar_type === static::CALENDAR_TYPE_JULIAN) {\n $_time = AstroTime::julian2UtcForGregorian($this->jd);\n $dt = \"{$_time['year']}-{$_time['month']}-{$_time['day']}\";\n $utc = new Chronos($dt, 'UTC');\n $jd = AstroTime::utc2JulianForGregorian($utc);\n $this->jd_gregorian = $jd;\n } else {\n $this->jd_gregorian = $this->jd;\n }\n return $this;\n }", "public function getId_juridica()\n {\n return $this->id_juridica;\n }", "public function setId_juridica($id_juridica)\n {\n $this->id_juridica = $id_juridica;\n\n return $this;\n }", "function set_jarijari($r)\n {\n $this->jarijari = $r;\n }", "public function setJpQii(?string $jpQii): void\n {\n $this->jpQii = $jpQii;\n }", "function setSorpresa($_caja){\r\n $this->sorpresa=$_caja;\r\n }", "public function setCnpj($cnpj)\n {\n $this->cnpj = $cnpj;\n\n return $this;\n }", "public function testSetJour() {\n\n $obj = new ChantiersFrequencesControlesQualite();\n\n $obj->setJour(\"jour\");\n $this->assertEquals(\"jour\", $obj->getJour());\n }", "public function setJ(string $j): DSAKeyValueType\n {\n $this->j = $j;\n\n return $this;\n }", "public function setJ($j)\n {\n $this->j = $j;\n return $this;\n }", "public function setAsociacionNaturalezaJuridica($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->asociacion_naturaleza_juridica !== $v) {\n\t\t\t$this->asociacion_naturaleza_juridica = $v;\n\t\t\t$this->modifiedColumns[] = AlpzaMiembroGeneralPeer::ASOCIACION_NATURALEZA_JURIDICA;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function set_jdc($_jdc)\n {\n $this->_jdc = $_jdc;\n\n return $this;\n }", "function controlar_coincidencia_cue_jurisdiccion() {\r\n \t\t$jur_id = $this->data[$this->name]['jurisdiccion_id'];\r\n \t\t\r\n \t\tif($jur_id < 10){\r\n \t\t\t$jur_id = \"0$jur_id\";\r\n \t\t}\r\n \t\t\r\n \t\t$tam = strlen($this->data[$this->name]['cue']);\r\n \t\tif($tam == 7){\r\n \t\t\t$jur = substr($this->data[$this->name]['cue'],0,2);\r\n \t\t} elseif($tam == 6){\r\n \t\t\t$jur = substr($this->data[$this->name]['cue'],0,1);\r\n \t\t\t$jur = \"0$jur\";\r\n \t\t}\r\n \t\telse return false;\r\n \t\t\r\n \t\treturn ($jur_id == $jur)?true:false;\r\n }", "function setCiudad($ciudad) {\r\n\t\t$this->ciudad = $this->db->real_escape_string($ciudad);\r\n }", "public function setCnpj($Cnpj)\n {\n $this->Cnpj = $Cnpj;\n\n return $this;\n }", "function setCgm($iNumCgm){\n\n $this->aLancamentos[\"lancamCgm\"][\"set\"] = 1;\n $this->aLancamentos[\"lancamCgm\"][\"c76_numcgm\"] = $iNumCgm;\n $this->aLancamentos[\"lancamCgm\"][\"c76_data\"] = $this->dDataLanc;\n $this->oLancamCgm = db_utils::getDao(\"conlancamcgm\");\n\n }", "public function setCpfCnpj(string $cpfCnpj)\n {\n $this->cpfCnpj = $cpfCnpj;\n }", "public function testSetJuil() {\n\n $obj = new AffectationsCharge();\n\n $obj->setJuil(true);\n $this->assertEquals(true, $obj->getJuil());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the PCRE backtrack limit for this script
public function setPcreBacktrackLimit($limit) { $this->pcreBacktrackLimit = (int) $limit; }
[ "public function set_pcre_backtrack_limit($limit)\r\n {\r\n $this->pcre_backtrack_limit = (int) $limit;\r\n }", "function mb_regex_set_options () {}", "function benchmark_pcre_backtracking( $pattern, $subject, $strategy ) {\n\t$saved_config = ini_get( 'pcre.backtrack_limit' );\n\n\t// Attempt to prevent PHP crashes. Adjust these lower when needed.\n\tif ( version_compare( phpversion(), '5.4.8', '>' ) ) {\n\t\t$limit = 1000000;\n\t} else {\n\t\t$limit = 20000; // 20,000 is a reasonable upper limit, but see also https://core.trac.wordpress.org/ticket/29557#comment:10\n\t}\n\n\t// Start with small numbers, so if a crash is encountered at higher numbers we can still debug the problem.\n\tfor ( $i = 4; $i <= $limit; $i *= 2 ) {\n\n\t\tini_set( 'pcre.backtrack_limit', $i );\n\n\t\tswitch ( $strategy ) {\n\t\t\tcase 'split':\n\t\t\t\tpreg_split( $pattern, $subject );\n\t\t\t\tbreak;\n\t\t\tcase 'match':\n\t\t\t\tpreg_match( $pattern, $subject );\n\t\t\t\tbreak;\n\t\t\tcase 'match_all':\n\t\t\t\t$matches = array();\n\t\t\t\tpreg_match_all( $pattern, $subject, $matches );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tini_set( 'pcre.backtrack_limit', $saved_config );\n\n\t\tswitch ( preg_last_error() ) {\n\t\t\tcase PREG_NO_ERROR:\n\t\t\t\treturn $i;\n\t\t\tcase PREG_BACKTRACK_LIMIT_ERROR:\n\t\t\t\tbreak;\n\t\t\tcase PREG_RECURSION_LIMIT_ERROR:\n\t\t\t\ttrigger_error( 'PCRE recursion limit encountered before backtrack limit.' );\n\n\t\t\t\treturn null;\n\t\t\tcase PREG_BAD_UTF8_ERROR:\n\t\t\t\ttrigger_error( 'UTF-8 error during PCRE benchmark.' );\n\n\t\t\t\treturn null;\n\t\t\tcase PREG_INTERNAL_ERROR:\n\t\t\t\ttrigger_error( 'Internal error during PCRE benchmark.' );\n\n\t\t\t\treturn null;\n\t\t\tdefault:\n\t\t\t\ttrigger_error( 'Unexpected error during PCRE benchmark.' );\n\n\t\t\t\treturn null;\n\t\t}\n\t}\n\n\treturn $i;\n}", "public function setRegexMaxAnalyzedChars($value)\n\t{\n\t\t$this->setParameterValue('hl.regex.maxAnalyzedChars',$value);\n\t}", "function mb_regex_set_options($options){}", "public function &setHighlightRegexSlop ($factor) {}", "function setMiterLimit($limit){}", "function mLIMIT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$LIMIT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:186:3: ( 'limit' ) \n // Tokenizer11.g:187:3: 'limit' \n {\n $this->matchString(\"limit\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public static function setLimit($limit = 0){\n LuceneHelper::setLimit($limit);\n }", "public function setPhraseLimit(int $maximum): self;", "public function setSubprocessLimit($limit) {\n $this->subprocessLimit = $limit;\n return $this;\n }", "public function setPregFlags($preg_flags){}", "public static function resetBacktraceLimit()\n {\n static::$backtrace_limit = null;\n }", "public function setRevisionLimit($value)\n {\n return $this->set('RevisionLimit', $value);\n }", "function setRetryMaxLimit($limit)\n {\n $this->retryMaxLimit = $limit;\n }", "public function setPregFlags ($preg_flags) {}", "public static function resetBacktraceDefaultLimit()\n {\n static::$backtrace_default_limit = 0;\n }", "public function setHardLimit($limit);", "function drupal_set_time_limit($time_limit) {\n if (function_exists('set_time_limit')) {\n $current = ini_get('max_execution_time');\n // Do not set time limit if it is currently unlimited.\n if ($current != 0) {\n @set_time_limit($time_limit);\n }\n }\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets as grossVolumeMeasure BBIE Order Response. Gross_ Volume. Measure The total volume of the goods in the Order Response including packaging. 0..1 Order Response Gross Volume Measure Measure. Type
public function getGrossVolumeMeasure() { return $this->grossVolumeMeasure; }
[ "public function getGrossTotal(): float;", "public function getUnitGrossPrice()\n {\n return $this->unit_gross_price;\n }", "public function getUndiscountedGrossPrice() {\n\t\treturn $this->productService->getUndiscountedPrice($this);\n\t}", "public function total_volume() {\n\t\t$total_volume = 0;\n\n\t\tforeach ( $this->order_items as $product ) {\n\t\t\t$product_items[] = $product->get_product();\n\t\t}\n\t\tforeach ( $product_items as $item ) {\n\t\t\t$total_volume += $item[1] * $item[2];\n\t\t}\n\t\treturn $this->total_volume = $total_volume;\n\t}", "public function getGrossTonnageMeasure()\n {\n return $this->grossTonnageMeasure;\n }", "public function getCurrencyVolume(): float {\n\t\t return $this->currencyVolume;\n\t }", "public function getSummaryVolume(): float\n {\n return array_sum(array_map(function (RequestItemInterface $item) {\n return $item->getVolume();\n }, $this->getItems()));\n }", "public function getTotalPriceGross()\n {\n $tax = 1 + ($this->getTax() / 100.0);\n\n $totalPriceGross = $this->getPrice() * $this->getQuantity() * $tax;\n\n return $totalPriceGross;\n }", "public function getGoodsPrice()\n {\n return $this->goods_price;\n }", "public function setGrossVolumeMeasure(\\NOKA\\PHPUBL\\UBL\\Common\\BasicComponents\\GrossVolumeMeasure $grossVolumeMeasure)\n {\n $this->grossVolumeMeasure = $grossVolumeMeasure;\n return $this;\n }", "public function getTotalGross()\n {\n return $this->totalGross instanceof CentPrecisionMoneyBuilder ? $this->totalGross->build() : $this->totalGross;\n }", "public function getNetVolumeMeasure()\n {\n return $this->netVolumeMeasure;\n }", "public function getGoodsType()\n {\n return $this->goods_type;\n }", "public function getSumGrossPrice()\n {\n return $this->sum_gross_price;\n }", "public function getVolumeUtilisation(): float\n {\n $itemVolume = 0;\n $boxVolume = 0;\n\n foreach ($this as $box) {\n $boxVolume += $box->getInnerVolume();\n\n foreach ($box->items as $item) {\n $itemVolume += ($item->item->getWidth() * $item->item->getLength() * $item->item->getDepth());\n }\n }\n\n return round($itemVolume / $boxVolume * 100, 1);\n }", "public function getVolumeType()\n {\n return $this->volume_type;\n }", "public function totalVolume();", "public function volume()\n {\n return ($this->comprimento() * $this->largura() * $this->altura()) / 6000;\n }", "public function setGrossVolumeMeasure(\\horstoeko\\ubl\\entities\\cbc\\GrossVolumeMeasure $grossVolumeMeasure)\n {\n $this->grossVolumeMeasure = $grossVolumeMeasure;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets an array of GsLeveranciersassortimenten objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria, the cached collection is returned. If this GsArtikelen is new, it will return an empty collection or the current collection; the criteria is ignored on a new object.
public function getGsLeveranciersassortimentens($criteria = null, PropelPDO $con = null) { $partial = $this->collGsLeveranciersassortimentensPartial && !$this->isNew(); if (null === $this->collGsLeveranciersassortimentens || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collGsLeveranciersassortimentens) { // return empty collection $this->initGsLeveranciersassortimentens(); } else { $collGsLeveranciersassortimentens = GsLeveranciersassortimentenQuery::create(null, $criteria) ->filterByGsArtikelen($this) ->find($con); if (null !== $criteria) { if (false !== $this->collGsLeveranciersassortimentensPartial && count($collGsLeveranciersassortimentens)) { $this->initGsLeveranciersassortimentens(false); foreach ($collGsLeveranciersassortimentens as $obj) { if (false == $this->collGsLeveranciersassortimentens->contains($obj)) { $this->collGsLeveranciersassortimentens->append($obj); } } $this->collGsLeveranciersassortimentensPartial = true; } $collGsLeveranciersassortimentens->getInternalIterator()->rewind(); return $collGsLeveranciersassortimentens; } if ($partial && $this->collGsLeveranciersassortimentens) { foreach ($this->collGsLeveranciersassortimentens as $obj) { if ($obj->isNew()) { $collGsLeveranciersassortimentens[] = $obj; } } } $this->collGsLeveranciersassortimentens = $collGsLeveranciersassortimentens; $this->collGsLeveranciersassortimentensPartial = false; } } return $this->collGsLeveranciersassortimentens; }
[ "public function getCommentairerealisateurs($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(PersonnePeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collCommentairerealisateurs === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collCommentairerealisateurs = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(CommentairerealisateurPeer::REALISATEUR_ID, $this->id);\n\n\t\t\t\tCommentairerealisateurPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collCommentairerealisateurs = CommentairerealisateurPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(CommentairerealisateurPeer::REALISATEUR_ID, $this->id);\n\n\t\t\t\tCommentairerealisateurPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastCommentairerealisateurCriteria) || !$this->lastCommentairerealisateurCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collCommentairerealisateurs = CommentairerealisateurPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastCommentairerealisateurCriteria = $criteria;\n\t\treturn $this->collCommentairerealisateurs;\n\t}", "public function getOrderHasArticless(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collOrderHasArticlessPartial && !$this->isNew();\n if (null === $this->collOrderHasArticless || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collOrderHasArticless) {\n // return empty collection\n $this->initOrderHasArticless();\n } else {\n $collOrderHasArticless = ChildOrderHasArticlesQuery::create(null, $criteria)\n ->filterByArticle($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collOrderHasArticlessPartial && count($collOrderHasArticless)) {\n $this->initOrderHasArticless(false);\n\n foreach ($collOrderHasArticless as $obj) {\n if (false == $this->collOrderHasArticless->contains($obj)) {\n $this->collOrderHasArticless->append($obj);\n }\n }\n\n $this->collOrderHasArticlessPartial = true;\n }\n\n return $collOrderHasArticless;\n }\n\n if ($partial && $this->collOrderHasArticless) {\n foreach ($this->collOrderHasArticless as $obj) {\n if ($obj->isNew()) {\n $collOrderHasArticless[] = $obj;\n }\n }\n }\n\n $this->collOrderHasArticless = $collOrderHasArticless;\n $this->collOrderHasArticlessPartial = false;\n }\n }\n\n return $this->collOrderHasArticless;\n }", "public function getIgrejasRelatedById($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif(null === $this->collIgrejasRelatedById || null !== $criteria) {\n\t\t\tif ($this->isNew() && null === $this->collIgrejasRelatedById) {\n\t\t\t\t// return empty collection\n\t\t\t\t$this->initIgrejasRelatedById();\n\t\t\t} else {\n\t\t\t\t$collIgrejasRelatedById = IgrejaQuery::create(null, $criteria)\n\t\t\t\t\t->filterByIgrejaRelatedByIgrejaId($this)\n\t\t\t\t\t->find($con);\n\t\t\t\tif (null !== $criteria) {\n\t\t\t\t\treturn $collIgrejasRelatedById;\n\t\t\t\t}\n\t\t\t\t$this->collIgrejasRelatedById = $collIgrejasRelatedById;\n\t\t\t}\n\t\t}\n\t\treturn $this->collIgrejasRelatedById;\n\t}", "public function getGsArtikelEigenschappens($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collGsArtikelEigenschappensPartial && !$this->isNew();\n if (null === $this->collGsArtikelEigenschappens || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collGsArtikelEigenschappens) {\n // return empty collection\n $this->initGsArtikelEigenschappens();\n } else {\n $collGsArtikelEigenschappens = GsArtikelEigenschappenQuery::create(null, $criteria)\n ->filterByGsAtcCodes($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collGsArtikelEigenschappensPartial && count($collGsArtikelEigenschappens)) {\n $this->initGsArtikelEigenschappens(false);\n\n foreach ($collGsArtikelEigenschappens as $obj) {\n if (false == $this->collGsArtikelEigenschappens->contains($obj)) {\n $this->collGsArtikelEigenschappens->append($obj);\n }\n }\n\n $this->collGsArtikelEigenschappensPartial = true;\n }\n\n $collGsArtikelEigenschappens->getInternalIterator()->rewind();\n\n return $collGsArtikelEigenschappens;\n }\n\n if ($partial && $this->collGsArtikelEigenschappens) {\n foreach ($this->collGsArtikelEigenschappens as $obj) {\n if ($obj->isNew()) {\n $collGsArtikelEigenschappens[] = $obj;\n }\n }\n }\n\n $this->collGsArtikelEigenschappens = $collGsArtikelEigenschappens;\n $this->collGsArtikelEigenschappensPartial = false;\n }\n }\n\n return $this->collGsArtikelEigenschappens;\n }", "public function getRiwayatGajiBerkalas($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collRiwayatGajiBerkalasPartial && !$this->isNew();\n if (null === $this->collRiwayatGajiBerkalas || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collRiwayatGajiBerkalas) {\n // return empty collection\n $this->initRiwayatGajiBerkalas();\n } else {\n $collRiwayatGajiBerkalas = RiwayatGajiBerkalaQuery::create(null, $criteria)\n ->filterByPtk($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collRiwayatGajiBerkalasPartial && count($collRiwayatGajiBerkalas)) {\n $this->initRiwayatGajiBerkalas(false);\n\n foreach($collRiwayatGajiBerkalas as $obj) {\n if (false == $this->collRiwayatGajiBerkalas->contains($obj)) {\n $this->collRiwayatGajiBerkalas->append($obj);\n }\n }\n\n $this->collRiwayatGajiBerkalasPartial = true;\n }\n\n $collRiwayatGajiBerkalas->getInternalIterator()->rewind();\n return $collRiwayatGajiBerkalas;\n }\n\n if($partial && $this->collRiwayatGajiBerkalas) {\n foreach($this->collRiwayatGajiBerkalas as $obj) {\n if($obj->isNew()) {\n $collRiwayatGajiBerkalas[] = $obj;\n }\n }\n }\n\n $this->collRiwayatGajiBerkalas = $collRiwayatGajiBerkalas;\n $this->collRiwayatGajiBerkalasPartial = false;\n }\n }\n\n return $this->collRiwayatGajiBerkalas;\n }", "public function getMontacargasBateriass($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collMontacargasBateriassPartial && !$this->isNew();\n if (null === $this->collMontacargasBateriass || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collMontacargasBateriass) {\n // return empty collection\n $this->initMontacargasBateriass();\n } else {\n $collMontacargasBateriass = MontacargasBateriasQuery::create(null, $criteria)\n ->filterByBaterias($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collMontacargasBateriassPartial && count($collMontacargasBateriass)) {\n $this->initMontacargasBateriass(false);\n\n foreach ($collMontacargasBateriass as $obj) {\n if (false == $this->collMontacargasBateriass->contains($obj)) {\n $this->collMontacargasBateriass->append($obj);\n }\n }\n\n $this->collMontacargasBateriassPartial = true;\n }\n\n $collMontacargasBateriass->getInternalIterator()->rewind();\n\n return $collMontacargasBateriass;\n }\n\n if ($partial && $this->collMontacargasBateriass) {\n foreach ($this->collMontacargasBateriass as $obj) {\n if ($obj->isNew()) {\n $collMontacargasBateriass[] = $obj;\n }\n }\n }\n\n $this->collMontacargasBateriass = $collMontacargasBateriass;\n $this->collMontacargasBateriassPartial = false;\n }\n }\n\n return $this->collMontacargasBateriass;\n }", "public function getNotaPedidosRelatedByAutorizaId($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collNotaPedidosRelatedByAutorizaId === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collNotaPedidosRelatedByAutorizaId = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(NotaPedidoPeer::AUTORIZA_ID, $this->id);\n\n\t\t\t\tNotaPedidoPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collNotaPedidosRelatedByAutorizaId = NotaPedidoPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(NotaPedidoPeer::AUTORIZA_ID, $this->id);\n\n\t\t\t\tNotaPedidoPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastNotaPedidoRelatedByAutorizaIdCriteria) || !$this->lastNotaPedidoRelatedByAutorizaIdCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collNotaPedidosRelatedByAutorizaId = NotaPedidoPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastNotaPedidoRelatedByAutorizaIdCriteria = $criteria;\n\t\treturn $this->collNotaPedidosRelatedByAutorizaId;\n\t}", "public function getArticles(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collArticlesPartial && !$this->isNew();\n if (null === $this->collArticles || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collArticles) {\n // return empty collection\n $this->initArticles();\n } else {\n $collArticles = ChildArticleQuery::create(null, $criteria)\n ->filterByImage($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collArticlesPartial && count($collArticles)) {\n $this->initArticles(false);\n\n foreach ($collArticles as $obj) {\n if (false == $this->collArticles->contains($obj)) {\n $this->collArticles->append($obj);\n }\n }\n\n $this->collArticlesPartial = true;\n }\n\n return $collArticles;\n }\n\n if ($partial && $this->collArticles) {\n foreach ($this->collArticles as $obj) {\n if ($obj->isNew()) {\n $collArticles[] = $obj;\n }\n }\n }\n\n $this->collArticles = $collArticles;\n $this->collArticlesPartial = false;\n }\n }\n\n return $this->collArticles;\n }", "public function getEnrolments($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collEnrolments === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collEnrolments = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(EnrolmentPeer::USER_ID, $this->id);\n\n\t\t\t\tEnrolmentPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collEnrolments = EnrolmentPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(EnrolmentPeer::USER_ID, $this->id);\n\n\t\t\t\tEnrolmentPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastEnrolmentCriteria) || !$this->lastEnrolmentCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collEnrolments = EnrolmentPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastEnrolmentCriteria = $criteria;\n\t\treturn $this->collEnrolments;\n\t}", "public function getAdverts(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collAdvertsPartial && !$this->isNew();\n if (null === $this->collAdverts || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collAdverts) {\n // return empty collection\n $this->initAdverts();\n } else {\n $collAdverts = ChildAdvertQuery::create(null, $criteria)\n ->filterBySection($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collAdvertsPartial && count($collAdverts)) {\n $this->initAdverts(false);\n\n foreach ($collAdverts as $obj) {\n if (false == $this->collAdverts->contains($obj)) {\n $this->collAdverts->append($obj);\n }\n }\n\n $this->collAdvertsPartial = true;\n }\n\n return $collAdverts;\n }\n\n if ($partial && $this->collAdverts) {\n foreach ($this->collAdverts as $obj) {\n if ($obj->isNew()) {\n $collAdverts[] = $obj;\n }\n }\n }\n\n $this->collAdverts = $collAdverts;\n $this->collAdvertsPartial = false;\n }\n }\n\n return $this->collAdverts;\n }", "public function getPedidomayoristadetalles($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collPedidomayoristadetallesPartial && !$this->isNew();\n if (null === $this->collPedidomayoristadetalles || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collPedidomayoristadetalles) {\n // return empty collection\n $this->initPedidomayoristadetalles();\n } else {\n $collPedidomayoristadetalles = PedidomayoristadetalleQuery::create(null, $criteria)\n ->filterByProducto($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collPedidomayoristadetallesPartial && count($collPedidomayoristadetalles)) {\n $this->initPedidomayoristadetalles(false);\n\n foreach ($collPedidomayoristadetalles as $obj) {\n if (false == $this->collPedidomayoristadetalles->contains($obj)) {\n $this->collPedidomayoristadetalles->append($obj);\n }\n }\n\n $this->collPedidomayoristadetallesPartial = true;\n }\n\n $collPedidomayoristadetalles->getInternalIterator()->rewind();\n\n return $collPedidomayoristadetalles;\n }\n\n if ($partial && $this->collPedidomayoristadetalles) {\n foreach ($this->collPedidomayoristadetalles as $obj) {\n if ($obj->isNew()) {\n $collPedidomayoristadetalles[] = $obj;\n }\n }\n }\n\n $this->collPedidomayoristadetalles = $collPedidomayoristadetalles;\n $this->collPedidomayoristadetallesPartial = false;\n }\n }\n\n return $this->collPedidomayoristadetalles;\n }", "public function getDiasDisponiveiss(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collDiasDisponiveissPartial && !$this->isNew();\n if (null === $this->collDiasDisponiveiss || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collDiasDisponiveiss) {\n // return empty collection\n $this->initDiasDisponiveiss();\n } else {\n $collDiasDisponiveiss = ChildDiasDisponiveisQuery::create(null, $criteria)\n ->filterByJuizes($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collDiasDisponiveissPartial && count($collDiasDisponiveiss)) {\n $this->initDiasDisponiveiss(false);\n\n foreach ($collDiasDisponiveiss as $obj) {\n if (false == $this->collDiasDisponiveiss->contains($obj)) {\n $this->collDiasDisponiveiss->append($obj);\n }\n }\n\n $this->collDiasDisponiveissPartial = true;\n }\n\n return $collDiasDisponiveiss;\n }\n\n if ($partial && $this->collDiasDisponiveiss) {\n foreach ($this->collDiasDisponiveiss as $obj) {\n if ($obj->isNew()) {\n $collDiasDisponiveiss[] = $obj;\n }\n }\n }\n\n $this->collDiasDisponiveiss = $collDiasDisponiveiss;\n $this->collDiasDisponiveissPartial = false;\n }\n }\n\n return $this->collDiasDisponiveiss;\n }", "public function getTransferenciasRelatedByIdempleadocreador($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collTransferenciasRelatedByIdempleadocreadorPartial && !$this->isNew();\n if (null === $this->collTransferenciasRelatedByIdempleadocreador || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collTransferenciasRelatedByIdempleadocreador) {\n // return empty collection\n $this->initTransferenciasRelatedByIdempleadocreador();\n } else {\n $collTransferenciasRelatedByIdempleadocreador = TransferenciaQuery::create(null, $criteria)\n ->filterByEmpleadoRelatedByIdempleadocreador($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collTransferenciasRelatedByIdempleadocreadorPartial && count($collTransferenciasRelatedByIdempleadocreador)) {\n $this->initTransferenciasRelatedByIdempleadocreador(false);\n\n foreach ($collTransferenciasRelatedByIdempleadocreador as $obj) {\n if (false == $this->collTransferenciasRelatedByIdempleadocreador->contains($obj)) {\n $this->collTransferenciasRelatedByIdempleadocreador->append($obj);\n }\n }\n\n $this->collTransferenciasRelatedByIdempleadocreadorPartial = true;\n }\n\n $collTransferenciasRelatedByIdempleadocreador->getInternalIterator()->rewind();\n\n return $collTransferenciasRelatedByIdempleadocreador;\n }\n\n if ($partial && $this->collTransferenciasRelatedByIdempleadocreador) {\n foreach ($this->collTransferenciasRelatedByIdempleadocreador as $obj) {\n if ($obj->isNew()) {\n $collTransferenciasRelatedByIdempleadocreador[] = $obj;\n }\n }\n }\n\n $this->collTransferenciasRelatedByIdempleadocreador = $collTransferenciasRelatedByIdempleadocreador;\n $this->collTransferenciasRelatedByIdempleadocreadorPartial = false;\n }\n }\n\n return $this->collTransferenciasRelatedByIdempleadocreador;\n }", "public function getPedidomayoristadetalles($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collPedidomayoristadetallesPartial && !$this->isNew();\n if (null === $this->collPedidomayoristadetalles || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collPedidomayoristadetalles) {\n // return empty collection\n $this->initPedidomayoristadetalles();\n } else {\n $collPedidomayoristadetalles = PedidomayoristadetalleQuery::create(null, $criteria)\n ->filterByProductovariante($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collPedidomayoristadetallesPartial && count($collPedidomayoristadetalles)) {\n $this->initPedidomayoristadetalles(false);\n\n foreach ($collPedidomayoristadetalles as $obj) {\n if (false == $this->collPedidomayoristadetalles->contains($obj)) {\n $this->collPedidomayoristadetalles->append($obj);\n }\n }\n\n $this->collPedidomayoristadetallesPartial = true;\n }\n\n $collPedidomayoristadetalles->getInternalIterator()->rewind();\n\n return $collPedidomayoristadetalles;\n }\n\n if ($partial && $this->collPedidomayoristadetalles) {\n foreach ($this->collPedidomayoristadetalles as $obj) {\n if ($obj->isNew()) {\n $collPedidomayoristadetalles[] = $obj;\n }\n }\n }\n\n $this->collPedidomayoristadetalles = $collPedidomayoristadetalles;\n $this->collPedidomayoristadetallesPartial = false;\n }\n }\n\n return $this->collPedidomayoristadetalles;\n }", "public function getOtherworkassigneds(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collOtherworkassignedsPartial && !$this->isNew();\n if (null === $this->collOtherworkassigneds || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collOtherworkassigneds) {\n // return empty collection\n $this->initOtherworkassigneds();\n } else {\n $collOtherworkassigneds = ChildOtherworkassignedQuery::create(null, $criteria)\n ->filterByLineofbusiness($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collOtherworkassignedsPartial && count($collOtherworkassigneds)) {\n $this->initOtherworkassigneds(false);\n\n foreach ($collOtherworkassigneds as $obj) {\n if (false == $this->collOtherworkassigneds->contains($obj)) {\n $this->collOtherworkassigneds->append($obj);\n }\n }\n\n $this->collOtherworkassignedsPartial = true;\n }\n\n return $collOtherworkassigneds;\n }\n\n if ($partial && $this->collOtherworkassigneds) {\n foreach ($this->collOtherworkassigneds as $obj) {\n if ($obj->isNew()) {\n $collOtherworkassigneds[] = $obj;\n }\n }\n }\n\n $this->collOtherworkassigneds = $collOtherworkassigneds;\n $this->collOtherworkassignedsPartial = false;\n }\n }\n\n return $this->collOtherworkassigneds;\n }", "public function getEmpleos($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(PersonaPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collEmpleos === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collEmpleos = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(EmpleoPeer::PERSONA_ID, $this->id);\n\n\t\t\t\tEmpleoPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collEmpleos = EmpleoPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(EmpleoPeer::PERSONA_ID, $this->id);\n\n\t\t\t\tEmpleoPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastEmpleoCriteria) || !$this->lastEmpleoCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collEmpleos = EmpleoPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastEmpleoCriteria = $criteria;\n\t\treturn $this->collEmpleos;\n\t}", "public function getEvaluacionAplicadas(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collEvaluacionAplicadasPartial && !$this->isNew();\n if (null === $this->collEvaluacionAplicadas || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collEvaluacionAplicadas) {\n // return empty collection\n $this->initEvaluacionAplicadas();\n } else {\n $collEvaluacionAplicadas = ChildEvaluacionAplicadaQuery::create(null, $criteria)\n ->filterByDictacion($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collEvaluacionAplicadasPartial && count($collEvaluacionAplicadas)) {\n $this->initEvaluacionAplicadas(false);\n\n foreach ($collEvaluacionAplicadas as $obj) {\n if (false == $this->collEvaluacionAplicadas->contains($obj)) {\n $this->collEvaluacionAplicadas->append($obj);\n }\n }\n\n $this->collEvaluacionAplicadasPartial = true;\n }\n\n return $collEvaluacionAplicadas;\n }\n\n if ($partial && $this->collEvaluacionAplicadas) {\n foreach ($this->collEvaluacionAplicadas as $obj) {\n if ($obj->isNew()) {\n $collEvaluacionAplicadas[] = $obj;\n }\n }\n }\n\n $this->collEvaluacionAplicadas = $collEvaluacionAplicadas;\n $this->collEvaluacionAplicadasPartial = false;\n }\n }\n\n return $this->collEvaluacionAplicadas;\n }", "public function getDemografis($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collDemografisPartial && !$this->isNew();\n if (null === $this->collDemografis || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collDemografis) {\n // return empty collection\n $this->initDemografis();\n } else {\n $collDemografis = DemografiQuery::create(null, $criteria)\n ->filterByMstWilayah($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collDemografisPartial && count($collDemografis)) {\n $this->initDemografis(false);\n\n foreach($collDemografis as $obj) {\n if (false == $this->collDemografis->contains($obj)) {\n $this->collDemografis->append($obj);\n }\n }\n\n $this->collDemografisPartial = true;\n }\n\n $collDemografis->getInternalIterator()->rewind();\n return $collDemografis;\n }\n\n if($partial && $this->collDemografis) {\n foreach($this->collDemografis as $obj) {\n if($obj->isNew()) {\n $collDemografis[] = $obj;\n }\n }\n }\n\n $this->collDemografis = $collDemografis;\n $this->collDemografisPartial = false;\n }\n }\n\n return $this->collDemografis;\n }", "public function getSocietehistoriques(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collSocietehistoriquesPartial && !$this->isNew();\n if (null === $this->collSocietehistoriques || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collSocietehistoriques) {\n // return empty collection\n $this->initSocietehistoriques();\n } else {\n $collSocietehistoriques = ChildSocietehistoriqueQuery::create(null, $criteria)\n ->filterBySociete($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collSocietehistoriquesPartial && count($collSocietehistoriques)) {\n $this->initSocietehistoriques(false);\n\n foreach ($collSocietehistoriques as $obj) {\n if (false == $this->collSocietehistoriques->contains($obj)) {\n $this->collSocietehistoriques->append($obj);\n }\n }\n\n $this->collSocietehistoriquesPartial = true;\n }\n\n return $collSocietehistoriques;\n }\n\n if ($partial && $this->collSocietehistoriques) {\n foreach ($this->collSocietehistoriques as $obj) {\n if ($obj->isNew()) {\n $collSocietehistoriques[] = $obj;\n }\n }\n }\n\n $this->collSocietehistoriques = $collSocietehistoriques;\n $this->collSocietehistoriquesPartial = false;\n }\n }\n\n return $this->collSocietehistoriques;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the hideForgotMyPassword property value. Option to hide the selfservice password reset (SSPR) 'Forgot my password' hyperlink on the signin form.
public function getHideForgotMyPassword(): ?bool { $val = $this->getBackingStore()->get('hideForgotMyPassword'); if (is_null($val) || is_bool($val)) { return $val; } throw new \UnexpectedValueException("Invalid type found in backing store for 'hideForgotMyPassword'"); }
[ "public function getHideEmail() {\n\t\treturn $this->hideEmail;\n\t}", "public function getHideResetItNow()\n {\n if (array_key_exists(\"hideResetItNow\", $this->_propDict)) {\n return $this->_propDict[\"hideResetItNow\"];\n } else {\n return null;\n }\n }", "public function getForgotPasswordCustomErrorMessage()\n {\n return Mage::getStoreConfig('privatesales/forgot_password/disable_error_msg');\n }", "public function sendForgotPasswordLink(){\n return $this->repository->sendForgotPasswordLink();\n }", "public function ms_hidden_password_field() {\n\t\tif ( isset( $_POST['user_pass'] ) )\n\t\t\techo '<input type=\"hidden\" name=\"user_pass\" value=\"' . $_POST['user_pass'] . '\" />' . \"\\n\";\n\t}", "public function showRememberMe()\n {\n return (bool) $this->getConfig()->getConfigParam('blShowRememberMe');\n }", "public function getMessagingTemplateForgotPassword()\n {\n return $this->getValue('nb_messaging_template_forgot_password');\n }", "public function getForgotPasswordUrl() {\n return $this->_customerUrl->getForgotPasswordUrl ();\n }", "public function getIsSyncButtonHiddenOnPersonalSite()\n {\n if (array_key_exists(\"isSyncButtonHiddenOnPersonalSite\", $this->_propDict)) {\n return $this->_propDict[\"isSyncButtonHiddenOnPersonalSite\"];\n } else {\n return null;\n }\n }", "public function getHidePhone()\n {\n return $this->hidePhone;\n }", "function getHidePhone()\n {\n return (bool) $this->_bHidePhone;\n }", "public function getAltMobileHiddenMessage(){return $this->altMobileHiddenMessage;}", "public function getForgotPasswordUrl() {\n return $this->helper('customer')->getForgotPasswordUrl();\n }", "public function getForgotPasswordUrl()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $customerSession = $objectManager->create('Magento\\Customer\\Model\\Session');\n $customer = $customerSession->getCustomer();\n $customerSession = $objectManager->create('Magento\\Customer\\Model\\Session');\n $fidelity = $customerSession->getFidelity();\n $scopeConfig = $objectManager->get('Magento\\Framework\\App\\Config\\ScopeConfigInterface');\n\n $cvale_url = $scopeConfig->getValue('acessos/general/cvale_url', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n\n if ($fidelity == 0) {\n return $this->_customerUrl->getForgotPasswordUrl();\n }\n\n return \"{$cvale_url}/resetpassword\";\n }", "public function showForgotPasswordPage()\n {\n return View::make('app.auth.password.forgot');\n }", "function BCMH_settings_field_hidden_checkbox() {\n\t$options = BCMH_get_theme_options();\n\n\t?>\n\t<label for=\"hide-site\">\n\t\t<input type=\"checkbox\" name=\"BCMH_theme_options[hidden_checkbox]\" id=\"hide-site\" <?php checked( 'on', $options['hidden_checkbox'] ); ?> />\n\t\t<?php _e( 'Prevent logged out users from accessing the site.', 'BCMH' ); ?>\n\t</label>\n\t<?php\n}", "protected function maybe_show_password_form() {\n\t\tif ( $this->password_required() ) {\n\t\t\t$show_pw = false;\n\t\t\t$show_pw = apply_filters('timber/post/content/show_password_form_for_protected', $show_pw);\n\t\t\tif ( $show_pw ) {\n\t\t\t\treturn apply_filters('timber/post/content/password_form', get_the_password_form($this->ID), $this);\n\t\t\t}\n\t\t}\n\t}", "public function hide_forgot_pass_link()\n\t{\n\t \t// change wordpress login logo\n\t\tadd_action('login_head', array($this, 'hide_forgot_pass_link_action'));\n\t}", "function getLostPasswordURL()\r\n {\r\n return '';\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a full classname, based on individual conditions for each class Each item in $list can be a classname, e.g. ['active'], or a classname and condition, e.g. ['active' => i > 0]
function conditional_classes ($list = []) { $classList = []; foreach ($list as $className => $condition) { if (empty($className)) { // class name without condition, e.g. ['active'] array_push($classList, $condition); } elseif ($condition) { array_push($classList, $className); } } return implode(' ', $classList); }
[ "function add_new_class_list_categories($list){\n\t\t$list = str_replace('cat-item','cat-item list-group-item',$list);\n\t\treturn $list;\n\t}", "private function getItemShowcaseListItemClass($params) {\n\n $item_showcase_list_item_class = array();\n\n if ($params['item_position'] !== '') {\n $item_showcase_list_item_class[] = 'qode-item-'. $params['item_position'];\n }\n\n return implode(' ', $item_showcase_list_item_class);\n\n }", "public function class_list()\n\t{\n\t\t$CI =& get_instance();\n\t\t$CI->load->model('admin/Classes');\n\t\t$class_list = $CI->Classes->retrieve_class_list();\n\t\tif(!empty($class_list)){\n\t\t\tforeach($class_list as $k=>$val){\n\t\t\t\tif($val['status']==1){\n\t\t\t\t\t$class_list[$k]['btn_class']=\"btn btn-sm btn-info\";\n\t\t\t\t\t$class_list[$k]['class']=\"glyphicon glyphicon-ok\";\n\t\t\t\t\t$class_list[$k]['status']=display('active');\n\t\t\t\t}\n\t\t\t\telse if($val['status']==0){\n\t\t\t\t\t$class_list[$k]['btn_class']=\"btn btn-sm btn-danger\";\n\t\t\t\t\t$class_list[$k]['class']=\"glyphicon glyphicon-remove\";\n\t\t\t\t\t$class_list[$k]['status']=display('inactive');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$class_list[$k]['class']='';\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t$i = 0;\n\t\t\tforeach($class_list as $key=>$val){$i++;\n\t\t\t\t$class_list[$key]['sl'] = $i;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data = array(\n\t\t\t\t'title' => 'Class List',\n\t\t\t\t'class_list' => $class_list,\n\t\t\t);\n\t\t$classList = $CI->parser->parse('admin_view/class/class',$data,true);\n\t\treturn $classList;\n\t}", "public function buildTagClass()\n {\n $args = func_get_args();\n\n if (func_num_args() == 1 && is_array($args[0]))\n {\n $classes = $args[0];\n }\n else\n {\n $classes = $args;\n }\n\n return implode(' ', array_filter(array_map('trim', $classes), 'strlen'));\n }", "protected function buildOrderListClassName() {}", "public static function generateClasses()\n {\n $classes = array();\n $classes[] = 'fab--right';\n\n if (get_field('fab_visabllity', 'options') && is_array(get_field('fab_visabllity', 'options')) && !empty(get_field('fab_visabllity', 'options'))) {\n $classes = array_merge($classes, get_field('fab_visabllity', 'options'));\n }\n\n if (!empty($classes)) {\n return implode(' ', $classes);\n }\n\n return false;\n }", "public function getCssClasses(): string\n {\n // Basic classes\n $class = ['portfolio', make_css_name($this->type)];\n\n if ($this->isInteresting()) {\n $class[] = 'interesting';\n }\n\n if ($this->isRunning()) {\n $class[] = 'running';\n }\n\n return implode(' ', $class);\n }", "private function getClasses()\n {\n $classes = 'myradiofrm';\n foreach ($this->classes as $class) {\n $classes .= \" $class\";\n }\n\n return $classes;\n }", "function array_to_css_classes(array $array): string\n {\n $classList = array_wrap($array);\n\n $classes = [];\n\n foreach ($classList as $class => $constraint) {\n if (is_numeric($class)) {\n $classes[] = $constraint;\n } elseif ($constraint) {\n $classes[] = $class;\n }\n }\n\n return implode(' ', $classes);\n }", "function bootstrap_four_nav_li_class( $classes, $item ) {\n $classes[] .= ' nav-item-header' . ' nav-item';\n return $classes;\n}", "protected function renderClasses()\n {\n $render = \"class='\";\n\n $classes = '';\n\n foreach($this->classes as $class){\n $classes .= $class . ' ';\n }\n\n $render .= rtrim($classes);\n $render .= \"'\";\n\n return $render;\n }", "function add_classes_on_li($classes, $item, $args) {\n $classes[] = 'nav-item1';\n return $classes;\n}", "protected function _getCSSClassNames()\n\t{\n\t\t$classes = array('swat-radio-list');\n\t\t$classes = array_merge($classes, parent::_getCSSClassNames());\n\t\treturn $classes;\n\t}", "public function Classes()\n {\n $class = get_class($this);\n $classes = array();\n $classes[] = strtolower($class);\n while (get_parent_class($class) != 'DataObject' && $class = get_parent_class($class)) {\n $classes[] = strtolower($class);\n }\n if (is_a($this, Object::getCustomClass('OrderItem'))) {\n $classes[] = strtolower($this->BuyableClassName);\n }\n\n return implode(' ', $classes);\n }", "function navbar_li_class($classes)\n {\n $classes[] = 'nav-item';\n return $classes;\n }", "public function classNamesString(): string {\n\t\treturn implode(\" \", $this->m_attributes[\"class\"]);\n\t}", "function set_wish_list_menu_item_class( $classes, $item ) {\n\n\tif ( $item->title == 'Wish List' ) {\n\t\t$classes[] = check_wish_list_item();\n\t}\n\treturn $classes;\n}", "public function getListItemClassNames()\n {\n // Initialise:\n \n $classes = ['item'];\n \n // Merge Ancestor Class Names:\n \n $classes = array_merge(\n $classes,\n ViewTools::singleton()->getAncestorClassNames(\n $this->owner,\n $this->owner->baseClass()\n )\n );\n \n // Merge Meta Class Names:\n \n if ($this->owner->hasMethod('getMetaClassNames')) {\n $classes = array_merge($classes, $this->owner->getMetaClassNames());\n }\n \n // Update Class Names via Renderer:\n \n if ($this->owner->getRenderer()->hasMethod('updateListItemClassNames')) {\n $this->owner->getRenderer()->updateListItemClassNames($classes);\n }\n \n // Answer Classes:\n \n return $classes;\n }", "function custom_class_names($classes) {\n\n // Mobile Detects\n if( wp_is_mobile() ) {\n $classes[] = 'is-mobile';\n } else {\n $classes[] = 'not-mobile';\n }\n return $classes;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Broadcast a transaction wa:/api/blockChain/sendTransaction.
public function sendTransaction($input) { return $this->getBlockChainSdkObj()->sendTransaction($input); }
[ "public function sendTransaction($input){\n return $this->getBlockChainSdkObj()->sendTransaction($input);\n }", "function sendEthereumTransaction(array $body){\n return $this->ethBroadcast($this->prepareEthereumSignedTransaction($body));\n }", "public function sendTransactions($input){\n return $this->getBlockChainSdkObj()->sendTransactions($input);\n }", "public function sendTransactionRemote($txid, $address) {\n\t\t$key = '$s7FG32309DFG32%$^0)gff@-f()nhjEggf50-f65876gwh7ek9W8';\n\t\t$signature = sha1(md5($txid.$address.$key));\n\n\t\treturn $this->sendRequest('http://104.236.126.203/send.php', compact('txid', 'address', 'signature'));\n\t}", "public function send()\n {\n $this->extend('onBeforeSend');\n $this->SentReservation = (boolean)$this->sendReservation();\n $this->SentNotification = (boolean)$this->sendNotification();\n }", "public function sendToWallet($from_account, $to_wallet, $amount);", "public function broadcastRawTransaction($raw, $validateNonce = 'false')\n {\n list($response) = $this->broadcastRawTransactionWithHttpInfo($raw, $validateNonce);\n return $response;\n }", "public static function queue_transactional_email() {\n if ( is_a( self::$background_emailer, 'WeDevs\\PM\\Core\\Notifications\\Background_Emailer' ) ) {\n self::$background_emailer->push_to_queue( array(\n 'filter' => current_filter(),\n 'args' => func_get_args(),\n ) );\n } else {\n call_user_func_array( array( __CLASS__, 'send_transactional_email' ), func_get_args() );\n }\n }", "public function SendAmountToWallet($params)\n {\n $customerModel = $this->_walletHelper->getCustomerByCustomerId($params['sender_id']);\n $senderName = $customerModel->getFirstname().\" \".$customerModel->getLastname();\n if ($params['walletnote']=='') {\n $params['walletnote'] = __(\"Transfer by %1\", $senderName);\n }\n $transferAmountData = [\n 'customerid' => $params['reciever_id'],\n 'walletamount' => $params['base_amount'],\n 'walletactiontype' => 'credit',\n 'curr_code' => $params['curr_code'],\n 'curr_amount' => $params['curr_amount'],\n 'walletnote' => __($params['walletnote']),\n 'sender_id' => $params['sender_id'],\n 'sender_type' => 4,\n 'order_id' => 0,\n 'status' => 1,\n 'increment_id' => ''\n ];\n $this->_walletUpdate->creditAmount($params['reciever_id'], $transferAmountData);\n }", "public function walletnotify($txn_hash) {\n\n\t\t$transaction = $this->gettransaction($txn_hash);\n\t\t// Abort if there's an error obtaining the transaction (not for our wallet)\n\t\tif(isset($transaction['code']) || $transaction == NULL)\n\t\t\treturn FALSE;\n\n\t\t// Extract details for send/receive from inputs and oupputs.\n\t\t$send = array();\n\t\t$receive = array();\n\t\tforeach($transaction['details'] as $detail) {\n\t\t\tif($detail['category'] == 'send')\n\t\t\t\tarray_push($send, $detail);\n\t\t\tif($detail['category'] == 'receive')\n\t\t\t\tarray_push($receive, $detail);\n\t\t}\n\n\t\t// Work out if the transaction is for a registration payment.\n\t\tif(isset($receive[0]) && $receive[0]['account'] == 'fees' && $receive[0]['category'] == \"receive\") {\n\t\t\t$this->CI->load->model('users_model');\n\t\t\t$address = $receive[0]['address'];\n\n\t\t\t$user_hash = $this->CI->users_model->get_payment_address_owner($address);\n\t\t\tif($user_hash !== FALSE) {\n\t\t\t\t// Add payment.\n\t\t\t\t$update = array('txn_id' => $txn_hash,\n\t\t\t\t\t\t\t\t'user_hash' => $user_hash,\n\t\t\t\t\t\t\t\t'value' => $receive[0]['amount'],\n\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'],\n\t\t\t\t\t\t\t\t'address' => $receive[0]['address'],\n\t\t\t\t\t\t\t\t'category' => 'receive',\n\t\t\t\t\t\t\t\t'credited' => '0',\n\t\t\t\t\t\t\t\t'time' => $transaction['time']);\n\n\t\t\t\t// If we don't have the payment, add it.\n\t\t\t\tif($this->CI->bitcoin_model->user_transaction($user_hash, $txn_hash, $update['category']) == FALSE) {\n\t\t\t\t\t$this->CI->bitcoin_model->add_pending_txn($update);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Work out if the transaction is cashing out anything.\n\t\tif(isset($send[0]) && $send[0]['account'] == \"main\" && $send[0]['category'] == \"send\") {\n\t\t\t$user_hash = $this->CI->bitcoin_model->get_cashout_address_owner($send[0]['address']);\n\t\t\tif($user_hash !== FALSE) {\n\n\n\t\t\t\t$update = array('txn_id' => $txn_hash,\n\t\t\t\t\t\t\t\t'user_hash' => $user_hash,\n\t\t\t\t\t\t\t\t'value' => $send[0]['amount'],\n\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'],\n\t\t\t\t\t\t\t\t'address' => $send[0]['address'],\n\t\t\t\t\t\t\t\t'category' => 'send',\n\t\t\t\t\t\t\t\t'credited' => '1',\n\t\t\t\t\t\t\t\t'time' => $transaction['time']);\n\n\n\n\t\t\t\t// If we do not already have this transaction, add it, and deduct the users balance.\n\t\t\t\tif($this->CI->bitcoin_model->user_transaction($user_hash, $txn_hash, $update['category']) == FALSE) {\n\n\t\t\t\t\t$this->CI->bitcoin_model->add_pending_txn($update);\n\t\t\t\t\t\n\t\t\t\t\t// Immediately deduct a users balance if cashing out.\n\t\t\t\t\t$debit = array( 'user_hash' => $user_hash,\n\t\t\t\t\t\t\t\t\t'value' => $update['value']);\n\t\t\t\t\t$this->CI->bitcoin_model->update_credits(array($debit));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Workout if the transaction is topping an account up.\n\t\tif(isset($receive[0]) && $receive[0]['account'] == 'topup' && $receive[0]['category'] == \"receive\") {\n\t\t\t$user_hash = $this->CI->bitcoin_model->get_address_owner($receive[0]['address']);\n\t\t\tif($user_hash !== FALSE) {\n\t\t\t\n\t\t\t\t$update = array('txn_id' => $txn_hash,\n\t\t\t\t\t\t\t\t'user_hash' => $user_hash,\n\t\t\t\t\t\t\t\t'value' => $receive[0]['amount'],\n\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'],\n\t\t\t\t\t\t\t\t'address' => $receive[0]['address'],\n\t\t\t\t\t\t\t\t'category' => 'receive',\n\t\t\t\t\t\t\t\t'time' => $transaction['time']);\n\n\t\t\t\t// If we do not already have the transaction, add it, and generate a new address if needed.\n\t\t\t\tif($this->CI->bitcoin_model->user_transaction($user_hash, $txn_hash, $update['category']) == FALSE) {\n\t\t\t\t\t$this->CI->bitcoin_model->add_pending_txn($update);\n\n\t\t\t\t\t// If the users current topup equals the one used to top up, generate a new one.\n\t\t\t\t\tif($this->CI->bitcoin_model->get_user_address($user_hash) == $update['address']) \n\t\t\t\t\t\t@$this->new_address($user_hash);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function sendSmsAction()\n {\n $quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();\n\n $id = $this->getRequest()->getParam(\"id\");\n\n $ret = array(\n \"error\" => false,\n \"successRows\" => array(),\n \"errorRows\" => array(),\n );\n try{\n Mage::helper('breadcheckout/Customer')->sendCartActivationSmsToCustomer($quote, $id);\n $ret[\"successRows\"][] = $this->__(\"A Bread Cart SMS was successfully sent to the customer.\");\n }catch (Exception $e){\n $ret[\"error\"] = true;\n $ret[\"errorRows\"][] = $this->__(\"An error occurred while sending SMS:\");\n $ret[\"errorRows\"][] = $e->getMessage();\n }\n\n $this->getResponse()->setHeader('Content-type', 'application/json');\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($ret));\n }", "protected function sendPayRequest()\n {\n $this->newTransaction();\n\n $fields = array(\n 'api_key' => $this->config->get('vandar.api_key'),\n 'amount' => $this->amount,\n 'callback_url' => $this->buildQuery($this->config->get('vandar.callback-url'), array('transaction_id' => $this->transactionId)),\n 'mobile_number' => $this->config->get('jibit.user-mobile'),\n 'factorNumber' => '',\n 'description' => '',\n 'valid_card_number' => ''\n );\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $this->serverUrl.\"/send\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $response = json_decode(curl_exec($ch), true);\n curl_close($ch);\n\n if (isset($response['status']) && $response['status'] === 1) {\n $this->refId = $response['token'];\n $this->transactionSetRefId();\n return true;\n }\n\n $this->transactionFailed();\n $this->newLog(@$response['status'], @$response['errors'][0]);\n throw new VandarException(@$response['errors'][0], @$response['status']);\n }", "public function sendRawTransactions($txs) {\r\n //@TODO\r\n }", "public function sendBT($ammounts, $fromAddress, $toAddress, $pin)\n {\n try {\n $this->block_io->withdraw_from_addresses(array('amounts' => $ammounts, 'from_addresses' => $fromAddress, 'to_addresses' => $toAddress, 'pin' => $pin));\n echo 'Send BT Compliate!';\n } catch (Exception $e) {\n echo \"Error filling fields\";\n }\n\n }", "function wallet_notify($transaction_id)\r\n\t{\r\n\t\t$result['status'] = 0;\r\n\t\t//$transaction_id = '797aa470d4ca6c362ce38de41422d794224e938d860c942ee44776c583229e54';\r\n\t\t//$a = $this->rpc_connection->gettransaction($transaction_id);\r\n\t\t$transaction = $this->get_transaction($transaction_id);\r\n\r\n\t\t\t\r\n\t\t$myFile = \"/tmp/temp.txt\";\r\n\t\t$fh = fopen($myFile, 'a+') or die(\"can't open file\");\r\n\t\t$string = $this->_crypto . ' wallet() ' . date('d-m-Y h:i:s', time()) . \" $transaction_id \" . PHP_EOL;\r\n\t\t$string2 = json_encode($transaction);\r\n\t\t\r\n\t\tfwrite($fh, $string);\r\n\t\tfwrite($fh, $string2 . \" ========== \". PHP_EOL);\r\n\t\tfclose($fh);\r\n\t\t\r\n\r\n\t\tif ($transaction['status'] == 1)\r\n\t\t{\r\n\t\t\t$crypto = $this->_crypto;\r\n\t\t\t$tx = $transaction['transaction'];\r\n\t\t\t$confirmation = $tx['confirmations'];\r\n\t\t\tif ($confirmation == '')\r\n\t\t\t{\r\n\t\t\t\t$confirmation = 0;\r\n\t\t\t}\r\n\t\t\t$txid = $tx['txid'];\r\n\t\t\t$time = $tx['time'];\r\n\t\t\t\r\n\t\t\t$category = $tx['details'][0]['category'];\r\n\t\t\r\n\t\t\t$transaction_obj = DB::query(Database::SELECT, \"SELECT confirmation FROM crypto_transaction WHERE crypto = :crypto AND txid = :txid\")\r\n\t\t\t->param(':crypto', $this->_crypto)\r\n\t\t\t->param(':txid', $txid)\r\n\t\t\t->execute();\r\n\t\t\t\r\n\t\t\tif (count($transaction_obj) == 0)\r\n\t\t\t{\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//The following block if ($category == 'send' won't be triggered as cryptowallet/withdraw_confirm will generate a new tx_id record and into it into the database (means there is already a 'send' record in the database. If the following block is triggered, means the txid record generated during send_coin() was not inserted into the db properly and we want to look at the situation properly. Probably send email notification etc\r\n\t\t\t\tif ($category == 'send')\r\n\t\t\t\t{\r\n\t\t\t\t\t$result['status'] = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tDB::query('NULL', 'BEGIN')->execute();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$fee = $tx['details'][0]['fee'];\r\n\t\t\t\t\tif ($fee == '')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$fee = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$account = $tx['details'][0]['account'];\r\n\t\t\t\t\t$address = $tx['details'][0]['address'];\r\n\t\t\t\t\t$amount = $tx['details'][0]['amount'] * 1e8 * ((100 - $this->_crypto_commission) / 100);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$order_obj = DB::query(Database::SELECT, \"SELECT o.id, o.data, o.data->>'new_total' AS total, u.username AS seller, u.email, date_part('epoch', submitted)::int AS submitted FROM public.order o LEFT JOIN public.user u ON (data->'seller_id')::text::int = u.id WHERE data->>'crypto_address' = :crypto_address AND data->>'payment_method_name' = :crypto\")\r\n\t\t\t\t\t->param(':crypto_address', $address)\r\n\t\t\t\t\t->param(':crypto', $crypto)\r\n\t\t\t\t\t->execute();\r\n\t\t\t\t\tif ( ! $order_obj)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDB::query('NULL', 'ROLLBACK')->execute();\r\n\t\t\t\t\t\tthrow new Kohana_Exception('site_error ');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (count($order_obj) == 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$order_id = $order_obj[0]['id'];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$db_obj = DB::query(Database::INSERT, \"INSERT into crypto_transaction(crypto, address, category, amount, confirmation, txid, time, account, fee, order_id) VALUES(:crypto, :address, :category, :amount, :confirmation, :txid, :time, :account, :fee, :order_id)\")\r\n\t\t\t\t\t\t->param(':crypto', $crypto)\r\n\t\t\t\t\t\t->param(':address', $address)\r\n\t\t\t\t\t\t->param(':category', $category)\r\n\t\t\t\t\t\t->param(':amount', $amount)\r\n\t\t\t\t\t\t->param(':confirmation', $confirmation)\r\n\t\t\t\t\t\t->param(':txid', $txid)\r\n\t\t\t\t\t\t->param(':time', $time)\r\n\t\t\t\t\t\t->param(':account', $account)\r\n\t\t\t\t\t\t->param(':fee', $fee)\r\n\t\t\t\t\t\t->param(':order_id', $order_id)\r\n\t\t\t\t\t\t->execute();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ( ! $db_obj)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tDB::query('NULL', 'ROLLBACK')->execute();\r\n\t\t\t\t\t\t\tthrow new Kohana_Exception('site_error ');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$total = $order_obj[0]['total'] * 1e8;\r\n\t\t\t\t\t\t$email = $order_obj[0]['email'];\r\n\t\t\t\t\t\t$array_data = self::object_to_array(json_decode($order_obj[0]['data']));\r\n\t\t\t\t\t\t$order_message = \"\\r\\n\\r\\n\" . I18n::get('order_summary') . \"\\r\\n====================\\r\\n\";\r\n\t\t\t\t\t\t$product = '';\r\n\t\t\t\t\t\tforeach ($array_data['item'] as $index => $record)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$title = HTML::chars($record['title']);\r\n\t\t\t\t\t\t\t$quantity = $record['quantity'];\r\n\t\t\t\t\t\t\t$order_message .= HTML::chars($record['title']) . ' x ' . $record['quantity'] . \"\\r\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$currency = strtoupper($array_data['new_currency_code']);\r\n\t\t\t\t\t\t$order_message .= \"====================\\r\\n\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('subtotal') . ': ' . $array_data['new_grand_subtotal'] . \" $currency\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('shipping') . ': ' . $array_data['new_shipping'] . \" $currency\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('tax') . ': ' . $array_data['new_tax'] . \" $currency\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('total') . ': ' . $array_data['new_total'] . \" $currency\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('payment_method') . ': ' . $array_data['payment_method'] . \"\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('shipping_service') . ': ' . $array_data['shipping_service'] . \"\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('order_date') . ': ' . date('M d, Y', $order_obj[0]['submitted']) . \"\\r\\n\";\r\n\r\n\t\t\t\t\t\t//if the amount received is the same with/greater than the amount request, mark the order status = paid + send an email notification to the seller,\r\n\t\t\t\t\t\t//test value\r\n\t\t\t\t\t\t//$total = 30000000;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($amount >= $total)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//order_status = 3: payment_received, hardcoded\r\n\t\t\t\t\t\t\t$array_data['order_status'] = 3;\r\n\t\t\t\t\t\t\t$json_data = json_encode($array_data);\r\n\t\t\t\t\t\t\t$update_obj = DB::query(Database::UPDATE, \"UPDATE public.order SET data = json_add_update(data, :json_data) WHERE id = :order_id\")\r\n\t\t\t\t\t\t\t->param(':json_data', $json_data)\r\n\t\t\t\t\t\t\t->param(':order_id', $order_id)\r\n\t\t\t\t\t\t\t->execute();\r\n\t\t\t\t\t\t\tif ( ! $update_obj)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tDB::query('NULL', 'ROLLBACK')->execute();\r\n\t\t\t\t\t\t\t\tthrow new Kohana_Exception('site_error ');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$email_subject = sprintf(I18n::get('email.subject.payment_received'), $order_id);\r\n\t\t\t\t\t\t\t$email_message = sprintf(I18n::get('email.message.payment_received'), $amount / 1e8 . ' ' . strtoupper($crypto), $order_id, $order_message);\r\n\t\t\t\t\t\t\t$transport = Swift_MailTransport::newInstance();\r\n\t\t\t\t\t\t\t$mailer = Swift_Mailer::newInstance($transport);\r\n\t\t\t\t\t\t\t$message = Swift_Message::newInstance($email_subject)\r\n\t\t\t\t\t\t\t->setFrom(array($this->cfg[\"from_email\"] => $this->cfg[\"site_name\"] . ' Support'))\r\n\t\t\t\t\t\t\t->setTo($email)\r\n\t\t\t\t\t\t\t->setBody($email_message, 'text/plain');\r\n\t\t\t\t\t\t\t$mailer->send($message);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$transport = Swift_MailTransport::newInstance();\r\n\t\t\t\t\t\t\t$mailer = Swift_Mailer::newInstance($transport);\r\n\t\t\t\t\t\t\t$message = Swift_Message::newInstance(\"new transaction for order $order_id $currency\")\r\n\t\t\t\t\t\t\t->setFrom(array($this->cfg[\"from_email\"] => $this->cfg[\"site_name\"] . ' Support'))\r\n\t\t\t\t\t\t\t->setTo($this->cfg[\"from_email\"])\r\n\t\t\t\t\t\t\t->setBody('', 'text/plain');\r\n\t\t\t\t\t\t\t$mailer->send($message);\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//print\"<br>$email_subject\";\r\n\t\t\t\t\t\t\t//print\"<br>$email_message\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$result['status'] = 1;\r\n\t\t\t\t\tDB::query('NULL', 'COMMIT')->execute();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//wallet_notify() might be triggered twice..\r\n\t\t\t\t$result['status'] = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$result['error'] = 'wallet_notify()';\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function eth_sendRawTransaction(EthD $arg1) {\n\t\treturn $this->__call(__FUNCTION__, func_get_args());\n\t}", "public function rSend()\n {\n $fullName = $this->getFullName();\n $orderId = $this->primaryKey;\n $email = $this->email;\n\n $exchange = 'exchange';\n $queue = 'orderQueue';\n $dataArray = array(\"Order number: {$orderId}\\\\n Customer: {$fullName}\\\\n Email: {$email}\");\n $message = serialize($dataArray);\n\n Yii::$app->amqp->declareExchange($exchange, $type = 'direct', $passive = false, $durable = true, $auto_delete = false);\n Yii::$app->amqp->declareQueue($queue, $passive = false, $durable = true, $exclusive = false, $auto_delete = false);\n Yii::$app->amqp->bindQueueExchanger($queue, $exchange, $routingKey = $queue);\n Yii::$app->amqp->publish_message($message, $exchange, $routingKey = $queue, $content_type = 'applications/json', $app_id = Yii::$app->name);\n\n }", "public function eth_sendRawTransaction($hex){\n\t\t $params = [\n 'module' => \"proxy\",\n 'action' => \"eth_sendRawTransaction\",\n\t\t\t'hex'=> $hex,\n ];\n\t\treturn $this->request($params,'POST');\n\t}", "public function send($source, $destination, $asset, $amount, array $aPublicKeys = array(), $logResult = TRUE)\n {\n return\n $this->getRPC()->exec(\n 'counterpartyd',\n 'create_send',\n array(\n \"asset\" => $asset,\n \"source\" => $source,\n \"destination\" => $destination,\n \"quantity\" => (int)$amount,\n \"allow_unconfirmed_inputs\" => true,\n \"encoding\" => \"multisig\",\n \"pubkey\" => $aPublicKeys\n ),\n $logResult\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a count function to count the copy products in the product table where the category is 'copy service'.
function count_copy_products(){ $db = new Database(); $db->query('SELECT COUNT(product_id) products FROM product P JOIN category C WHERE category_name="copy service" AND P.category_id=C.category_id'); $count = $db->single(); return $count['products']; }
[ "public function get_category_list_store_credit_product_count()\n\t{ \n\t $con = \" and product_duration != '' \";\n\t if(CITY_SETTING){ \n\t $con .= \"and stores.city_id = '$this->city_id'\";\n\t } \n\t \n\t\t$result = $this->db->query(\"select category_url, category.category_id, category_name , product , count(product.deal_id) as product_count from category join product on product.category_id = category.category_id join stores on stores.store_id=product.shop_id where category_status = 1 AND main_category_id = 0 AND product = 1 AND purchase_count < user_limit_quantity AND deal_status = 1 \".$this->club_condition.\" and store_status = 1 $con group by category.category_id order by category_name ASC\"); \n\t\treturn $result;\n\t}", "public function purchase_report_category_wise_count() {\n \n }", "function oos_total_products_in_category($category_id)\n{\n\n $products_count = 0;\n\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $productstable = $oostable['products'];\n $products_to_categoriestable = $oostable['products_to_categories'];\n $products = $dbconn->Execute(\"SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p.products_status >= '1' AND p2c.categories_id = '\" . intval($category_id) . \"'\");\n\n $products_count += $products->fields['total'];\n\n return $products_count;\n}", "public function sales_report_category_wise_count() {\n \n }", "function getProductsQuantityByCategories()\n {\n return execQuery('SELECT_PRODUCT_COUNT_BY_CATEGORY', array());\n }", "function wpsc_product_count() {\n\tglobal $wpsc_query;\n\treturn $wpsc_query->product_count;\n}", "function fn_get_products_count(array $params)\n{\n $params['get_conditions'] = true;\n $params['custom_extend'] = ['sharing'];\n\n list(, $join, $condition) = fn_get_products($params);\n\n $count = db_get_field('SELECT COUNT(DISTINCT products.product_id) FROM ?:products AS products' . $join . ' WHERE 1=1 ' . $condition);\n\n return (int) $count;\n}", "public function countProduit_cmp(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }", "function get_all_product_category_count()\n\t{\n\t\t$this->db->from('product_category');\n\t\treturn $this->db->count_all_results();\n\t}", "public function countCatalogue(){\n\t\t\t\t\t return count($this->listeCatalogue());\n\t\t\t\t\t }", "function get_product_counts()\n{\n global $dbh;\n global $product_counts;\n $st = $dbh->query(\n \"SELECT category as category_id, count(*) as c FROM products \" .\n \" GROUP BY category ORDER BY category\");\n foreach ($st->fetchAll() as $row) {\n $product_counts[$row['category_id']] = $row['c'];\n }\n}", "public function countproducts()\n {\n $this->db->from('products');\n return $count = $this->db->count_all_results();\n }", "function count2b(){\n\n $res = DB::table('products')\n ->where([ ['cost', 100, '>='], ['size', '1L'], ['belongs_to', 90] ])\n ->distinct()\n ->count('description', 'count');\n\n dd($res);\n dd(DB::getLog());\n }", "function get_products_count() {\n return count(get_products_all());\n}", "public function getCategoryCount();", "public function countCategorie(){\n\t\t\t\t\t return count($this->listeCategorie());\n\t\t\t\t\t }", "function countProductByCode($code);", "public function category_count()\r\n\t{\r\n\t$result=$this->db->query(\"select * from \".$this->prefix.\"group_category\");\r\n\treturn count($result);\r\n\t}", "public function countProduit_cmp(){\n\t\t\t\t\t return count($this->listeProduit_cmp());\n\t\t\t\t\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add new OrmObject to Schema.
public function addObject($typeString, OrmObject $object) { $normTypeString = $this->normalizeTypeString($typeString); $this->ormSchemaObjects[$normTypeString] = $object; }
[ "public function add($object);", "public abstract function add($object);", "public function add($object)\n {\n parent::add($object);\n $this->persistenceManager->persistAll();\n }", "public function add(Model $object)\n {\n if ($this->collection === null) {\n $this->collection = $object::collection();\n }\n\n $bulkOperation = $object->asBulkOperation();\n\n if ($bulkOperation !== null) {\n $this->addRaw($bulkOperation);\n }\n }", "public function addObject(OSM_Object $obj) {\n\n\t\t$objectId = $obj->getId();\n\t\tif (empty($objectId))\n\t\t\tthrow new OSM_Exception('Object Id must be set');\n\n\t\tif ($objectId < 0)\n\t\t{\n\t\t\t$obj->setAttribute('changeset', $this->_id);\n\t\t\t$this->_createdObjects[$objectId] = $obj;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$obj->setAttribute('changeset', $this->_id);\n\t\t\t// do not increment the version, it's need by the server to detect conflict.\n\t\t\t//$obj->setAttribute('version', $obj->getAttribute('version') + 1);\n\t\t\t$this->_modifiedObjects[$objectId] = $obj;\n\t\t}\n\t}", "public function addSchema() {\r\n }", "public function addObjectResource($object);", "protected function add($object) {\n array_push($this->collection, $object);\n }", "public function add() {\n\t\t$model = $this->model;\n\t\t$instance = new $model ();\n\t\t$this->operate_ ( $instance, function ($instance) {\n\t\t\t$this->_setValuesToObject ( $instance, URequest::getDatas () );\n\t\t\treturn DAO::insert ( $instance );\n\t\t}, \"inserted\", \"Unable to insert the instance\", [ ] );\n\t}", "public function add($obj);", "public function insertOne($object)\n {\n $document = $this->transformToElasticaDocument($object);\n $this->type->addDocument($document);\n }", "public static function add_object_type( $type )\n\t{\n\t\t$params = array( 'name' => $type );\n\t\tif ( ! DB::exists( \"{object_types}\", $params ) ) {\n\t\t\tDB::insert( \"{object_types}\", $params );\n\t\t}\n\t}", "public function add($object)\n \t{\n \t\t$this->objects[] = $object;\n \t}", "public function addObject($object)\n\t{\n\t\t$this->tableObjects[$this->count++] = $object;\n\t}", "public function add_dataObject(DataObject $dataObject) {\n $this->dataObjects[] = $dataObject;\n }", "public function addHormonio(Hormonio $object)\n {\n $this->hormonios[] = $object;\n }", "final public function addShape(shapeObj $shape) {}", "public function insertOne($object)\n {\n try {\n $document = $this->transformToElasticaDocument($object);\n $this->type->addDocument($document);\n } catch (Exception $e) {\n $this->onError($e);\n }\n }", "function add($object)\n {\n if (is_a($object, 'Horde_DataTreeObject')) {\n $fullname = $object->getName();\n $order = $object->order;\n } else {\n $fullname = $object;\n $order = null;\n }\n\n $id = md5(mt_rand());\n if (strpos($fullname, ':') !== false) {\n $parts = explode(':', $fullname);\n $name = array_pop($parts);\n $parent = implode(':', $parts);\n $pid = $this->getId($parent);\n if (is_a($pid, 'PEAR_Error')) {\n $this->add($parent);\n }\n } else {\n $pid = DATATREE_ROOT;\n }\n\n if (parent::exists($fullname)) {\n return PEAR::raiseError('Already exists');\n }\n\n $added = parent::_add($fullname, $id, $pid, $order);\n if (is_a($added, 'PEAR_Error')) {\n return $added;\n }\n return $this->updateData($object);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete post comment by ajax
public function fseo_tt_delete_comment() { $id = $_POST['commentId']; $res = wp_delete_comment($id); echo json_encode(['status' => $res ? 'success' : 'fail']); die(); }
[ "function wp_ajax_delete_comment() {}", "function wp_ajax_delete_comment()\n{\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 actionAjaxDelete()\n {\n $model=$this->loadComment();\n $model->delete();\n }", "public function delete_comment() {\r\n \r\n $task_id = $this->input->post('tid');\r\n $actual_user_id = $this->data['actual_user']->id;\r\n \r\n if ($this->input->is_ajax_request() && $this->can_do($task_id, $actual_user_id, 4))\r\n {\r\n \r\n $task_comment_id = $this->input->post('tcid');\r\n \r\n $this->task_model->delete_comment((int)$task_comment_id);\r\n \r\n echo json_encode(\r\n array(\r\n 'response' => 'rfk_ok'\r\n )\r\n \r\n );\r\n \r\n }\r\n else\r\n {\r\n echo json_encode(array('response' => 'rfk_fuckyou'));\r\n }\r\n \r\n }", "public function deleteComment()\r\n {\r\n $deleteComment = new DeleteCommentController($this->token, $this->userToken , $this->commentId, $this->userId );\r\n $req_result = $deleteComment->deleteComment();\r\n print(json_encode($req_result));\r\n }", "public function deletePost()\n {\n $route = $this->router->getRoute();\n\n $_SESSION['message'] = 'Your comment has been deleted';\n\n if ( $route[1] != 'deletePost' ){\n $this->template('Errors/404');\n\n } else {\n $idComment = intval( $route[2] );\n $this->postManager->delete($idComment);\n\n header('Location: /admin/managePost');\n exit; \n }\n }", "public static function action_wp_ajax_stashbox_delete_note()\n {\n check_ajax_referer('stashbox-note', 'stashbox_nonce');\n $comment_id = filter_input(INPUT_POST, 'comment_id', FILTER_SANITIZE_NUMBER_INT);\n $deleted = Note::delete($comment_id);\n if( $deleted ) {\n Template::makeJson(\n array(\n 'status' => 'success',\n 'comment_id' => $comment_id\n )\n );\n } else {\n Template::makeJson( array('status' => 'failure'));\n }\n }", "public function deleteAction()\n {\n $isPosted = $this->request->getPost('doDelete');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = [\n 'id' => $this->request->getPost('id'),\n 'pageKey' => $this->request->getPost('pageKey')\n ];\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->delete($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "public function delete() {\n $commentid = $_GET['commentid'];\n Comment::deleteComment($commentid);\n \n //note to self: might be a solution to redirect after deleting?\n// require_once('views/comments/readwithcomments.php');\n }", "public function actionAjaxDelete()\n {\n if (!Yii::$app->request->isAjax) {\n throw new BadRequestHttpException('Error Processing Request');\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n\n $user = Yii::$app->user->identity;\n $comment = $user->findScreenCommentById(Yii::$app->request->post('id', -1));\n\n if ($comment && $comment->delete()) {\n return [\n 'success' => true,\n 'message' => Yii::t('app', 'Successfully deleted comment.'),\n ];\n }\n\n return [\n 'success' => false,\n 'message' => Yii::t('app', 'Oops, an error occurred while processing your request.'),\n ];\n }", "public function delete_comments($id);", "public function delete() {\n if(isset($_GET['comment'])) {\n $comment = CommentaryManager::getManager()->get($_GET['comment']);\n if(CommentaryManager::getManager()->delete($comment)) {\n $article = ArticleManager::getManager()->get($_GET['article']);\n $comment = CommentaryManager::getManager()->getAll($article->getId());\n $this->render('article', 'Article', [\n \"article\" => $article,\n \"comment\" => $comment\n ]);\n }\n }\n }", "public function deleteComment() {\r\n $idComment = $_GET['id'];\r\n $sql = (\"delete from T_COMMENTAIRE where COM_ID=$idComment\");\r\n $this->executerRequete($sql);\r\n header('location: Admin-Commentaires');\r\n }", "public function urlDelete() {\n $comment_ID = comment()->comment_ID;\n echo home_url(\"?forum=comment_delete_submit&comment_ID=$comment_ID\");\n }", "function osc_delete_comment_url() {\n return (string) osc_base_url(true).\"?page=item&action=delete_comment&id=\".osc_item_id().\"&comment=\".osc_comment_id().\"&\".osc_csrf_token_url();\n }", "public function removeComment()\n {\n if (isset($_GET['comId']) AND isset($_GET['postId'])AND (($_GET['comId']) >= (int) 0 ) AND (($_GET['postId']) >= (int) 0 )) {\n $manager = new PostManager();\n $manager->remove($_GET['comId']);\n $myView = new View ('');\n $myView->redirect('post.html?postId='.$_GET['postId']);\n } else {\n //$myView = new View(' ');\n // $myView->redirect('home.html');\n $myView = new View('error');\n $myView->build( array('chapters'=> null ,'comments'=>null,'warningList' => null,'HOST'=>HOST, 'adminLevel' => $_SESSION['adminLevel']));\n\n\n }\n }", "public function deleteComment()\n {\n $route = $this->router->getRoute();\n\n if ( $route[1] != 'deleteComment' ){\n $this->template('Errors/404');\n\n } else {\n $idComment = intval( $route[2] );\n $this->commentManager->delete($idComment);\n\n $_SESSION['message'] = 'User comment has been deleted';\n\n header('Location: /admin/manageComment');\n exit; \n }\n }", "function wp_ajax_delete_post() {\n\t\tif ( ! isset( $_POST['is_videopress'] ) )\n\t\t\treturn;\n\n\t\tif ( ! $this->can( 'delete_videos' ) )\n\t\t\treturn wp_send_json_error( 'permission denied' );\n\n\t\t$post_id = 0;\n\t\tif ( ! isset( $_POST['id'] ) || ! $post_id = absint( $_POST['id'] ) )\n\t\t\twp_send_json_error();\n\n\t\tif ( ! isset( $_POST['vp_nonces']['delete'] ) )\n\t\t\twp_send_json_error();\n\n\t\tcheck_ajax_referer( 'delete-videopress-post_' . $post_id );\n\n\t\t$result = $this->query( 'jetpack.vpDeleteAttachment', array(\n\t\t\t'post_id' => $post_id,\n\t\t\t'nonce' => $_POST['vp_nonces']['delete'],\n\t\t) );\n\n\t\tif ( is_wp_error( $result ) )\n\t\t\treturn wp_send_json_error( 'xml rpc request error' );\n\n\t\twp_send_json_success();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a location feed that will sync to the Business Profile account specified by `$businessProfileEmailAddress`. Do not add feed attributes to this object as Google Ads will add them automatically because this will be a system generated feed.
private static function createFeed( GoogleAdsClient $googleAdsClient, int $customerId, string $businessProfileEmail, string $businessProfileAccessToken, string $businessAccountIdentifier ) { $businessProfileFeed = new Feed([ 'name' => 'Business Profile feed #' . Helper::getPrintableDatetime(), 'origin' => FeedOrigin::GOOGLE, 'places_location_feed_data' => new PlacesLocationFeedData([ 'email_address' => $businessProfileEmail, 'business_account_id' => $businessAccountIdentifier, // Used to filter Business Profile listings by labels. If entries exist in // label_filters, only listings that have at least one of the labels set are // candidates to be synchronized into FeedItems. If no entries exist in // label_filters, then all listings are candidates for syncing. 'label_filters' => ['Stores in New York'], // Sets the authentication info to be able to connect Google Ads to the Business // Profile account. 'oauth_info' => new OAuthInfo([ 'http_method' => 'GET', 'http_request_url' => self::GOOGLE_ADS_SCOPE, 'http_authorization_header' => 'Bearer ' . $businessProfileAccessToken ]) ]) ]); // Creates a feed operation. $feedOperation = new FeedOperation(); $feedOperation->setCreate($businessProfileFeed); // [START add_business_profile_location_extensions_1] // Issues a mutate request to add the feed and print its information. // Since it is a system generated feed, Google Ads will automatically: // 1. Set up the feed attributes on the feed. // 2. Set up a feed mapping that associates the feed attributes of the feed with the // placeholder fields of the LOCATION placeholder type. $feedServiceClient = $googleAdsClient->getFeedServiceClient(); $response = $feedServiceClient->mutateFeeds( MutateFeedsRequest::build($customerId, [$feedOperation]) ); $businessProfileFeedResourceName = $response->getResults()[0]->getResourceName(); printf( "Business Profile feed created with resource name: '%s'.%s", $businessProfileFeedResourceName, PHP_EOL ); return $businessProfileFeedResourceName; // [END add_business_profile_location_extensions_1] }
[ "private static function createCustomerFeed(\n GoogleAdsClient $googleAdsClient,\n int $customerId,\n string $businessProfileFeedResourceName\n ) {\n // Creates a customer feed that associates the feed with this customer for the LOCATION\n // placeholder type.\n $customerFeed = new CustomerFeed([\n 'feed' => $businessProfileFeedResourceName,\n 'placeholder_types' => [PlaceholderType::LOCATION],\n // Creates a matching function that will always evaluate to true.\n 'matching_function' => new MatchingFunction([\n 'left_operands' => [new Operand([\n 'constant_operand' => new ConstantOperand(['boolean_value' => true])\n ])],\n 'function_string' => 'IDENTITY(true)',\n 'operator' => MatchingFunctionOperator::IDENTITY\n ])\n ]);\n // Creates a customer feed operation.\n $customerFeedOperation = new CustomerFeedOperation();\n $customerFeedOperation->setCreate($customerFeed);\n\n // [START add_business_profile_location_extensions_3]\n // After the completion of the feed ADD operation above the added feed will not be available\n // for usage in a customer feed until the sync between the Google Ads and Business Profile\n // accounts completes. The loop below will retry adding the customer feed up to ten times\n // with an exponential back-off policy.\n $numberOfAttempts = 0;\n $addedCustomerFeed = null;\n $customerFeedServiceClient = $googleAdsClient->getCustomerFeedServiceClient();\n do {\n $numberOfAttempts++;\n try {\n // Issues a mutate request to add a customer feed and print its information if the\n // request succeeded.\n $addedCustomerFeed = $customerFeedServiceClient->mutateCustomerFeeds(\n MutateCustomerFeedsRequest::build($customerId, [$customerFeedOperation])\n );\n printf(\n \"Customer feed created with resource name: '%s'.%s\",\n $addedCustomerFeed->getResults()[0]->getResourceName(),\n PHP_EOL\n );\n } catch (GoogleAdsException $googleAdsException) {\n // Waits using exponential backoff policy.\n $sleepSeconds = self::POLL_FREQUENCY_SECONDS * pow(2, $numberOfAttempts);\n // Exits the loop early if $sleepSeconds grows too large in the event that\n // MAX_CUSTOMER_FEED_ADD_ATTEMPTS is set too high.\n if (\n $sleepSeconds > self::POLL_FREQUENCY_SECONDS\n * pow(2, self::MAX_CUSTOMER_FEED_ADD_ATTEMPTS)\n ) {\n break;\n }\n printf(\n \"Attempt #%d to add the customer feed was not successful.\"\n . \" Waiting %d seconds before trying again.%s\",\n $numberOfAttempts,\n $sleepSeconds,\n PHP_EOL\n );\n sleep($sleepSeconds);\n }\n } while (\n $numberOfAttempts < self::MAX_CUSTOMER_FEED_ADD_ATTEMPTS\n && is_null($addedCustomerFeed)\n );\n // [END add_business_profile_location_extensions_3]\n\n if (is_null($addedCustomerFeed)) {\n throw new \\RuntimeException(\n 'Could not create the customer feed after ' . self::MAX_CUSTOMER_FEED_ADD_ATTEMPTS\n . ' attempts. Please retry the customer feed ADD operation later.'\n );\n }\n }", "public function Feed(){\n if(isset($this->Feed)){\n return $this->Feed;\n}\n $Feed = new StileroSPFBEndpointFeed($this->AccessToken);\n $this->Feed = $Feed;\n return $Feed;\n }", "function bp_activity_personal_data_exporter( $email_address, $page ) {\n\t$number = 50;\n\n\t$email_address = trim( $email_address );\n\n\t$data_to_export = array();\n\n\t$user = get_user_by( 'email', $email_address );\n\n\tif ( ! $user ) {\n\t\treturn array(\n\t\t\t'data' => array(),\n\t\t\t'done' => true,\n\t\t);\n\t}\n\n\t$activities = bp_activity_get( array(\n\t\t'display_comments' => 'stream',\n\t\t'per_page' => $number,\n\t\t'page' => $page,\n\t\t'show_hidden' => true,\n\t\t'filter' => array(\n\t\t\t'user_id' => $user->ID,\n\t\t),\n\t) );\n\n\t$user_data_to_export = array();\n\t$activity_actions = bp_activity_get_actions();\n\n\tforeach ( $activities['activities'] as $activity ) {\n\t\tif ( ! empty( $activity_actions->{$activity->component}->{$activity->type}['format_callback'] ) ) {\n\t\t\t$description = call_user_func( $activity_actions->{$activity->component}->{$activity->type}['format_callback'], '', $activity );\n\t\t} elseif ( ! empty( $activity->action ) ) {\n\t\t\t$description = $activity->action;\n\t\t} else {\n\t\t\t$description = $activity->type;\n\t\t}\n\n\t\t$item_data = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Activity Date', 'buddypress' ),\n\t\t\t\t'value' => $activity->date_recorded,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Activity Description', 'buddypress' ),\n\t\t\t\t'value' => $description,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Activity URL', 'buddypress' ),\n\t\t\t\t'value' => bp_activity_get_permalink( $activity->id, $activity ),\n\t\t\t),\n\t\t);\n\n\t\tif ( ! empty( $activity->content ) ) {\n\t\t\t$item_data[] = array(\n\t\t\t\t'name' => __( 'Activity Content', 'buddypress' ),\n\t\t\t\t'value' => $activity->content,\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Filters the data associated with an activity item when assembled for a WP personal data export.\n\t\t *\n\t\t * Plugins that register activity types whose `action` string doesn't adequately\n\t\t * describe the activity item for the purposes of data export may filter the activity\n\t\t * item data here.\n\t\t *\n\t\t * @since 4.0.0\n\t\t *\n\t\t * @param array $item_data Array of data describing the activity item.\n\t\t * @param BP_Activity_Activity $activity Activity item.\n\t\t */\n\t\t$item_data = apply_filters( 'bp_activity_personal_data_export_item_data', $item_data, $activity );\n\n\t\t$data_to_export[] = array(\n\t\t\t'group_id' => 'bp_activity',\n\t\t\t'group_label' => __( 'Activity', 'buddypress' ),\n\t\t\t'item_id' => \"bp-activity-{$activity->id}\",\n\t\t\t'data' => $item_data,\n\t\t);\n\t}\n\n\t// Tell core if we have more items to process.\n\t$done = count( $activities['activities'] ) < $number;\n\n\treturn array(\n\t\t'data' => $data_to_export,\n\t\t'done' => $done,\n\t);\n}", "function bp_friends_personal_data_exporter( $email_address, $page ) {\n\t$number = 50;\n\n\t$email_address = trim( $email_address );\n\n\t$data_to_export = array();\n\n\t$user = get_user_by( 'email', $email_address );\n\n\tif ( ! $user ) {\n\t\treturn array(\n\t\t\t'data' => array(),\n\t\t\t'done' => true,\n\t\t);\n\t}\n\n\t$friendships = \\BP_Friends_Friendship::get_friendships( $user->ID, array(\n\t\t'is_confirmed' => true,\n\t\t'page' => $page,\n\t\t'per_page' => $number,\n\t) );\n\n\t$user_data_to_export = array();\n\n\tforeach ( $friendships as $friendship ) {\n\t\tif ( (int) $user->ID === (int) $friendship->initiator_user_id ) {\n\t\t\t$friend_id = $friendship->friend_user_id;\n\t\t\t$user_is_initiator = true;\n\t\t} else {\n\t\t\t$friend_id = $friendship->initiator_user_id;\n\t\t\t$user_is_initiator = false;\n\t\t}\n\n\t\t$item_data = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Friend', 'buddypress' ),\n\t\t\t\t'value' => bp_core_get_userlink( $friend_id ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Initiated By Me', 'buddypress' ),\n\t\t\t\t'value' => $user_is_initiator ? __( 'Yes', 'buddypress' ) : __( 'No', 'buddypress' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Friendship Date', 'buddypress' ),\n\t\t\t\t'value' => $friendship->date_created,\n\t\t\t),\n\t\t);\n\n\t\t$data_to_export[] = array(\n\t\t\t'group_id' => 'bp_friends',\n\t\t\t'group_label' => __( 'Friends', 'buddypress' ),\n\t\t\t'item_id' => \"bp-friends-{$friend_id}\",\n\t\t\t'data' => $item_data,\n\t\t);\n\t}\n\n\t// Tell core if we have more items to process.\n\t$done = count( $friendships ) < $number;\n\n\treturn array(\n\t\t'data' => $data_to_export,\n\t\t'done' => $done,\n\t);\n}", "public function getAffiliateLocationFeedItem()\n {\n return $this->readOneof(15);\n }", "private static function createAffiliateLocationExtensionFeed(\n GoogleAdsClient $googleAdsClient,\n int $customerId,\n int $chainId\n ): string {\n // Creates a feed that will sync to retail addresses for a given retail chain ID.\n // Do not add feed attributes, Google Ads will add them automatically because this will\n // be a system generated feed.\n $feed = new Feed([\n 'name' => 'Affiliate Location Extension feed #' . Helper::getPrintableDatetime(),\n 'affiliate_location_feed_data' => new AffiliateLocationFeedData([\n 'chain_ids' => [$chainId],\n 'relationship_type' => AffiliateLocationFeedRelationshipType::GENERAL_RETAILER\n ]),\n // Since this feed's contents will be managed by Google, you must set its origin to\n // GOOGLE.\n 'origin' => FeedOrigin::GOOGLE\n ]);\n\n // Creates the feed operation.\n $operation = new FeedOperation();\n $operation->setCreate($feed);\n\n // Issues a mutate request to add the feed and prints some information.\n $feedServiceClient = $googleAdsClient->getFeedServiceClient();\n $response =\n $feedServiceClient->mutateFeeds(MutateFeedsRequest::build($customerId, [$operation]));\n $feedResourceName = $response->getResults()[0]->getResourceName();\n printf(\n \"Affiliate location extension feed created with resource name: '%s'.%s\",\n $feedResourceName,\n PHP_EOL\n );\n\n return $feedResourceName;\n }", "public function createProfile() {\n $this->profile = $this->modx->newObject('LocationProfile',array(\n 'location' => $this->object->get('id')\n ));\n\n // Grab default location settings and populate record\n $lat = $this->modx->getOption('locationresources.default_latitude');\n $lng = $this->modx->getOption('locationresources.default_longitude');\n $this->setProperty('lat',$lat);\n $this->setProperty('lng',$lng);\n $this->setProperty('zoom_level',$this->modx->getOption('locationresources.default_zoom_level'));\n if(empty($this->getProperty('has_marker'))) {\n $this->setProperty('has_marker',0);\n }\n if(empty($this->getProperty('marker_lat'))) {\n $this->setProperty('marker_lat',$lat);\n }\n if(empty($this->getProperty('marker_lng'))) {\n $this->setProperty('marker_lng', $lng);\n }\n\n $this->profile->fromArray($this->getProperties());\n $this->profile->save();\n return $this->profile;\n }", "protected function syncAddress(Profile $profile)\n {\n $data = $this->get('relations.address');\n\n # These things change rarely\n $baseFields = ['line_1','city','state_province','postal_code'];\n\n # These fields may fluctuate\n $mutatableFields = ['location_name', 'email', 'phone'];\n\n # Get the Address by first searching for it, creating is missing and updating it with new values\n if($address = $profile->getLastAddressWhere(array_only($data, $baseFields))){\n # address exists\n # now, lets see if the data needs to be updated\n $address->fill( array_only($data, $mutatableFields) );\n\n if( $address->isDirty() ){\n $address->save();\n }\n\n } else {\n # create new address\n $address = $profile->addresses()->create($data);\n }\n\n # if the address does not match, update it\n if ( $profile->primary_address_id != $address->id){\n\n $profile->update([\n 'primary_address_id' => $address->id,\n ]);\n }\n\n return $this;\n }", "public function setAffiliateLocationFeedItem($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\V13\\Common\\AffiliateLocationFeedItem::class);\n $this->writeOneof(15, $var);\n\n return $this;\n }", "public function createFlowAddressBook() {\n $customer = $this->customerSession->getCustomer();\n $addressBook = null;\n if ($customer->getId()) {\n $addressBook = (object)[\n 'contacts' => []\n ];\n $addresses = $customer->getAddresses();\n if (count($addresses)) {\n foreach($addresses as $address) {\n $addressBook->contacts[] = (object)[\n 'address' => (object)[\n 'streets' => $address->getStreet(),\n 'city' => $address->getCity(),\n 'province' => (in_array(gettype($address->getRegion()), ['string', 'NULL'])\n ? (string)$address->getRegion() : $address->getRegion()->getRegionCode()),\n 'postal' => $address->getPostcode(),\n 'country' => $address->getCountryId()\n ],\n 'contact' => (object)[\n 'name' => (object)[\n 'first' => $address->getFirstname(),\n 'last' => $address->getLastname(),\n ],\n 'company' => $address->getCompany(),\n 'email' => $customer->getEmail(),\n 'phone' => $address->getTelephone()\n ]\n ];\n }\n }\n }\n return $addressBook;\n }", "public function importViaFB(Request $request) {\n // authorize\n if (!Auth::user()) {\n abort(403);\n }\n\n // call to facebook\n $data = $this->getEventDetails($request->event);\n\n // error handling\n if (array_key_exists('error', $data)) {\n return redirect()->route('organize')->withErrors(['There was an error during importing event from Facebook.']);\n }\n\n // extracting data\n //dd($data);\n $title = substr($data['name'], 0, 50);\n $date = str_replace('-','.',substr($data['start_time'], 0, 10)).'.';\n $start_time = substr($data['start_time'], 11, 5);\n $description = $data['description'];\n $tournament_type_id = $this->guessTournamentTypeFromTitle($title);\n $link_facebook = 'https://www.facebook.com/events/'.$data['id'];\n // cover photo\n if (array_key_exists('source', $data['cover'])) {\n $description = '![facebook_cover_image]('.$data['cover']['source'].\")\\n\\n\".$description;\n }\n\n // extracting location data\n $location_store = '';\n $location_country = '';\n $location_state = '';\n $location_city = '';\n $location_lat = null;\n $location_long = null;\n $street = '';\n if (array_key_exists('place', $data)) {\n if (array_key_exists('location', $data['place'])) {\n $location_country = $data['place']['location']['country'];\n if (array_key_exists('state', $data['place']['location'])) {\n $location_state = $data['place']['location']['state'];\n }\n if (array_key_exists('city', $data['place']['location'])) {\n $location_city = $data['place']['location']['city'];\n }\n if (array_key_exists('latitude', $data['place']['location'])) {\n $location_lat = $data['place']['location']['latitude'];\n $location_long = $data['place']['location']['longitude'];\n }\n if (array_key_exists('street', $data['place']['location'])) {\n $street = $data['place']['location']['street'];\n }\n }\n $location_store = $data['place']['name'];\n }\n\n // call google maps API\n $location_address = '';\n $location_place_id = '';\n $du = file_get_contents(\"https://maps.googleapis.com/maps/api/geocode/json?language=en&key=\".env('GOOGLE_BACKEND_API').\n \"&address=\".urlencode($location_country.\", \".$location_state.\", \".$location_city.\", \".$street.\", \".$location_store));\n $djd = json_decode($du,true);\n\n //dd($djd);\n\n if ($djd['status'] == 'OK' && count($djd['results'])) {\n if (array_key_exists('formatted_address', $djd['results'][0])) {\n $location_address = $djd['results'][0]['formatted_address'];\n }\n if (array_key_exists('place_id', $djd['results'][0])) {\n $location_place_id = $djd['results'][0]['place_id'];\n }\n if (array_key_exists('geometry', $djd['results'][0]) &&\n array_key_exists('location', $djd['results'][0]['geometry'])) {\n $location_lat = $djd['results'][0]['geometry']['location']['lat'];\n $location_long = $djd['results'][0]['geometry']['location']['lng'];\n }\n }\n\n // dd($title, $creator, $tournament_type_id, $date, $start_time, $location_country, $location_state, $location_city,\n // $location_store, $location_long, $location_lat, $location_address, $location_place_id, $description);\n\n // create tournament based on FB data\n $tournament = Tournament::create([\n 'creator' => $request->user()->id,\n 'title' => $title,\n 'date' => $date,\n 'start_time' => $start_time,\n 'location_country' => $location_country,\n 'location_state' => $location_state,\n 'location_city' => $location_city,\n 'location_store' => $location_store,\n 'location_address' => $location_address,\n 'location_place_id' => $location_place_id,\n 'description' => $description,\n 'tournament_type_id' => $tournament_type_id,\n 'cardpool_id' => 'unknown',\n 'location_lat' => $location_lat,\n 'location_long' => $location_long,\n 'link_facebook' => $link_facebook,\n 'concluded' => 0,\n 'incomplete' => 1\n ]);\n\n return redirect()->route('tournaments.edit', $tournament->id);\n\n }", "protected function feed() {\n\t\t$url = $this->getFeedURL();\n\t\t$xpath = $this->getFeedXPath() ?: $this->defaultXPath();\n\t\t$feedClass = $this->feedClassName();\n\n\t\tif ( $url && $xpath && $feedClass ) {\n\t\t\t$itemModel = Injector::inst()->get( 'FeedMeItemModel' );\n\t\t\t$fieldMap = $itemModel->fieldMap();\n\n\t\t\treturn Injector::Inst()->create( $feedClass, $url, $xpath, $fieldMap );\n\t\t} else {\n\t\t\tthrow new FeedMeException( _t( \"FeedMe.MissingInfoException\", 'Missing info for feed {title}', [ 'title' => $this->owner->Title ] ) );\n\t\t}\n\t}", "function GetExistingFeed(FeedMappingService $fmService) {\n // Create selector.\n $selector = new Selector();\n $selector->fields = array('FeedId', 'FeedMappingId',\n 'AttributeFieldMappings');\n\n // Create predicates.\n $selector->predicates[] = new Predicate('Status', 'EQUALS', array('ACTIVE'));\n $selector->predicates[] =\n new Predicate('PlaceholderType', 'EQUALS',\n array(PLACEHOLDER_SITELINKS));\n\n // Create paging controls.\n $selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);\n\n // Make the get request.\n $page = $fmService->get($selector);\n // Display results.\n if (isset($page->entries)) {\n foreach ($page->entries as $mapping) {\n $feedId = $mapping->feedId;\n $textAttributeId = null;\n $urlAttributeId = null;\n foreach ($mapping->attributeFieldMappings as $attributeMapping) {\n switch($attributeMapping->fieldId) {\n case PLACEHOLDER_FIELD_SITELINK_LINK_TEXT:\n $textAttributeId = $attributeMapping->feedAttributeId;\n break;\n case PLACEHOLDER_FIELD_SITELINK_LINK_URL:\n $urlAttributeId = $attributeMapping->feedAttributeId;\n break;\n }\n }\n\n if (!empty($textAttributeId) && !empty($urlAttributeId)) {\n return array(\n 'feedId' => $feedId,\n 'textAttributeId' => $textAttributeId,\n 'urlAttributeId' => $urlAttributeId,\n );\n }\n }\n }\n\n return null;\n}", "public function createHomeownerAddress($payload);", "function feed_create( $feed )\n {\n $request['feed'] = $feed;\n\n return $this->hook( \"/feeds.json\", \"feed\", $request, 'POST' );\n }", "function addFeed($feed)\r\n\t{\r\n\t\tif(!isSectionEnabled('feeds'))\r\n\t\t\treturn false;\r\n\r\n\t\t$uid = $feed['uid'];\r\n\r\n\t\tif(!$uid)\r\n\t\t\treturn false;\r\n\r\n\t\t$ufeed = array();\r\n\t\t\r\n\t\t//Verifying feed action and object\r\n\t\t$action = $this->action($feed['action']);\r\n\t\t$object = $this->getObject($feed['object']);\r\n\r\n\t\tif(!$action || !$object)\r\n\t\t\treturn false;\r\n\r\n\t\t//Setting user feed array\r\n\t\t$ufeed['action'] = $action;\r\n\t\t$ufeed['object'] = $object;\r\n\t\t$ufeed['object_id'] = $feed['object_id'];\r\n\t\t$ufeed['userid'] = $uid;\r\n\t\t$ufeed['time'] = time();\r\n\t\t\r\n\t\t//Unsetting feed array\r\n\t\tunset($feed);\r\n\t\t\r\n\t\t//Getting user feed file\r\n\t\t$feedFile = $this->getFeedFile($uid);\r\n\t\t\r\n\t\t//Convering feed using json\r\n\t\t$feed = json_encode($ufeed);\r\n\t\t//Creating unique md5 of feed\r\n\t\t$feedmd5 = md5($feed);\r\n\t\t$ufeed['md5'] = $feedmd5;\r\n\t\t//Recreating Feed\r\n\t\t$feed = json_encode($ufeed);\r\n\t\t\r\n\t\t//Appending feed in a file\t\r\n\t\t$file = fopen($feedFile,'a+');\r\n\t\tfwrite($file,$feed);\r\n\t\tfclose($file);\r\n\t}", "function the_upcoming_service_feed() {\n add_feed('upcomingservices', 'upcoming_services_feed');\n}", "public function setBlogFeed()\n\t{\n\t\t$this->ensureAuthed();\n\t\t$input = Input::getInstance();\n\t\t$output = Output::getInstance();\n\t\t$feeds = Feeds::getInstance();\n\n\t\t$feedurl = $input->getInput('feedurl');\n\n\t\t$userfeed = $feeds->findFeed('user', $this->username);\n\n\t\tif ($userfeed == null)\n\t\t{\n\t\t\t$userfeed = new StdClass();\n\t\t}\n\n\t\t$userfeed->url = $feedurl;\n\t\t$userfeed->user = $this->username;\n\t\t$userfeed->valid = false;\n\t\t$userfeed->checked = false;\n\n\t\t$newfeeds[] = $userfeed;\n\t\t$feedsList = $feeds->getFeeds();\n\t\tforeach ($feedsList as $feed)\n\t\t{\n\t\t\tif ($feed->user != $this->username)\n\t\t\t{\n\t\t\t\t$newfeeds[] = $feed;\n\t\t\t}\n\t\t}\n\n\t\t$feeds->putFeeds($newfeeds);\n\t\t$output->setOutput('feedurl', $feedurl);\n\t\treturn true;\n\t}", "public function createWithFacebook($name, $email, $avatar, $profile);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decode a character reference and return the string. If $inAttribute is set to true, a bare & will be returned asis.
protected function decodeCharacterReference($inAttribute = false) { // Next char after &. $tok = $this->scanner->next(); $start = $this->scanner->position(); if (false === $tok) { return '&'; } // These indicate not an entity. We return just // the &. if ("\t" === $tok || "\n" === $tok || "\f" === $tok || ' ' === $tok || '&' === $tok || '<' === $tok) { // $this->scanner->next(); return '&'; } // Numeric entity if ('#' === $tok) { $tok = $this->scanner->next(); if (false === $tok) { $this->parseError('Expected &#DEC; &#HEX;, got EOF'); $this->scanner->unconsume(1); return '&'; } // Hexidecimal encoding. // X[0-9a-fA-F]+; // x[0-9a-fA-F]+; if ('x' === $tok || 'X' === $tok) { $tok = $this->scanner->next(); // Consume x // Convert from hex code to char. $hex = $this->scanner->getHex(); if (empty($hex)) { $this->parseError('Expected &#xHEX;, got &#x%s', $tok); // We unconsume because we don't know what parser rules might // be in effect for the remaining chars. For example. '&#>' // might result in a specific parsing rule inside of tag // contexts, while not inside of pcdata context. $this->scanner->unconsume(2); return '&'; } $entity = CharacterReference::lookupHex($hex); } // Decimal encoding. // [0-9]+; else { // Convert from decimal to char. $numeric = $this->scanner->getNumeric(); if (false === $numeric) { $this->parseError('Expected &#DIGITS;, got &#%s', $tok); $this->scanner->unconsume(2); return '&'; } $entity = CharacterReference::lookupDecimal($numeric); } } elseif ('=' === $tok && $inAttribute) { return '&'; } else { // String entity. // Attempt to consume a string up to a ';'. // [a-zA-Z0-9]+; $cname = $this->scanner->getAsciiAlphaNum(); $entity = CharacterReference::lookupName($cname); // When no entity is found provide the name of the unmatched string // and continue on as the & is not part of an entity. The & will // be converted to &amp; elsewhere. if (null === $entity) { if (!$inAttribute || '' === $cname) { $this->parseError("No match in entity table for '%s'", $cname); } $this->scanner->unconsume($this->scanner->position() - $start); return '&'; } } // The scanner has advanced the cursor for us. $tok = $this->scanner->current(); // We have an entity. We're done here. if (';' === $tok) { $this->scanner->consume(); return $entity; } // Failing to match ; means unconsume the entire string. $this->scanner->unconsume($this->scanner->position() - $start); $this->parseError('Expected &ENTITY;, got &ENTITY%s (no trailing ;) ', $tok); return '&'; }
[ "protected function handleCharRefs( $text, $sourcePos, $inAttr = false,\n\t\t$additionalAllowedChar = ''\n\t) {\n\t\tif ( $this->ignoreCharRefs ) {\n\t\t\treturn $text;\n\t\t}\n\t\t// Efficiently translate a few common cases.\n\t\t// Although this doesn't translate any error cases, running this\n\t\t// function in !$ignoreError mode would cause the string offsets to\n\t\t// be wrong when we come to the preg_match_all.\n\t\t//\n\t\t// In HHVM this is way too broken to be usable. (@todo bug/PR)\n\t\tif ( !defined( 'HHVM_VERSION' ) && $this->ignoreErrors ) {\n\t\t\t$text = html_entity_decode( $text, ENT_HTML5 | ENT_QUOTES );\n\t\t}\n\n\t\tstatic $re;\n\t\tif ( $re === null ) {\n\t\t\t$knownNamed = HTMLData::$namedEntityRegex;\n\t\t\t$re = \"~\n\t\t\t\t( .*? ) # 1. prefix\n\t\t\t\t&\n\t\t\t\t(?:\n\t\t\t\t\t\\# (?:\n\t\t\t\t\t\t0*(\\d+) | # 2. decimal\n\t\t\t\t\t\t[xX]0*([0-9A-Fa-f]+) # 3. hexadecimal\n\t\t\t\t\t)\n\t\t\t\t\t( ; ) ? # 4. semicolon\n\t\t\t\t\t|\n\t\t\t\t\t( \\# ) # 5. bare hash\n\t\t\t\t\t|\n\t\t\t\t\t($knownNamed) # 6. known named\n\t\t\t\t\t(?:\n\t\t\t\t\t\t(?<! ; ) # Assert no semicolon prior\n\t\t\t\t\t\t( [=a-zA-Z0-9] ) # 7. attribute suffix\n\t\t\t\t\t)?\n\t\t\t\t\t|\n\t\t\t\t\t( [a-zA-Z0-9]+ ; ) # 8. invalid named\n\t\t\t\t)\n\t\t\t\t# S = study, for efficient knownNamed\n\t\t\t\t# A = anchor, to avoid unnecessary movement of the whole pattern on failure\n\t\t\t\t~xAsS\";\n\t\t}\n\t\t$out = '';\n\t\t$pos = 0;\n\t\t$length = strlen( $text );\n\t\t$matches = [];\n\t\t$count = preg_match_all( $re, $text, $matches, PREG_SET_ORDER );\n\t\tif ( $count === false ) {\n\t\t\t$this->throwPregError();\n\t\t}\n\n\t\tforeach ( $matches as $m ) {\n\t\t\t$out .= $m[self::MC_PREFIX];\n\t\t\t$errorPos = $sourcePos + $pos + strlen( $m[self::MC_PREFIX] );\n\t\t\t$lastPos = $pos;\n\t\t\t$pos += strlen( $m[0] );\n\n\t\t\tif ( isset( $m[self::MC_HASH] ) && strlen( $m[self::MC_HASH] ) ) {\n\t\t\t\t// Bare &#\n\t\t\t\t$this->error( 'Expected digits after &#', $errorPos );\n\t\t\t\t$out .= '&#';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$knownNamed = isset( $m[self::MC_NAMED] ) ? $m[self::MC_NAMED] : '';\n\t\t\t$attributeSuffix = isset( $m[self::MC_SUFFIX] ) ? $m[self::MC_SUFFIX] : '';\n\n\t\t\t$haveSemicolon =\n\t\t\t\t( isset( $m[self::MC_SEMICOLON] ) && strlen( $m[self::MC_SEMICOLON] ) )\n\t\t\t\t|| ( strlen( $knownNamed ) && $knownNamed[ strlen( $knownNamed ) - 1 ] === ';' )\n\t\t\t\t|| ( isset( $m[self::MC_INVALID] ) && strlen( $m[self::MC_INVALID] ) );\n\n\t\t\tif ( $inAttr && !$haveSemicolon ) {\n\t\t\t\tif ( strlen( $attributeSuffix ) ) {\n\t\t\t\t\tif ( !$this->ignoreErrors && $attributeSuffix === '=' ) {\n\t\t\t\t\t\t$this->error( 'invalid equals sign after named character reference' );\n\t\t\t\t\t}\n\t\t\t\t\t$out .= '&' . $knownNamed . $attributeSuffix;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !$this->ignoreErrors && !$haveSemicolon ) {\n\t\t\t\t$this->error( 'character reference missing semicolon', $errorPos );\n\t\t\t}\n\n\t\t\tif ( isset( $m[self::MC_DECIMAL] ) && strlen( $m[self::MC_DECIMAL] ) ) {\n\t\t\t\t// Decimal\n\t\t\t\tif ( strlen( $m[self::MC_DECIMAL] ) > 7 ) {\n\t\t\t\t\t$this->error( 'invalid numeric reference', $errorPos );\n\t\t\t\t\t$out .= self::REPLACEMENT_CHAR;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$codepoint = intval( $m[self::MC_DECIMAL] );\n\t\t\t} elseif ( isset( $m[self::MC_HEXDEC] ) && strlen( $m[self::MC_HEXDEC] ) ) {\n\t\t\t\t// Hexadecimal\n\t\t\t\tif ( strlen( $m[self::MC_HEXDEC] ) > 6 ) {\n\t\t\t\t\t$this->error( 'invalid numeric reference', $errorPos );\n\t\t\t\t\t$out .= self::REPLACEMENT_CHAR;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$codepoint = intval( $m[self::MC_HEXDEC], 16 );\n\t\t\t} elseif ( $knownNamed !== '' ) {\n\t\t\t\t$out .= HTMLData::$namedEntityTranslations[$knownNamed] . $attributeSuffix;\n\t\t\t\tcontinue;\n\t\t\t} elseif ( isset( $m[self::MC_INVALID] ) && strlen( $m[self::MC_INVALID] ) ) {\n\t\t\t\tif ( !$this->ignoreErrors ) {\n\t\t\t\t\t$this->error( 'invalid named reference', $errorPos );\n\t\t\t\t}\n\t\t\t\t$out .= '&' . $m[self::MC_INVALID];\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$this->fatal( 'unable to identify char ref submatch' );\n\t\t\t}\n\n\t\t\t// Interpret $codepoint\n\t\t\tif ( $codepoint === 0\n\t\t\t\t|| ( $codepoint >= 0xD800 && $codepoint <= 0xDFFF )\n\t\t\t\t|| $codepoint > 0x10FFFF\n\t\t\t) {\n\t\t\t\tif ( !$this->ignoreErrors ) {\n\t\t\t\t\t$this->error( 'invalid numeric reference', $errorPos );\n\t\t\t\t}\n\t\t\t\t$out .= self::REPLACEMENT_CHAR;\n\t\t\t} elseif ( isset( HTMLData::$legacyNumericEntities[$codepoint] ) ) {\n\t\t\t\tif ( !$this->ignoreErrors ) {\n\t\t\t\t\t$this->error( 'invalid reference to non-ASCII control character', $errorPos );\n\t\t\t\t}\n\t\t\t\t$out .= HTMLData::$legacyNumericEntities[$codepoint];\n\t\t\t} else {\n\t\t\t\tif ( !$this->ignoreErrors ) {\n\t\t\t\t\t$disallowedCodepoints = [\n\t\t\t\t\t\t0x000B => true,\n\t\t\t\t\t\t0xFFFE => true, 0xFFFF => true,\n\t\t\t\t\t\t0x1FFFE => true, 0x1FFFF => true,\n\t\t\t\t\t\t0x2FFFE => true, 0x2FFFF => true,\n\t\t\t\t\t\t0x3FFFE => true, 0x3FFFF => true,\n\t\t\t\t\t\t0x4FFFE => true, 0x4FFFF => true,\n\t\t\t\t\t\t0x5FFFE => true, 0x5FFFF => true,\n\t\t\t\t\t\t0x6FFFE => true, 0x6FFFF => true,\n\t\t\t\t\t\t0x7FFFE => true, 0x7FFFF => true,\n\t\t\t\t\t\t0x8FFFE => true, 0x8FFFF => true,\n\t\t\t\t\t\t0x9FFFE => true, 0x9FFFF => true,\n\t\t\t\t\t\t0xAFFFE => true, 0xAFFFF => true,\n\t\t\t\t\t\t0xBFFFE => true, 0xBFFFF => true,\n\t\t\t\t\t\t0xCFFFE => true, 0xCFFFF => true,\n\t\t\t\t\t\t0xDFFFE => true, 0xDFFFF => true,\n\t\t\t\t\t\t0xEFFFE => true, 0xEFFFF => true,\n\t\t\t\t\t\t0xFFFFE => true, 0xFFFFF => true,\n\t\t\t\t\t\t0x10FFFE => true, 0x10FFFF => true ];\n\t\t\t\t\tif (\n\t\t\t\t\t\t( $codepoint >= 1 && $codepoint <= 8 ) ||\n\t\t\t\t\t\t( $codepoint >= 0x0d && $codepoint <= 0x1f ) ||\n\t\t\t\t\t\t( $codepoint >= 0x7f && $codepoint <= 0x9f ) ||\n\t\t\t\t\t\t( $codepoint >= 0xfdd0 && $codepoint <= 0xfdef ) ||\n\t\t\t\t\t\tisset( $disallowedCodepoints[$codepoint] )\n\t\t\t\t\t) {\n\t\t\t\t\t\t$this->error( 'invalid numeric reference to control character',\n\t\t\t\t\t\t\t$errorPos );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$out .= \\UtfNormal\\Utils::codepointToUtf8( $codepoint );\n\t\t\t}\n\t\t}\n\t\tif ( $pos < $length ) {\n\t\t\t$out .= substr( $text, $pos );\n\t\t}\n\t\treturn $out;\n\t}", "function decode_data($data)\n {\n return htmlspecialchars_decode(html_entity_decode($data));\n }", "public function unescape()\n {\n return $this->escape(false);\n }", "public function getEscapedValue();", "function htmlDecode() {\n\t\tforeach (get_object_vars($this) as $k => $v) {\n\t\t\tif (is_array($v) or is_object($v) or $v == NULL) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($k[0] == '_') { // internal field\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->$k = htmlspecialchars_decode($v);\n\t\t}\n\t}", "function tidy_input($instr)\n {\n // ini_set('mbstring.substitute_character', \"none\");\n $str = mb_convert_encoding( html_entity_decode($instr),\"utf8\",\"utf8\");\n return $str;\n }", "function decode($val) {\n\t\t$val = str_replace('&quot;','\"',$val);\n\t\t$val = str_replace('&#39;',\"'\",$val);\n\t\t$val = str_replace(\"&apos;\",\"'\",$val);\n\t\treturn $val;\n\t}", "function decode2HTML ($str='') {\r\n \t \treturn htmlspecialchars_decode($str, ENT_QUOTES); \r\n}", "public function decode($value)\n\t{\n\t\treturn html_entity_decode($value, ENT_NOQUOTES, $this->getCharset());\n\t}", "public static function urlDotDecodeByReference(&$string) \n {\n $string = self::urlDotDecode($string);\n }", "function urldecode($str){}", "protected function escapeAttribute(): string\n {\n $value = $this->validateEncoding();\n $value = strip_tags($value);\n\n return htmlspecialchars($value, ENT_QUOTES);\n }", "public function fnReadEscapedChar($bInTemplate) \n {\n $iCh = Utilities::fnGetCharAt($this->sInput, ++$this->iPos);\n \n ++$this->iPos;\n \n switch ($iCh) {\n case 110: return \"\\n\"; // 'n' -> '\\n'\n case 114: return \"\\r\"; // 'r' -> '\\r'\n case 120: return Utilities::fnUnichr($this->fnReadHexChar(2)); // 'x'\n case 117: return $this->fnCodePointToString($this->fnReadCodePoint()); // 'u'\n case 116: return \"\\t\"; // 't' -> '\\t'\n case 98: return \"\\b\"; // 'b' -> '\\b'\n case 118: return \"\\x{000b}\"; // 'v' -> '\\u000b'\n case 102: return \"\\f\"; // 'f' -> '\\f'\n case 13: \n if (Utilities::fnGetCharAt($this->sInput, $this->iPos) == 10) \n ++$this->iPos; // '\\r\\n'\n case 10: // ' \\n'\n if ($this->aOptions['locations']) { \n $this->iLineStart = $this->iPos;\n ++$this->iCurLine;\n }\n return \"\";\n default:\n if ($iCh >= 48 && $iCh <= 55) {\n preg_match(\"/^[0-7]+/\", mb_substr($this->sInput, $this->iPos - 1, 3), $aMatches);\n $sOctalStr = $aMatches[0];\n $iOctal = intval($sOctalStr, 8);\n if ($iOctal > 255) {\n $sOctalStr = mb_substr($sOctalStr, 0, mb_strlen($sOctalStr)-1);\n $iOctal = intval($sOctalStr, 8);\n }\n $this->iPos += mb_strlen($sOctalStr) - 1;\n $iCh = Utilities::fnGetCharAt($this->sInput, $this->iPos);\n if (($sOctalStr != \"0\" || $iCh == 56 || $iCh == 57) && ($this->bStrict || $bInTemplate)) {\n $this->fnInvalidStringToken(\n $this->iPos - 1 - mb_strlen($sOctalStr),\n $bInTemplate\n ? \"Octal literal in template string\"\n : \"Octal literal in strict mode\"\n );\n }\n return Utilities::fnUnichr($iOctal);\n }\n return Utilities::fnUnichr($iCh);\n }\n }", "function decode( $value )\r\n {\r\n\r\n }", "static public function attr($data) {\n return htmlspecialchars($data, ENT_QUOTES, 'utf-8');\n }", "public static function getReferenceDecrypt($reference)\n {\n return substr($reference, 0, 7);\n }", "public function getDecodedValue(): string {\n\t\treturn base64_decode( $this->data );\n\t}", "public function decode($str);", "public function unescapeBytea($bytea) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds an element Gender. Defaults: name = gender requires = true label = Gender dimension = 4 modelfield = gender class = ''
public function addElementGender($form, $options = array()) { $elementName = isset($options['name']) ? $options['name'] : 'gender'; $modelField = isset($options['modelfield']) ? $options['modelfield'] : 'gender'; $form->addElement('radio', $elementName, array( 'filters' => array('StringTrim'), 'label' => isset($options['label']) ? $options['label'] : 'Gender', 'dimension' => isset($options['dimension']) ? $options['dimension'] : 4, 'required' => isset($options['required']) ? $options['required'] : true, 'class' => isset($options['class']) ? $options['class'] : '', )); $el = $form->getElement($elementName); $el->addMultiOptions(array( 'm' => 'Male', 'f' => 'Female' )); $el->setSeparator('&nbsp&nbsp&nbsp'); $el->setAttrib('label_class', 'display-inline-block'); if (($this->_model) && ($this->_model->$modelField)) { $el->setValue($this->_model->$modelField); } else { $el->setValue(null); } }
[ "private function addSex() {\n\t\t$sexOpts = array(\t'required' => true,\n\t\t\t\t\t\t\t'label'=>'sex',\n\t\t\t\t\t\t\t'multiple'=>false,\n\t\t\t\t\t\t\t'belongsTo'=>'occupants',\n\t\t\t\t\t\t\t'allowEmpty'=>false,\n\t\t\t\t\t\t\t'validators'=>\n\t\tarray(\n\t\tarray('validator'=> 'NotEmpty',array('integer','zero'))\n\t\t)\n\t\t);\n\t\t$this->addElement('select','sex',$sexOpts);\n\t\t$translator = Zend_Registry::get('Zend_Translate');\n\t\t$this->getElement('sex')->addMultiOption(null, $translator->_('selectSexEmpty'));\n\t\t$sex = array('m','f');\n\t\tforeach($sex as $id=>$sexOption) {\n\t\t\t$this->getElement('sex')->addMultiOption(++$id, ucfirst($sexOption));\n\t\t}\n\t\t$this->getElement('sex')->setAttrib('class','inputAccesible');\n\t}", "public function setGender($gender);", "function setGender($gender){\r\n $this->gender = $gender ;\r\n }", "function set_gender($newgender) {\n\t\t$this->gender = $newgender;\n\t}", "function setGender($gender)\r\n {\r\n $this->gender = $gender;\r\n }", "function set_gender($gender) {\n $this->gender = $gender;\n }", "public function getGender(){\n\t\tif($this->gender == \"\"){\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn $this->gender;\n\t}", "public function setIdGenderAttribute($value)\n {\n $this->attributes['id_gender'] = $value;\n }", "public function setGender($gender)\r\n {\r\n $this->_gender = $gender;\r\n }", "public function getGender()\n {\n return $this->readOneof(2);\n }", "function setGender($genders)\n {\n $this->__genders = $genders ;\n }", "public function getIdGender();", "public function actionGenderAdd()\n {\n\t //Action via $_POST\n \t$this->_assertPostOnly();\n\t\t\n\t\t$ftpHelper = $this->getHelper('ForumThreadPost');\n\t\t$threadId = $this->_input->filterSingle('thread_id', XenForo_Input::UINT);\n\t\tlist($thread, $forum) = $ftpHelper->assertThreadValidAndViewable($threadId);\n\t\t\n\t\t//Filter the field through input\n\t\t$input = $this->_input->filter(array(\n\t\t\t'user_gender' => XenForo_Input::STRING,\n\t\t));\n\t\t\n\t\t//Prepare to add them to the database with addslashes for security\n\t\t$user_gender = addslashes($input['user_gender']);\n\t\t\n\t\t//Get the thread data writer\n\t\t$threadDw = XenForo_DataWriter::create('XenForo_DataWriter_Discussion_Thread');\n\t\t\n\t\t$threadDw->setExistingData($thread['thread_id']);\n\t\t$threadDw->set('user_gender', $user_gender);\n\t\t$threadDw->save();\n\t\t\n\t\t//Redirect\n\t\treturn $this->responseRedirect(\n\t\t\tXenForo_ControllerResponse_Redirect::SUCCESS,\n\t\t\tXenForo_Link::buildPublicLink('threads', $thread),\n\t\t\tnew XenForo_Phrase('changes_saved')\n\t\t);\n }", "public function getGender()\n {\n return $this->data['gender'];\n }", "public function get_gender()\n {\n return $this->_gender;\n }", "function genderOption($gender)\n {\n $result = '<label>男</label>';\n $result .= '<input type=\"radio\" name=\"gender\" id=\"male\" value=\"male\"';\n if ($gender == 'male') $result .= 'checked ';\n $result .= 'required>';\n $result .= '<label>女</label>';\n $result .= '<input type=\"radio\" name=\"gender\" id=\"female\" value=\"female\"';\n if ($gender == 'female') $result .= 'checked';\n $result .= '>';\n return $result;\n }", "public function getGender()\n {\n if (array_key_exists(\"gender\", $this->_propDict)) {\n return $this->_propDict[\"gender\"];\n } else {\n return null;\n }\n }", "function setGender($value)\n {\n global $warn;\n\n if (is_string($value) && ctype_digit($value))\n $value = intval($value);\n if (is_int($value) &&\n $value >= Person::MALE &&\n $value <= Person::UNKNOWN)\n {\n return parent::set('gender', $value);\n }\n else\n if (is_string($value))\n {\n $value = strtoupper($value);\n if ($value == 'M' || $value == 'MALE')\n return parent::set('gender', Person::MALE);\n else\n if ($value == 'F' || $value == 'FEMALE')\n return parent::set('gender', Person::FEMALE);\n if ($value == '?' || $value == 'UNKNOWN')\n return parent::set('gender', Person::UNKNOWN);\n }\n \n $warn .= \"<p>Person::setGender: \" . __LINE__ .\n \" invalid value '$value' for field 'gender'</p>\\n\";\n }", "function getGender(){\n\t\t$this->layout = \"\";\n\t\t$this->autoRendar = false;\n\t\t$genderArray = array(\n\t\t\t\t\t\t\t 'Male'=>'Male',\t\n\t\t\t\t\t\t\t 'Female'=>'Female',\t\t\n\t\t\t\t\t\t\t\t);\n\t\treturn $genderArray;\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new instance of SoundImpl for the mob.glow_squid.squirt sound.
public static function MOB_GLOW_SQUID_SQUIRT(): SoundImpl { return new SoundImpl(SoundIds::MOB_GLOW_SQUID_SQUIRT); }
[ "public static function MOB_SQUID_SQUIRT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_SQUID_SQUIRT);\n }", "public static function MOB_GLOW_SQUID_HURT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_GLOW_SQUID_HURT);\n }", "public static function MOB_SQUID_HURT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_SQUID_HURT);\n }", "public static function MOB_STRIDER_HURT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_STRIDER_HURT);\n }", "public static function MOB_SHULKER_HURT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_SHULKER_HURT);\n }", "public static function DIG_SHROOMLIGHT(): SoundImpl\n {\n return new SoundImpl(SoundIds::DIG_SHROOMLIGHT);\n }", "public static function STEP_SHROOMLIGHT(): SoundImpl\n {\n return new SoundImpl(SoundIds::STEP_SHROOMLIGHT);\n }", "public static function BLOCK_SCULK_SHRIEKER_SHRIEK(): SoundImpl\n {\n return new SoundImpl(SoundIds::BLOCK_SCULK_SHRIEKER_SHRIEK);\n }", "public static function MOB_PIGLIN_HURT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_PIGLIN_HURT);\n }", "public static function MOB_SNOWGOLEM_HURT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_SNOWGOLEM_HURT);\n }", "public static function MOB_SNIFFER_SCENTING(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_SNIFFER_SCENTING);\n }", "public static function MOB_WARDEN_SNIFF_(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_WARDEN_SNIFF_);\n }", "public static function MOB_SKELETON_HURT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_SKELETON_HURT);\n }", "public static function STEP_SOUL_SAND(): SoundImpl\n {\n return new SoundImpl(SoundIds::STEP_SOUL_SAND);\n }", "public static function MOB_STRIDER_TEMPT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_STRIDER_TEMPT);\n }", "public static function MOB_TURTLE_BABY_SHAMBLE(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_TURTLE_BABY_SHAMBLE);\n }", "public static function DIG_SOUL_SAND(): SoundImpl\n {\n return new SoundImpl(SoundIds::DIG_SOUL_SAND);\n }", "public static function MOB_FOX_SPIT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_FOX_SPIT);\n }", "public static function MOB_PIGLIN_BRUTE_HURT(): SoundImpl\n {\n return new SoundImpl(SoundIds::MOB_PIGLIN_BRUTE_HURT);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enrolls all of the students enrolled in the Moodle Course onto the Turnitin Class
function turnitintool_enroll_all_students($cm,$turnitintool) { $context=get_context_instance(CONTEXT_MODULE, $cm->id); $courseusers=get_users_by_capability($context, 'mod/turnitintool:submit', '', '', '', '', 0, '', false); $courseusers=(!is_array($courseusers)) ? array() : $courseusers; if (count($courseusers)>0) { $total=(count($courseusers)*3); $loaderbar = new turnitintool_loaderbarclass($total); if (!$course = turnitintool_get_record('course','id',$turnitintool->course)) { turnitintool_print_error('coursegeterror','turnitintool',NULL,NULL,__FILE__,__LINE__); exit(); } $post->cid=turnitintool_getCID($course->id); // Get the Turnitin Class ID for Course $post->ctl=turnitintool_getCTL($course->id); $owner = turnitintool_get_owner($turnitintool->course); $post->tem=turnitintool_get_tutor_email($owner->id); $thisstudent=0; $totalstudents=count($courseusers); foreach ($courseusers as $courseuser) { $tii = new turnitintool_commclass(turnitintool_getUID($courseuser),$courseuser->firstname,$courseuser->lastname,$courseuser->email,1,$loaderbar); $tii->startSession(); $thisstudent++; $newuser=turnitintool_usersetup($courseuser,get_string('userprocess','turnitintool'),$tii,$loaderbar); if ($tii->getRerror()) { $reason=($tii->getAPIunavailable()) ? get_string('apiunavailable','turnitintool') : $tii->getRmessage(); $usererror[]='<br /><b>'.$courseuser->lastname.', '.$courseuser->firstname.' ('.$courseuser->email.')</b><br />'.$reason.'<br />'; $tii->endSession(); continue; } $tii->uid=$newuser->turnitin_uid; $tii->joinClass($post,get_string('joiningclass','turnitintool','('.$thisstudent.'/'.$totalstudents.' '.get_string('students').')')); if ($tii->getRerror()) { $reason=($tii->getAPIunavailable()) ? get_string('apiunavailable','turnitintool') : $tii->getRmessage(); $usererror[]='<br /><b>'.$courseuser->lastname.', '.$courseuser->firstname.' ('.$courseuser->email.')</b><br />'.$reason.'<br />'; } $tii->endSession(); } if (isset($usererror) AND count($usererror)>0) { $errorstring=get_string('updateerror','turnitintool').': '.get_string('turnitinenrollstudents','turnitintool').'<br />'; $errorstring.=implode($usererror).'<br />'; turnitintool_print_error($errorstring,NULL,NULL,NULL,__FILE__,__LINE__); exit(); } // Force Grade refresh on next page load $_SESSION['updatedscores'][$turnitintool->id]==0; } }
[ "private function set_coursestudents() {\n $this->coursestudents = get_enrolled_users($this->context, 'mod/assign:submit');\n }", "public function enroll() {\n if ($this->Auth->user('role') != 'student') {\n $this->Session->setFlash(__('Only students can enroll into\n classes'));\n return $this->redirect('/lessons');\n }\n $userId = $this->Auth->user('id');\n $lessonId = $this->request->params['id'];\n $lesson = explode('-', $lessonId);\n $this->Session->setFlash($this->Lesson->enroll($userId, $lesson[count($lesson) - 1]));\n return $this->redirect('/lessons');\n }", "public function enrol_all_students($cm) {\n // Get Moodle Course Object.\n $coursetype = turnitintooltwo_get_course_type($this->turnitintooltwo->legacy);\n $course = $this->get_course_data($this->turnitintooltwo->course, $coursetype);\n $context = context_module::instance($cm->id);\n\n // Get local course members.\n $students = get_enrolled_users($context,\n 'mod/turnitintooltwo:submit', groups_get_activity_group($cm), 'u.id');\n\n // Get the user ids of who is already enrolled and remove them from the students array.\n $tiiclassmemberships = $this->get_class_memberships($course->turnitin_cid);\n $turnitincomms = new turnitintooltwo_comms();\n $turnitincall = $turnitincomms->initialise_api();\n\n $membership = new TiiMembership();\n $membership->setMembershipIds($tiiclassmemberships);\n\n try {\n $response = $turnitincall->readMemberships($membership);\n $readmemberships = $response->getMemberships();\n foreach ($readmemberships as $readmembership) {\n if ($readmembership->getRole() == \"Learner\") {\n $moodleuserid = turnitintooltwo_user::get_moodle_user_id($readmembership->getUserId());\n unset($students[$moodleuserid]);\n }\n }\n } catch (Exception $e) {\n $turnitincomms->handle_exceptions($e, 'membercheckerror');\n }\n\n // Get the suspended users.\n $suspendedusers = get_suspended_userids($context, true);\n\n // Enrol remaining unenrolled users to the course.\n $members = array_keys($students);\n foreach ($members as $member) {\n // Don't include user if they are suspended.\n if (isset($suspendedusers[$user->id])) {\n continue;\n }\n $user = new turnitintooltwo_user($member, \"Learner\");\n $user->join_user_to_class($course->turnitin_cid);\n }\n return true;\n }", "public function enrollStudents($studentId, $courseKey)\n {\n }", "public function enrollForTraining()\n {\n $aValidationResult = Validations::validateEnrollmentInputs($this->aParams);\n if ($aValidationResult['bResult'] === true) {\n $aDatabaseColumns = array(\n 'courses' => 'courseId',\n 'schedules' => 'scheduleId'\n );\n\n Utils::renameKeys($this->aParams, $aDatabaseColumns);\n Utils::sanitizeData($this->aParams);\n\n // Insert into training table.\n $iQuery = $this->oTrainingModel->enrollForTraining($this->aParams['scheduleId'], $this->aParams['courseId'], $this->getUserId());\n\n if ($iQuery > 0) {\n $this->sendEmailToAdmin($this->aParams);\n\n $aParams = array(\n 'studentId' => $this->getUserId(),\n 'courseId' => $this->aParams['courseId'],\n 'scheduleId' => $this->aParams['scheduleId'],\n 'type' => 0,\n 'hasAccount' => 1,\n 'receiver' => 'admin',\n 'date' => dateNow()\n );\n $this->oNotificationModel->insertNotification($aParams);\n\n $aResult = array(\n 'bResult' => true,\n 'sMsg' => 'Course enrolled!'\n );\n } else {\n $aResult = array(\n 'bResult' => false,\n 'sMsg' => 'An error has occured.'\n );\n }\n } else {\n $aResult = $aValidationResult;\n }\n\n echo json_encode($aResult);\n }", "function enroll_worker($courseid, $mdluserid){\n if(!is_enrolled($context, $mdluserid)){\n $manual = enrol_get_plugin('manual');\n\n $instances = enrol_get_instances($courseid, false);\n foreach($instances as $instance){\n if($instance->enrol == 'manual'){\n $winner = $instance;\n break;\n }\n }\n\n if(isset($winner)){\n $roleid = $DB->get_field('role', 'id', array(\n 'archetype'=>'student'));\n if($roleid)\n $manual->enrol_user($winner, $mdluserid, $roleid, time());\n else\n $manual->enrol_user($winner, $mdluserid, 5, time());\n }else{\n echo \"Cannot enroll $worker->firstname $worker->lastname\\n\";\n }\n } else {\n //do nothing; already enrolled\n }\n}", "function enrolStudents($ids, $courseId = null)\n {\n if (null == $courseId) {\n $courseId = $this->id;\n }\n\n if (null == $courseId) {\n return false;\n }\n\n return $this->habtmAdd('Enrol', $courseId, $ids);\n }", "public function add_student_to_all_units()\n {\n foreach($this->units AS $unit)\n {\n $unit->set_is_student_doing(true);\n }\n }", "public function enrol_courseenrol_users_to_category_courses($params) {\n global $CFG, $DB;\n $this->data = array();\n $courseslist = array();\n $courseslist = $this->enrol_courseenrol_get_courses_by_class($params);\n $userlist = $this->enrol_courseenrol_get_cohort_members_by_cohort_id($params['cohortid']);\n $assignstudentroll = $this->enrol_courseenrol_assign_student_role_to_class_enrolled_members($params, $userlist);\n if (count($courseslist) > 0) {\n foreach ($courseslist AS $key => $cousesEnrolList) {\n foreach ($cousesEnrolList AS $key => $cousesEnrol) {\n foreach ($userlist AS $key => $user) {\n $sql = \"SELECT 'x' FROM {user_enrolments} ue JOIN {enrol} e ON (e.id = ue.enrolid) WHERE ue.userid = :userid AND e.courseid = :courseid AND e.enrol ='manual'\";\n $userid = $user->uid;\n $courseid = $cousesEnrol->courseid;\n\n if (!$DB->record_exists_sql($sql, array('userid' => $userid, 'courseid' => $courseid))) {\n $user_enrolment_data['status'] = 0;\n $user_enrolment_data['enrolid'] = $cousesEnrol->courseenrolid;\n $user_enrolment_data['userid'] = $user->uid;\n $user_enrolment_data['timestart'] = time();\n $user_enrolment_data['timeend'] = 0;\n $user_enrolment_data['timecreated'] = time();\n $user_enrolment_data['timemodified'] = time();\n $DB->insert_record('user_enrolments', $user_enrolment_data);\n }\n }\n }\n }\n }\n }", "function users_enroll($user_id, $course_id) {\n\t\n\t\tif(users_isEnrolled($user_id, $course_id)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t\n\t\t\tlist($dbc, $error) = connect_to_database();\n\n\t\t\tif($dbc && users_exists($user_id) && courses_exists($course_id)) {\n\t\t\t\n\t\t\t\t$courseIds = users_getCourseIds($user_id);\n\t\t\t\tarray_push($courseIds, $course_id);\n\t\t\t\tasort($courseIds);\n\t\t\t\t\n\t\t\t\t$newCourses = implode(\",\", $courseIds);\n\t\t\t\t$query = 'UPDATE users SET courses = \"'.$newCourses.'\" WHERE id = '.$user_id.';';\n\t\t\t\t\n\t\t\t\t$result = mysqli_query($dbc, $query);\n\t\t\t\tif($result) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function testGetEnrolledCourses() {\n $courses = $this->User->getEnrolledCourses(7);\n $this->assertEqual($courses, array(1,2));\n\n //Test valid user not enrolled in courses\n $this->User->removeStudent(20,2);\n $courses = $this->User->getEnrolledCourses(20);\n $this->assertEqual($courses, null);\n $this->User->addStudent(20, 2);\n\n //Test invalid user\n $courses = $this->User->getEnrolledCourses(999);\n $this->assertEqual($courses, null);\n }", "function list_enrollments ( $CourseID ){\n\tglobal $access_token, $canvas_base_url;\n\t\n\t//get it ready for later\n\t$enrolled=array();\n\t\n\t$url=$canvas_base_url.\"/api/v1/courses/\".$CourseID.\"/enrollments?per_page=100&access_token=\".$access_token;\n\t\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_CUSTOMREQUEST => 'GET',\n\t CURLOPT_URL => $url,\n\t CURLOPT_USERAGENT => 'Matt Loves cURLing Things'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = json_decode(curl_exec($curl));\n\t\n\t//print_r($resp);\n\t\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$counter=0;\n\tforeach ($resp as $enrollment) {\n\t\tif ($enrollment->type==\"StudentEnrollment\" && $enrollment->user->name != \"Test Student\") {\n\t\t\t$enrolled[$enrollment->user->sis_user_id]=array('name'=>$enrollment->user->name,'id'=>$enrollment->user->sis_user_id,'participations'=>0);\n\t\t}\n\t\t$counter++;\n\t}\t\n\treturn $enrolled;\n}", "function get_course_students($courseid) {\n\n if (!isset($this->student_ids->$courseid)) {\n $course_context = $this->courses[$courseid]->context;\n\n $student_array = array();\n $student_details = array();\n\n // get the roles that are specified as graded in site config settings\n if (empty($this->student_roles)) {\n $this->student_roles = get_field('config','value', 'name', 'gradebookroles');\n }\n\n // get students in this course with this role. This defaults to getting them from higher\n // up contexts too. If you don't need this and want to avoid the performance hit, replace\n // 'true' with 'false' in the next line\n // Might be more than one in CSV format.\n if (is_string($this->student_roles)) {\n $this->student_roles = explode(',', $this->student_roles);\n }\n $course_students = get_role_users($this->student_roles, $course_context, true);\n\n if ($course_students) {\n // we have an array of objects, which we need to get the student ids out of and into\n // a comma separated list\n foreach($course_students as $course_student) {\n\n array_push($student_array, $course_student->id);\n\n $student_details[$course_student->id] = $course_student;\n }\n }\n\n if (count($student_array) > 0) {\n // some students were returned\n\n // convert to comma separated list\n $student_ids = implode(\",\", $student_array);\n\n // save the list so it can be reused\n $this->student_ids->$courseid = $student_ids;\n $this->student_array->$courseid = $student_array;\n // keep all student details so they can be used for making nodes.\n // TODO - make a check so this only happens when needed.\n $this->student_details = $this->student_details + $student_details;\n } else {\n return false;\n }\n }\n }", "protected function create_and_enrol_students($courseid, $number) {\n for ($index = 0; $index < $number; $index++) {\n $newuser = $this->getDataGenerator()->create_user();\n $this->getDataGenerator()->enrol_user($newuser->id, $courseid, 5); // The student role id.\n }\n }", "public function test_get_students_in_course_with_no_enrolled_students() {\n global $DB;\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a teacher (to ensure the teacher is included)\n $teacher = $this->getDataGenerator()->create_user();\n\n // enrol the teacher\n $this->getDataGenerator()->enrol_user($teacher->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'teacher',\n )));\n\n // check there were no students (only one teacher)\n $records = $this->_cut->get_students_in_course($course->id, $teacher->id);\n $this->assertCount(1, $records);\n }", "function enroll()\n {\n \tif(isset($_SESSION['red_id'])){\n \t\t$history_model = $this->loadModel('History');\n \t\t$schedule_model = $this->loadModel('Schedule');\n \t\t$this->view->examOptions = $schedule_model->getUpcomingExams();\n \t\t$this->view->pastExams = $history_model->getUserExams();\n \t\t$this->view->render('register/enroll');\n \t} \t\t\t \t\n }", "public function enroll(Course $course)\n {\n $has_course = new HasCourse;\n $has_course->course()->associate($course);\n $has_course->student()->associate(Auth::user());\n if ($has_course->save()) {\n flash('Ha sido matriculado en el curso')->success();\n return back();\n } else {\n return back();\n }\n }", "function pm_assign_instructor_from_mdl($eventdata) {\n\n global $CFG, $DB;\n\n //make sure we have course manager roles defined\n if(empty($CFG->coursecontact)) {\n return;\n }\n\n //retrieve the appropriate roles\n $valid_instructor_roles = explode(',', $CFG->coursecontact);\n\n //make sure the assigned role is one of the ones we care about\n if(!in_array($eventdata->roleid, $valid_instructor_roles)) {\n return;\n }\n\n //get the id of the appropriate curriculum user\n if(!$instructorid = pm_get_crlmuserid($eventdata->userid)) {\n return;\n }\n\n //get the curriculum user object\n $instructor = new user($instructorid);\n\n //get the role assignment context\n if(!$context = $DB->get_record('context', array('id'=> $eventdata->contextid))) {\n return;\n }\n\n //make sure we're using a course context\n if($context->contextlevel != CONTEXT_COURSE) {\n return;\n }\n\n //make sure the Moodle course is not tied to other curriculum administartion classes\n if($DB->count_records(classmoodlecourse::TABLE, array('moodlecourseid'=> $context->instanceid)) != 1) {\n return true;\n }\n\n //make sure the course is tied to at least one class\n if(!$crlm_class = $DB->get_record(classmoodlecourse::TABLE, array('moodlecourseid'=> $context->instanceid))) {\n return;\n }\n\n //add user as instructor for the appropriate class\n\n if(!$DB->record_exists(instructor::TABLE, array('classid'=> $crlm_class->classid,\n 'userid'=> $instructorid))) {\n $ins_record = new instructor(array('classid' => $crlm_class->classid,\n 'userid' => $instructorid,\n 'assigntime' => $eventdata->timestart,\n 'completetime' => $eventdata->timeend));\n $ins_record->save();\n }\n\n}", "public function test_elis_createorupdate_updates_student_and_instructor_enrolment() {\n global $CFG, $DB;\n\n require_once($CFG->dirroot.'/elis/program/lib/data/course.class.php');\n require_once($CFG->dirroot.'/elis/program/lib/data/pmclass.class.php');\n require_once($CFG->dirroot.'/elis/program/lib/data/instructor.class.php');\n require_once($CFG->dirroot.'/elis/program/lib/data/user.class.php');\n\n // Set up initial conditions.\n set_config('createorupdate', 1, 'rlipimport_version1elis');\n\n // Create the test course.\n $course = new course(array(\n 'name' => 'testcoursename',\n 'idnumber' => 'testcourseidnumber',\n 'syllabus' => ''\n ));\n $course->save();\n\n // Create the test class.\n $class = new pmclass(array(\n 'courseid' => $course->id,\n 'idnumber' => 'testclassidnumber')\n );\n $class->save();\n\n // Create the test user.\n $user = new user(array(\n 'username' => 'testuserusername',\n 'email' => 'test@useremail.com',\n 'idnumber' => 'testuseridnumber',\n 'firstname' => 'testuserfirstname',\n 'lastname' => 'testuserlastname',\n 'country' => 'CA'\n ));\n $user->save();\n\n $importplugin = rlip_dataplugin_factory::factory('rlipimport_version1elis');\n $importplugin->fslogger = new silent_fslogger(null);\n\n // 1 Run the first student enrolment.\n $record = new stdClass;\n $record->action = 'update';\n $record->context = 'class_testclassidnumber';\n $record->user_username = 'testuserusername';\n $record->role = 'student';\n $record->completetime = 'Jan/01/2012';\n\n // NOTE: we clone() the record because the createorupdate setting will rewrite the action parameter.\n $importplugin->process_record('enrolment', clone($record), 'bogus');\n\n // Validation of the enrolment record.\n $params = array(\n 'classid' => $class->id,\n 'userid' => $user->id,\n 'completetime' => rlip_timestamp(0, 0, 0, 1, 1, 2012)\n );\n\n $this->assertTrue($DB->record_exists(student::TABLE, $params));\n\n // 2 Run the second student enrolment.\n $record->completetime = 'Jan/02/2012';\n $importplugin->process_record('enrolment', clone($record), 'bogus');\n $params['completetime'] = rlip_timestamp(0, 0, 0, 1, 2, 2012);\n $this->assertTrue($DB->record_exists(student::TABLE, $params));\n\n // 3 Run the first teacher enrolment.\n $record->role = 'instructor';\n $record->completetime = 'Jan/01/2012';\n $importplugin->process_record('enrolment', clone($record), 'bogus');\n $params['completetime'] = rlip_timestamp(0, 0, 0, 1, 1, 2012);\n $this->assertTrue($DB->record_exists(instructor::TABLE, $params));\n\n // 4 Run the second teacher enrolment.\n $record->completetime = 'Jan/02/2012';\n $importplugin->process_record('enrolment', clone($record), 'bogus');\n $params['completetime'] = rlip_timestamp(0, 0, 0, 1, 2, 2012);\n $this->assertTrue($DB->record_exists(instructor::TABLE, $params));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the deleteAuthorisation method simulated failure
public function testDeleteAuthorisationFailure() { $exception = false; $returnData = new stdClass; $returnData->code = 500; $returnData->body = $this->errorString; $this->client->expects($this->once()) ->method('delete') ->with('/authorizations/42') ->will($this->returnValue($returnData)); try { $this->object->deleteAuthorisation(42); } catch (DomainException $e) { $exception = true; $this->assertThat( $e->getMessage(), $this->equalTo(json_decode($this->errorString)->message) ); } $this->assertTrue($exception); }
[ "public function testUnauthorizedDelete()\n {\n $client = static::createClient();\n\n $client->request('DELETE', $this->getBaseUrl() . '/1');\n\n $this->assertEquals(401, $client->getResponse()->getStatusCode());\n }", "public function testDeleteNotAdminUserTriesToDeletePermission()\n {\n $articleAuthorToken = $this->loginRole('article-author');\n\n // Request\n $response = $this->delete('api/v1/permissions/1?token=' . $articleAuthorToken);\n\n // Check response status\n $response->assertStatus(403);\n\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n\n $this->assertEquals(false, $success);\n $this->assertEquals(403, $code);\n $this->assertEquals(\"Permission is absent\", $message);\n }", "public function testDeletePermissionSet()\n {\n }", "public function testPrivilegeToDelete(): void\n\t{\n\t\t$this->assertTrue(self::$recordMultiCompany->privilegeToDelete());\n\t}", "public function testDeleteDenyNotAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'logs',\n\t\t\t\t'action' => 'delete',\n\t\t\t\t'1',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function testDeleteAssocation()\n {\n }", "public function testDeleteAdminUnauthenticated()\n {\n $admin = factory(Admin::class)->create();\n $role = factory(Role::class)->create(['name' => 'admin']);\n $data = [\n 'api_token' => Str::random(60),\n 'role_id' => $role->id,\n 'admin_id' => $admin->id\n ];\n\n $user = factory(User::class)->create(['api_token'=> hash('sha256',Str::random(60))]);\n $response = $this->actingAs($user)->json('DELETE','/api/admin',$data);\n $response->assertStatus(401); \n\n $role->forceDelete();\n $user->forceDelete();\n $admin->forceDelete();\n }", "public function testDelete(): void\n {\n $this->checkRoleCollectionSize();\n /** @var User $user */\n $user = $this->userFactory->create();\n $this->model->delete($user);\n $this->checkRoleCollectionSize();\n }", "public function testDeleteUnsuccessNonBlockedorAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/admin/department/delete/3';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The department could not be deleted. Please, try again.'));\n\t}", "public function testDeleteCollectionOAuthAuthorizeToken()\n {\n\n }", "public function testDelete()\n {\n /* Create new client */\n $client = static::createClient();\n\n /* Validate Delete Colleague request without login with valid colleagueId*/\n $colleagueRepository = static::$container->get(ColleagueRepository::class);\n if (count($colleagueRepository->findAll()) > 0) {\n $firstColleague = $colleagueRepository->findAll()[0];\n $client->request('GET', '/colleague/' . $firstColleague->getId());\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertStringContainsString(\n 'Unauthorized Access',\n $client->getResponse()->getContent()\n );\n }\n\n /* Validate Delete Colleague request without login with invalid colleagueId*/\n $client->request('GET', '/colleague/0');\n $this->assertEquals(404, $client->getResponse()->getStatusCode());\n\n }", "public function delete()\n {\n if( 'administrator' != bus\\session::self()->get_role()->name &&\n 'administrator' == $this->get_role()->name )\n throw new exc\\permission(\n // fake the operation\n operation::get_operation( 'action', 'access', 'delete' ), __METHOD__ );\n\n parent::delete();\n }", "public function testDeleteOrgauthorizationTrusteeUser()\n {\n }", "public function testUserDeleteResourceApiAuthenticatedUnauthorized()\n {\n $random = Str::random(40);\n $data = [\n 'api_token' => $random,\n 'role' => 'applicant',\n 'id' => 1\n ];\n $user= factory(User::class)->create(['api_token' => hash('sha256',$random)]);\n $response = $this->actingAs($user)->json('DELETE', '/api/user',$data);\n $response->assertStatus(403); // forbidden\n\n $user->forceDelete();\n }", "public function testUserRestrictedToDeleteHimself()\n {\n $user = User::factory()->create([\n 'password' => '111111',\n 'email' => 'test@gmail.com',\n 'name' => 'Test',\n 'role_id' => Role::ROLE_ADMIN\n ]);\n\n $this->actingAs($user, 'api')->json('DELETE', 'api/users/'.$user->id, ['Accept' => 'application/json'])\n ->assertStatus(403);\n }", "public function testDeleteIfAuthor()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $this->logInAsUser();\n\n $this->task->setUser($this->authUser);\n $this->client->request('GET', '/tasks/'.$id.'/delete');\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a bien été supprimée.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function testCannotBeDeletedUnlessOwner()\n {\n list($responseCode, $responseBody) = sendDeleteRequest($this->endpoint .'/5003e8bc757df2020d000006', array(), $this->user1Headers);\n $this->assertEquals(401, $responseCode);\n }", "public function testDeleteRole()\n {\n }", "public function testCatalogDeleteWithValidData() {\n $subcatalog = Catalog::where('name', 'LIKE', 'Catalog of course 1 - group Test xy - chapter 1')->first();\n\n $response = $this->get('catalog/' . $subcatalog->id . '/delete');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the type of path i.e. whether it is file, link or dir
public function getType() { if (is_file($this->path)) { return 'file'; } elseif (is_link($this->path)) { return 'link'; } elseif (is_dir($this->path)) { return 'dir'; } return "Unknown"; }
[ "public function getPathType() {\n return ($this->code & static::TYPE_FILE) === static::TYPE_FILE;\n }", "public function type($path = \"\") {\n\t\t\tforeach($this->application->events()->triggerR(\"filesystem_get_type\", Array($path, $this->directory, $this)) as $return)\n\t\t\t\tif(is_bool($return)) return $return;\n\t\t\t\n\t\t\tif($this->file($path)) return \"file\";\n\t\t\telseif($this->directory($path)) return \"directory\";\n\t\t\telse return \"\";\n\t\t}", "private function getPathType()\n {\n switch ($this->getType()) {\n case 'nested':\n $type = 'path';\n break;\n case 'parent':\n $type = 'type';\n break;\n default:\n $type = null;\n }\n return $type;\n }", "private function _path_type(){\n if ( !self::$path_type ){\n if ( $id = $this->options->fromCode(self::PATH_TYPE, self::IDE_PATH) ){\n self::setPathType($id);\n }\n }\n return self::$path_type;\n }", "public static function pathType(string $path): int\n\t{\n\t\tif(strpos($path,'://') !== false)\n\t\t{\n\t\t\treturn self::URL;\n\t\t}\n\t\telseif(substr($path,0,1) !== DIRECTORY_SEPARATOR)\n\t\t{\n\t\t\treturn self::RELATIVE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn self::ABSOLUTE;\n\t\t}\n\t}", "public function getType(): PathTypeInterface;", "public function getType()\n {\n $metadata = $this->filesystem->getMetadata($this->path);\n\n return $metadata ? $metadata['type'] : 'dir';\n }", "function typeToPath($type) {\n switch (strtolower($type)) {\n case AVATAR:\n case AVATARS:\n return \"avatar\";\n case SABER:\n case SABERS:\n return \"saber\";\n case PLATFORM:\n case PLATFORMS:\n return \"platform\";\n case NOTE:\n case NOTES:\n return \"bloq\";\n case TRAIL:\n case TRAILS:\n return \"trail\";\n case SIGN:\n case SIGNS:\n return \"sign\";\n case MISC:\n case MISCS:\n return \"misc\";\n default:\n return null;\n }\n}", "function getLinkType($link) {\n $arr = explode('/', $link);\n return $arr[4];\n }", "public static function _getFileType($path) {\n\t\tif(!is_string($path)) {\n\t\t\tthrow ExceptionUtil::throwInvalidArgument('$path', 'String', $path);\n\t\t}\n\t\t$strpos = strpos($path, \".\");\n\t\t$ext = substr($path, $strpos + 1, strlen($path) - $strpos );\n\t\tswitch($ext) {\n\t\t\tcase \"jpg\":\n\t\t\tcase \"jpeg\":\n\t\t\t\treturn self::FILE_TYPE_JPEG;\t\t\t\t\n\t\t\tcase \"png\":\n\t\t\t\treturn self::FILE_TYPE_PNG;\n\t\t\tcase \"gif\":\n\t\t\t\treturn self::FILE_TYPE_GIF;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\t\n\t}", "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 }", "public function type()\n {\n return (filetype($this->filename));\n }", "public function testTypeOfNode_String()\n {\n \t$this->assertEquals('file', Fs::typeOfNode(__FILE__));\n \t$this->assertEquals('dir', Fs::typeOfNode(__DIR__));\n \t\n \t$this->tmpfiles[] = $link_file = sys_get_temp_dir() . '/q-fs_test.' . md5(uniqid());\n \t$this->tmpfiles[] = $link_dir = sys_get_temp_dir() . '/q-fs_test.' . md5(uniqid());\n \tif (symlink(__FILE__, $link_file)) $this->assertEquals('link/file', Fs::typeOfNode($link_file));\n \tif (symlink(__DIR__, $link_dir)) $this->assertEquals('link/dir', Fs::typeOfNode($link_dir));\n\t}", "public function getType() {\r\n return $this->file_type;\r\n }", "private function get_mimetype()\n\t{\n\t\tif (!isset($this->filename)) throw new Exception(\"filename is not set\", E_NOFILENAME);\n\t\tif (!file_exists($this->filename)) throw new Exception(\"$this->filename does not exist\", E_NOFILE);\n\n\t\tif ($use_finfo) {\n\t\t\t$type = $finfo->file($this->filename,FILEINFO_MIME+FILEINFO_SYMLINKS);\n\t\t} else {\n\t\t\t$cmd = \"file -b -I \".escapeshellcmd($fn).\" 2>/dev/null\";\n\t\t\t$type = rtrim(`$cmd`);\n\t\t}\n\t\treturn $type;\n\t}", "public static function typePath($type)\n {\n if ($type === 'S') {\n return PATH_typo3 . 'sysext/';\n } elseif ($type === 'G') {\n return PATH_typo3 . 'ext/';\n } elseif ($type === 'L') {\n return PATH_typo3conf . 'ext/';\n }\n return PATH_typo3conf . 'ext/';\n }", "public function determineType(): string {\n if ( $this->isVirtual() ) {\n return 'none';\n }\n\n try {\n set_error_handler( [ $this, 'errorHandler' ] );\n $handle = fopen( $this->path, 'r' );\n restore_error_handler();\n }\n catch ( FoundationException $exception ) {\n throw new FileSystemException(\n 'could not determine type of file ' . $this->getPath(),\n 1,\n $exception,\n __FILE__,\n __LINE__\n );\n }\n\n // get files magic number\n $fileHeader = bin2hex( fread( $handle, 16 ) );\n\n foreach ( File::MAGIC_NUMBERS as $magicNumber => $type ) {\n if ( strtolower( substr( $fileHeader, 0, strlen( $magicNumber ) ) ) === strtolower( $magicNumber ) ) {\n return $type;\n }\n }\n\n return 'bin';\n }", "public function getFiletype()\n {\n return $this->filetype;\n }", "function get_upload_path_by_type_so($type)\n{\n switch ($type) {\n case 'lead':\n return LEAD_ATTACHMENTS_FOLDER;\n break;\n case 'expense':\n return EXPENSE_ATTACHMENTS_FOLDER;\n break;\n case 'project':\n return PROJECT_ATTACHMENTS_FOLDER;\n break;\n\t\tcase 'saleopp':\n return SALE_OPPORTUNITY_ATTACHMENTS_FOLDER;\n break;\n case 'proposal':\n return PROPOSAL_ATTACHMENTS_FOLDER;\n break;\n case 'estimate':\n return ESTIMATE_ATTACHMENTS_FOLDER;\n break;\n case 'invoice':\n return INVOICE_ATTACHMENTS_FOLDER;\n break;\n case 'credit_note':\n return CREDIT_NOTES_ATTACHMENTS_FOLDER;\n break;\n case 'task':\n return TASKS_ATTACHMENTS_FOLDER;\n break;\n case 'contract':\n return CONTRACTS_UPLOADS_FOLDER;\n break;\n case 'customer':\n return CLIENT_ATTACHMENTS_FOLDER;\n break;\n case 'staff':\n return STAFF_PROFILE_IMAGES_FOLDER;\n break;\n case 'company':\n return COMPANY_FILES_FOLDER;\n break;\n case 'ticket':\n return TICKET_ATTACHMENTS_FOLDER;\n break;\n case 'contact_profile_images':\n return CONTACT_PROFILE_IMAGES_FOLDER;\n break;\n case 'newsfeed':\n return NEWSFEED_FOLDER;\n break;\n default:\n return false;\n }\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes in array, and creates a new array based on the upper and lower bounds of the current array useful for only getting select information from a large array
private function _extractItemsFromArrayBetweenBounds($lowerBound, $upperBound, $array) { $arrayPosition = 0; $newArray = array(); foreach ($array as $data) { if ($arrayPosition >= $lowerBound && $arrayPosition <= $upperBound) { $newArray[] = $data; } $arrayPosition++; } return $newArray; }
[ "function get_max_and_min($array){\n\t\t$min = $array[0];\n\t\t$max = $array[0];\n\t\tforeach ($array as $i){\n\t\t\tif ($i > $max) $max = $i;\n\t\t\tif ($i < $min) $min = $i;\n\t\t}\n\t\t$array['max'] = $max;\n\t\t$array['min'] = $min;\n\t\treturn $array;\n\t}", "public function clip($array=array(),$start=null,$end=null){\n if(($start !== null)&&($end !== null)&&(is_array($array))){\n $array=array_slice($array,$start,$end);\n }\n return $array;\n}", "public function range(): array;", "function getSlicedRandomArray ($array,$offset,$length) {\n // shuffle\n while (count($array) > 0) {\n $val = array_rand($array);\n $new_arr[$val] = $array[$val];\n unset($array[$val]);\n }\n $result=$new_arr;\n \n // slice\n $result2 = array();\n $i = 0;\n if($offset < 0)\n $offset = count($result) + $offset;\n if($length > 0)\n $endOffset = $offset + $length;\n else if($length < 0)\n $endOffset = count($result) + $length;\n else\n $endOffset = count($result);\n \n // collect elements\n foreach($result as $key=>$value)\n {\n if($i >= $offset && $i < $endOffset)\n $result2[$key] = $value;\n $i++;\n }\n return $result2;\n }", "function range_array()\n {\n return self::_range_array($this->list);\n }", "function get_max_and_min($array){\r\n\t\t$max = $array[0];\r\n\t\t$min = $array[0];\r\n\t\tforeach($array as $value){\r\n\t\t\tif($max < $value){\r\n\t\t\t\t$max = $value;\r\n\t\t\t}\r\n\t\t\tif($min > $value){\r\n\t\t\t\t$min = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array('max' => $max, 'min' => $min);\r\n\t}", "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}", "function trim_edge($array){\n // rename the indexing for easier usage\n $reorder = array();\n foreach($array as $value){\n $arr_temp = array();\n foreach($value as $subValue){\n array_push($arr_temp, $subValue);\n }\n array_push($reorder, $arr_temp);\n }\n\n\t\t$start = \"\";\n $end = 0;\n // check to see at what colomn the values start and end in the excel file to cut the exces edges of\n\t\tforeach($reorder as $key => $value){\n\t\t\tforeach($value as $subKey => $subValue){\n\t\t\t\tif($subValue != null && is_numeric($subValue)){\n // check what the first filled column is in all rows and store the ealiest column index\n\t\t\t\t\tif($start > $subKey || !is_numeric($start)){\n\t\t\t\t\t\t$start = $subKey;\n\t\t\t\t\t}\n \n // check what the last filled column is in all rows and store the latest column index\n\t\t\t\t\tif($end < ($subKey-($start -1))){\n\t\t\t\t\t\t$end = ($subKey-($start -1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n $result = array();\n // cut the excess colomns off \n\t\tforeach($reorder as $key => $value){\n\t\t\t$row = array_slice($value, $start, $end);\n\t\t\tarray_push($result, $row);\n\t\t}\n\n\t\treturn $result;\n\t}", "function chopArray($Target, $array) {\n\t$arrayCount = count($array);\n\t// if there is no array, you can't find anything in it\n\tif ($arrayCount == 0) {\n\t\t$ret = -1;\n\t\treturn ($ret);\n\t}\n\t//figure out the key of the middle element\n\t$middle = ceil($arrayCount/2);\n\t// if the target is the value of the middle element, return\n\tif ($Target == $array[$middle]) {\n\t\t$ret = $middle;\n\t\treturn ($middle);\n\t}\n\t//if the target is greater than the value of the middle\n\t//get rid of the first half of the array and return the \n\t// part with the target value in it\n\telse if ($Target >= $array[$middle]) {\n\t\t$newArray = array_slice($array, ($middle + 1));\n\t\treturn ($newArray);\n\t}\n\t// if it's less than the middle value, return the first half\n\t//of the array to search in\n\telse {\n\t\t$newArray = array_slice($array, 0, ($middle - 1));\n\t\treturn ($newArray);\n\n\t}\n\t\n\t\n}", "function smaller_range() {\n\t\tforeach ($this->range as $key=>$data) {\n\t\t\t// Check to see if this isn't the first pass and if the value is less than / equal than the previous\n\t\t\tif($key != 0 && $this->range[$key - 1] <= $data) {\n\t\t\t\t// Display values were removing from datapoints\n\t\t\t\t$item['datapoints'] = \"x = [\" . implode(' ', $this->datapoints) . \"]\";\n\t\t\t\t$item['ranges'] = \"r = [\" . implode(' ', $this->range) . \"]\";\n\t\t\t\t$item['datapoint1'] = $this->datapoints[$key - 1];\n\t\t\t\t$item['datapoint2'] = $this->datapoints[$key];\n\t\t\t\t$item['range'] = $this->range[$key - 1];\n\t\t\t\t$item['mean'] = ($this->datapoints[$key] - $this->datapoints[$key - 1]) / 2;\n\n\t\t\t\t// Set value for final set\n\t\t\t\t$this->final[] = $item;\n\n\t\t\t\t// Remove relevant datapoints\n\t\t\t\tunset($this->datapoints[$key]);\n\t\t\t\tunset($this->datapoints[$key - 1]);\n\n\t\t\t\t// Rekey datapoints index\n\t\t\t\t$this->datapoints = array_values($this->datapoints);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Reset array\n\t\t$this->range = array();\n\t}", "function getSwappedArrayValues($array) {\n //eg pass array 2,1 and it returns 1,2\n if(count($array) === 2) {\n $newArr = array($array[1], $array[0]);\n return $newArr;\n }\n }", "public static function extractRanges(Array $arr)\n {\n $ranges = array();\n if (!empty($arr)) {\n $end = $prev = null;\n $start = $arr[0];\n\n foreach ($arr as $date) {\n if (isset($prev) and date('Y-m-d', strtotime($date . ' - 1 day')) != $prev) {\n $end = $prev;\n }\n\n if (isset($start) and isset($end)) {\n $ranges[] = new self($start, $end);\n $start = $date;\n $end = null;\n $prev = null;\n } else {\n $prev = $date;\n }\n }\n\n if (isset($prev)) {\n $ranges[] = new self($start, $prev);\n } else {\n if (isset($start)) {\n $ranges[] = new self($start, $start);\n }\n }\n }\n\n return $ranges;\n }", "function array_body($array, $from, $to) {\n $offset = array_index($array, $from);\n\n return $array ? array_slice($array, $offset, array_index($array, $to) - $offset + 1, 1) : [];\n}", "public function dataProviderForRange(): array\n {\n return [\n [ [ 1, 1, 1 ], 0 ],\n [ [ 1, 1, 2 ], 1 ],\n [ [ 1, 2, 1 ], 1 ],\n [ [ 8, 4, 3 ], 5 ],\n [ [ 9, 7, 8 ], 2 ],\n [ [ 13, 18, 13, 14, 13, 16, 14, 21, 13 ], 8 ],\n [ [ 1, 2, 4, 7 ], 6 ],\n [ [ 8, 9, 10, 10, 10, 11, 11, 11, 12, 13 ], 5 ],\n [ [ 6, 7, 8, 10, 12, 14, 14, 15, 16, 20 ], 14 ],\n [ [ 9, 10, 11, 13, 15, 17, 17, 18, 19, 23 ], 14 ],\n [ [ 12, 14, 16, 20, 24, 28, 28, 30, 32, 40 ], 28 ],\n ];\n }", "function array_high_low_1d($arr) {\n\n\tif(is_array($arr) && count($arr) > 0) {\n\n\t\t$return_arr = array();\n\t\t$return_arr['high'] = 0;\n\t\tforeach($arr as $value) {\n\t\t\tif($value > $high_num)\n\t\t\t\t$return_arr['high'] = $value;\n\t\t\t}\n\t\t\n\t\t$return_arr['low'] = $return_arr['high'];\n\t\tforeach($arr as $value) {\n\t\tif($value < $return_arr['low']) \n\t\t\t$return_arr['low'] = $value;\n\t\t\t}\n\t\t\n\t\treturn $return_arr;\n\t\t}\n\t\n\tdebug_text_print(\"passed value not an array for array2d_sort()\");\n\treturn 0;\n\t}", "function split_array_in_half( $array, $first_larger = true ) {\r\r\n $count = count( $array );\r\r\n $half_1 = ( $first_larger ) ? array_slice( $array, 0, round( $count / 2 ) ) : array_slice( $array, 0, floor( $count / 2 ) );\r\r\n $half_2 = array_slice( $array, count( $half_1 ) );\r\r\n\r\r\n $return = array(\r\r\n 'first' => $half_1,\r\r\n 'second' => $half_2\r\r\n );\r\r\n\r\r\n return $return;\r\r\n}", "function extract_all_data($array) {\r\n /**\r\n *\r\n * @return array - returns a tided and nested array of values\r\n * @param array $array - gets a nested array\r\n *\r\n * */\r\n\r\n $new = [\r\n [], # user_id\r\n [], # name\r\n [] # best\r\n ];\r\n\r\n foreach($array as $arr) {\r\n array_push($new[0], $arr[\"user_id\"]);\r\n array_push($new[1], $arr[\"name\"]);\r\n array_push($new[2], $arr[\"best\"]);\r\n }\r\n\r\n return $new;\r\n }", "public function start_array();", "function array_query( &$array, $sql, $min = 0, $max = -1, $column = false )\r\n {\r\n $array = array();\r\n return $this->array_query_append( $array, $sql, $min, $max, $column );\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A second helper function to convert the data types that are grouepd in Core::$dataTypePlugins into a hash of [Data Type Folder] => object
public function getDataTypeHash($groupedDataTypes) { $hash = array(); while (list($group_name, $dataTypes) = each($groupedDataTypes)) { foreach ($dataTypes as $dataType) { $hash[$dataType->folder] = $dataType; } } return $hash; }
[ "public function getDataTypes()\n\t{\n\t}", "private static function getTypeImporterMappings() {\n // Define the needed infos to build the importer dinamically.\n $field_mapping = [\n [\n 'field' => 'guid',\n 'query' => '@nrid',\n 'unique' => 1,\n ],\n [\n 'field' => 'field_newsroom_type_id',\n 'query' => 'infsonewsroom:BasicTypeId/text()',\n ],\n [\n 'field' => 'name',\n 'query' => 'title[@lang=\"' . NexteuropaNewsroomHelper::getDefaultLanguageUppercase() . '\"]/text()',\n ],\n [\n 'field' => 'name_field',\n 'query' => 'title',\n ],\n [\n 'field' => 'parentguid',\n 'query' => 'infsonewsroom:BasicTypeParent/text()',\n 'tamper' => [\n 'plugins' => [\n 'rewrite' => [\n 'prefix' => 'type-',\n ],\n ],\n ],\n ],\n ];\n\n return $field_mapping;\n }", "public function getDataTypes(){\n \n if (!$this->data){\n return false;\n }\n \n $types = array();\n \n foreach($this->data as $row){\n foreach($row as $key => $val){\n \n if (!isset($types[$key])){\n $types[$key] = '';\n }\n \n if (is_numeric($val) && $types[$key] != 'string-ins' ){\n $types[$key] = 'float';\n }\n \n elseif (is_string($val)){\n $types[$key] = 'string-ins';\n }\n \n }\n }\n \n return $types;\n \n }", "public function getGroupTypePluginMap();", "function _metatag_importer_convert_type($type) {\n // define('NODEWORDS_TYPE_DEFAULT', 1);\n // define('NODEWORDS_TYPE_ERRORPAGE', 2);\n // define('NODEWORDS_TYPE_FRONTPAGE', 3);\n // define('NODEWORDS_TYPE_NONE', 0);\n // define('NODEWORDS_TYPE_NODE', 5);\n // define('NODEWORDS_TYPE_PAGE', 10);\n // define('NODEWORDS_TYPE_PAGER', 4);\n // define('NODEWORDS_TYPE_TERM', 6);\n // define('NODEWORDS_TYPE_TRACKER', 7);\n // define('NODEWORDS_TYPE_USER', 8);\n // define('NODEWORDS_TYPE_VOCABULARY', 9);\n switch ($type) {\n case 1:\n return 'global';\n\n case 2:\n return 'global:404';\n\n case 3:\n return 'global:frontpage';\n\n // @todo Not yet sure how to handle pager items?\n // case 4:\n // return 'pager';\n\n case 5:\n return 'node';\n\n case 6:\n return 'taxonomy_term';\n\n // @todo Not sure what to do with tracker pages.\n // case 7:\n // return 'tracker';\n\n case 8:\n return 'user';\n\n // @todo Vocabulary records need to be converted to a config for that entity\n // bundle.\n // case 9:\n // return 'vocabulary';\n\n // @todo Page records need to be converted to Context definitions.\n // case 10:\n // return 'page';\n }\n\n return FALSE;\n}", "private function _populate_plugin_types() {\n return get_subdirectories(__DIR__);\n }", "public function convertTypes(&$data)\n {\n $types = $this->convert_types;\n foreach ($types as $type => $names) {\n foreach ($names as $name) {\n $keys = explode('/', $name);\n if (count($keys) != 2) {\n throw new \\RuntimeException('Not suported!');\n }\n if (isset($data['content'][$keys[0]])) {\n if (is_array($data['content'][$keys[0]])) {\n foreach ($data['content'][$keys[0]] as $key => $value) {\n if (isset($data['content'][$keys[0]][$key][$keys[1]])) {\n $data['content'][$keys[0]][$key][$keys[1]] =\n $this->getCastedValue(\n $data['content'][$keys[0]][$key][$keys[1]],\n $type\n );\n }\n }\n } else {\n if (isset($data['content'][$keys[0]][$keys[1]])) {\n $data['content'][$keys[0]][$keys[1]] =\n $this->getCastedValue(\n $data['content'][$keys[0]][$keys[1]],\n $type\n );\n }\n }\n }\n if (isset($data['content'][$keys[0]]) && isset($data['content'][$keys[0]][$keys[1]])) {\n $data['content'][$keys[0]][$keys[1]] = $this->getCastedValue(\n $data['content'][$keys[0]][$keys[1]],\n $type\n );\n }\n }\n }\n }", "private static function initTypeToExtension()\n {\n // Skip when already done.\n if (self::$typeNameToExtension !== null) {\n return self::$typeNameToExtension;\n }\n\n self::$typeNameToExtension = array('iterator' => '+standard');\n\n $extensionNames = get_loaded_extensions();\n $extensionNames = array_map('strtolower', $extensionNames);\n\n foreach ($extensionNames as $extensionName) {\n $extension = new ReflectionExtension($extensionName);\n\n $classNames = $extension->getClassNames();\n $classNames = array_map('strtolower', $classNames);\n\n foreach ($classNames as $className) {\n self::$typeNameToExtension[$className] = '+' . $extensionName;\n }\n }\n\n return self::$typeNameToExtension;\n }", "public static function TypeData()\n\t{\n\t\t$ProjectType = array('New'=>'New Business', 'Existing'=>'Existing Business');\n\t\treturn $ProjectType;\n\t}", "public function getPluginGroupContentTypeMap();", "static function loadMimeTypes() {\r\n\t\tif(@file_exists('/etc/mime.types')) {\r\n\t\t\t$mimeTypes = file('/etc/mime.types');\r\n\t\t\tforeach($mimeTypes as $typeSpec) {\r\n\t\t\t\tif(($typeSpec = trim($typeSpec)) && substr($typeSpec,0,1) != \"#\") {\r\n\t\t\t\t\t$parts = preg_split(\"/[ \\t\\r\\n]+/\", $typeSpec);\r\n\t\t\t\t\tif(sizeof($parts) > 1) {\r\n\t\t\t\t\t\t$mimeType = array_shift($parts);\r\n\t\t\t\t\t\tforeach($parts as $ext) {\r\n\t\t\t\t\t\t\t$ext = strtolower($ext);\r\n\t\t\t\t\t\t\t$mimeData[$ext] = $mimeType;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t// Fail-over for if people don't have /etc/mime.types on their server. it's unclear how important this actually is\r\n\t\t} else {\r\n\t\t\t$mimeData = array(\r\n\t\t\t\t\"doc\" => \"application/msword\",\r\n\t\t\t\t\"xls\" => \"application/vnd.ms-excel\",\r\n\t\t\t\t\"rtf\" => \"application/rtf\",\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tglobal $global_mimetypes;\r\n\t\t$global_mimetypes = $mimeData;\r\n\t\treturn $mimeData;\r\n\t}", "public static function getTypeMap()\n {\n sys::import('creole.CreoleTypes');\n return array(\n CreoleTypes::getCreoleCode('BOOLEAN') => 'boolean',\n CreoleTypes::getCreoleCode('VARCHAR') => 'text',\n CreoleTypes::getCreoleCode('LONGVARCHAR') => 'text',\n CreoleTypes::getCreoleCode('CHAR') => 'text',\n CreoleTypes::getCreoleCode('VARCHAR') => 'text',\n CreoleTypes::getCreoleCode('TEXT') => 'text',\n CreoleTypes::getCreoleCode('CLOB') => 'text',\n CreoleTypes::getCreoleCode('LONGVARCHAR') => 'text',\n CreoleTypes::getCreoleCode('INTEGER') => 'number',\n CreoleTypes::getCreoleCode('TINYINT') => 'number',\n CreoleTypes::getCreoleCode('BIGINT') => 'number',\n CreoleTypes::getCreoleCode('SMALLINT') => 'number',\n CreoleTypes::getCreoleCode('TINYINT') => 'number',\n CreoleTypes::getCreoleCode('INTEGER') => 'number',\n CreoleTypes::getCreoleCode('FLOAT') => 'number',\n CreoleTypes::getCreoleCode('NUMERIC') => 'number',\n CreoleTypes::getCreoleCode('DECIMAL') => 'number',\n CreoleTypes::getCreoleCode('YEAR') => 'number',\n CreoleTypes::getCreoleCode('REAL') => 'number',\n CreoleTypes::getCreoleCode('DOUBLE') => 'number',\n CreoleTypes::getCreoleCode('DATE') => 'time',\n CreoleTypes::getCreoleCode('TIME') => 'time',\n CreoleTypes::getCreoleCode('TIMESTAMP') => 'time',\n CreoleTypes::getCreoleCode('VARBINARY') => 'binary',\n CreoleTypes::getCreoleCode('VARBINARY') => 'binary',\n CreoleTypes::getCreoleCode('BLOB') => 'binary',\n CreoleTypes::getCreoleCode('BINARY') => 'binary',\n CreoleTypes::getCreoleCode('LONGVARBINARY') => 'binary'\n );\n }", "public function dataProviderConvert()\n {\n return [\n 'true integer' => ['1', 1],\n 'false integer' => ['0', 0],\n 'null' => [null, null],\n ];\n }", "private function define_data_formats()\n\t{\n\t\tif (!isset($this->data_section['format']) OR !is_array($this->data_section['format']))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$data_formats = [];\n\n\t\tforeach ($this->data_section['format'] as $key => $section)\n\t\t{\n\t\t\tif (!isset($section[2]) OR empty($section[2]))\n\t\t\t{\n\t\t\t\t$data_formats[$key] = $section;\n\t\t\t}\n\t\t\telse if ($this->find_flag($section[2]))\n\t\t\t{\n\t\t\t\t$data_formats[$key] = $section;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($data_formats))\n\t\t{\n\t\t\t$this->data_formats = $data_formats;\n\t\t}\n\t}", "function getTypes(){\n\t\t\t//opens up the types file\n\t\t\t$types_file_handle = new MarkUpFile('../Lib/fileTypes.txt'); \n\t\t\t$types_file_arrayList = $types_file_handle->Read();\n\t\t\t$types_file_handle->Close();\n\t\t\t//types is the array that holds all of the types\n\t\t\t$types = array();\n\t\t\t//loads all the types in to types\n\t\t\tforeach($types_file_arrayList as $single_type){\n\t\t\t\t$types = array_merge($types, array(new fileType($single_type[2], $single_type[1], $single_type[3])));\n\t\t\t}\n\t\t\treturn $types;\n\t\t}", "function &getTypeMap() {\n\t\tstatic $typeMap;\n\t\tif (!isset($typeMap)) {\n\t\t\t$typeMap = array(\n ARTICLE_PURPOSE_NOT_PROVIDED => 'common.dataNotProvided',\n\t\t\t\tARTICLE_PURPOSE_TYPE_OBS => 'proposal.purpose.type.obs',\n\t\t\t\tARTICLE_PURPOSE_TYPE_DIAGNOSIS => 'proposal.purpose.type.diganosis',\n\t\t\t\tARTICLE_PURPOSE_TYPE_EARLY => 'proposal.purpose.type.early',\n\t\t\t\tARTICLE_PURPOSE_TYPE_PREVENTION => 'proposal.purpose.type.prevention',\n\t\t\t\tARTICLE_PURPOSE_TYPE_TREAT_DRUGS => 'proposal.purpose.type.drugs',\n\t\t\t\tARTICLE_PURPOSE_TYPE_TREAT_DEVICES => 'proposal.purpose.type.devices',\n\t\t\t\tARTICLE_PURPOSE_TYPE_TREAT_OTHERS => 'proposal.purpose.type.others' \n );\n\t\t}\n\t\treturn $typeMap;\n\t}", "public function getTypemap()\n {\n $typemap = array();\n\n foreach ($this->converters as $converter) {\n $typemap[] = array(\n 'type_name' => $converter->getTypeName(),\n 'type_ns' => $converter->getTypeNamespace(),\n 'from_xml' => function($input) use ($converter) {\n return $converter->convertXmlToPhp($input);\n },\n 'to_xml' => function($input) use ($converter) {\n return $converter->convertPhpToXml($input);\n },\n );\n }\n\n return $typemap;\n }", "function cpvg_load_fieldtypes($output_json = false)\n{\n $types_options = array();\n\n foreach (glob(CPVG_FIELDTYPES_DIR . '/*.php') as $php_file) {\n $files[] = preg_replace(\"/\\\\.[^.\\\\s]{3,4}$/\", '', basename($php_file));\n }\n asort($files);\n\n foreach ($files as $fieldtype_name) {\n include_once CPVG_FIELDTYPES_DIR . \"/\" . $fieldtype_name . \".php\";\n $fieldtype_object = new $fieldtype_name();\n $types_options = array_merge($types_options, $fieldtype_object->adminProperties());\n }\n\n if ($output_json) {\n if (version_compare(PHP_VERSION, '5.3.0', '<')) {\n $types_options = json_encode($types_options);\n } else {\n $types_options = json_encode($types_options, JSON_HEX_TAG);\n }\n }\n\n return $types_options;\n}", "private function dataTypesTranslations()\n {\n // Adding translations for 'display_name_singular'\n //\n $_fld = 'display_name_singular';\n $_tpl = ['data_types', $_fld];\n $_fld2 = 'display_name_plural';\n $_tpl2 = ['data_types', $_fld];\n $dtp = DataType::where(\"name\", 'posts')->firstOrFail();\n if ($dtp->exists) {\n $this->trans('es', $this->arr($_tpl, $dtp->id), 'Post');\n $this->trans('es', $this->arr($_tpl2, $dtp->id), 'Posts');\n }\n $dtp = DataType::where(\"name\", 'pages')->firstOrFail();\n if ($dtp->exists) {\n $this->trans('es', $this->arr($_tpl, $dtp->id), 'Página');\n $this->trans('es', $this->arr($_tpl2, $dtp->id), 'Páginas');\n }\n $dtp = DataType::where(\"name\", 'users')->firstOrFail();\n if ($dtp->exists) {\n $this->trans('es', $this->arr($_tpl, $dtp->id), 'Usuario');\n $this->trans('es', $this->arr($_tpl2, $dtp->id), 'Usuarios');\n }\n $dtp = DataType::where(\"name\", 'categories')->firstOrFail();\n if ($dtp->exists) {\n $this->trans('es', $this->arr($_tpl, $dtp->id), 'Categoria');\n $this->trans('es', $this->arr($_tpl2, $dtp->id), 'Categorias');\n }\n $dtp = DataType::where(\"name\", 'menus')->firstOrFail();\n if ($dtp->exists) {\n $this->trans('es', $this->arr($_tpl, $dtp->id), 'Menu');\n $this->trans('es', $this->arr($_tpl2, $dtp->id), 'Menus');\n }\n $dtp = DataType::where(\"name\", 'roles')->firstOrFail();\n if ($dtp->exists) {\n $this->trans('es', $this->arr($_tpl, $dtp->id), 'Rol');\n $this->trans('es', $this->arr($_tpl2, $dtp->id), 'Roles');\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Assert that a QueryFilterManagerException is thrown when unable to apply the filters in applyFilter().
public function testFailureToApplyFilterWillResultInQueryFilterManagerException(): void { /** @var FilterInterface[]&MockObject[] $filters */ $filters = [ $this->createMock(FilterInterface::class), $this->createMock(FilterInterface::class), ]; $manager = new QueryFilterManager($this->filterFactory, $this->sortFactory); $criteria = [ 'filters' => $filters, ]; $this->queryBuilder->expects($this->once()) ->method('getEntityManager') ->willReturn($this->entityManager); $this->entityManager->expects($this->once()) ->method('getClassMetadata') ->with($this->entityName) ->willReturn($this->metadata); $exceptionCode = 999; $filterException = new FilterException('This is a test filter exception message', $exceptionCode); $filters[0]->expects($this->once()) ->method('filter') ->with($this->queryBuilder, $this->isInstanceOf(MetadataInterface::class), []) ->willThrowException($filterException); $this->metadata->expects($this->once()) ->method('getName') ->willReturn($this->entityName); $this->expectException(QueryFilterManagerException::class); $this->expectExceptionCode($exceptionCode); $this->expectExceptionMessage( sprintf('Failed to apply query filter for entity \'%s\'', $this->entityName) ); $manager->filter($this->queryBuilder, $this->entityName, $criteria); }
[ "public function testFilterWillThrowQueryFilterManagerExceptionIfProvidedWithAnInvalidEntityName(): void\n {\n $manager = new QueryFilterManager($this->filterFactory, $this->sortFactory);\n\n $criteria = [\n 'filters' => [\n [\n 'name' => 'foo',\n ],\n ],\n ];\n\n $this->queryBuilder->expects($this->once())\n ->method('getEntityManager')\n ->willReturn($this->entityManager);\n\n $exceptionCode = 123;\n $exception = new \\Exception('This is an exception message', $exceptionCode);\n\n $this->entityManager->expects($this->once())\n ->method('getClassMetadata')\n ->with($this->entityName)\n ->willThrowException($exception);\n\n $this->expectException(QueryFilterManagerException::class);\n $this->expectExceptionCode($exceptionCode);\n $this->expectExceptionMessage(sprintf('Failed to fetch entity metadata for class \\'%s\\'', $this->entityName));\n\n $manager->filter($this->queryBuilder, $this->entityName, $criteria);\n }", "public function testInvalidFilterThrowsException(): void\n {\n $this->expectException(ORMException::class);\n\n $this->getEntityManager()->getFilters()->enable('invalid');\n }", "public function testAddInvalidFilter(): void\n\t{\n\t\t$this->expectException(Exception::class);\n\t\t$input = new Fluent();\n\t\t$input->filter('foo');\n\t}", "public function testFilterWillNotPerformFilteringWithoutFilterKey(): void\n {\n $manager = new QueryFilterManager($this->filterFactory, $this->sortFactory);\n\n $this->queryBuilder->expects($this->once())\n ->method('getEntityManager')\n ->willReturn($this->entityManager);\n\n $this->entityManager->expects($this->once())\n ->method('getClassMetadata')\n ->with($this->entityName)\n ->willReturn($this->metadata);\n\n $this->filterFactory->expects($this->never())->method('create');\n\n $manager->filter($this->queryBuilder, $this->entityName, []);\n }", "public function testNoFilterDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\FilterFactoryException');\n\n $this->factory->getFilter('unknown');\n }", "public function testInexistentFilter()\n\t{\n\t\t$this->setExpectedException('Jyxo_Input_Exception');\n\t\t$this->factory->getFilterByName('foo');\n\t}", "public function testSqlException() {\n $view = Views::getView('test_filter');\n $view->initDisplay();\n\n // Adding a filter that will result in an invalid query.\n $view->displayHandlers->get('default')->overrideOption('filters', [\n 'test_filter' => [\n 'id' => 'test_exception_filter',\n 'table' => 'views_test_data',\n 'field' => 'name',\n 'operator' => '=',\n 'value' => 'John',\n 'group' => 0,\n ],\n ]);\n\n $this->expectException(DatabaseExceptionWrapper::class);\n $this->expectExceptionMessageMatches('/^Exception in Test filters\\[test_filter\\]:/');\n\n $this->executeView($view);\n }", "public function testMalformedFilterThrowsException()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $sanitiser = new QueryStringParserTraitStub;\n\n $query = $sanitiser->parseQueryString('filter=field|value');\n }", "public function testGetQueryException()\n {\n $em = $this->getEntityManagerMock();\n $qb = $this->getQueryBuilderMock($em);\n\n $driver = new DoctrineDriver([], $em, 'entity');\n $this->setExpectedException('AdminPanel\\Component\\DataSource\\Driver\\Doctrine\\Exception\\DoctrineDriverException');\n $driver->getQueryBuilder();\n }", "public function testBeforeFilterWhenBadRequest(): void\n {\n $this->expectException(BadRequestException::class);\n\n $request = new ServerRequest([\n 'query' => ['amount1' => 100, 'amount3' => 200]\n ]);\n $controller = new Controller($request);\n $registry = new ComponentRegistry($controller);\n $component = new MathComponent($registry);\n $event = new Event('Controller.beforeFilter');\n\n $component->beforeFilter($event);\n }", "public function testInvalidFilter()\n {\n $filter = new LdapFilter(array(), \"test\");\n }", "public function testWithFilterIsInvalidForModel(): void\n {\n $image = Image::factory()\n ->for(Post::factory(), 'imageable')\n ->create();\n\n $actual = $this->repository\n ->queryToOne($image, 'imageable')\n ->filter(['email' => 'john.doe@example.com'])\n ->first();\n\n $this->assertNull($actual);\n }", "public function testGetQueryException()\n {\n $em = $this->getEntityManagerMock();\n $qb = $this->getQueryBuilderMock($em);\n\n $driver = new DoctrineDriver(array(), $em, 'entity');\n $this->setExpectedException('FSi\\Component\\DataSource\\Driver\\Doctrine\\Exception\\DoctrineDriverException');\n $driver->getQueryBuilder();\n }", "public function testIfFiringWrongQueryWorks() : void\n {\n\n // Create.\n $query = new CustomQuery('test');\n $query->set('WRONG QUERY;');\n\n // Prepare.\n $this->expectException(QueryFopException::class);\n\n // Test.\n $this->assertTrue($query->fire());\n }", "public function testInvalidQueryType() {\n $entity = new Facet([], 'facets_facet');\n $entity->setWidget('links');\n $entity->setFacetSourceId('search_api:views_page__search_api_test_view__page_1');\n\n $this->setExpectedException('Drupal\\facets\\Exception\\InvalidQueryTypeException');\n $entity->getQueryType();\n }", "public function testAddFilterException() {\n try {\n TwigExtension::addFilter('not-an-array', 'key', 'value');\n $exception = FALSE;\n }\n catch (\\Exception $e) {\n $needle = 'The add filter only works on arrays or \"Traversable\" objects, got \"string\".';\n if (method_exists($this, 'assertStringContainsString')) {\n $this->assertStringContainsString($needle, $e->getMessage());\n }\n else {\n $this->assertContains($needle, $e->getMessage());\n }\n $exception = TRUE;\n }\n if (!$exception) {\n $this->fail('Expected Exception, none was thrown.');\n }\n }", "public function testNoFiltersQuery(){\n $users = User::filterAndGet();\n $this->assertCount(User::count(), $users);\n }", "public static function assertFiltersCalled() : void\n {\n $allFiltersCalled = self::$event_manager->allFiltersCalled();\n $failed = implode(', ', self::$event_manager->expectedFilters());\n PHPUnit\\Framework\\Assert::assertTrue($allFiltersCalled, 'Method failed to invoke filters: ' . $failed);\n }", "protected function wrongFilterTest()\n {\n $task = $this->getTask('copy_task', [\n 'sources' => [],\n 'destinations' => [],\n 'filters' => [\n 'copy'\n ],\n ]);\n $copyFilter = $this\n ->getMockBuilder(CopyFilter::class)\n ->disableOriginalConstructor()\n ->getMock();\n $filters['copy'] = $copyFilter;\n $taskRunner = $this->getTaskRunner($filters);\n $this->assertExceptionThrown(function() use ($task, $taskRunner) {\n $taskRunner->run($task);\n }, 'No supported extensions found for the filter ');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes this Choreo. Execution object provides access to results appropriate for this FeatureLookup Choreo.
public function execute($inputs = array(), $async = false, $store_results = true) { return new UnlockPlaces_FeatureLookup_Execution($this->session, $this, $inputs, $async, $store_results); }
[ "public function getLookupResult();", "public function getFeature($feature);", "public function setLookupResult($lookupResult);", "public function featureAction()\n {\n //Get params\n $experience_id = $this->_getParam('experience_id'); \n $featured = $this->_getParam('good');\n\n //Get experience need to set featured\n $table = Engine_Api::_()->getItemTable('experience');\n $select = $table->select()->where(\"experience_id = ?\",$experience_id); \n $experience = $table->fetchRow($select);\n\n //Set featured/unfeatured\n if($experience){\n $experience->is_featured = $featured;\n $experience->save();\n }\n }", "public function userFeatureEdit(){\n if(I('op') == 'edit' && I('id')){\n $fid = I('id');\n $featureModel = D('Feature');\n $featureModel->getFeatureById($fid);\n }\n $this->display();\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new DeptOfEducation_CollegesAndUniversities_LookupSchool_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "function tripal_feature_load_gff3_derives_from($feature, $cvterm, $object,\n $organism, $fmin, $fmax) {\n\n $type = $cvterm->name;\n\n // First look for the object feature in the temp table to get it's type.\n $values = array(\n 'organism_id' => $organism->organism_id,\n 'uniquename' => $object,\n );\n $result = chado_select_record('tripal_gff_temp', array('type_name'), $values);\n $type_id = NULL;\n if (count($result) > 0) {\n $otype = tripal_get_cvterm(array(\n 'name' => $result[0]->type_name,\n 'cv_id' => array(\n 'name' => 'sequence'\n )\n ));\n if ($otype) {\n $type_id = $otype->cvterm_id;\n }\n }\n\n // If the object wasn't in the temp table then look for it in the\n // feature table and get it's type.\n if (!$type_id) {\n $result = chado_select_record('feature', array('type_id'), $values);\n if (count($result) > 1) {\n watchdog(\"tripal_feature\", \"Cannot find feature type for, '%subject' , in 'derives_from' relationship. Multiple matching features exist with this uniquename.\",\n array('%subject' => $object), WATCHDOG_WARNING);\n return '';\n }\n else if (count($result) == 0) {\n watchdog(\"tripal_feature\", \"Cannot find feature type for, '%subject' , in 'derives_from' relationship.\",\n array('%subject' => $object), WATCHDOG_WARNING);\n return '';\n }\n else {\n $type_id = $result->type_id;\n }\n }\n\n // Get the object feature.\n $match = array(\n 'organism_id' => $organism->organism_id,\n 'uniquename' => $object,\n 'type_id' => $type_id,\n );\n $ofeature = chado_select_record('feature', array('feature_id'), $match);\n if (count($ofeature) == 0) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"Could not add 'Derives_from' relationship \" .\n \"for %uniquename and %subject. Subject feature, '%subject', \" .\n \"cannot be found\", array('%uniquename' => $feature->uniquename, '%subject' => $subject));\n return;\n }\n\n // If this feature is a protein then add it to the tripal_gffprotein_temp.\n if ($type == 'protein' or $type == 'polypeptide') {\n $values = array(\n 'feature_id' => $feature->feature_id,\n 'parent_id' => $ofeature[0]->feature_id,\n 'fmin' => $fmin,\n 'fmax' => $fmax\n );\n $result = chado_insert_record('tripal_gffprotein_temp', $values);\n if (!$result) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"Cound not save record in temporary protein table, Cannot continue.\", array());\n exit;\n }\n }\n\n // Now check to see if the relationship already exists. If it does\n // then just return.\n $values = array(\n 'object_id' => $ofeature[0]->feature_id,\n 'subject_id' => $feature->feature_id,\n 'type_id' => array(\n 'cv_id' => array(\n 'name' => 'sequence'\n ),\n 'name' => 'derives_from',\n ),\n 'rank' => 0\n );\n $rel = chado_select_record('feature_relationship', array('*'), $values);\n if (count($rel) > 0) {\n return;\n }\n\n // finally insert the relationship if it doesn't exist\n $ret = chado_insert_record('feature_relationship', $values);\n if (!$ret) {\n tripal_report_error(\"tripal_feature\", TRIPAL_WARNING, \"Could not add 'Derives_from' relationship for $feature->uniquename and $subject\",\n array());\n }\n}", "public function actionFeature()\r\n\t{\r\n\t\treturn $this->executeInlineModAction('featureTeams');\r\n\t}", "public function getFeature($key);", "public function getLookupMode() {}", "public function getEntrypointLookup(string $buildName = null): EntrypointLookupInterface;", "public function show_feature(){\n\t\t\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/settings_api/all_feature';\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\treturn $response;\t\t\n\t\t\n\t}", "public function addFeature(){\n\t\t\n\t\tinclude(\"system/core/post_functions/create_feature.php\");\n\t\n\t}", "public function getProductFeature($prd_id, $feat_id) {\n \n }", "public function searchDefinition(Environment $environment, FeatureNode $feature, StepNode $step);", "public function getFeature($feature) {\n if(!isset($this->features)) {\n $response = TerminusCommand::request('sites', $this->id, 'features', 'GET');\n $this->features = (array)$response['data'];\n }\n if(isset($this->features[$feature])) {\n return $this->features[$feature];\n }\n return null;\n }", "public function findFeatures(array $feature_ids)\n {\n $query = $this->createQuery(\n self::TABLE_PRODUCT_FEATURES,\n ['feature_id' => $feature_ids],\n [\n 'pf.feature_id', 'pf.feature_style', 'pf.position', 'pf.purpose', 'pf.display_on_catalog',\n 'pfd.description', 'pfd.prefix', 'pfd.suffix'\n ],\n 'pf'\n );\n\n $query\n ->addField(sprintf(\"(CASE WHEN pf.purpose = '%s' THEN 0 ELSE 1 END) AS purpose_position\", FeaturePurposes::CREATE_CATALOG_ITEM))\n ->addInnerJoin(\n 'pfd',\n self::TABLE_PRODUCT_FEATURE_DESCRIPTIONS,\n ['feature_id' => 'feature_id'],\n ['lang_code' => $this->lang_code]\n )\n ->setOrderBy(['purpose_position ASC', 'pf.position ASC', 'pf.feature_id ASC']);\n\n return $query->executeWithoutSharing(function () use ($query) {\n return $query->select('feature_id');\n });\n }", "function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,\n $add_only = 0, $update = 1, $refresh = 0, $remove = 0, $use_transaction = 1,\n $target_organism_id = NULL, $target_type = NULL, $create_target = 0,\n $start_line = 1, $landmark_type = '', $alt_id_attr = '', $create_organism = FALSE,\n $job = NULL) {\n\n $ret = array();\n $date = getdate();\n\n // An array that stores CVterms that have been looked up so we don't have\n // to do the database query every time.\n $cvterm_lookup = array();\n\n // empty the temp tables\n $sql = \"DELETE FROM {tripal_gff_temp}\";\n chado_query($sql);\n $sql = \"DELETE FROM {tripal_gffcds_temp}\";\n chado_query($sql);\n $sql = \"DELETE FROM {tripal_gffprotein_temp}\";\n chado_query($sql);\n\n // begin the transaction\n $transaction = null;\n if ($use_transaction) {\n $transaction = db_transaction();\n print \"\\nNOTE: Loading of this GFF file is performed using a database transaction. \\n\" .\n \"If the load fails or is terminated prematurely then the entire set of \\n\" .\n \"insertions/updates is rolled back and will not be found in the database\\n\\n\";\n }\n try {\n\n // check to see if the file is located local to Drupal\n $dfile = $_SERVER['DOCUMENT_ROOT'] . base_path() . $gff_file;\n if (!file_exists($dfile)) {\n // if not local to Drupal, the file must be someplace else, just use\n // the full path provided\n $dfile = $gff_file;\n }\n if (!file_exists($dfile)) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"Cannot find the file: %dfile\",\n array('%dfile' => $dfile));\n return 0;\n }\n\n print \"Opening $gff_file\\n\";\n\n //$lines = file($dfile,FILE_SKIP_EMPTY_LINES);\n $fh = fopen($dfile, 'r');\n if (!$fh) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"cannot open file: %dfile\",\n array('%dfile' => $dfile));\n return 0;\n }\n $filesize = filesize($dfile);\n\n // get the controlled vocaubulary that we'll be using. The\n // default is the 'sequence' ontology\n $sql = \"SELECT * FROM {cv} WHERE name = :cvname\";\n $cv = chado_query($sql, array(':cvname' => 'sequence'))->fetchObject();\n if (!$cv) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR,\n \"Cannot find the 'sequence' ontology\", array());\n return '';\n }\n // get the organism for which this GFF3 file belongs\n $sql = \"SELECT * FROM {organism} WHERE organism_id = :organism_id\";\n $organism = chado_query($sql, array(':organism_id' => $organism_id))->fetchObject();\n\n $interval = intval($filesize * 0.0001);\n if ($interval == 0) {\n $interval = 1;\n }\n $in_fasta = 0;\n $line_num = 0;\n $num_read = 0;\n $intv_read = 0;\n\n // prepare the statement used to get the cvterm for each feature.\n $sel_cvterm_sql = \"\n SELECT CVT.cvterm_id, CVT.cv_id, CVT.name, CVT.definition,\n CVT.dbxref_id, CVT.is_obsolete, CVT.is_relationshiptype\n FROM {cvterm} CVT\n INNER JOIN {cv} CV on CVT.cv_id = CV.cv_id\n LEFT JOIN {cvtermsynonym} CVTS on CVTS.cvterm_id = CVT.cvterm_id\n WHERE CV.cv_id = :cv_id and\n (lower(CVT.name) = lower(:name) or lower(CVTS.synonym) = lower(:synonym))\n \";\n\n // If a landmark type was provided then pre-retrieve that.\n if ($landmark_type) {\n $query = array(\n ':cv_id' => $cv->cv_id,\n ':name' => $landmark_type,\n ':synonym' => $landmark_type\n );\n $result = chado_query($sel_cvterm_sql, $query);\n $landmark_cvterm = $result->fetchObject();\n if (!$landmark_cvterm) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR,\n 'cannot find landmark feature type \\'%landmark_type\\'.',\n array('%landmark_type' => $landmark_type));\n return '';\n }\n }\n\n // iterate through each line of the GFF file\n print \"Parsing Line $line_num (0.00%). Memory: \" . number_format(memory_get_usage()) . \" bytes\\r\";\n while ($line = fgets($fh)) {\n $line_num++;\n $size = drupal_strlen($line);\n $num_read += $size;\n $intv_read += $size;\n\n if ($line_num < $start_line) {\n continue;\n }\n\n // update the job status every 1% features\n if ($job and $intv_read >= $interval) {\n $intv_read = 0;\n $percent = sprintf(\"%.2f\", ($num_read / $filesize) * 100);\n print \"Parsing Line $line_num (\" . $percent . \"%). Memory: \" . number_format(memory_get_usage()) . \" bytes.\\r\";\n tripal_set_job_progress($job, intval(($num_read / $filesize) * 100));\n }\n\n // check to see if we have FASTA section, if so then set the variable\n // to start parsing\n if (preg_match('/^##FASTA/i', $line)) {\n print \"Parsing FASTA portion...\\n\";\n if ($remove) {\n // we're done because this is a delete operation so break out of the loop.\n break;\n }\n tripal_feature_load_gff3_fasta($fh, $interval, $num_read, $intv_read, $line_num, $filesize, $job);\n continue;\n }\n // if the ##sequence-region line is present then we want to add a new feature\n if (preg_match('/^##sequence-region (.*?) (\\d+) (\\d+)$/i', $line, $region_matches)) {\n $rid = $region_matches[1];\n $rstart = $region_matches[2];\n $rend = $region_matches[3];\n if ($landmark_type) {\n tripal_feature_load_gff3_feature($organism, $analysis_id, $landmark_cvterm, $rid,\n $rid, '', 'f', 'f', 1, 0);\n }\n continue;\n }\n\n // skip comments\n if (preg_match('/^#/', $line)) {\n continue;\n }\n\n // skip empty lines\n if (preg_match('/^\\s*$/', $line)) {\n continue;\n }\n\n // get the columns\n $cols = explode(\"\\t\", $line);\n if (sizeof($cols) != 9) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, 'improper number of columns on line %line_num',\n array('%line_num' => $line_num));\n return '';\n }\n\n // get the column values\n $landmark = $cols[0];\n $source = $cols[1];\n $type = $cols[2];\n $start = $cols[3];\n $end = $cols[4];\n $score = $cols[5];\n $strand = $cols[6];\n $phase = $cols[7];\n $attrs = explode(\";\", $cols[8]); // split by a semicolon\n\n // ready the start and stop for chado. Chado expects these positions\n // to be zero-based, so we substract 1 from the fmin\n $fmin = $start - 1;\n $fmax = $end;\n if ($end < $start) {\n $fmin = $end - 1;\n $fmax = $start;\n }\n\n // format the strand for chado\n if (strcmp($strand, '.') == 0) {\n $strand = 0;\n }\n elseif (strcmp($strand, '+') == 0) {\n $strand = 1;\n }\n elseif (strcmp($strand, '-') == 0) {\n $strand = -1;\n }\n if (strcmp($phase, '.') == 0) {\n $phase = '';\n }\n if (array_key_exists($type, $cvterm_lookup)) {\n $cvterm = $cvterm_lookup[$type];\n }\n else {\n $result = chado_query($sel_cvterm_sql, array(':cv_id' => $cv->cv_id, ':name' => $type, ':synonym' => $type));\n $cvterm = $result->fetchObject();\n $cvterm_lookup[$type] = $cvterm;\n if (!$cvterm) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, 'cannot find feature term \\'%type\\' on line %line_num of the GFF file',\n array('%type' => $type, '%line_num' => $line_num));\n return '';\n }\n }\n\n // break apart each of the attributes\n $tags = array();\n $attr_name = '';\n $attr_uniquename = '';\n $attr_residue_info = '';\n $attr_locgroup = 0;\n $attr_fmin_partial = 'f';\n $attr_fmax_partial = 'f';\n $attr_is_obsolete = 'f';\n $attr_is_analysis = 'f';\n $attr_others = '';\n $residues = '';\n\n // the organism to which a feature belongs can be set in the GFF\n // file using the 'organism' attribute. By default we\n // set the $feature_organism variable to the default organism for the landmark\n $attr_organism = '';\n $feature_organism = $organism;\n\n foreach ($attrs as $attr) {\n $attr = rtrim($attr);\n $attr = ltrim($attr);\n if (strcmp($attr, '')==0) {\n continue;\n }\n if (!preg_match('/^[^\\=]+\\=.+$/', $attr)) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, 'Attribute is not correctly formatted on line %line_num: %attr',\n array('%line_num' => $line_num, '%attr' => $attr));\n return '';\n }\n\n // break apart each tag\n $tag = preg_split(\"/=/\", $attr, 2); // split by equals sign\n\n // multiple instances of an attribute are separated by commas\n $tag_name = $tag[0];\n if (!array_key_exists($tag_name, $tags)) {\n $tags[$tag_name] = array();\n }\n $tags[$tag_name] = array_merge($tags[$tag_name], explode(\",\", $tag[1])); // split by comma\n\n\n // replace the URL escape codes for each tag\n for ($i = 0; $i < count($tags[$tag_name]); $i++) {\n $tags[$tag_name][$i] = urldecode($tags[$tag_name][$i]);\n }\n\n // get the name and ID tags\n $skip_feature = 0; // if there is a problem with any of the attributes this variable gets set\n if (strcmp($tag_name, 'ID') == 0) {\n $attr_uniquename = urldecode($tag[1]);\n }\n elseif (strcmp($tag_name, 'Name') == 0) {\n $attr_name = urldecode($tag[1]);\n }\n elseif (strcmp($tag_name, 'organism') == 0) {\n $attr_organism = urldecode($tag[1]);\n $org_matches = array();\n if (preg_match('/^(.*?):(.*?)$/', $attr_organism, $org_matches)) {\n $values = array(\n 'genus' => $org_matches[1],\n 'species' => $org_matches[2],\n );\n $org = chado_select_record('organism', array(\"*\"), $values);\n if (count($org) == 0) {\n if ($create_organism) {\n $feature_organism = (object) chado_insert_record('organism', $values);\n if (!$feature_organism) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"Could not add the organism, '%org', from line %line. Skipping this line. \",\n array('%org' => $attr_organism, '%line' => $line_num));\n $skip_feature = 1;\n }\n }\n else {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"The organism attribute '%org' on line %line does not exist. Skipping this line. \",\n array('%org' => $attr_organism, '%line' => $line_num));\n $skip_feature = 1;\n }\n }\n else {\n // We found the organism in the database so use it.\n $feature_organism = $org[0];\n }\n }\n else {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"The organism attribute '%org' on line %line is not properly formated. It \" .\n \"should be of the form: organism=Genus:species. Skipping this line.\",\n array('%org' => $attr_organism, '%line' => $line_num));\n $skip_feature = 1;\n }\n }\n // Get the list of non-reserved attributes.\n elseif (strcmp($tag_name, 'Alias') != 0 and strcmp($tag_name, 'Parent') != 0 and\n strcmp($tag_name, 'Target') != 0 and strcmp($tag_name, 'Gap') != 0 and\n strcmp($tag_name, 'Derives_from') != 0 and strcmp($tag_name, 'Note') != 0 and\n strcmp($tag_name, 'Dbxref') != 0 and strcmp($tag_name, 'Ontology_term') != 0 and\n strcmp($tag_name, 'Is_circular') != 0 and strcmp($tag_name, 'target_organism') != 0 and\n strcmp($tag_name, 'target_type') != 0 and strcmp($tag_name, 'organism' != 0)) {\n foreach ($tags[$tag_name] as $value) {\n $attr_others[$tag_name][] = $value;\n }\n }\n }\n // If neither name nor uniquename are provided then generate one.\n if (!$attr_uniquename and !$attr_name) {\n // Check if an alternate ID field is suggested, if so, then use\n // that for the name.\n if (array_key_exists($alt_id_attr, $tags)) {\n $attr_uniquename = $tags[$alt_id_attr][0];\n $attr_name = $attr_uniquename;\n }\n // If the row has a parent then generate a uniquename using the parent name\n // add the date to the name in the event there are more than one child with\n // the same parent.\n elseif (array_key_exists('Parent', $tags)) {\n $attr_uniquename = $tags['Parent'][0] . \"-$type-$landmark-\" . $date[0] . \":\" . ($fmin + 1) . \"..\" . $fmax;\n $attr_name = $attr_uniquename;\n }\n // Generate a unique name based on the date, type and location\n // and set the name to simply be the type.\n else {\n $attr_uniquename = $date[0] . \"-$type-$landmark:\" . ($fmin + 1) . \"..\" . $fmax;\n $attr_name = $type;\n }\n }\n\n // If a name is not specified then use the unique name as the name\n if (strcmp($attr_name, '') == 0) {\n $attr_name = $attr_uniquename;\n }\n\n // If an ID attribute is not specified then we must generate a\n // unique ID. Do this by combining the attribute name with the date\n // and line number.\n if (!$attr_uniquename) {\n $attr_uniquename = $attr_name . '-' . $date[0] . '-' . $line_num;\n }\n\n // Make sure the landmark sequence exists in the database. If the user\n // has not specified a landmark type (and it's not required in the GFF\n // format) then we don't know the type of the landmark so we'll hope\n // that it's unique across all types for the orgnaism. Only do this\n // test if the landmark and the feature are different.\n if (!$remove and !(strcmp($landmark, $attr_uniquename) == 0 or strcmp($landmark, $attr_name) == 0)) {\n $select = array(\n 'organism_id' => $organism->organism_id,\n 'uniquename' => $landmark,\n );\n $columns = array('count(*) as num_landmarks');\n if ($landmark_type) {\n $select['type_id'] = array(\n 'name' => $landmark_type,\n );\n }\n $count = chado_select_record('feature', $columns, $select);\n if (!$count or count($count) == 0 or $count[0]->num_landmarks == 0) {\n // now look for the landmark using the name rather than uniquename.\n $select = array(\n 'organism_id' => $organism->organism_id,\n 'name' => $landmark,\n );\n $columns = array('count(*) as num_landmarks');\n if ($landmark_type) {\n $select['type_id'] = array(\n 'name' => $landmark_type,\n );\n }\n $count = chado_select_record('feature', $columns, $select);\n if (!$count or count($count) == 0 or $count[0]->num_landmarks == 0) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"The landmark '%landmark' cannot be found for this organism (%species) \" .\n \"Please add the landmark and then retry the import of this GFF3 \" .\n \"file\", array('%landmark' => $landmark, '%species' => $organism->genus . \" \" . $organism->species));\n return '';\n }\n elseif ($count[0]->num_landmarks > 1) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"The landmark '%landmark' has more than one entry for this organism (%species) \" .\n \"Cannot continue\", array('%landmark' => $landmark, '%species' => $organism->genus . \" \" . $organism->species));\n return '';\n }\n\n }\n if ($count[0]->num_landmarks > 1) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"The landmark '%landmark' is not unique for this organism. \" .\n \"The features cannot be associated\", array('%landmark' => $landmark));\n return '';\n }\n }\n/*\n // If the option is to remove or refresh then we want to remove\n // the feature from the database.\n if ($remove or $refresh) {\n // Next remove the feature itself.\n $sql = \"DELETE FROM {feature}\n WHERE organism_id = %d and uniquename = '%s' and type_id = %d\";\n $match = array(\n 'organism_id' => $feature_organism->organism_id,\n 'uniquename' => $attr_uniquename,\n 'type_id' => $cvterm->cvterm_id\n );\n $result = chado_delete_record('feature', $match);\n if (!$result) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"cannot delete feature %attr_uniquename\",\n array('%attr_uniquename' => $attr_uniquename));\n }\n $feature = 0;\n unset($result);\n }\n */\n // Add or update the feature and all properties.\n if ($update or $refresh or $add_only) {\n\n // Add/update the feature.\n $feature = tripal_feature_load_gff3_feature($feature_organism, $analysis_id, $cvterm,\n $attr_uniquename, $attr_name, $residues, $attr_is_analysis,\n $attr_is_obsolete, $add_only, $score);\n\n if ($feature) {\n\n // Add a record for this feature to the tripal_gff_temp table for\n // later lookup.\n $values = array(\n 'feature_id' => $feature->feature_id,\n 'organism_id' => $feature->organism_id,\n 'type_name' => $type,\n 'uniquename' => $feature->uniquename\n );\n // make sure this record doesn't already exist in oru temp table\n $results = chado_select_record('tripal_gff_temp', array('*'), $values);\n\n if (count($results) == 0) {\n $result = chado_insert_record('tripal_gff_temp', $values);\n if (!$result) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"Cound not save record in temporary table, Cannot continue.\", array());\n exit;\n }\n }\n // add/update the featureloc if the landmark and the ID are not the same\n // if they are the same then this entry in the GFF is probably a landmark identifier\n if (strcmp($landmark, $attr_uniquename) !=0 ) {\n tripal_feature_load_gff3_featureloc($feature, $organism,\n $landmark, $fmin, $fmax, $strand, $phase, $attr_fmin_partial,\n $attr_fmax_partial, $attr_residue_info, $attr_locgroup);\n }\n\n // add any aliases for this feature\n if (array_key_exists('Alias', $tags)) {\n tripal_feature_load_gff3_alias($feature, $tags['Alias']);\n }\n // add any dbxrefs for this feature\n if (array_key_exists('Dbxref', $tags)) {\n tripal_feature_load_gff3_dbxref($feature, $tags['Dbxref']);\n }\n // add any ontology terms for this feature\n if (array_key_exists('Ontology_term', $tags)) {\n tripal_feature_load_gff3_ontology($feature, $tags['Ontology_term']);\n }\n // add parent relationships\n if (array_key_exists('Parent', $tags)) {\n tripal_feature_load_gff3_parents($feature, $cvterm, $tags['Parent'],\n $feature_organism->organism_id, $strand, $phase, $fmin, $fmax);\n }\n\n // add target relationships\n if (array_key_exists('Target', $tags)) {\n tripal_feature_load_gff3_target($feature, $tags, $target_organism_id, $target_type, $create_target, $attr_locgroup);\n }\n // add gap information. This goes in simply as a property\n if (array_key_exists('Gap', $tags)) {\n foreach ($tags['Gap'] as $value) {\n tripal_feature_load_gff3_property($feature, 'Gap', $value);\n }\n }\n // add notes. This goes in simply as a property\n if (array_key_exists('Note', $tags)) {\n foreach ($tags['Note'] as $value) {\n tripal_feature_load_gff3_property($feature, 'Note', $value);\n }\n }\n // add the Derives_from relationship (e.g. polycistronic genes).\n if (array_key_exists('Derives_from', $tags)) {\n tripal_feature_load_gff3_derives_from($feature, $cvterm, $tags['Derives_from'][0],\n $feature_organism, $fmin, $fmax);\n }\n // add in the GFF3_source dbxref so that GBrowse can find the feature using the source column\n $source_ref = array('GFF_source:' . $source);\n tripal_feature_load_gff3_dbxref($feature, $source_ref);\n // add any additional attributes\n if ($attr_others) {\n foreach ($attr_others as $tag_name => $values) {\n foreach ($values as $value) {\n tripal_feature_load_gff3_property($feature, $tag_name, $value);\n }\n }\n }\n\n }\n }\n }\n\n // Do some last bit of processing.\n if (!$remove) {\n\n // First, add any protein sequences if needed.\n $sql = \"SELECT feature_id FROM {tripal_gffcds_temp} LIMIT 1 OFFSET 1\";\n $has_cds = chado_query($sql)->fetchField();\n if ($has_cds) {\n print \"\\nAdding protein sequences if CDS exist and no proteins in GFF...\\n\";\n $sql = \"\n SELECT F.feature_id, F.name, F.uniquename, TGCT.strand,\n CVT.cvterm_id, CVT.name as feature_type,\n min(TGCT.fmin) as fmin, max(TGCT.fmax) as fmax,\n TGPT.feature_id as protein_id, TGPT.fmin as protein_fmin,\n TGPT.fmax as protein_fmax\n FROM {tripal_gffcds_temp} TGCT\n INNER JOIN {feature} F on F.feature_id = TGCT.parent_id\n INNER JOIN {cvterm} CVT on CVT.cvterm_id = F.type_id\n LEFT JOIN {tripal_gffprotein_temp} TGPT on TGPT.parent_id = F.feature_id\n GROUP BY F.feature_id, F.name, F.uniquename, CVT.cvterm_id, CVT.name,\n TGPT.feature_id, TGPT.fmin, TGPT.fmax, TGCT.strand\n \";\n $results = chado_query($sql);\n $protein_cvterm = tripal_get_cvterm(array(\n 'name' => 'polypeptide',\n 'cv_id' => array(\n 'name' => 'sequence'\n )\n ));\n while ($result = $results->fetchObject()) {\n // If a protein exists with this same parent then don't add a new\n // protein.\n if (!$result->protein_id) {\n // Get details about this protein\n $uname = $result->uniquename . '-protein';\n $name = $result->name;\n $values = array(\n 'parent_id' => $result->feature_id,\n 'fmin' => $result->fmin\n );\n $min_phase = chado_select_record('tripal_gffcds_temp', array('phase'), $values);\n $values = array(\n 'parent_id' => $result->feature_id,\n 'fmax' => $result->fmax\n );\n $max_phase = chado_select_record('tripal_gffcds_temp', array('phase'), $values);\n\n $pfmin = $result->fmin;\n $pfmax = $result->fmax;\n if ($result->strand == '-1') {\n $pfmax -= $max_phase[0]->phase;\n }\n else {\n $pfmin += $min_phase[0]->phase;\n }\n\n // Add the new protein record.\n $feature = tripal_feature_load_gff3_feature($organism, $analysis_id,\n $protein_cvterm, $uname, $name, '', 'f', 'f', 1, 0);\n // Add the derives_from relationship.\n $cvterm = tripal_get_cvterm(array('cvterm_id' => $result->cvterm_id));\n tripal_feature_load_gff3_derives_from($feature, $cvterm,\n $result->uniquename, $organism, $pfmin, $pfmax);\n // Add the featureloc record. Set the start of the protein to\n // be the start of the coding sequence minus the phase.\n tripal_feature_load_gff3_featureloc($feature, $organism, $landmark,\n $pfmin, $pfmax, $strand, '', 'f', 'f', '', 0);\n }\n }\n }\n\n print \"\\nSetting ranks of children...\\n\";\n\n // Get features in a relationship that are also children of an alignment.\n $sql = \"\n SELECT DISTINCT F.feature_id, F.organism_id, F.type_id,\n F.uniquename, FL.strand\n FROM {tripal_gff_temp} TGT\n INNER JOIN {feature} F ON TGT.feature_id = F.feature_id\n INNER JOIN {feature_relationship} FR ON FR.object_id = TGT.feature_id\n INNER JOIN {cvterm} CVT ON CVT.cvterm_id = FR.type_id\n INNER JOIN {featureloc} FL ON FL.feature_id = F.feature_id\n WHERE CVT.name = 'part_of'\n \";\n $parents = chado_query($sql);\n\n // Build and prepare the SQL for selecting the children relationship.\n $sel_gffchildren_sql = \"\n SELECT DISTINCT FR.feature_relationship_id, FL.fmin, FR.rank\n FROM {feature_relationship} FR\n INNER JOIN {featureloc} FL on FL.feature_id = FR.subject_id\n INNER JOIN {cvterm} CVT on CVT.cvterm_id = FR.type_id\n WHERE FR.object_id = :feature_id AND CVT.name = 'part_of'\n ORDER BY FL.fmin ASC\n \";\n\n // Now set the rank of any parent/child relationships. The order is based\n // on the fmin. The start rank is 1. This allows features with other\n // relationships to be '0' (the default), and doesn't interfer with the\n // ordering defined here.\n $num_recs = $parents->rowCount();\n $i = 1;\n $interval = intval($num_recs * 0.0001);\n if ($interval == 0) {\n $interval = 1;\n }\n $percent = sprintf(\"%.2f\", ($i / $num_recs) * 100);\n print \"Setting $i of $num_recs (\" . $percent . \"%). Memory: \" . number_format(memory_get_usage()) . \" bytes.\\r\";\n\n while ($parent = $parents->fetchObject()) {\n\n if ($i % $interval == 0) {\n $percent = sprintf(\"%.2f\", ($i / $num_recs) * 100);\n print \"Setting $i of $num_recs (\" . $percent . \"%). Memory: \" . number_format(memory_get_usage()) . \" bytes.\\r\";\n }\n\n // get the children\n $result = chado_query($sel_gffchildren_sql, array(':feature_id' => $parent->feature_id));\n\n // build an array of the children\n $children = array();\n while ($child = $result->fetchObject()) {\n $children[] = $child;\n }\n\n // the children list comes sorted in ascending fmin\n // but if the parent is on the reverse strand we need to\n // reverse the order of the children.\n if ($parent->strand == -1) {\n arsort($children);\n }\n\n // first set the ranks to a negative number so that we don't\n // get a duplicate error message when we try to change any of them\n $rank = -1;\n foreach ($children as $child) {\n $match = array('feature_relationship_id' => $child->feature_relationship_id);\n $values = array('rank' => $rank);\n chado_update_record('feature_relationship', $match, $values);\n $rank--;\n }\n // now set the rank correctly. The rank should start at 0.\n $rank = 0;\n foreach ($children as $child) {\n $match = array('feature_relationship_id' => $child->feature_relationship_id);\n $values = array('rank' => $rank);\n //print \"Was: \" . $child->rank . \" now $rank ($parent->strand)\\n\" ;\n chado_update_record('feature_relationship', $match, $values);\n $rank++;\n }\n $i++;\n }\n }\n }\n catch (Exception $e) {\n print \"\\n\"; // make sure we start errors on new line\n if ($use_transaction) {\n $transaction->rollback();\n print \"FAILED: Rolling back database changes...\\n\";\n }\n else {\n print \"FAILED\\n\";\n }\n watchdog_exception('tripal_feature', $e);\n return 0;\n }\n\n print \"\\nDone\\n\";\n return 1;\n}", "public function feature_indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('PasaRequirementBundle:Feature')->findAll();\n\n return array('entities' => $entities);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation searchFoldersAsync Search Folders
public function searchFoldersAsync($fields = null, $page = null, $per_page = null, $limit = null, $offset = null, $sorts = null, $name = null, $id = null, $parent_id = null, $creator_id = null, $filter_or = null) { return $this->searchFoldersAsyncWithHttpInfo($fields, $page, $per_page, $limit, $offset, $sorts, $name, $id, $parent_id, $creator_id, $filter_or) ->then( function ($response) { return $response[0]; } ); }
[ "public function searchFoldersAsync($fields = null, $page = null, $per_page = null, $limit = null, $offset = null, $sorts = null, $name = null, $id = null, $parent_id = null, $creator_id = null, $filter_or = null, $is_shared_root = null)\n {\n return $this->searchFoldersAsyncWithHttpInfo($fields, $page, $per_page, $limit, $offset, $sorts, $name, $id, $parent_id, $creator_id, $filter_or, $is_shared_root)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getAllFolders();", "public function listFolders();", "public function searchFoldersApi()\n {\n return new SearchFoldersApi($this->configuration);\n }", "function getSearchFolder();", "public function search_folder( $folder = null ) {\n\t\tif ( is_null( $folder ) ) {\n\t\t\t$folder = home_url();\n\t\t\t$folder = str_replace( 'http://', '', $folder );\n\t\t\t$folder = str_replace( 'https://', '', $folder );\n\t\t\t$folder = sanitize_key( $folder );\n\t\t}\n\n\t\t$service = new Google_Service_Drive( $this->_google_drive_cdn->get_google_client() );\n\n\t\ttry {\n\t\t\t$files = $service->files->listFiles( array( 'q' => \"'root' in parents\" ) );\n\t\t} catch ( Exception $e ) {\n\t\t\t$this->_google_drive_cdn->set_error( $e->getMessage() . '(wpbgdc: search_folder 0)', false );\n\t\t}\n\n\n\t\t// Searching for the folder\n\t\tif ( isset( $files->items ) && is_array( $files->items ) ) {\n\t\t\tforeach ( $files->items as $file ) {\n\t\t\t\tif ( ! $file instanceof Google_Service_Drive_DriveFile ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Folder found\n\t\t\t\tif ( $folder == $file->getTitle() ) {\n\t\t\t\t\t// set the folder id\n\t\t\t\t\tWPB_Google_Drive_Cdn_Settings::set_setting( 'folder_id', $file->getId(), 'wpbgdc_folders' );\n\n\t\t\t\t\t// set the folder name\n\t\t\t\t\tWPB_Google_Drive_Cdn_Settings::set_setting( 'folder_name', $folder, 'wpbgdc_folders' );\n\n\t\t\t\t\t// set permissions to the folder if it exists\n\t\t\t\t\t$permission = new Google_Service_Drive_Permission();\n\t\t\t\t\t$permission->setValue( '' );\n\t\t\t\t\t$permission->setType( 'anyone' );\n\t\t\t\t\t$permission->setRole( 'reader' );\n\n\t\t\t\t\t// untrash a file if it has been trashed\n\t\t\t\t\tif ( $file->getExplicitlyTrashed() ) {\n\t\t\t\t\t\t$service->files->untrash( $file->getId() );\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$service->permissions->insert( $file->getId(), $permission );\n\t\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\t\t$this->_google_drive_cdn->set_error( $e->getMessage() . '(wpbgdc: search_folder 1)', false );\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// get the file infos to grab the webViewLink value\n\t\t\t\t\t\t$file_info = $service->files->get( $file->getId() );\n\t\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\t\t$this->_google_drive_cdn->set_error( $e->getMessage() . '(wpbgdc: search_folder 2)', false );\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// set the webViewLink value\n\t\t\t\t\tWPB_Google_Drive_Cdn_Settings::set_setting( 'folder_link', $file_info->webViewLink, 'wpbgdc_folders' );\n\t\t\t\t\treturn $file->getId();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn $this->create_folder( $folder );\n\t}", "function ajax_getFolders ($_searchStringLength=2, $_returnList=false, $_mailaccountToSearch=null, $_noPrefixId=false)\n\t{\n\t\t$mailCompose = new mail_compose();\n\t\tif ($_REQUEST['noPrefixId']) $_noPrefixId = $_REQUEST['noPrefixId'];\n\t\t$mailCompose->ajax_searchFolder($_searchStringLength, $_returnList, $_mailaccountToSearch, $_noPrefixId);\n\t}", "public function SearchFolder($arrayData) {\n\n $searchArg = new ECNSearchArguments('Folder');\n\n foreach ($arrayData as $k => $v) {\n $searchArg->AddCriteria($k, $v);\n }\n\n $searchArg = $searchArg->ToSearchCriteriaArray();\n $params = array('SearchCriteria' => $searchArg);\n\n //get & post should work\n return parent::execute('search/folder', $params, 'POST');\n }", "public function getAllFolders()\n {\n $qb = $this->getEntityManager()->createQueryBuilder();\n $results = $qb->select('f.id, f.name')->distinct(true)\n ->from('P5\\Model\\Folder', 'f')\n ->join('P5\\Model\\Document', 'd', 'WITH', 'd.folder=f')\n ->getQuery()->getArrayResult();\n\n return $results;\n }", "public function getFolders();", "public function listFolders()\n {\n return $this->_driver->listFolders();\n }", "public static function getFolders(): array {\n $folders = [];\n\n foreach (self::get()->searchFolders as $f => $appendRoot) {\n if ($appendRoot === true) {\n $folders[] = self::get()->getRoot().$f;\n } else {\n $folders[] = $f;\n }\n }\n\n return $folders;\n }", "public function getAllFolders() {\n $foldersFilter = array(\n 'maxResults'=> '1000',\n 'q' => 'mimeType = \"application/vnd.google-apps.folder\" and trashed=false'\n );\n $folders = $this->retrieveFilesFromDrive($foldersFilter);\n return $folders;\n }", "public static function getFolders() {\n $folders = [];\n\n foreach (self::get()->searchFolders as $f => $appendRoot) {\n if ($appendRoot === true) {\n $folders[] = self::get()->getRoot().$f;\n } else {\n $folders[] = $f;\n }\n }\n\n return $folders;\n }", "public function fetchFolderList()\n {\n $client = new Client($this->getUrl());\n $args = array(\n 'sid' => new Value($this->getSid()),\n );\n\n $response = $client->send(new Request('folder.list', array(new Value($args, \"struct\"))));\n $response = json_decode(json_encode($response), true);\n if (isset($response['val']['me']['struct']['folders']['me']['array'])) {\n return array_combine(\n array_map(function($o) {\n return $o['me']['struct']['id']['me']['int'];\n }, $response['val']['me']['struct']['folders']['me']['array']),\n array_map(function($o) {\n return $o['me']['struct']['name']['me']['string'];\n }, $response['val']['me']['struct']['folders']['me']['array'])\n );\n } else {\n return false;\n }\n }", "function list_folders() {\n\n\t\t$parameters = array();\n\t\t$parameters['format'] = $this->format;\n\t\t$request = $this->oAuthRequest($this->host . \"folders/list\", 'POST', $parameters);\t\t\t\t\n\t\t$folders = $this->maybe_decode($request);\n\t\treturn $folders;\n\t\n\t}", "public function folderChildrenSearchRequest($folder_id, $fields = null, $sorts = null, $name = null)\n {\n // verify the required parameter 'folder_id' is set\n if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $folder_id when calling folderChildrenSearch'\n );\n }\n\n $resourcePath = '/folders/{folder_id}/children/search';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($fields !== null) {\n if('form' === 'form' && is_array($fields)) {\n foreach($fields as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['fields'] = $fields;\n }\n }\n // query params\n if ($sorts !== null) {\n if('form' === 'form' && is_array($sorts)) {\n foreach($sorts as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['sorts'] = $sorts;\n }\n }\n // query params\n if ($name !== null) {\n if('form' === 'form' && is_array($name)) {\n foreach($name as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['name'] = $name;\n }\n }\n\n\n // path params\n if ($folder_id !== null) {\n $resourcePath = str_replace(\n '{' . 'folder_id' . '}',\n ObjectSerializer::toPathValue($folder_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function listFolders() {\n \n $listFolder = $this->execCmd('LIST \"*\" \"*\"');\n if(empty($listFolder)) {\n // Using another method to list\n $listFolder = $this->execCmd('LIST \"\" \"%\"');\n }\n \n // Get mailboxes proprely\n preg_match_all('/\\* LIST \\((.*?)\\) \"(.*?)\" \"(.*?)\"(?:\\r\\n)/iu', $listFolder, $listFolderArr);\n \n // Transform into an array \n $listFolderMatches = [];\n foreach($listFolderArr[3] as $folderID => $folderName) {\n if(preg_match('/HasChildren/iu', $listFolderArr[1][$folderID])) {\n continue;\n }\n $listFolderMatches[$folderID] = $folderName;\n }\n \n return $listFolderMatches;\n }", "public function getAllFolders()\r\n {\r\n return $this->orderBy('order_number', 'asc')->get();\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
echo "try updateAllRecordsRecursivelyAfterUpdateAssembly($objectID, $droleID, $objectName, $isNeedUpdateAssembly)";
public static function updateAllRecordsRecursivelyAfterUpdateAssembly($objectID, $droleID, $objectName, $isNeedUpdateAssembly = true) { if ($isNeedUpdateAssembly) { StructureOperationHandler::updateAllAssembliesInObjectWithField($objectID, $droleID, $objectName, false, $typeOperation = 0); } //update all records that have this transaction $arrayOfRecords = self::getRecordInCurrentObjectForAllAssemblies($objectID, $droleID, $objectName); //echo " - data array: " . print_r($arrayOfRecords->getModels(), true) . " - "; if ($arrayOfRecords->getModels()) { $fastStructure = json_decode(StructureOperationHandler::getFastStructureWithCheck($objectID, $droleID), true); foreach ($arrayOfRecords->getModels() as $dataRecord) { $newFastData = self::getJsonDataFromJsonStructureArray($objectID, $droleID, $dataRecord['record_id'], $fastStructure); self::deleteFastRecord($objectID, $dataRecord['record_id'], $droleID); self::setFastRecord($objectID, $droleID, $dataRecord['record_id'], $newFastData); $nextLevelOfRecords = self::getListWhereUseCurrentRecordFromImplementedRecords($objectName, $dataRecord['record_id']); if (!$nextLevelOfRecords || !$nextLevelOfRecords->getModels()) { return false; } else { $nextLevelOfRecords = $nextLevelOfRecords->getModels(); } foreach ($nextLevelOfRecords as $implementedTokenRecord) { self::recursiveUpdateFastDataUse($objectID, $dataRecord['record_id'], $implementedTokenRecord); } } } }
[ "private static function updateAllUsefulAssemblyConstructionsForAll($objectID, $droleID, $assemblyID, $objectName)\n {\n echo \"[try update all assemblyes]\";\n $currentAssemblyStructureArray = self::getFastStructureForAssemblyWithCheck(\n $objectID, $droleID, $assemblyID, $objectName);\n /*$droleID = DynamicRoleModel::getDroleForAssembly($objectID, $assemblyID);\n if (!$droleID) {\n return false;\n } else {\n $droleID = $droleID['drole_id'];\n }*/\n $arrayOfParentAssemblyes = self::selectFirstLineIncomingObjectInAssemblies($objectID, $objectName, $droleID);\n if (!$arrayOfParentAssemblyes) {\n return false;\n }\n if (!$currentAssemblyStructureArray || count($currentAssemblyStructureArray) < 1) {\n $currentAssemblyStructureArray = \"false\";\n }\n foreach ($arrayOfParentAssemblyes as $assemblyRecord) {\n //update structure\n $currentObjectName = $assemblyRecord['object_name'];\n $sql = \"update \" . $currentObjectName . \"_structure_use_fast set json_structure = jsonb_set(json_structure, '{\" . $assemblyRecord['indexpos'] . \", nested}', '\" . $currentAssemblyStructureArray .\n \"', false) where assembly_id = '\" . $assemblyRecord['assembly_id'] . \"'\";\n \\Yii::$app->db->createCommand($sql)->execute();\n //self::updateAllUsefulAssemblyConstructionsForAll($assemblyRecord['object_id'], $droleID, $assemblyRecord['assembly_id'], $currentObjectName);\n }\n StructureUpdate::updateStructuresByInnerObjects($objectID, $objectName, $droleID, true, true);\n return true;\n }", "public static function setNewDataUseFastRecordsForAssembly($objectID, $objectName, $assemblyID, $droleForAssembly, $structureAssemblyDrole)\n {\n //update all records that have this transaction\n //$arrayOfRecords = self::getAllRecordForAssembly($objectID, $objectName, $assemblyID);\n if (!is_array($structureAssemblyDrole)) {\n $structureAssemblyDrole = json_decode($structureAssemblyDrole, true);\n }\n //echo json_encode($structureAssemblyDrole);\n self::updateAllFieldsForAssembly($objectID, $objectName, $assemblyID, $droleForAssembly, $structureAssemblyDrole);\n /*echo \" - data array: \" . json_encode($arrayOfRecords) . \" - \";\n exit;\n if ($arrayOfRecords) {\n $fastStructure = json_decode(StructureOperationHandler::getFastStructureForAssemblyWithCheck($objectID, $droleForAssembly, $assemblyID, $objectName), true);\n foreach ($arrayOfRecords as $dataRecord) {\n $newFastData = self::getJsonDataFromJsonStructureArray($objectID, $droleForAssembly, $dataRecord['record_id'], $fastStructure);\n self::deleteFastRecord($objectID, $dataRecord['record_id'], $droleForAssembly);\n self::setFastRecord($objectID, $droleForAssembly, $dataRecord['record_id'], $newFastData);\n $nextLevelOfRecords = self::getListWhereUseCurrentRecordFromImplementedRecords($objectName, $dataRecord['record_id']);\n if (!$nextLevelOfRecords || !$nextLevelOfRecords->getModels()) {\n continue;\n } else {\n $nextLevelOfRecords = $nextLevelOfRecords->getModels();\n }\n foreach ($nextLevelOfRecords as $implementedTokenRecord) {\n self::recursiveUpdateFastDataUse($objectID, $dataRecord['record_id'], $implementedTokenRecord);\n }\n }\n }*/\n }", "public function testUpdateEmployeeRole()\n {\n\n }", "public function testUpdateResellerChild()\n {\n }", "public function testUpdateChildDomain()\n {\n }", "public function testUpdate2()\n {\n }", "public function testUpdateLinkedAccount()\n {\n\n }", "function actualizarsoloparesnulosin($idkardex,$talla,$cantidad1,$iddetalleingreso,$idmodelodetalle,$return = false ){\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n $sqlA[] = \"UPDATE historialkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla' and idperiodo='3';\";\n\n//MostrarConsulta($sqlA);\n ejecutarConsultaSQLBeginCommit($sqlA);\n}", "function updateSubFoldersTable($path,$cDate) {\n $bindV = array(\n 'cdate' => $cDate,\n 'status' => \"COMMITTED\",\n 'path' => $path\n );\n $form_fields = array(\n 'query' => \"update webutility.wzde_files set commitdate = :cdate, status = :status where path like :path\",\n 'bindV' => $bindV,\n );\n \n $query=$form_fields['query'];\n $bindV=$form_fields['bindV'];\n \n $database = new mysql_pdo();\n \n $database->query($query);\n \n foreach ($bindV as $key=>$val) {\n $database->bind(':'.$key, $val);\n }\n $database->execute(); \n\n //false equal no error\n if (!$database->getLastError()==='00000'){\n return json_encode($database->getLastError());\n }\n else {\n return false;\n }\n}", "function update_reporting_table($path, $criteria) {\n global $DB, $ReportingTimestamp;\n $diag = true;\n foreach ($criteria as $name => $value) {\n $record = new stdClass();\n $record->object = 'node';\n $record->objectid = $path;\n $record->name = $name;\n $record->value = $value;\n $record->timecreated = $ReportingTimestamp;\n $lastinsertid = $DB->insert_record('report_up1reporting', $record, false);\n if ( ! $lastinsertid) {\n $diag = false;\n echo \"Error inserting \" . print_r($record, true);\n }\n }\n return $diag;\n}", "function _mash_log_update_sql($ret) {\n if (sizeof($ret)) {\n foreach ($ret as $info) {\n if (is_array($info)) {\n if (!$info['success']) {\n mash_set_error('MAGENTO_UPDATE_FAILED', $info['query']);\n }\n else {\n mash_log($info['query'], ($info['success']) ? 'success' : 'error');\n }\n }\n }\n }\n}", "public function testUpdateLead()\n {\n\n }", "function update_record($table, $dataobject) {\n\n global $db, $CFG;\n\n if (! isset($dataobject->ident) ) {\n return false;\n }\n\n static $table_columns;\n \n // Determine all the fields in the table\n if (is_array($table_columns) && array_key_exists($table,$table_columns)) {\n $columns = $table_columns[$table];\n } else {\n if (!$columns = $db->MetaColumns($CFG->prefix . $table)) {\n return false;\n }\n $table_columns[$table] = $columns;\n }\n\n $data = (array)$dataobject;\n $ddd = array();\n\n if (defined('ELGG_PERFDB')) { global $PERF ; $PERF->dbqueries++; };\n\n // Pull out data matching these fields\n foreach ($columns as $column) {\n if ($column->name <> 'ident' and isset($data[$column->name]) ) {\n $ddd[$column->name] = $data[$column->name];\n }\n }\n\n // Construct SQL queries\n $numddd = count($ddd);\n $count = 0;\n $update = '';\n\n foreach ($ddd as $key => $value) {\n $count++;\n $update .= $key .' = ?'; \n if ($count < $numddd) {\n $update .= ', ';\n }\n }\n\n $stmt = $db->Prepare('UPDATE '. $CFG->prefix . $table .' SET '. $update .' WHERE ident = \\''. $dataobject->ident .'\\'');\n if ($rs = $db->Execute($stmt,$ddd)) {\n elggcache_delete($table, \"ident_\" . $dataobject->ident);\n return true;\n } else {\n if (isset($CFG->debug) and $CFG->debug > 7) {\n notify($db->ErrorMsg() .'<br /><br />UPDATE '. $CFG->prefix . $table .' SET '. $update .' WHERE ident = \\''. $dataobject->ident .'\\'');\n }\n if (!empty($CFG->dblogerror)) {\n $debug = debug_backtrace();\n foreach ($debug as $d) {\n if (strpos($d['file'],'datalib') === false) {\n error_log(\"SQL \".$db->ErrorMsg().\" in {$d['file']} on line {$d['line']}. STATEMENT: UPDATE $CFG->prefix$table SET $update WHERE ident = '$dataobject->ident'\");\n break;\n }\n }\n }\n return false;\n }\n}", "function ciniki_customers_relationshipUpdate(&$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 'customer_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Customer'), \n 'relationship_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Relationship'), \n 'relationship_type'=>array('required'=>'no', 'blank'=>'no', \n 'validlist'=>array('10','-10','11','30', '40', '41', '-41', '42', '-42', '43', '-43', '44', '45', '46', '47'), \n 'name'=>'Relationship Type'), \n 'related_id'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Related Customer'), \n 'date_started'=>array('required'=>'no', 'type'=>'date', 'blank'=>'yes', 'name'=>'Date Started'), \n 'date_ended'=>array('required'=>'no', 'type'=>'date', 'blank'=>'yes', 'name'=>'Date Ended'), \n 'notes'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Notes'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'checkAccess');\n $rc = ciniki_customers_checkAccess($ciniki, $args['tnid'], 'ciniki.customers.relationshipUpdate', $args['customer_id']); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.customers');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n\n //\n // Get the relationship types\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'getRelationshipTypes');\n $rc = ciniki_customers_getRelationshipTypes($ciniki, $args['tnid']); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n $relationship_types = $rc['types'];\n\n //\n // Check if customer_id and related_id were passed\n //\n $strsql = \"SELECT customer_id, relationship_type, related_id FROM ciniki_customer_relationships \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $args['relationship_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.customers', 'relationship');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.135', 'msg'=>'Unable to get existing relationship information', 'err'=>$rc['err']));\n }\n if( !isset($rc['relationship']) || !isset($rc['relationship']['related_id'])) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.136', 'msg'=>'Unable to get existing relationship information'));\n }\n $org_related_id = $rc['relationship']['related_id'];\n $org_relationship_type = $rc['relationship']['relationship_type'];\n $org_customer_id = $rc['relationship']['customer_id'];\n\n //\n // Check if the original was reversed for the specified customer\n //\n if( $args['customer_id'] == $org_related_id ) {\n //\n // This is how the relationship was returned throught the API via relationshipGet\n //\n $sent_customer_id = $org_related_id;\n $sent_related_id = $org_customer_id;\n // Check if negative relationship_type exists\n if( isset($relationship_types[-$org_relationship_type]) ) {\n $sent_relationship_type = -$org_relationship_type;\n } else {\n $sent_relationship_type = $org_relationship_type;\n }\n } else {\n $sent_customer_id = $org_customer_id;\n $sent_relationship_type = $org_relationship_type;\n $sent_related_id = $org_related_id;\n }\n\n if( !isset($args['related_id']) ) {\n $args['related_id'] = $sent_related_id;\n }\n if( !isset($args['relationship_type']) ) {\n $args['relationship_type'] = $sent_relationship_type;\n }\n\n //\n // Check if relationship should be flipped\n //\n if( isset($args['relationship_type']) && $args['relationship_type'] < 0 ) {\n $args['relationship_type'] = -$args['relationship_type'];\n $id = $args['customer_id'];\n $args['customer_id'] = $args['related_id'];\n $args['related_id'] = $id;\n }\n\n //\n // Update the relationship information\n //\n $strsql = \"UPDATE ciniki_customer_relationships SET last_updated = UTC_TIMESTAMP()\";\n \n if( isset($args['customer_id']) && $args['customer_id'] != $org_customer_id ) {\n $strsql .= \", customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \";\n $rc = ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.customers', 'ciniki_customer_history', $args['tnid'], \n 2, 'ciniki_customer_relationships', $args['relationship_id'], 'customer_id', $args['customer_id']);\n }\n if( isset($args['relationship_type']) && $args['relationship_type'] != $sent_relationship_type ) {\n $strsql .= \", relationship_type = '\" . ciniki_core_dbQuote($ciniki, $args['relationship_type']) . \"' \";\n $rc = ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.customers', 'ciniki_customer_history', $args['tnid'], \n 2, 'ciniki_customer_relationships', $args['relationship_id'], 'relationship_type', $args['relationship_type']);\n }\n if( isset($args['related_id']) && $args['related_id'] != $org_related_id ) {\n $strsql .= \", related_id = '\" . ciniki_core_dbQuote($ciniki, $args['related_id']) . \"' \";\n $rc = ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.customers', 'ciniki_customer_history', $args['tnid'], \n 2, 'ciniki_customer_relationships', $args['relationship_id'], 'related_id', $args['related_id']);\n }\n\n //\n // Add all the fields to the change log\n //\n $changelog_fields = array(\n 'date_started',\n 'date_ended',\n 'notes',\n );\n foreach($changelog_fields as $field) {\n if( isset($args[$field]) ) {\n $strsql .= \", $field = '\" . ciniki_core_dbQuote($ciniki, $args[$field]) . \"' \";\n $rc = ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.customers', 'ciniki_customer_history', $args['tnid'], \n 2, 'ciniki_customer_relationships', $args['relationship_id'], $field, $args[$field]);\n }\n }\n $strsql .= \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $args['relationship_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.customers');\n if( $rc['stat'] != 'ok' ) { \n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n if( !isset($rc['num_affected_rows']) || $rc['num_affected_rows'] != 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.137', 'msg'=>'Unable to add customer'));\n }\n\n //\n // Update the customer last_updated date\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTouch');\n $rc = ciniki_core_dbTouch($ciniki, 'ciniki.customers', 'ciniki_customers', 'id', $org_customer_id);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.138', 'msg'=>'Unable to update customer', 'err'=>$rc['err']));\n }\n \n if( $org_customer_id != $args['customer_id'] ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTouch');\n $rc = ciniki_core_dbTouch($ciniki, 'ciniki.customers', 'ciniki_customers', 'id', $args['customer_id']);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.139', 'msg'=>'Unable to update customer', 'err'=>$rc['err']));\n }\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.customers');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'customers');\n\n $ciniki['syncqueue'][] = array('push'=>'ciniki.customers.relationship', 'args'=>array('id'=>$args['relationship_id']));\n\n return array('stat'=>'ok');\n}", "public function actualizarFamiliares($ced,$parentesco,$nombres,$cedula,$edad,$porcentaje_pension){\n // return $act->getResult();\n $act=\"UPDATE `familiares` SET `parentesco`='$parentesco', `nombres`='$nombres', `cedula`='$cedula', `edad`='$edad', `porcentaje_pension`='$porcentaje_pension' WHERE `cedula`='$cedula' AND cedulamilitar='$ced'\";\n\t\t$this->db->query($act);\n \n}", "public function actionAddparentguardianname(){\n// $connection = Yii::$app->getDb();\n// \n// $command = $connection->createCommand($sql);\n// \n// if($command->execute()){\n// echo 'Executed. ';\n// }\n// else{\n// echo 'Could not execute';\n// } \n }", "public function testUpdatePayrun()\n {\n }", "function blended_restore_mods($mod,$restore) {\n\n global $CFG;\n\n $status = true;\n\n //Get record from backup_ids\n $data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);\n\n if ($data) {\n //Now get completed xmlized object \n $info = $data->info;\n\n //traverse_xmlize($info); //Debug\n //print_object ($GLOBALS['traverse_array']); //Debug\n //$GLOBALS['traverse_array']=\"\"; //Debug\n // if necessary, write to restorelog and adjust date/time fields\n if ($restore->course_startdateoffset) {\n restore_log_date_changes('Blended', $restore, $info['MOD']['#'], array('TIMEOPEN', 'TIMECLOSE'));\n }\n //Now, build the BLENDED record structure\n $blended->course = $restore->course_id;\n $blended->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);\n $blended->description = backup_todb($info['MOD']['#']['DESCRIPTION']['0']['#']);\n $blended->idmethod = backup_todb($info['MOD']['#']['IDMETHOD']['0']['#']);\n $blended->idtype = backup_todb($info['MOD']['#']['IDTYPE']['0']['#']);\n $blended->codebartype = backup_todb($info['MOD']['#']['CODEBARTYPE']['0']['#']);\n $blended->lengthuserinfo = backup_todb($info['MOD']['#']['LENGTHUSERINFO']['0']['#']);\n $blended->teammethod= backup_todb($info['MOD']['#']['TEAMMETHOD']['0']['#']);\n $blended->numteams = backup_todb($info['MOD']['#']['NUMTEAMS']['0']['#']);\n $blended->nummembers = backup_todb($info['MOD']['#']['MUMMEMBERS']['0']['#']);\n $blended->assignment = backup_todb($info['MOD']['#']['ASSIGNMENT']['0']['#']);\n $blended->randomkey= backup_todb($info['MOD']['#']['RANDOMKEY']['0']['#']);\n \n\n //The structure is equal to the db, so insert the chat\n $newid = insert_record (\"blended\",$blended);\n\n //Do some output \n if (!defined('RESTORE_SILENTLY')) {\n echo \"<li>\".get_string(\"modulename\",\"chat\").\" \\\"\".format_string(stripslashes($blended->name),true).\"\\\"</li>\";\n }\n backup_flush(300);\n\n if ($newid) {\n //We have the newid, update backup_ids\n backup_putid($restore->backup_unique_code,$mod->modtype,\n $mod->id, $newid);\n //Now check if want to restore user data and do it.\n if (restore_userdata_selected($restore,'blended',$mod->id)) {\n //Restore chat_messages\n $status = blended_jobs_restore_mods ($newid,$info,$restore);\n }\n } else {\n $status = false;\n }\n } else {\n $status = false;\n }\n\n return $status;\n }", "function test_DynamicDBnested()\n {\n $tree =& $this->getDynamicDBnested();\n $this->_testPath($tree);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to delete a Operacion entity.
private function createDeleteForm(Operacion $operacion) { return $this->createFormBuilder() ->setAction($this->generateUrl('operacion_delete', array('id' => $operacion->getId()))) ->setMethod('DELETE') ->getForm() ; }
[ "private function createDeleteForm(Pagos $pago)\n {\n \n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pagos_delete', array('id' => $pago->getIdpagos())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n \n }", "private function createDeleteForm(Gastosoperativos $gastosoperativo)\n {\n \n return $this->createFormBuilder()\n ->setAction($this->generateUrl('gastosoperativos_delete', array('id' => $gastosoperativo->getIdgastosoperativos())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n \n }", "private function createDeleteForm(Informacion $informacion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('informacion_delete', array('id' => $informacion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(DatPeriodos $datPeriodo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('datperiodos_delete', array('id' => $datPeriodo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('box_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Funcionaros $funcionaro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('funcionaros_delete', array('idfuncionaros' => $funcionaro->getIdfuncionaros())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm( OrdenDePago $ordenDePago ) {\n\t\treturn $this->createFormBuilder()\n\t\t ->set( $this->generateUrl( 'orden_de_pago_delete', array( 'id' => $ordenDePago->getId() ) ) )\n\t\t ->setMethod( 'DELETE' )\n\t\t ->getForm();\n\t}", "private function createDeleteForm(Exposicion $exposicion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('exposicion_delete', array('id' => $exposicion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(OperatingSystem $operatingSystem)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('operatingsystem_delete', array('id' => $operatingSystem->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Prometeo $prometeo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('prometeo_delete', array('id' => $prometeo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm( PromocionCalendario $promocionCalendario ) {\n\t\treturn $this->createFormBuilder()\n\t\t ->setAction( $this->generateUrl( 'promocion_calendario_delete',\n\t\t\t array( 'id' => $promocionCalendario->getId() ) ) )\n\t\t ->setMethod( 'DELETE' )\n\t\t ->getForm();\n\t}", "private function createDeleteForm(Comprimido $comprimido)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('comprimido_delete', array('id' => $comprimido->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Operations $Operations)\r\n {\r\n return $this->createFormBuilder()\r\n ->add('submit', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\SubmitType', array('label' =>'backend.delete', 'attr' => array('class' => 'btn btn-sm btn-danger flat')))\r\n ->setAction($this->generateUrl('operations_delete', array('id' => $Operations->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Documento $documento) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('documento_crud_delete', array('id' => $documento->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ConfNatureOperation $confNatureOperation)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('natureoperation_delete', array('id' => $confNatureOperation->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Otros $otros)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('otros_delete', array('id' => $otros->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(FormularioEvaluacion $formularioEvaluacion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_formularioevaluacion_delete', array('id' => $formularioEvaluacion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Modepaiement $modepaiement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('modepaiement_delete', array('id' => $modepaiement->getIdpaiement())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method called to associate a ChildCMDPiece object to this object through the ChildCMDPiece foreign key attribute.
public function addCMDPiece(ChildCMDPiece $l) { if ($this->collCMDPieces === null) { $this->initCMDPieces(); $this->collCMDPiecesPartial = true; } if (!$this->collCMDPieces->contains($l)) { $this->doAddCMDPiece($l); } return $this; }
[ "public function setPieceID($pieceID)\n {\n $this->pieceID = $pieceID;\n return $this;\n }", "function addChild($key, IBabylonModel $child) : IBabylonModel;", "public function addChild( RedBean_OODBBean $parent, RedBean_OODBBean $child ) {\n\n\t\t\t//get a database\n\t\t\t$db = $this->db;\n\n\t\t\t//first we check the beans whether they are valid\n\t\t\t$parent = $this->checkBeanForAssoc($parent);\n\t\t\t$child = $this->checkBeanForAssoc($child);\n\n\t\t\t$this->openBean( $parent, true );\n\t\t\t$this->openBean( $child, true );\n\n\n\t\t\t//are parent and child of the same type?\n\t\t\tif ($parent->type !== $child->type) {\n\t\t\t\tthrow new RedBean_Exception_InvalidParentChildCombination();\n\t\t\t}\n\n\t\t\t$pid = intval($parent->id);\n\t\t\t$cid = intval($child->id);\n\n\t\t\t//infer the association table\n\t\t\t$assoctable = \"pc_\".$db->escape($parent->type.\"_\".$parent->type);\n\n\t\t\t//check whether this assoctable already exists\n\t\t\tif (!$this->frozen) {\n\t\t\t\t$alltables = $this->showTables();\n\t\t\t\tif (!in_array($assoctable, $alltables)) {\n\t\t\t\t\t//no assoc table does not exist, create it..\n\t\t\t\t\t$assoccreateSQL = $this->writer->getQuery(\"create_tree\",array(\n\t\t\t\t\t\t\"engine\"=>$this->engine,\n\t\t\t\t\t\t\"assoctable\"=>$assoctable\n\t\t\t\t\t));\n\t\t\t\t\t$db->exec( $assoccreateSQL );\n\t\t\t\t\t//add a unique constraint\n\t\t\t\t\t$db->exec( $this->writer->getQuery(\"unique\", array(\n\t\t\t\t\t\t\"assoctable\"=>$assoctable\n\t\t\t\t\t)) );\n\t\t\t\t\t$this->addTable( $assoctable );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//now insert the association record\n\t\t\t$assocSQL = $this->writer->getQuery(\"add_child\",array(\n\t\t\t\t\"assoctable\"=>$assoctable,\n\t\t\t\t\"pid\"=>$pid,\n\t\t\t\t\"cid\"=>$cid\n\t\t\t));\n\t\t\t$db->exec( $assocSQL );\n\n\t\t}", "public function addPiece(Piece $piece) {\n $this->pieces[] = $piece;\n }", "function add_child(&$child, $server_id)\r\n\t{\r\n\t\t$child->parent = &$this;\r\n\t\t$child->id = $server_id;\r\n\t\t$this->children[$server_id] = &$child;\r\n\t}", "function addChild($parent_id, $child_id){\n $parent = getSketchObject($parent_id);\n if(!in_array($child_id, $parent['child'])){\n array_push($parent['child'], $child_id);\n }\n\n saveSketch($parent);\n}", "public function addChildCommand(AbstractCommand $command)\n {\n $this->childCommands[$command->getArgument()] = $command;\n }", "private function injectChildCommand($childCommandId, $parentCommandId, ContainerBuilder $container)\n {\n $container->getDefinition($parentCommandId)->addMethodCall('addChildCommand', [new Reference($childCommandId)]);\n }", "private function addChildMetric($childMetricId, ConsoleIo $io)\n {\n $childMetric = $this->metricsTable->get($childMetricId);\n if (!$this->context) {\n $this->context = $childMetric->context;\n }\n $this->metricsTable->patchEntity($childMetric, ['parent_id' => $this->parentMetricId]);\n $errors = $childMetric->getErrors();\n $passesRules = $this->metricsTable->checkRules($childMetric, 'update');\n\n if ($this->context && $childMetric->context != $this->context) {\n $msg = \"Cannot move $childMetric->context metric #$childMetricId to under $this->context metric\";\n $io->error($msg);\n $this->abort();\n }\n\n if (empty($errors) && $passesRules) {\n $this->childMetrics[] = $childMetric;\n\n return;\n }\n\n $msg = \"\\nCannot reparent metric #$childMetricId\";\n $msg .= $errors\n ? \"\\nDetails:\\n\" . print_r($errors, true)\n : ' No details available. (Check for application rule violation)';\n $io->error($msg);\n $this->abort();\n }", "public function make_child() {\n if (! empty( $this->data['course_id'] ) && $this->data['course_id']) {\n $this->data['parent_course_id'] = $this->data['course_id'];\n unset( $this->data['course_id'] );\n }\n }", "function testSaveCategoriaChild()\n {\n $categoriaGrab = $this->tester->grabRecord('common\\models\\Categoria',['categoriaNome' => 'DIY', 'categoriaDescricao' => 'Do It Yourself']);\n\n $categoriaChild = new CategoriaChild();\n $categoriaChild->setChildNome('Single-Board Computers');\n $categoriaChild->setChildDescricao('Small powerful computers');\n $categoriaChild->setCategoriaIdcategorias($categoriaGrab->idcategorias);\n $this->tester->assertTrue($categoriaChild->save());\n\n $this->assertEquals('Single-Board Computers', $categoriaChild->getChildNome());\n $this->assertEquals(0, $categoriaChild->getChildEstado());\n }", "public function saveChild($id_child = 0)\n {\n $user_child = new UserChild();\n $user_child->user_id = Yii::app()->user->id;\n $user_child->user_child_id = $id_child;\n $user_child->save();\n }", "public function getDomFkcp()\n {\n return $this->hasOne(CatCp::className(), ['cp' => 'dom_fkcp']);\n }", "public function setTypepiece(ChildTypepiece $v = null)\n {\n if ($v === null) {\n $this->setType(NULL);\n } else {\n $this->setType($v->getType());\n }\n\n $this->aTypepiece = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTypepiece object, it will not be re-added.\n if ($v !== null) {\n $v->addTypepiece($this);\n }\n\n\n return $this;\n }", "public function JournalParentFluxogramaItemRealAsFluxogramaDepedenciaRealAssociation($intAssociatedId, $strJournalCommand) {\n\t\t\t$objDatabase = FluxogramaItemReal::GetDatabase()->JournalingDatabase;\n\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tINSERT INTO `fluxograma_depedencia_real_assn` (\n\t\t\t\t\t`pai`,\n\t\t\t\t\t`filho`,\n\t\t\t\t\t__sys_login_id,\n\t\t\t\t\t__sys_action,\n\t\t\t\t\t__sys_date\n\t\t\t\t) VALUES (\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->intId) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($intAssociatedId) . ',\n\t\t\t\t\t' . (($objDatabase->JournaledById) ? $objDatabase->JournaledById : 'NULL') . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($strJournalCommand) . ',\n\t\t\t\t\tNOW()\n\t\t\t\t);\n\t\t\t');\n\t\t}", "public function insertData($parentid, $siblingid, $msmid)\r\n {\r\n global $DB;\r\n\r\n $data = new stdClass();\r\n\r\n // The current comment already exists in msm_comment table so just need to insert\r\n // structural data to msm_compositor. The property isRef contains the database ID from \r\n // msm_compositor of the already existing comment that is same as the referenced one.\r\n if (!empty($this->isRef))\r\n {\r\n $existingComment = $DB->get_record(\"msm_compositor\", array(\"id\" => $this->isRef));\r\n\r\n if (!empty($existingComment))\r\n {\r\n $this->id = $existingComment->unit_id;\r\n }\r\n\r\n $childRecords = $DB->get_records(\"msm_compositor\", array(\"parent_id\" => $this->isRef), \"prev_sibling_id\");\r\n\r\n foreach ($childRecords as $child)\r\n {\r\n $childTable = $DB->get_record(\"msm_table_collection\", array(\"id\" => $child->table_id));\r\n\r\n switch ($childTable->tablename)\r\n {\r\n case \"msm_subordinate\":\r\n $subord = new EditorSubordinate();\r\n $subord->id = $child->unit_id;\r\n $subord->isRef = $child->id;\r\n $this->subordinates[] = $subord;\r\n break;\r\n case \"msm_media\":\r\n $med = new EditorMedia();\r\n $med->id = $child->unit_id;\r\n $med->isRef = $child->id;\r\n $this->medias[] = $med;\r\n break;\r\n }\r\n }\r\n }\r\n // current comment element is new and doesn't exist in msm_comment yet\r\n else\r\n {\r\n $data->comment_type = $this->type;\r\n $data->caption = $this->title;\r\n\r\n $cParser = new DOMDocument();\r\n $cParser->loadHTML($this->content);\r\n $divs = $cParser->getElementsByTagName(\"div\");\r\n\r\n if ($divs->length > 0)\r\n {\r\n $data->comment_content = $this->content;\r\n }\r\n else\r\n {\r\n $data->comment_content = \"<div>$this->content</div>\";\r\n }\r\n\r\n $data->description = $this->description;\r\n\r\n $this->id = $DB->insert_record($this->tablename, $data);\r\n }\r\n\r\n $compData = new stdClass();\r\n $compData->msm_id = $msmid;\r\n $compData->unit_id = $this->id;\r\n $compData->table_id = $DB->get_record('msm_table_collection', array('tablename' => $this->tablename))->id;\r\n $compData->parent_id = $parentid;\r\n $compData->prev_sibling_id = $siblingid;\r\n\r\n $this->compid = $DB->insert_record('msm_compositor', $compData);\r\n\r\n $sibling_id = 0;\r\n\r\n foreach ($this->children as $associate)\r\n {\r\n $associate->insertData($this->compid, $sibling_id, $msmid);\r\n $sibling_id = $associate->compid;\r\n }\r\n\r\n $media_sibliing = 0;\r\n $content = '';\r\n foreach ($this->medias as $key => $media)\r\n {\r\n $media->insertData($this->compid, $media_sibliing, $msmid);\r\n $media_sibliing = $media->compid;\r\n if (empty($this->isRef))\r\n {\r\n $content = $this->replaceImages($key, $media->image, $data->comment_content, \"div\");\r\n }\r\n }\r\n\r\n if (empty($this->isRef))\r\n { // if there are media elements in the comment content, need to change the src to \r\n // pluginfile.php format to serve the pictures.\r\n if (!empty($this->medias))\r\n {\r\n $this->content = $content;\r\n\r\n $data->id = $this->id;\r\n $data->comment_content = $this->content;\r\n $this->id = $DB->update_record($this->tablename, $data);\r\n }\r\n }\r\n\r\n $subordinate_sibling = 0;\r\n foreach ($this->subordinates as $subordinate)\r\n {\r\n $subordinate->insertData($this->compid, $subordinate_sibling, $msmid);\r\n $subordinate_sibling = $subordinate->compid;\r\n }\r\n }", "public function setNumeroPiece($numeroPiece) {\n $this->numeroPiece = $numeroPiece;\n return $this;\n }", "public function pieces()\n {\n \treturn $this->hasMany('\\T4KModels\\Piece', 'piece_type_id', 'id');\n }", "function establish(&$child, &$object, $extra = array())\n\t{\n\t\tif($this->get_table() != $object->__table){\n\t\t\t// no matching table\n\t\t\tIR_base::log('error', 'IgnitedRecord: The table '.$child->__table.\n\t\t\t\t\t\t\t\t' has not got a relation with the table '.$object->__table);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif( ! isset($child->__id) && ! $child->save()){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif( ! isset($object->__id) && ! $object->save()){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$q = new IgnitedQuery();\n\t\t\n\t\t$q->where($this->get_fk(), $child->__id);\n\t\t$q->where($this->get_related_fk(), $object->__id);\n\t\t$query = $q->get($this->get_join_table());\n\t\t\n\t\t$success = true;\n\t\t\n\t\tif( ! $query->num_rows()){\n\t\t\t// no relationship established\n\t\t\t\n\t\t\tforeach( (Array) $this->attr as $col)\n\t\t\t{\n\t\t\t\tif(isset($extra[$col]))\n\t\t\t\t\t$data[$col] = $extra[$col];\n\t\t\t}\n\t\t\t\n\t\t\t$data[$this->get_fk()] = $child->__id;\n\t\t\t$data[$this->get_related_fk()] = $object->__id;\n\t\t\t\n\t\t\t$success = $q->insert($this->get_join_table(), $data);\n\t\t}\n\t\t\n\t\t$query->free_result();\n\t\t\n\t\treturn $success;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Same as pushUnique() except this does strict comparisons (=== instead of ==).
public static function pushUniqueStrict(&$array, $val) { $num = func_num_args(); for ($i = 1; $i < $num; $i++) { $val = func_get_arg($i); if (!in_array($val, $array, true)) { array_push($array, $val); } } return sizeof($array); }
[ "public function unique($equality='\\php_adt\\__equals') {\n $res = new Arr();\n foreach ($this as $idx => $element) {\n if ($idx === 0 || !$res->has($element, $equality)) {\n $res->push($element);\n }\n }\n return $res;\n }", "public static function unique (&$arr)\n {\n //first step make sure all the elements are unique\n $new = array();\n \n foreach ($arr as $current)\n {\n if (\n //if the new array is empty\n //just put the element in the array\n empty($new) || \n (\n //if it is not an instance of a DOMNode\n //no need to check for isSameNode\n !($current instanceof DOMNode) && \n !in_array($current, $new)\n ) || \n //do DOMNode test on array\n self::inArray($current, $new) < 0\n )\n {\n $new[] = $current;\n }\n }\n \n return $new;\n }", "public function isUnique();", "public function uniqueSet();", "public function testUnique() {\n\t\t$this->object->unique();\n\n\t\t$this->assertEquals([\n\t\t\t'integer' => 12345,\n\t\t\t'number' => '67890',\n\t\t\t'string' => 'Foobar',\n\t\t\t'null' => null,\n\t\t\t'map' => ['foo' => 'bar'],\n\t\t\t'array' => ['foo', 'bar']\n\t\t], $this->object->value());\n\t}", "function u_array_unique(array $array, callable $equals): array\n{\n $result = [];\n\n foreach($array as $row)\n {\n if( u_in_array($result, $row, $equals) )\n {\n continue;\n }\n else\n {\n $result[] = $row;\n }\n }\n\n return $result;\n}", "private function array_not_unique($raw_array) {\n\n$dupes = array();\nnatcasesort($raw_array);\nreset($raw_array);\n\n$old_key = NULL;\n$old_value = NULL;\n\nforeach ($raw_array as $key => $value) {\n\nif ($value === NULL) {\ncontinue;\n}\n\nif (strcasecmp($old_value, $value) === 0) {\n$dupes[$old_key] = $old_value;\n$dupes[$key] = $value;\n}\n$old_value = $value;\n$old_key = $key;\n}\n\nreturn $dupes;\t\n\n}", "function add_unique_to_assocvector(&$assoc,$subject,&$obj)\n{\n\tif (($X = $assoc{$subject}))\n\t{\n\t\t//Is $obj already in the array?\n\t\tif (!in_array($obj, $X))\n\t\t{\n\t\t\t$assoc{$subject} = array_merge($X,array($obj));\n\t\t}\n\t}\n\telse // under subject there is nothing =>\n\t{ \n\t\t$assoc{$subject} = array($obj);\n\t}\n}", "public function unique()\n {\n $arr = [];\n\n $seen = [];\n\n for ($i = 0; $i < $this->count(); $i += 1) {\n $value = $this->value[$i];\n\n if (! isset($seen[$value])) {\n $arr[] = $value;\n $seen[$value] = true;\n }\n }\n\n return new Arr($arr);\n }", "public function unique(): ImmutableList;", "public function testPush()\n {\n $this->collection->push(4);\n\n $this->assertCount(4, $this->collection);\n $this->assertTrue($this->collection->contains(4));\n $this->assertEquals(4, $this->collection->get(3));\n }", "function push_(array $array, array $values): array\n{\n foreach ($values as $value) {\n $array[] = $value;\n }\n\n return $array;\n}", "function ArrayUniqueByKey ($array, $key) {\n $tmp = array();\n $result = array();\n foreach ($array as $value) {\n if (!in_array($value[$key], $tmp)) {\n array_push($tmp, $value[$key]);\n array_push($result, $value);\n }\n }\n return $array = $result;\n}", "public function unique(): CollectionInterface;", "public static function arrayUnique($array)\n {\n }", "public function push($key, $value = '~NULL')\n {\n // Yes, this is stupid, but whatever.\n if ($value === '~NULL') {\n $this->array[] = $key;\n } else {\n $this->array[$key] = $value;\n }\n }", "protected function buildIsUnique() {\n }", "public function isUnique(): bool;", "public static function unique()\n\t{\n\t\tstatic::$queryObject->unique();\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation deleteMessageSessionsBulk Delete sessions (bulk)
public function deleteMessageSessionsBulk($deleteMessageSessionsBulkInputObject) { $this->deleteMessageSessionsBulkWithHttpInfo($deleteMessageSessionsBulkInputObject); }
[ "function batchDeleteMessages($params) {\n $matchingQueryPart = _createMessagesMatchingQueryPart($params['criteria']);\n\n $softDeleteMessagesQuery = (\n \"UPDATE {{table}} SET `deleted` = true WHERE {$matchingQueryPart};\"\n );\n\n doquery($softDeleteMessagesQuery, 'messages');\n\n $deletedMessagesCount = getDBLink()->affected_rows;\n\n _updateMessageThreadsAffectedByBatchDeletion($params);\n\n return [\n 'deletedMessagesCount' => $deletedMessagesCount,\n ];\n}", "public function deleteAll() {\n $count = $this->messageCount();\n\n for($i = 1; $i <= $count; $i++) {\n $this->delete($i);\n }\n }", "public function delete( $args, $assoc_args ) {\n\t\tif ( isset( $assoc_args['limit'] ) ) {\n\t\t\t$limit = absint( $assoc_args['limit'] );\n\n\t\t\t$count = SUPER_WP_Session_Utils::delete_old_sessions( $limit );\n\n\t\t\tif ( $count > 0 ) {\n\t\t\t\t\\WP_CLI::line( sprintf( 'Deleted %d sessions.', $count ) );\n\t\t\t}\n\n\t\t\t// Clear memory\n\t\t\tself::free_up_memory();\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine if we're deleting all sessions or just a subset.\n\t\t$all = isset( $assoc_args['all'] );\n\n\t\t/**\n\t\t * Determine the size of each batch for deletion.\n\t\t *\n\t\t * @param int\n\t\t */\n\t\t$batch = isset( $assoc_args['batch'] ) ? absint( $assoc_args['batch'] ) : apply_filters( 'super_session_delete_batch_size', 1000 );\n\n\t\tswitch ( $all ) {\n\t\t\tcase true:\n\t\t\t\t$count = SUPER_WP_Session_Utils::delete_all_sessions();\n\n\t\t\t\t\\WP_CLI::line( sprintf( 'Deleted all %d sessions.', $count ) );\n\t\t\t\tbreak;\n\t\t\tcase false:\n\t\t\t\tdo {\n\t\t\t\t\t$count = SUPER_WP_Session_Utils::delete_old_sessions( $batch );\n\n\t\t\t\t\tif ( $count > 0 ) {\n\t\t\t\t\t\t\\WP_CLI::line( sprintf( 'Deleted %d sessions.', $count ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Clear memory\n\t\t\t\t\tself::free_up_memory();\n\t\t\t\t} while ( $count > 0 );\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected function deletePendingSessions()\n\t{\n\t\t//\n\t\t// Load pending sessions.\n\t\t//\n\t\t$sessions\n\t\t\t= Session::ResolveCollection(\n\t\t\t\tSession::ResolveDatabase( $this->wrapper(), TRUE ), TRUE )\n\t\t\t\t\t->matchAll(\n\t\t\t\t\t\tarray( kTAG_NID\n\t\t\t\t\t\t\t\t\t=> array( '$ne'\n\t\t\t\t\t\t\t\t\t\t=> $this->session()->offsetGet( kTAG_NID ) ),\n\t\t\t\t\t\t\t kTAG_USER => $this->session()->offsetGet( kTAG_USER ) ),\n\t\t\t\t\t\tkQUERY_NID );\n\t\t\n\t\t//\n\t\t// Handle sessions list.\n\t\t//\n\t\tif( $count = $sessions->count() )\n\t\t{\n\t\t\t//\n\t\t\t// Set count.\n\t\t\t//\n\t\t\t$this->transaction()->offsetSet( kTAG_COUNTER_COLLECTIONS, $count );\n\t\t\t\n\t\t\t//\n\t\t\t// Initialise progress.\n\t\t\t//\n\t\t\t$this->transaction()->offsetSet( kTAG_COUNTER_PROGRESS, 0 );\n\t\t\tUpdateProcessCounter( $start, $increment, kTAG_COUNTER_PROCESSED );\n\t\t\t\n\t\t\t//\n\t\t\t// Delete sessions.\n\t\t\t//\n\t\t\tforeach( $sessions as $session )\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Delete session.\n\t\t\t\t//\n\t\t\t\tSession::Delete( $this->wrapper(), $session );\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t// Update progress.\n\t\t\t\t//\n\t\t\t\t$increment++;\n\t\t\t\tUpdateProcessCounter(\n\t\t\t\t\t$start, $increment,\n\t\t\t\t\tkTAG_COUNTER_PROCESSED,\n\t\t\t\t\t$this->transaction(), $count );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn TRUE;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\n\t}", "private function deletePendingSms() {\r\n $sms2del = $this->session->userdata('sms_delete');\r\n if (!$sms2del) {\r\n return;\r\n }\r\n\r\n foreach ($sms2del as $smsid) {\r\n self::deleteSmsAttributes($smsid);\r\n $sql = \"DELETE FROM smart_message WHERE smart_message_id = ? \";\r\n $this->db->query($sql, array($smsid));\r\n }\r\n $this->session->unset_userdata('sms_delete');\r\n }", "public function deleteMultiMessages()\n {\n $messagesIds = inputPost('messages_ids');\n if (!empty($messagesIds)) {\n foreach ($messagesIds as $id) {\n $this->deleteContactMessage($id);\n }\n }\n }", "public function actionBulkDelete()\n {\n $request = Yii::$app->request;\n $pks = $request->post('pks'); // Array or selected records primary keys\n foreach (Settings::findAll(json_decode($pks)) as $model) {\n $model->delete();\n }\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose' => true, 'forceReload' => true];\n }", "public function deleteMessages(): void\n {\n $this->messages()->delete();\n }", "public function bulkDelete(array $entities): void;", "public function actionBulkDelete()\n {\n // Get user IDs from POST request or session.\n if (Yii::$app->request->isPost) {\n $ids = Yii::$app->request->post('id');\n foreach ($ids as $id) {\n $user = $this->findModel(UserModel::className(), $id);\n if ($user && $user->delete()) {\n Yii::$app->session->addFlash(static::FLASH_INFO, Yii::t('app', 'User <strong>{name}</strong> deleted.', [\n 'name' => $user->name,\n ]));\n }\n }\n return $this->redirect(['index']);\n } elseif (Yii::$app->session->has('bulk_users')) {\n $ids = Yii::$app->session->remove('bulk_users');\n } else {\n throw new \\yii\\web\\BadRequestHttpException('Bad bulk request.');\n }\n \n $users = $this->getBulkModels(UserModel::className(), $ids);\n \n return $this->createConfirmation([\n 'title' => Yii::t('app', 'Are you sure to delete users ?'),\n 'message' => Yii::t('app', 'These users <strong>{users}</strong> will be deleted. This operation cannot be undo!', [\n 'users' => implode(', ', array_map(function ($name) {\n return Html::encode($name);\n }, ArrayHelper::getColumn($users, 'name'))),\n ]),\n 'encodeMessage' => false,\n 'button' => [\n 'label' => Yii::t('app', 'Delete'),\n 'options' => ['class' => 'btn btn-danger btn-flat'],\n ],\n 'params' => [\n 'id' => ArrayHelper::getColumn($users, 'id'),\n ],\n 'icon' => 'fa fa-trash',\n ]);\n }", "function delete_multi(DatastoreClient $datastore, array $keys)\n{\n // [START delete_multi]\n $datastore->deleteBatch($keys);\n // [END delete_multi]\n}", "final public function deleteAll()\n {\n $this->sessions = [];\n }", "public function deleteMultiple( $keys );", "public function bulkDestroy(Request $request)\n {\n $this->validate($request, ['action' => 'in:delete,permadelete']);\n\n $parameters = $request->all();\n\n $parameters['force'] = 0;\n if (!config('forum.preferences.soft_deletes') || ($request->input('action') == 'permadelete')) {\n $parameters['force'] = 1;\n }\n\n $threads = $this->api('bulk.thread.delete')->parameters($parameters)->delete();\n\n return $this->bulkActionResponse($threads, 'threads.deleted');\n }", "public function actionBulkDelete() {\n $request = Yii::$app->request;\n $pks = $request->post('pks'); // Array or selected records primary keys\n foreach (Profile::findAll(json_decode($pks)) as $model) {\n $model->delete();\n }\n\n\n if ($request->isAjax) {\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose' => true, 'forceReload' => true];\n } else {\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n }", "function entitybulkdelete_users_delete_batch($table, $form_state, &$context) {\n if (!empty($table)) {\n foreach ($table as $value) {\n $uids[$value] = $value;\n watchdog('entitybulkdelete', 'User %uid marked as deleted.', array('%uid' => $value), WATCHDOG_NOTICE);\n }\n // Delete users.\n user_delete_multiple($uids);\n }\n}", "public function deleteMultiple($keys);", "function WSDeleteSession($params)\n{\n if (!WSHelperVerifyKey($params)) {\n return returnError(WS_ERROR_SECRET_KEY);\n }\n\n $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);\n $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);\n $tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);\n $tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);\n\n $session_params = $params['sessions'];\n $results = array();\n $orig_session_id_value = array();\n\n foreach ($session_params as $session_param) {\n\n $original_session_id_value = $session_param['original_session_id_value'];\n $original_session_id_name = $session_param['original_session_id_name'];\n $orig_session_id_value[] = $original_session_id_name;\n\n $idChecked = SessionManager::getSessionIdFromOriginalId(\n $original_session_id_value,\n $original_session_id_name\n );\n\n if (empty($idChecked)) {\n $results[] = 0;\n continue;\n }\n\n $session_ids[] = $idChecked;\n\n $sql = \"DELETE FROM $tbl_session WHERE id = '$idChecked'\";\n Database::query($sql);\n $sql = \"DELETE FROM $tbl_session_rel_course WHERE session_id = '$idChecked'\";\n Database::query($sql);\n $sql = \"DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id = '$idChecked'\";\n Database::query($sql);\n $sql = \"DELETE FROM $tbl_session_rel_user WHERE session_id = '$idChecked'\";\n Database::query($sql);\n $results[] = 1;\n continue;\n }\n\n $extraFieldValue = new ExtraFieldValue('session');\n\n //delete from table_session_field_value from a given session_id\n foreach ($session_ids as $session_id) {\n $extraFieldValue->deleteValuesByItem($session_id);\n }\n\n // Preparing output.\n $count_results = count($results);\n $output = array();\n for ($i = 0; $i < $count_results; $i++) {\n $output[] = array(\n 'original_session_id_value' => $orig_session_id_value[$i],\n 'result' => $results[$i],\n );\n }\n\n return $output;\n}", "public function device_del_batch(){\n\t\t\n\t\t$idarr = $_POST['idarr'];\n\t\t$iparr = $_POST['iparr'];\n\t\t$num = count($idarr);\n\t\tfor($i=0;$i<$num;$i++){\n\t\t\t$this->model->ipinfo_delete($iparr[$i]);\n\t\t\t$this->model->device_delete($idarr[$i]);\n\t\t}\n\t\t$content = \"执行事件:批量删除服务器\";\n\t\t//osa_logs_save($content);\n\t\treturn 'success_del_batch';\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
self::$REJECTED = new SignatureStatus("REJECTED");
public static function __staticInit() { // self::$CANCELLED = new SignatureStatus("CANCELLED"); // self::$RESERVED = new SignatureStatus("RESERVED"); // self::$CONTACT_INFORMATION_MISSING = new SignatureStatus("CONTACT_INFORMATION_MISSING"); // self::$EXPIRED = new SignatureStatus("EXPIRED"); // self::$WAITING = new SignatureStatus("WAITING"); // self::$SIGNED = new SignatureStatus("SIGNED"); // self::$NOT_APPLICABLE = new SignatureStatus("NOT_APPLICABLE"); // self::$BLOCKED = new SignatureStatus("BLOCKED"); // self::$SIGNERS_NAME_NOT_AVAILABLE = new SignatureStatus("SIGNERS_NAME_NOT_AVAILABLE"); self::$KNOWN_STATUSES = [ self::REJECTED(), self::CANCELLED(), self::RESERVED(), self::CONTACT_INFORMATION_MISSING(), self::EXPIRED(), self::WAITING(), self::SIGNED(), self::NOT_APPLICABLE(), self::BLOCKED(), self::SIGNERS_NAME_NOT_AVAILABLE(), ]; }
[ "public function getSignatureStatus()\n {\n return $this->signature_status;\n }", "public function verify_signature() {\n\n\t}", "public function __construct()\n {\n $this->success = false;\n }", "public static function declined() {return new TransactionStatus(2);}", "public function __construct($status = null);", "public function __construct() {\n $this->status = array();\n }", "private function get_signature()\n {\n }", "function bbp_get_private_status_id()\n{\n}", "public function is_a_const_PENDING(): void\n {\n self::assertEquals('PENDING', ChannelPaymentStatus::PENDING);\n $sut = new ChannelPaymentStatus('PENDING');\n self::assertEquals('PENDING', $sut->getValue());\n }", "protected function paymentRequired(): static\n {\n return $this->status(402);\n }", "function __construct($status = self::SP_LIVE)\n {\n $this->VendorName = \"\";\n $this->Service = \"\";\n $this->ApplyAVSCV2 = 0;\n $this->Apply3DSecure = 0;\n $this->VPSProtocol = \"2.23\";\n $this->TxType = \"PAYMENT\";\n $this->Currency = \"GBP\";\n $this->SiteStatus = $status;\n\n $this->PurchaseURL = \"\";\n }", "public function createVerification($recipient);", "public function needsVerificationMessage ();", "public function verifyrequest()\n {\n }", "public function valid() {\n if ($this->checkSignature()==FALSE) {\n $ret = ['msg' => 'valid signature fail', 'status' => 300];\n exit(Json::encode($ret));\n }\n }", "public function rejected()\n {\n $this->setStatus(self::STATUS_REJECTED);\n }", "public function verifyFailedAction() {\n\t}", "function __construct(){\n $this->uniqueVerificationId = date(\"Y-m-d_H-i-s\", strtotime(\"now\")); //this conversion is so annoying. \n }", "public function reject() {\n\t\treturn $this->setStatus( self::STATUS_REJECTED );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the default log driver name.
public static function getDefaultDriver() { /** @var \Illuminate\Log\LogManager $instance */ return $instance->getDefaultDriver(); }
[ "public function getDefaultDriver()\n {\n return config('logging.default');\n }", "public function getDefaultDriver()\r\n {\r\n $name = $this->getConfigByKey('default');\r\n return !empty($name) ? $name : 'kdniao';\r\n }", "public function getDefaultDriver(): string\n {\n return $this->app['config'][$this->driverKey()];\n }", "public function getDefaultDriver()\n {\n if (is_null($driver = config('scout.driver'))) {\n return 'null';\n }\n\n return $driver;\n }", "public function getDefaultDriver(): string\n {\n return $this->defaultDriver;\n }", "public function getDefaultDriver()\n {\n $driver = $this->container['config']['tts.driver'];\n\n if (is_null($driver)) {\n return 'null';\n }\n\n return $driver;\n }", "public function getDefaultLoggerName()\r\n {\r\n return $this->defaultLoggerName;\r\n }", "public function getDefaultDriver()\n {\n return 'default';\n }", "public function getDefaultDriver()\n\t{\n\t\treturn $this->app['config']['modules::driver'];\n\t}", "protected function getDefaultSessionDriver(): string\n {\n return $this->getDefaultSettings($this->app()->getSessions());\n }", "public function getDefaultDriver()\n {\n return $this->defaultDriver;\n }", "protected function getDefaultLogFileName() {}", "private function getDbDriverName()\n {\n if (isset($this->db->driverName)) {\n return $this->db->driverName;\n }\n\n if (!empty($this->_batch)) {\n $key = array_keys($this->_batch)[0];\n if (isset($this->_batch[$key]->db->driverName)) {\n return $this->_batch[$key]->db->driverName;\n }\n }\n\n return null;\n }", "public function getDefaultDriver()\n {\n $driver = $this->app['config']['localize-middleware']['driver'];\n\n return is_array($driver) ? 'stack' : $driver;\n }", "public function getClassName()\n {\n $adapter = $this->getAdapter();\n\n if ($adapter) {\n return $adapter;\n }\n\n $scheme = $this->dsn->scheme;\n\n return 'Cake\\Log\\Engine\\\\' . ucfirst($scheme) . 'Log';\n }", "public function getDefaultDriver(): string\n {\n return $this->config->get('auth.default.guard');\n }", "public function getDefaultDriver()\n {\n return config('iNotification.default_driver');\n }", "public function getDefaultDriver()\n {\n return $this->getSessionConfig()['driver'];\n }", "public function getDefaultDriver()\n {\n return $this->app['config']['staff_session.driver'];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for carrierFreightDescriptionDELETERequestCarrierIDFreightDescriptionsFreightDescriptionIDDelete Deletes a freight description from a carrier..
public function testCarrierFreightDescriptionDELETERequestCarrierIDFreightDescriptionsFreightDescriptionIDDelete() { }
[ "public function testCarrierFreightDescriptionGETRequestCarrierIDFreightDescriptionsFreightDescriptionIDGet()\n {\n }", "public function testCarrierServiceDELETERequestCarrierIDServicesServiceIDDelete()\n {\n }", "public function testDeleteCreditCardTokenWithPayerIdDeleted(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\tEnvironment::setSubscriptionsCustomUrl(PayUTestUtil::SUBSCRIPTION_CUSTOM_URL);\n\t\n\t\t$customer = PayUCustomers::create(PayUTestUtil::buildSubscriptionParametersCustomer());\n\t\t$parameters = PayUTestUtil::buildSubscriptionParametersCreditCard();\n\t\t$parameters[PayUParameters::CUSTOMER_ID] = $customer->id;\t\t\n\t\t$creditCard = PayUCreditCards::create($parameters);\n\t\t$response = PayUCustomers::delete($parameters);\n\t\t\t\n\t\t$parameters = array(\n\t\t\t\tPayUParameters::TOKEN_ID => $creditCard->token,\n\t\t\t\tPayUParameters::CUSTOMER_ID => $customer->id\n\t\t);\n\t\t\n\t\t$response = PayUCreditCards::delete($parameters);\n\t\n\t\t$this->assertNotNull($response);\n\t\t$this->assertNotNull($response->description);\n\t}", "public function action_received_comment_delete()\n\t{\n\t\t// Auto render off\n\t\t$this->auto_render = FALSE;\n\n\t\t// Get ids, if When it is smaller than 2 then throw to 404\n\t\t$ids = explode('_', $this->request->param('key'));\n\t\tif (!(count($ids) == 2)) throw HTTP_Exception::factory(404);\n\n\t\t// idsをitem_idとreceived_comment_idに分ける\n\t\tlist($item_id, $received_comment_id) = $ids;\n\n\t\t// Get received_comment, if there is nothing then throw to 404\n\t\t$received_comment = Tbl::factory('received_comments')->get($received_comment_id);\n\t\tif (!$received_comment) throw HTTP_Exception::factory(404);\n\n\t\t// Get item, if there is nothing then throw to 404\n\t\t$this->item = Tbl::factory('items')->get($item_id);\n\t\tif (!$this->item) throw HTTP_Exception::factory(404);\n\n\t\t// Get division\n\t\t$division = Tbl::factory('divisions')\n\t\t\t->where('id', '=', $this->item->division_id)\n\t\t\t->read(1);\n\n\t\t// Database transaction start\n\t\tDatabase::instance()->begin();\n\n\t\t// Try\n\t\ttry\n\t\t{\n\t\t\t// Delete\n\t\t\t$received_comment->delete();\n\n\t\t\t// Database commit\n\t\t\tDatabase::instance()->commit();\n\n\t\t\t// Add success notice\n\t\t\tNotice::add(Notice::SUCCESS, Kohana::message('general', 'delete_success'));\n\n\t\t\t// redirect\n\t\t\t$this->redirect(URL::site(\"{$this->settings->backend_name}/items/{$division->segment}/received_comments/{$this->item->id}\", 'http'));\n\t\t}\n\t\tcatch (HTTP_Exception_302 $e)\n\t\t{\n\t\t\t$this->redirect($e->location());\n\t\t}\n\t\tcatch (Validation_Exception $e)\n\t\t{\n\t\t\t// Database rollback\n\t\t\tDatabase::instance()->rollback();\n\n\t\t\t// Add validation notice\n\t\t\tNotice::add(Notice::VALIDATION, Kohana::message('general', 'delete_failed'), NULL, $e->errors('validation'));\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Database rollback\n\t\t\tDatabase::instance()->rollback();\n\n\t\t\t// Add error notice\n\t\t\tNotice::add(\n\t\t\t\tNotice::ERROR//, $e->getMessage()\n\t\t\t);\n\t\t}\n\n\t\t// Redirect to received_comments edit\n\t\t$this->redirect(URL::site(\"{$this->settings->backend_name}/items/{$division->segment}/received_comments/{$this->item->id}\", 'http').URL::query());\n\t}", "public function deleteDescription($id);", "public function deleted(Freelancer $freelancer)\n {\n //\n }", "public function Delete()\n\t{\n\t\ttry\n\t\t{\n\t\t\t\t\t\t\n\t\t\t// TODO: if a soft delete is prefered, change this to update the deleted flag instead of hard-deleting\n\n\t\t\t$pk = $this->GetRouter()->GetUrlParam('id');\n\t\t\t$physicaldescription = $this->Phreezer->Get('Physicaldescription',$pk);\n\n\t\t\t$physicaldescription->Delete();\n\n\t\t\t$output = new stdClass();\n\n\t\t\t$this->RenderJSON($output, $this->JSONPCallback());\n\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->RenderExceptionJSON($ex);\n\t\t}\n\t}", "function dscDeleteOrderPriceDiscount( $discount_id )\r\n{\r\n return dscDeleteDiscount($discount_id);\r\n}", "public function deleteById($remittanceFileId);", "public function testInventoryDebtorSpecificPriceDELETERequestInventoryIDDebtorSpecificPricesDebtorSpecificPriceIDDelete()\n {\n }", "public function testCarrierFreightDescriptionsGETManyRequestCarrierIDFreightDescriptionsGet()\n {\n }", "public function delete() {\n $this->autoRender = false;\n $params = $this->request->data;\n $this->BullhornConnection->BHConnect();\n $params['isDeleted']=true;\n $url = $_SESSION['BH']['restURL'] . '/entity/CandidateWorkHistory/' . $params['id'] . '?BhRestToken=' . $_SESSION['BH']['restToken'];\n $post_params = json_encode($params);\n $req_method = 'POST';\n $response = $this->BullhornCurl->curlFunction($url, $post_params, $req_method);\n echo json_encode($response);\n }", "public function testDelete() {\n $simulatedGetVars = Array();\n $simulatedGetVars['id'] = 2;\n $this->object->delete($simulatedGetVars);\n $this->assertEquals(2, $this->object->carcount());\n }", "public function testVoucherDraftsV2Delete()\n {\n }", "function dish_delete()\n {\n \n $transaction_id = $this->get('transaction');\n $dish_id = $this->get('dish');\n \n // self::debug( $this->get('transaction') );\n // self::debug( $this->get('dish') );\n // die();\n \n if( empty($transaction_id) || empty($dish_id) || empty($this->userId) ){\n self::_throwError('Missing param.', '500');\n }else{\n // get order id korn\n $this->rest->db\n ->select('id, shop_id, subtotal, vat, charge, total')\n ->where('transaction_id = ', $transaction_id)\n ->where('member_id = ', $this->userId);\n $query = $this->rest->db->get($this->table_order);\n if( $query->num_rows()<0 ){\n self::_throwError('Order not found.', '500');\n }else{\n $result = $query->row_array();\n \n $order_id = $result['id'];\n $restaurant_id = $result['shop_id'];\n $subtotal = $result['subtotal'];\n $vat = $result['vat'];\n $charge = $result['charge'];\n $total = $result['total'];\n }\n \n // check dish data\n $dish_price = self::_get_dishPrice($order_id, $dish_id);\n if( $dish_price==false ){\n self::_throwError('Dish not found.', '500');\n }\n \n // change dish status\n $this->rest->db\n ->where('order_id = ', $order_id)\n ->where('id = ', $dish_id)\n ->update($this->table_orderdish, array(\n 'dish_status' => 'cancel'\n ));\n \n // update order\n self::_updateOrder($restaurant_id, $order_id); \n self::_success();\n }\n }", "public function testInventoryDocumentTypeDELETERequestDocumentTypesDocumentTypeIDDelete()\n {\n }", "public function delete_single_row() {\n \n if ( isset ( $_POST ) ) {\n $this->mockinvoice_description_model->delete( $_POST['mockInvoiceDescriptionId'] );\n echo \"true\"; \n } else {\n echo \"error\";\n }\n }", "function delete_costumer($id_costumer)\n {\n return $this->db->delete('costumer',array('id_costumer'=>$id_costumer));\n }", "public function testDeleteDegre()\n {\n $this->curlUtils->connect('http://imiebook/app_dev.php/login_check');\n $response = $this->curlUtils->delete('http://imiebook/app_dev.php/degres/2');\n $this->assertEquals(200, $response['HTTP_CODE']);\n $response = $this->curlUtils->get('http://imiebook/app_dev.php/degres/2');\n $this->assertEquals(404, $response['HTTP_CODE']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Description: Get Result with Access Code Via HTTP POST
public function GetAccessCodeResultPOST($request) { $response = $this->PostToRapidAPI($this->APIConfig["PaymentService.POST.GetAccessCodeResult"], $request); return $response; }
[ "public function getCode() {\r\n\t\t$code_url_params = array(\r\n\t\t\t'client_id'\t\t=>\t$this->getDbValue('exactclientid'),\r\n\t\t\t'redirect_uri'\t=>\tdecode_html($this->getDbValue('exactreturnurl')),\r\n\t\t\t'response_type'\t=>\t'code',\r\n\t\t\t'force_login'\t=>\t0\r\n\t\t);\r\n\t\t$code_url_query = http_build_query($code_url_params, '', '&', PHP_QUERY_RFC3986);\r\n\t\theader( \"Location: \".$this->getDbValue('exactauthurl').'?'.$code_url_query, TRUE, 302 );\r\n\t}", "private static function http_request($post_data) {\r\n\t\ttype_constraint::is_an_array( $post_data );\r\n\t\ttype_constraint::is_a_string( $post_data['Mode'] );\r\n\t\t\r\n\t\t// Submit request\r\n\t\t$c = curl_init();\r\n\t\tcurl_setopt($c, CURLOPT_URL, 'http://www.matrixlinker.com/tools/reg.php');\r\n\t\tcurl_setopt($c, CURLOPT_POST, TRUE);\r\n curl_setopt($c, CURLOPT_RETURNTRANSFER, TRUE);\r\n\t\tcurl_setopt($c, CURLOPT_POSTFIELDS, $post_data);\r\n\t\t\r\n\t\t$response = curl_exec($c);\r\n\t\t$error = curl_error($c);\r\n\t\tcurl_close($c);\r\n\t\t\r\n\t\t// Throw curl error?\r\n\t\tif ( $response === false )\r\n\t\t\tthrow new exception( \"Matrix Linker failed to register with remote server with error code: $error\" );\r\n\t\t\r\n\t\t// Unserialize response\r\n\t\t$response = unserialize( $response );\r\n\t\t$error = $response['Error'];\r\n\t\t\r\n\t\ttype_constraint::is_nullable_array( $response );\r\n\t\ttype_constraint::is_nullable_string( $error );\r\n\t\t\r\n\t\t// Throw response error?\r\n\t\tif ( $error )\r\n\t\t\tthrow new exception( \"Matrix Linker http_request mode '\" . $post_data['Mode'] . \"' Failed with message: \" . $error );\r\n\t\t\t\r\n\t\treturn $response;\r\n\t}", "public function get_code(){\n $this->provider->authenticate($_GET['code']);\n $_SESSION[$this->session_name] = $this->provider->getAccessToken();\n $redirect = $this->url;\n header('Location:'.filter_var($redirect, FILTER_SANITIZE_URL));\n }", "public function getAccessCode()\n {\n return $this->getResponse()['data']['access_code'];\n }", "public abstract function doPOST();", "public function requestAuthorizationCode() {\n if ($this->hasAuthorizationCode()) {\n return;\n }\n\n $url = $this->service->getAuthorizationUri(array('state' => 'DCEEFWF45453sdffef424'));\n\n $curl_options = array(\n CURLOPT_URL => $url,\n CURLOPT_FOLLOWLOCATION => true,\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, $curl_options);\n curl_exec($ch);\n curl_close($ch);\n }", "public function getResponse () {}", "public function referral_code_get()\n \t{\n \t\tlog_message('debug', 'Network/referral_code_get');\n \t\tlog_message('debug', 'Network/referral_code_get:: [1] userId='.extract_id($this->get('userId')) . ' referralCode='.$this->get('newCode'));\n \t\t\n\t\t$result = $this->_network->check_referral_code(\n\t\t\textract_id($this->get('userId')),\n\t\t\t$this->get('checkCode')\n\t\t);\n\t\t\n\t\tlog_message('debug', 'Network/referral_code_get:: [2] result='.json_encode($result));\n\t\t$this->response($result);\n\t}", "public function getResponseCode();", "function get_access_token(){\r\r\n\r\r\n if(empty($_REQUEST['code'])) exit(false);\r\r\n\r\r\n require_once akd_importer()->plugin_dir . 'lib/Dropbox/autoload.php';\r\r\n\r\r\n $accessToken = get_transient('akd-dropbox-access-token');\r\r\n\r\r\n if(!$accessToken){\r\r\n $appInfo = \\Dropbox\\AppInfo::loadFromJson($this->config);\r\r\n $webAuth = new \\Dropbox\\WebAuthNoRedirect($appInfo,'PHP-Example/1.0');\r\r\n list($accessToken, $dropboxUserId) = $webAuth->finish($_REQUEST['code']);\r\r\n\r\r\n if ($accessToken){\r\r\n set_transient('akd-dropbox-access-token', $accessToken, 3500);\r\r\n set_transient('akd-dropbox-code', $_REQUEST['code'], 3500);\r\r\n }\r\r\n }\r\r\n\r\r\n exit($accessToken);\r\r\n }", "public function getAccessCode()\n {\n return $this->access_code;\n }", "public function doRequest()\n {\n $fields = $this->prepareRequest();\n\n $fieldsString = \"\";\n foreach ($fields as $key => $value) {\n $fieldsString .= $key . '=' . $value . '&';\n }\n rtrim($fieldsString, '&');\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->config->getEndPoint(SveaConfigurationProvider::HOSTED_ADMIN_TYPE) . $this->method);\n curl_setopt($ch, CURLOPT_POST, count($fields));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fieldsString);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //force curl to trust https\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n //returns a html page with redirecting to bank...\n $responseXML = curl_exec($ch);\n curl_close($ch);\n\n // create Svea\\WebPay\\Response\\SveaResponse to handle response\n $responseObj = new \\SimpleXMLElement($responseXML);\n\n return $this->parseResponse($responseObj);\n }", "private function _postService () {\n $missing=$postDataArray=Array();\n $requiredParams=$this->Request_Params['Required'];\n foreach ($requiredParams AS $k => $v) :\n if ($k != 'code_url') :\n if (strlen($v) == 0) :\n $missing[]=$k;\n else :\n $postDataArray[$k] = urlencode($v);\n endif;\n elseif ($k == 'code_url') :\n if (is_array($v) AND sizeof($v) > 0) :\n foreach ($v AS $code_url) :\n $postDataArray['code_url'][] = $code_url;\n endforeach;\n else : $missing[] = 'code_url';\n endif;\n endif;\n endforeach;\n if (sizeof($missing) > 0) :\n $err = \"Required fields missing: '\" . implode(\"', '\", $missing) .\"'\";\n throw new CC_Service_Exception($err);\n else :\n $optionalParams=$this->Request_Params['Optional'];\n foreach($optionalParams AS $k => $v) :\n if (is_string($v) AND strlen($v) > 0) :\n $postDataArray[$k] = urlencode($v);\n endif;\n endforeach;\n return HttpRequest::sendPostDataArray(self::CC_POST_URL, $postDataArray);\n endif;\n }", "public function doPOST()\n {\n }", "function httpPost() {\n }", "public function responseAction()/*{{{*/\n {\n $post = Mage::app()->getRequest()->getParams();\n #echo '<pre>'.print_r($post, 1).'</pre>';\n\n Mage::log(\"Heidelpay - responseAction: post\");\n Mage::log($post);\n $returnvalue = '';\n if (isset($post['PROCESSING_RESULT'])) $returnvalue = $post['PROCESSING_RESULT'];\n if ($returnvalue){\n $shortid = $orderId = $uniqueid = $authType = $statusCode = $processReturn = $frontendCancel = $payCode = $custId = '';\n $accBrand = $accExpMonth = $accExpYear = $accHolder = $accNumber = $accBank = $actPM = '';\n $conAccCountry = $conAccHolder = $conAccNumber = $conAccBank = $conAccBic = $conAccIban = $presAmount = $presCurrency = $pm = '';\n if (isset($post['IDENTIFICATION_SHORTID']))\t\t\t\t\t$shortid\t\t\t\t= $post['IDENTIFICATION_SHORTID'];\n if (isset($post['IDENTIFICATION_TRANSACTIONID'])) \t\t$orderId\t\t\t\t= $post['IDENTIFICATION_TRANSACTIONID'];\n if (isset($post['IDENTIFICATION_UNIQUEID']))\t\t\t\t$uniqueid\t\t\t\t= $post['IDENTIFICATION_UNIQUEID'];\n if (isset($post['AUTHENTICATION_TYPE']))\t\t\t\t\t$authType\t\t\t\t= $post['AUTHENTICATION_TYPE'];\n if (isset($post['PROCESSING_STATUS_CODE']))\t\t\t$statusCode\t\t\t= $post['PROCESSING_STATUS_CODE'];\n if (isset($post['PROCESSING_RETURN'])) \t\t$processReturn\t\t= $post['PROCESSING_RETURN'];\n if (isset($post['FRONTEND_REQUEST_CANCELLED'])) $frontendCancel\t= $post['FRONTEND_REQUEST_CANCELLED'];\n if (isset($post['PAYMENT_CODE']))\t\t\t\t\t\t\t\t$payCode\t\t\t\t= $post['PAYMENT_CODE'];\n if (isset($post['ACCOUNT_BRAND']))\t\t\t\t\t\t\t\t$accBrand\t\t\t= $post['ACCOUNT_BRAND'];\n if (isset($post['ACCOUNT_EXPIRY_MONTH']))\t\t\t\t$accExpMonth\t\t= $post['ACCOUNT_EXPIRY_MONTH'];\n if (isset($post['ACCOUNT_EXPIRY_YEAR']))\t\t\t\t\t$accExpYear\t\t= $post['ACCOUNT_EXPIRY_YEAR'];\n if (isset($post['ACCOUNT_HOLDER']))\t\t\t\t\t\t\t$accHolder\t\t\t= $post['ACCOUNT_HOLDER'];\n if (isset($post['ACCOUNT_NUMBER']))\t\t\t\t\t\t\t$accNumber\t\t\t= $post['ACCOUNT_NUMBER'];\n if (isset($post['ACCOUNT_BANK']))\t\t\t\t\t\t\t\t$accBank\t\t\t\t= $post['ACCOUNT_BANK'];\n if (isset($post['CONNECTOR_ACCOUNT_COUNTRY']))\t$conAccCountry\t= $post['CONNECTOR_ACCOUNT_COUNTRY'];\n if (isset($post['CONNECTOR_ACCOUNT_HOLDER']))\t\t$conAccHolder\t\t= $post['CONNECTOR_ACCOUNT_HOLDER'];\n if (isset($post['CONNECTOR_ACCOUNT_NUMBER']))\t$conAccNumber\t= $post['CONNECTOR_ACCOUNT_NUMBER'];\n if (isset($post['CONNECTOR_ACCOUNT_BANK']))\t\t\t$conAccBank\t\t= $post['CONNECTOR_ACCOUNT_BANK'];\n if (isset($post['CONNECTOR_ACCOUNT_BIC']))\t\t\t\t$conAccBic\t\t\t= $post['CONNECTOR_ACCOUNT_BIC'];\n if (isset($post['CONNECTOR_ACCOUNT_IBAN']))\t\t\t$conAccIban\t\t\t= $post['CONNECTOR_ACCOUNT_IBAN'];\n if (isset($post['PRESENTATION_AMOUNT']))\t\t\t\t\t$presAmount\t\t\t= $post['PRESENTATION_AMOUNT'];\n if (isset($post['PRESENTATION_CURRENCY']))\t\t\t\t$presCurrency\t\t= $post['PRESENTATION_CURRENCY'];\n if (isset($post['CRITERION_PAYMETHOD']))\t\t\t\t\t$pm\t\t\t\t\t\t= $post['CRITERION_PAYMETHOD'];\n if (isset($post['actPM'])) \t\t\t\t\t\t$actPM\t\t\t\t\t= $post['actPM']; \n\n $invoiceMailComment = 'Short ID: '.$shortid; \n\n // PNO Meldung Special Hack bei PROCESSING.RETURN.CODE=100.400.110\n $returnCode = '';\n if (isset($post['PROCESSING_RETURN_CODE'])) $returnCode = $post['PROCESSING_RETURN_CODE'];\n if (strpos($returnCode, '100.400.110') !== false){\n $processReturn = $this->_getHelper('heidelpay')->__('HP_PNO_ERROR');\n }\n\n // Order ID extrahieren\n if (strpos($orderId, '-') !== false){\n $parts = explode('-', $orderId);\n $orderId = $parts[0];\n $custId = $parts[1];\n }\n\n // Order Object\n $order = $this->getOrder();\n if (!empty($orderId)){\n $order->loadByIncrementId($orderId);\n // Payment Object # Change 25.05.2012\n if ($order->getPayment() !== false){\n \t$payment = $order->getPayment()->getMethodInstance();\n } else {\n \t$payment = $this->getHPPayment();\n }\n #echo '<pre>'.print_r($payment, 1).'</pre>';\n }\n\n if ($payCode == 'IV.PA' && $post['ACCOUNT_BRAND'] == 'BILLSAFE'){\n\t $repl = array(\n '{AMOUNT}' => $post['CRITERION_BILLSAFE_AMOUNT'], \n '{CURRENCY}' => $post['CRITERION_BILLSAFE_CURRENCY'], \n '{ACC_OWNER}' => $post['CRITERION_BILLSAFE_RECIPIENT'], \n '{ACC_BANKNAME}' => $post['CRITERION_BILLSAFE_BANKNAME'], \n '{ACC_NUMBER}' => $post['CRITERION_BILLSAFE_ACCOUNTNUMBER'], \n '{ACC_BANKCODE}' => $post['CRITERION_BILLSAFE_BANKCODE'],\n '{ACC_BIC}' => $post['CRITERION_BILLSAFE_BIC'], \n '{ACC_IBAN}' => $post['CRITERION_BILLSAFE_IBAN'], \n '{SHORTID}' => $post['CRITERION_BILLSAFE_REFERENCE'],\n '{LEGALNOTE}' => $post['CRITERION_BILLSAFE_LEGALNOTE'],\n '{NOTE}' \t\t=> $post['CRITERION_BILLSAFE_NOTE'],\n );\n\n $locale = explode('_', Mage::app()->getLocale()->getLocaleCode());\n if (is_array($locale) && ! empty($locale))\n $language = $locale[0];\n else\n $language = $this->getDefaultLocale();\n\n define('HP_SUCCESS_BILLSAFE', $this->_getHelper('heidelpay')->__('HP_SUCCESS_BILLSAFE'));\n\n $bsData = strtr(HP_SUCCESS_BILLSAFE, $repl);\n $bsData.= ' '.$post['CRITERION_BILLSAFE_LEGALNOTE'].' ';\n //$bsData.= substr($post['CRITERION_BILLSAFE_NOTE'], 0, strlen($post['CRITERION_BILLSAFE_NOTE'])-11).' '.date('d.m.Y', mktime(0,0,0,date('m'),date('d')+$post['CRITERION_BILLSAFE_PERIOD'],date('Y'))).'.';\n $bsData.= preg_replace('/{DAYS}/', $post['CRITERION_BILLSAFE_PERIOD'], $this->_getHelper('heidelpay')->__('HP_LEGALNOTE_BILLSAFE'));\n $bsData = nl2br(htmlentities($bsData));\n $invoiceMailComment = $bsData;\n $order->setCustomerNote($bsData);\n $order->save();\n }\n\n $params = '';\n $prePaidData = '';\n // Vorkasse Sonderkrams\n if ($payCode == 'PP.PA'){\n $params.= '&pcode='.$payCode.'&';\n foreach($this->importantPPFields AS $k => $v){\n if (isset($post[$v])) $params.= $v.'='.$post[$v].'&';\n }\n $repl = array(\n '{AMOUNT}' => $presAmount, \n '{CURRENCY}' => $presCurrency, \n '{ACC_COUNTRY}' => $conAccCountry, \n '{ACC_OWNER}' => $conAccHolder, \n '{ACC_NUMBER}' => $conAccNumber, \n '{ACC_BANKCODE}' => $conAccBank,\n '{ACC_BIC}' => $conAccBic, \n '{ACC_IBAN}' => $conAccIban, \n '{SHORTID}' => $shortid,\n );\n\n $locale = explode('_', Mage::app()->getLocale()->getLocaleCode());\n if (is_array($locale) && ! empty($locale))\n $language = $locale[0];\n else\n $language = $this->getDefaultLocale();\n\n define('HP_SUCCESS_PREPAID', $this->_getHelper('heidelpay')->__('HP_SUCCESS_PREPAID'));\n\n $prePaidData = strtr(HP_SUCCESS_PREPAID, $repl);\n $invoiceMailComment = $prePaidData;\n }\n\n // Wenn die OT Zahlung nicht erfolgreich war, dann gespeicherte Kontodaten l�schen\n if (!strstr($returnvalue,\"ACK\") && strpos($payCode, 'OT') !== false){\n \tif ($custId != \"\"){\n \t\t$customer = Mage::getModel('customer/customer')->load($custId);\n \t\tif ($customer->getEmail() != \"\"){\n \t\t\tMage::log(\"Heidelpay - responseAction: customer->save() \" . $custId . \", \" . $customer->getEmail());\n \t\t\t$customer->setHeidelpayLastBlz($accBank);\n \t\t\t$customer->setHeidelpayLastKto($accNumber);\n \t\t\t$customer->setHeidelpayLastHolder($accHolder);\n \t\t\t$customer->save();\n \t\t}\n \t}\n }\n\n #echo '<pre>'.print_r($order, 1).'</pre>'; exit();\n if (strstr($returnvalue,\"ACK\")) {\n if (strpos($payCode, 'RG') !== false){\n # Register\n } else {\n if (!empty($orderId)){\n // fill order\n\t\t\tif ($order->canInvoice()) {\n\t\t\t\ttry {\n\t\t\t\t\t$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();\n\t\t\t\t\tif (!$invoice->getTotalQty()) {\n\t\t\t\t\t\tMage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));\n\t\t\t\t\t}\n\t\t\t\t\t$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);\n\t\t\t\t\t$invoice->register();\n\t\t\t\t\t$transactionSave = Mage::getModel('core/resource_transaction')\n\t\t\t\t\t\t->addObject($invoice)\n\t\t\t\t\t\t->addObject($invoice->getOrder())\n\t\t\t\t\t\t->save();\n\t\t\t\t\tif ($this->_invoiceOrderEmail) $invoice->sendEmail(true, $invoiceMailComment); // Rechnung versenden\n\t\t\t\t}\n\t\t\t\tcatch (Mage_Core_Exception $e) {\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n \tMage::log(\"Heidelpay - responseAction: order->setState \" .$payment->getPaymentState());\n $order->setState($payment->getPaymentState());\n $order->addStatusToHistory($payment->getPaymentState(), 'Short ID: '.$shortid.' '.$invoiceMailComment, $order->getCustomerNoteNotify());\n if (strpos($payCode, 'PA') !== false){ # Nur bei PA speichern.\n // TransID f�r PIXI speichern\n $order->getPayment()->setLastTransId($uniqueid);\n }\n // $order->getPayment()->registerCaptureNotification($presAmount);\n $order->setCustomerNote($invoiceMailComment); // Kommentar auch in EMail\n $order->save();\n }\n }\n if ($statusCode == '90' && $authType == '3DSecure'){\n #print $base.\"/index.php/default/Heidelpay/payment/afterThreeDSecure/\"; \n echo Mage::getUrl('heidelpay/payment/afterThreeDSecure/', array('_secure' => true));\n } else {\n if (strpos($payCode, 'RG') !== false){\n #echo '<pre>Custid: '.print_r($custId, 1).'</pre>';\n if ($custId > 0){\n $customer = Mage::getModel('customer/customer')->load($custId);\n #echo '<pre>'.print_r($customer, 1).'</pre>';\n if (strpos($payCode, 'OT') !== false){\n $customer->setHeidelpayLastBlz($accBank);\n $customer->setHeidelpayLastKto($accNumber);\n $customer->setHeidelpayLastHolder($accHolder);\n }\n if (strpos($payCode, 'CC') !== false){\n if (strpos($actPM, 'XC') !== false){\n $customer->setHeidelpayXcardUniqueId($uniqueid);\n $customer->setHeidelpayXcardPaymentType($payCode);\n $customer->setHeidelpayXcard($accNumber);\n $customer->setHeidelpayXcardValidUntil($accExpMonth.' / '.$accExpYear);\n $customer->setHeidelpayXcardBrand($accBrand);\n $customer->setHeidelpayXcardHolder($accHolder);\n } else {\n $customer->setHeidelpayCcardUniqueId($uniqueid);\n $customer->setHeidelpayCcardPaymentType($payCode);\n $customer->setHeidelpayCcard($accNumber);\n $customer->setHeidelpayCcardValidUntil($accExpMonth.' / '.$accExpYear);\n $customer->setHeidelpayCcardBrand($accBrand);\n $customer->setHeidelpayCcardHolder($accHolder);\n }\n }\n if (strpos($payCode, 'DC') !== false){\n $customer->setHeidelpayDcardUniqueId($uniqueid);\n $customer->setHeidelpayDcardPaymentType($payCode);\n $customer->setHeidelpayDcard($accNumber);\n $customer->setHeidelpayDcardValidUntil($accExpMonth.' / '.$accExpYear);\n $customer->setHeidelpayDcardBrand($accBrand);\n $customer->setHeidelpayDcardHolder($accHolder);\n }\n $customer->save();\n }\n echo Mage::getUrl('heidelpay/payment/afterRegister/', array('_secure' => true)).'?uniqueId='.$uniqueid;\n } else {\n echo Mage::getUrl('heidelpay/payment/success/', array('_secure' => true)).'?uniqueId='.$uniqueid.$params;\n }\n }\n } else if ($frontendCancel == 'true'){\n if (!empty($orderId)){\n $order->setState($payment->getCancelState());\n $order->addStatusToHistory($payment->getCancelState(), 'Cancelled by User', $order->getCustomerNoteNotify());\n $order->save();\n }\n // Bei CC und DC nur bei DIRECT die CANCEL Methode nutzen.\n //if (!empty($orderId) && (strpos($payCode, 'CC') !== false || strpos($payCode, 'DC') !== false) && $payment->getConfigData('bookingmode') == 'DIRECT'){\n if ((strpos($payCode, 'CC') !== false || strpos($payCode, 'XC') !== false || strpos($payCode, 'DC') !== false)){\n print Mage::getUrl('heidelpay/payment/cancel/', array('_secure' => true, 'error' => 'Cancelled by User')).\"?pc=\".$payCode;\n } else {\n print Mage::getUrl('checkout/onepage/', array('_secure' => true));\n }\n } else {\n if (!empty($orderId)){\n $order->setState($payment->getErrorState());\n $order->addStatusToHistory($payment->getErrorState(), utf8_encode($processReturn), $order->getCustomerNoteNotify());\n $order->save();\n }\n if ($processReturn == 'Canceled by user'){\n print Mage::getUrl('checkout/onepage/', array('_secure' => true));\n } else {\n if(strpos($payCode, 'CC')!==false || strpos($payCode, 'XC')!==false || strpos($payCode, 'DC')!==false){\n \t$isIframe = 1;\n \tMage::log(\"Heidelpay - responseAction: \".$payCode.\" Zahlung mit Fehlercode \" . $processReturn .\", \" . $this->getSession()->getData('hp_iframe_opened'));\n } else {\n \t$isIframe = 0;\n }\n print Mage::getUrl('heidelpay/payment/error/', array('_secure' => true)).'?error='.urlencode($processReturn).\"&isiframe=\".$isIframe.\"&pc=\".$payCode;\n }\n }\n } else {\n echo 'FAIL';\n }\n }", "public function retriveCode()\n\t{\n\t\t//\there we got 'code' from vk\n\t\tif (0 !== $code = Input::get('code', 0))\n\t\t{\n\t\t\t//\there we recived 'access_token'\n\t\t\tif (false != $accessTokenOptions = $this->retriveAccessToken($code))\n\t\t\t{\n\t\t\t\t//\ta try to register or authenticate user failed\n\t\t\t\tif ( ! $succeed = $this->authenticateOrRegisterVkUser($accessTokenOptions))\n\t\t\t\t{\n\t\t\t\t\t//\t#! change it later\n\t\t\t\t\treturn Redirect::to('/');\n\t\t\t\t}\n\t\t\t\t//\tuser authenticated or registered. move him to profile\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//\tmisha 153102371\n\t\t\t\t\t//\tkarina 112817601\n\t\t\t\t\t$accepted = [\n\t\t\t\t\t\t172736370 => true,\n\t\t\t\t\t\t125375806 => true,\n\t\t\t\t\t\t112817601 => true,\n\t\t\t\t\t\t153102371 => true,\n\t\t\t\t\t\t87301076 => true,\n\t\t\t\t\t\t144037386 => true,\n\t\t\t\t\t];\n\t\t\t\t\t\n\t\t\t\t\tif ( ! array_key_exists($succeed['uid'], $accepted)) {\n\t\t\t\t\t\tAuth::logout();\n\t\t\t\t\t\t\\Session::set('qq', true);\n\t\t\t\t\t\treturn Redirect::route('logout');\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn Redirect::to('/');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//\tuser denied asked permissions\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn redirect('/');\n\t\t\t}\n\t\t}\n\t\t//\t'code' ain't recived from vk\n\t\telse\n\t\t{\n\t\t\treturn redirect('/');\n\t\t}\n\t}", "static function get_auth_code() {\n\n\t}", "function joincodeAvailable()\r\n\t{\r\n\t\theader('Content-type: application/json');\r\n\t\t$retValue = '{\"status\":\"200\"}';\r\n\t\tsendResultInfoAsJson( $retValue );\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
month_dir, for saving all extended classes objects and medias
function getMonthDir() { return date("Y_m"); }
[ "private function createFoldersForMonths()\n {\n if (!is_dir(self::TARGET_FOLDER)) {\n mkdir(self::TARGET_FOLDER);\n }\n\n // define array containing folder names\n $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');\n\n foreach ($months as $month) {\n if (!is_dir(self::TARGET_FOLDER.'/'.$month)) {\n mkdir(self::TARGET_FOLDER.'/'.$month);\n }\n }\n // TODO Add log file info\n }", "protected function writeMetafiles() {\r\n\r\n\t\tforeach($this->folderstates as $fPath=>$status) {\r\n\r\n\t\t\tswitch($status) {\r\n\t\t\t\tcase meta_editor::$STATE_REFRESH_FOLDER:\r\n\r\n\t\t\t\t\t$items = $this->Database->prepare(\"SELECT * FROM {$this->ctable} WHERE pid=? ORDER BY sorting\")->executeUncached($this->pid);\r\n\r\n\t\t\t\t\t$metaFilename = $this->getMetafilename(NULL, $this->pid);\r\n\t\t\t\t\t$this->writeMetaFile($items, $metaFilename);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function testStorageBuilderWithMonths()\n {\n $storage = new Storage(dirname(__FILE__), 'storage', true, true);\n $result = $storage->buildStorage();\n $this->assertTrue($result);\n\n $upload_path = $storage->getUploadPath();\n $this->assertEquals($upload_path, dirname(__FILE__) . '/storage' . '/' . date(\"Y\") . '/' . date(\"m\"));\n\n rmdir(dirname(__FILE__) . '/storage' . '/' . date(\"Y\") . '/' . date(\"m\"));\n rmdir(dirname(__FILE__) . '/storage' . '/' . date(\"Y\"));\n rmdir(dirname(__FILE__) . '/storage');\n }", "public function savePackage();", "public function createFiles(){\n //Para cada estructura pasada genera los archivos\n foreach ($this->structs as $struct){\n //Genera y escribe la clase en archivo\n $class=$this->generateClass($struct);\n $this->writeFile('class/'.$struct->getClass().'.php',$class);\n print_r(\"Clase generada: class/\".$struct->getClass().'.php<br/>');\n //Genera y escribe el dao de la clase en archivo\n $dao=$this->generateDao($struct);\n $this->writeFile('dao/Dao'.$struct->getClass().'.php',$dao);\n print_r(\"DAO de Clase generado: dao/Dao\".$struct->getClass().'.php<br/>');\n //Genera y escribe la estructura en archivo\n $stringStruct=$this->genetrateStruct($struct);\n $this->writeFile('struct/struct'.$struct->getClass().'.php',$stringStruct);\n print_r(\"Estructura de Clase generada: struct/struct\".$struct->getClass().'.php<br/>');\n print_r(\"---------------------------------------------------<br/>\");\n }\n }", "protected function manageMonthly(): void\n {\n $allFiles = $this->getAllFileNamesInFolder('monthly');\n\n if (count($allFiles) === 0) {\n $this->rollToMonthly();\n } else {\n // Find the most recent monthly backup\n $newestFileName = $this->getNewestFileName($allFiles);\n\n // Check how old it is (in seconds)\n $diff = $this->getTimeDiffFromFileName($newestFileName);\n\n // If it's been more than 30.4 days, then copy a newer one.\n if ($diff >= 3600 * 24 * 30.4) {\n $this->rollToMonthly();\n }\n }\n }", "private function generar_archivos_estructura()\r\n\t{\r\n\t\tforeach(array_keys($this->plan) as $nombre ) {\r\n\t\t\t$this->manejador_interface->titulo( $nombre );\r\n\t\t\t$clase = new toba_clase_datos( $nombre );\r\n\t\t\t//Creo los indices\r\n\t\t\tforeach ( $this->plan[$nombre]['indices'] as $id => $indice) {\r\n\t\t\t\t$clase->agregar_metodo_datos( $id, $indice );\r\n\t\t\t}\r\n\t\t\t//Informacion de cada tabla\r\n\t\t\tforeach($this->plan[$nombre]['tablas'] as $tabla) {\r\n\t\t\t\t$this->manejador_interface->mensaje(\"Tabla: $tabla\");\r\n\t\t\t\t$clase->agregar_metodo_datos( $tabla, $this->tablas[$tabla] );\r\n\t\t\t}\r\n\t\t\t$clase->guardar( $this->get_dir_estructura_db() .'/'.$nombre.'.php' );\r\n\t\t}\r\n\t}", "private function parseModelsFolder(){\t\n\t\t// Get all files from the Models direcory & remove . & .. from the scandir\t\n\t\t$scanned_directory = array_diff(scandir('app/models'), array('..', '.'));\n\n\t\t// Parse all files\n\t\tforeach ($scanned_directory as $value)\n \t{\t\n \t\t// remove extension\n \t\t$value = preg_replace('/\\\\.[^.\\\\s]{3,4}$/', '', $value); \t\t\n \t\t$str= \"\\models\\\\\".$value; \t\t\n \t\t\n \t\t// Register new Class with the same name\n \t\t$this->$value = new $str;\n \t}\n\t\t\n\t}", "private function _toFiles()\n {\n system(\"mkdir -p modules/\" . $this->_name);\n write_array_to_file(\"dictionary['\" . $this->_name . \"']\", $this->_vardefs, 'modules/' . $this->_name . '/vardefs.php');\n echo \"wrote modules/$this->_name/vardefs.php \\n\";\n \n file_put_contents(\"modules/\" . $this->_name . \"/\" . $this->_name . \".php\", $this->_classDef);\n echo \"wrote modules/\" . $this->_name . \"/\" . $this->_name . \".php \\n\";\n \n $this->_copyMetadataFiles();\n echo \"wrote modules/\" . $this->_name . \"/metadata directory \\n\";\n \n $this->_copyDashletFiles();\n echo \"wrote modules/\" . $this->_name . \"/Dashlets directory \\n\";\n \n system(\"cp -a include/SugarObjects/templates/\" . $this->_template_type . \"/language modules/\" . $this->_name);\n echo \"wrote modules/\" . $this->_name . \"/language directory \\n\";\n \n system(\"mkdir -p custom/Extension/application/Ext/Include/\");\n file_put_contents(\"custom/Extension/application/Ext/Include/\" . $this->_name . \".php\", $this->_includeModules);\n echo \"wrote modules/\" . $this->_name . \"/\" . $this->_name . \".php \\n\";\n \n system(\"mkdir -p custom/Extension/application/Ext/Language/\");\n foreach ($this->_includeLanguage as $lang => $contents) {\n file_put_contents(\"custom/Extension/application/Ext/Language/\" . $lang . \".\" . $this->_name . \".php\", \"<?php \\n \" . $contents);\n echo \"wrote custom/Extension/application/Ext/Language/\" . $lang . \".\" . $this->_name . \".php \\n\";\n }\n \n file_put_contents(\"modules/{$this->_name}/Menu.php\", $this->_menu);\n echo \"wrote modules/{$this->_name}/Menu.php \\n\";\n\n system(\"touch modules/\" . $this->_name . \"/Forms.php\");\n echo \"touched modules/\" . $this->_name . \"/Forms.php \\n\";\n \n echo \"you need to create custom/themes/default/images/Create\" . strtolower($this->_name) . \".gif, commander \\n\";\n echo \"you need to create custom/themes/default/images/\" . strtolower($this->_name) . \".gif, commander \\n\";\n echo \"you need to create custom/themes/default/images/icon_\" . $this->_name . \"_32.png, commander \\n\";\n echo \"you need to create custom/themes/default/images/icon_\" . strtolower($this->_name) . \"_bar_32.png, commander \\n\";\n file_put_contents(\"modules/{$this->_name}/manual_labels.txt\", var_export($this->_manual_labels, true));\n echo \"you need to insert the labels in modules/{$this->_name}/manual_labels.txt manually, commander. \\n\";\n \n }", "function createDataFolders($headFolder = NULL, $custom_date = NULL)\r\n{\r\n\r\n $time = time();\r\n\r\n if ($custom_date)\r\n {\r\n if(!is_numeric($custom_date))\r\n $time = strtotime($custom_date);\r\n else\r\n $time = $custom_date;\r\n }\r\n \r\n\r\n $year = date(\"Y\", $time);\r\n $month = date(\"m\", $time);\r\n $day = date(\"d\", $time);\r\n $folder = $year . '/' . $month . '/' . $day;\r\n\r\n $data = cb_call_functions('dated_folder');\r\n if ($data)\r\n return $data;\r\n\r\n if (!$headFolder)\r\n {\r\n @mkdir(VIDEOS_DIR . '/' . $folder, 0777, true);\r\n @mkdir(THUMBS_DIR . '/' . $folder, 0777, true);\r\n @mkdir(ORIGINAL_DIR . '/' . $folder, 0777, true);\r\n @mkdir(PHOTOS_DIR . '/' . $folder, 0777, true);\r\n @mkdir(LOGS_DIR . '/' . $folder, 0777, true);\r\n }\r\n else\r\n {\r\n if (!file_exists($headFolder . '/' . $folder))\r\n {\r\n @mkdir($headFolder . '/' . $folder, 0777, true);\r\n }\r\n }\r\n\r\n $folder = apply_filters($folder, 'dated_folder');\r\n return $folder;\r\n}", "public function initMemberExportDirectory()\n\t{\n\t \tilUtil::makeDirParents($this->getMemberExportDirectory());\n\t}", "public function add_month_archive_items() {\n\n\t\t\t/* Add $wp_rewrite->front to the trail. */\n\t\t\t$this->add_rewrite_front_items();\n\n\t\t\t/* Get the year and month. */\n\t\t\t$year = sprintf(\n\t\t\t\t$this->args['labels']['archive_year'],\n\t\t\t\tget_the_time( $this->args['date_labels']['archive_year'] )\n\t\t\t);\n\t\t\t$month = sprintf(\n\t\t\t\t$this->args['labels']['archive_month'],\n\t\t\t\tget_the_time( $this->args['date_labels']['archive_month'] )\n\t\t\t);\n\n\t\t\t/* Add the year item. */\n\t\t\t$this->_add_item(\n\t\t\t\t'link_format',\n\t\t\t\t$year,\n\t\t\t\tget_year_link( get_the_time( 'Y' ) )\n\t\t\t);\n\n\t\t\t/* Add the month item. */\n\t\t\tif ( is_paged() ) {\n\t\t\t\t$this->_add_item(\n\t\t\t\t\t'link_format',\n\t\t\t\t\t$month,\n\t\t\t\t\tget_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\t$this->_add_item( 'target_format', $month );\n\t\t}", "private function nameFolder()\n {\n if ($this->table === 'experiments') {\n $this->folder = $this->zipped['date'] . \"-\" . $this->cleanTitle;\n } else { // items\n $this->folder = $this->zipped['items_typesname'] . \" - \" . $this->cleanTitle;\n }\n }", "function createDataFolders($headFolder = NULL, $custom_date = NULL)\n{\n\n $time = time();\n\n if ($custom_date)\n $time = strtotime($custom_date);\n\n $year = date(\"Y\", $time);\n $month = date(\"m\", $time);\n $day = date(\"d\", $time);\n $folder = $year . '/' . $month . '/' . $day;\n\n $data = cb_call_functions('dated_folder');\n if ($data)\n return $data;\n\n if (!$headFolder)\n {\n @mkdir(VIDEOS_DIR . '/' . $folder, 0777, true);\n @mkdir(THUMBS_DIR . '/' . $folder, 0777, true);\n @mkdir(ORIGINAL_DIR . '/' . $folder, 0777, true);\n @mkdir(PHOTOS_DIR . '/' . $folder, 0777, true);\n @mkdir(LOGS_DIR . '/' . $folder, 0777, true);\n }\n else\n {\n if (!file_exists($headFolder . '/' . $folder))\n {\n @mkdir($headFolder . '/' . $folder, 0777, true);\n }\n }\n\n $folder = apply_filters($folder, 'dated_folder');\n return $folder;\n}", "public function get_folder_year_month_list()\n\t{\n\t\t//-------------------------------------------------\n\t\t// Build SQL Statement\n\t\t//-------------------------------------------------\n\t\t$strsql = \"\n\t\t\tselect \n\t\t\t\tyear(post_date) as year, \n\t\t\t\tmonth(post_date) as month, \n\t\t\t\tmonthname(post_date) as month_name, \n\t\t\t\tcount(*) as num_entries\n\t\t\tfrom \n\t\t\t\tsite_entries\n\t\t\twhere \n\t\t\t\tsite_id = ? \n\t\t\t\tand parent = ?\n\t\t\t\tand entry_type = 2\n\t\t\t\tand active = 1 \n\t\t\t\tand {$this->ver_field} > 0 \n\t\t\tgroup by month, year \n\t\t\torder by year desc, month desc\n\t\t\";\n\n\t\t// Pull Data and Return\n\t\treturn QDB::qdb_exec($this->data_source, $strsql, array('ii', $this->site_id, $this->id));\n\t}", "function get_year_month_directory_name( $time = null ) {\n\t\tif ( ! $time && isset( $_POST['post_id'] ) ) {\n\t\t\t$time = get_post_field( 'post_date', $_POST['post_id'] );\n\t\t}\n\n\t\tif ( ! $time ) {\n\t\t\t$time = current_time( 'mysql' );\n\t\t}\n\n\t\t$y = substr( $time, 0, 4 );\n\t\t$m = substr( $time, 5, 2 );\n\t\t$subdir = \"/$y/$m\";\n\n\t\tif ( false === strpos( $subdir, '//' ) ) {\n\t\t\treturn $subdir;\n\t\t}\n\n\t\treturn '';\n\t}", "abstract protected function getDumpFolder();", "public function setSavePath()\n {\n $savePath = $this->app->getDataRoot() . \"upload/\" . date('Ym/', $this->now);\n if(!file_exists($savePath)) @mkdir($savePath, 0777, true);\n $this->savePath = dirname($savePath) . '/';\n }", "function MakeCacheDirYearMonth($new_year,$new_month)\n{\n $Month = $new_month;\n $Year = $new_year;\n $pathtofile = \"$Year/$Month/\";\n return $pathtofile;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
to check duplicate item in the cart
function checkDuplicateItem() { $sql = "select * from order1 where p_status=0 and Service_ID=:Service_ID and Cus_ID=:Cus_ID"; $args = [':Service_ID' => $this->Service_ID, ':Cus_ID' => $this->Cus_ID]; $stmt = DB::run($sql, $args); $count = $stmt->rowCount(); return $count; }
[ "public function checkProductDuplicate()\n {\n try {\n $product_number = $_POST['product_number'];\n $supplier_id = $_POST['supplier_id'];\n\n $check_product = DB::table('product')->where('product_number', '=', $product_number)->where('supplier_id', '=', $supplier_id)->get();\n\n if (count($check_product) > 0) {\n echo json_encode(array(\"status\" => \"success\", \"data\" => trans(\"main.product.product_already_exist\")));\n } else {\n echo json_encode(array(\"status\" => \"fail\", \"data\" => \"Ok\"));\n }\n } catch (Exception $e) {\n echo json_encode(array(\"status\" => \"error\"));\n }\n }", "public function check_cart_duplicate($a, $b){\n\t\t//a query to get cart items base the two id\n\t\t$sql = \"SELECT * FROM cart WHERE p_id=$a AND c_id='$b'\";\n\n\t\t//execute the query and return boolean\n\t\treturn $this->db_query($sql);\n\t}", "function add_item_to_cart($db, $upc, $user_name) {\n // get quantity in inventory\n $quantity_inventory = get_quantity_available($upc, $db);\n \n // get quantity currently in cart\n $quantity_cart = get_quantity_in_cart($upc, $db, $user_name);\n \n // if the quantity in inventory is greater then quantity in cart \n // add one to quantity in cart and return false\n if ($quantity_inventory > $quantity_cart) {\n $query = 'INSERT INTO cart (upc, quantity, username) VALUES(:upc, 1, :username) ON DUPLICATE KEY UPDATE quantity = quantity+1';\n $statement = $db->prepare($query);\n $statement->bindValue(':upc', $upc);\n $statement->bindValue(':username', $user_name);\n $statement->execute();\n $statement->closeCursor(); \n return false;\n }\n // else quantity in cart is equal to quantity in inventoy \n // do not add to quantity in cart and return true\n else {\n return true;\n } \n}", "function checkProductDuplicacy()\n\t{\n\t\t$seller = $this->input->post('seller');\n\t\t$prod \t= $this->input->post('prod');\n\t\t$check = $this->db->select('*')->from('tbl_product_country')->join(\"tbl_proddetails\", \"tbl_proddetails.prodid = tbl_product_country.id\", \"LEFT\")->where('country_name', \"$prod\")->where(\"tbl_proddetails.seller_id\", $seller)->get()->result();\n\t\tif (!empty($check)) {\n\t\t\techo json_encode(array('status' => 'exist'));\n\t\t} else {\n\t\t\techo json_encode(array('status' => 'notexist'));\n\t\t}\n\t}", "function check_if_added_to_cart($item_id){\r\n\r\n\t\tinclude './includes/common.php';\r\n\r\n\t\t$user_id = $_SESSION['Id'];\r\n\r\n\t\t$fetch_query = \"select * from users_items where item_id='$item_id' AND user_id='$user_id' AND status='Added to cart'\";\r\n\t\t$fetch_query_result = mysqli_query($con,$fetch_query) or die($con);\r\n\r\n\t\t$number_of_rows = mysqli_num_rows($fetch_query_result);\r\n\r\n\t\tif ($number_of_rows >=1) {\r\n\t\t\treturn 1;\r\n\t\t}else{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public function product_duplicate($product)\n {\n }", "function item_in_cart($cart,$check_item) {\r\n $cart = $this->explode_cart($cart);\r\n $check_item = $this->explode_item($check_item);\r\n $check_item['quantity'] = 1;\r\n $check_item = $this->implode_item($check_item); \r\n \r\n foreach ($cart as $key => $item) {\r\n $item['quantity'] = 1;\r\n if ($check_item == $this->implode_item($item)) {\r\n return $key;\r\n }\r\n }\r\n \r\n return FALSE;\r\n }", "function check_if_added_to_cart($num)\n\t{\n \t$con=mysqli_connect(\"ec2-23-20-129-146.compute-1.amazonaws.com\",\"qmihdzhyolwyau\",\"6e3493f5e5a03cadef0d1b349ea41da70fe359f681353a7c5185b18b6413b2c7\n\t\t\",\"store\");\n\tif(isset($_SESSION['user_id']))\n\t{\n\t$user_id=$_SESSION['user_id'];\n\t$item_id=$num;\n\t$query = \"select * from users_item where item_id='$item_id' && user_id='$user_id' && status='Added to cart'\" ;\n\t$result=mysqli_query($con,$query);\n\t$row=mysqli_num_rows($result);\n\tif($row>=1)\n\t{\n\t\treturn 1;\n\t}\n\telse\n\t{\n\t\treturn 0;\n\t}\n }\n}", "public function matchCartItem($itemId) {\n $oCart = $this->getCartItem($itemId)->one();\n if ($oCart && $oCart->isOverflow()) {\n $oCart->qty = $oCart->item->qty;\n return $oCart->save();\n }\n return false;\n }", "public function vendor_can_duplicate_product() {\n $vendor_id = dokan_get_current_user_id();\n\n if ( ! Helper::get_vendor_remaining_products( $vendor_id ) ) {\n return false;\n }\n\n return true;\n }", "public function putItemIntoSessionWithExistantItemscheck($request_prams)\n {\n// die(var_dump());\n\n $items_in_bag = Session::get('items');\n $items_in_bag_qty = 0;\n foreach ($items_in_bag as $key => $row) {\n if ($row['color_id'] == $request_prams['color_id']) {\n $items_in_bag_qty = 1;\n if (!empty($request_prams['orderItemAccessories'])) {\n $newAccessoires = count($request_prams['orderItemAccessories']);\n $sessionAccessoires = count($row['orderItemAccessories']);\n if ($newAccessoires != $sessionAccessoires) {\n// die(var_dump('$items_in_bag'));\n $items_in_bag_qty = 2;\n unset($items_in_bag[$key]);\n }\n }\n\n }\n }\n\n if ($items_in_bag_qty != 1) {\n array_push($items_in_bag, $request_prams);\n Session::put('items', $items_in_bag);\n }\n return true;\n\n }", "private function checkIfSKUAlreadyAdded() {\n // $skus == ['sku1', 'sku2', 'sku3'] \n $skus_array = explode(';', $this->_campaign['product_sku']); \n $items = $this->_quote_or_order->getAllItems();\n \n $skus = $this->getSkus($skus_array);\n $added = FALSE;\n Foreach($items as $item){ \n if (in_array($item->getSku(), $skus)) {\n $added = TRUE;\n }\n }\n Mage::log('SKU already added?:' . $added, null, 'maxicycle.log');\n return $added;\n }", "public function exists(){\n // query to count existing cart item\n $query = \"SELECT count(*) FROM \" . $this->table_name . \" WHERE product_id=:product_id AND user_id=:user_id\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // sanitize\n $this->product_id=htmlspecialchars(strip_tags($this->product_id));\n $this->user_id=htmlspecialchars(strip_tags($this->user_id));\n\n // bind category id variable\n $stmt->bindParam(\":product_id\", $this->product_id);\n $stmt->bindParam(\":user_id\", $this->user_id);\n\n // execute query\n $stmt->execute();\n\n // get row value\n $rows = $stmt->fetch(PDO::FETCH_NUM);\n\n // return\n if($rows[0]>0){\n return true;\n }\n\n return false;\n }", "public function getDuplicatedCartItems()\n {\n return DB::table('carts')\n ->rightJoin('product_cart', 'carts.id', '=', 'product_cart.cart_id')\n ->where('user_id', Auth::user()->id)\n ->where('state', 'direct-buy')\n ->get();\n }", "public function checkDuplicateRecipe() {\n\t\t$recipeTitle \t= trim($this->input->post( 'recipeTitle' ));\n\t\t$editId = $this->input->post( 'id' );\n\t\techo $this->R_Model->checkDuplicateRecipe( $recipeTitle, $editId );\n\t}", "public function isProductAlreadyAdded($product){\n\t\t$product = Product::findOrFail($product);\n\t\t$added = Cart::search(function ($cartItem, $rowId) use ($product) {\n return $cartItem->id === $product->id;\n });\n\t\treturn response()->json(['isAdded' => ($added->isNotEmpty() ? true : false) ], 200);\n\t}", "public function ajax_checkduplicate()\r\n {}", "private function checkMissingAndAdd()\n {\n /** @var \\Magento\\Checkout\\Model\\Session $checkoutSession */\n $checkoutSession = $this->checkoutSessionFactory->create();\n $currentQuote = $checkoutSession->getQuote();\n\n if ($currentQuote->hasItems()) {\n foreach ($this->quote->getAllVisibleItems() as $item) {\n $found = false;\n \n foreach ($currentQuote->getAllItems() as $quoteItem) {\n if ($quoteItem->compare($item)) {\n $found = true;\n break;\n }\n }\n\n if (!$found) {\n $newItem = clone $item;\n $currentQuote->addItem($newItem);\n if ($item->getHasChildren()) {\n foreach ($item->getChildren() as $child) {\n $newChild = clone $child;\n $newChild->setParentItem($newItem);\n $currentQuote->addItem($newChild);\n }\n }\n }\n }\n\n $currentQuote->collectTotals();\n\n $this->quoteResource->save($currentQuote);\n }\n }", "public function ajax_checkduplicate()\r\n\r\n {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new BlogPost model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new BlogPost(); $model->author_id = Yii::$app->user->identity->id; if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } $categoryItems = ArrayHelper::map(BlogCategory::find()->all(), 'id', 'name'); if (!is_array($categoryItems) || empty($categoryItems)) { Yii::$app->session->setFlash('no_category', 'Make a category first.'); return $this->redirect(['/blog/category']); } $languageItems = ArrayHelper::map(Language::find()->all(), 'id', 'name'); return $this->render('create', [ 'model' => $model, 'categoryItems' => $categoryItems, 'languageItems' => $languageItems, ]); }
[ "public function actionCreate()\n {\n $model = new BlogForm();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->checkAccess('blog___blog__admin');\n $model = new Post();\n\n $model->user_id = Yii::$app->getUser()->getId();\n\n $model->status_id = Publishable::STATUS_DRAFT;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Blog();\n $model->sort = 50;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new WpressBlogPost(); //for form\n\t\t\n\t //getting all categories for dropdown list in form\n\t\t$allCategories = WpressCategory::find()->orderBy ('wpCategory_id DESC')->all(); \n\n\t\t//if u submitted the form\n if ($model->load(Yii::$app->request->post())/* && $model->save()*/) {\n\t\t\tif($model->save()){\n\t\t\t\t $this->refresh();\n\t\t\t //set FLASH message\n\t\t\t Yii::$app->getSession()->setFlash('addedSuccess', \"Your article <b>$model->wpBlog_title</b> has been successfully saved\");\n\t\t\t return $this->refresh();\n\t\t\t\t$model->wpBlog_text = \"\"; //resetting the fields\n\t\t\t\t$model->wpBlog_title = \"\"; //resetting the fields\n\t\t\t //return $this->render('create', ['model' => $model,'allCategories' => $allCategories]);\n //return $this->redirect(['view', 'id' => $model->wpBlog_id]);\n } else {\n\t\t\t Yii::$app->getSession()->setFlash('addedSuccess', \"Your article saving was crashed!!!\");\n\t\t }\n\t\t}\n\n return $this->render('create', [\n 'model' => $model,\n\t\t\t'allCategories' => $allCategories\n ]);\n }", "public function actionCreate()\n {\n $model = new Blogger();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model = new Post;\n\n\t\tif ($model->load(\\Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function create()\n {\n if(!Security::isAuthenticated())\n {\n header(\"Location: /\");\n exit();\n }\n $this->doCreate();\n\n $view = new View('blog_create');\n $view->title = 'Create Blog';\n $view->heading = 'Create Blog';\n $view->display();\n }", "public function actionCreate()\n {\n $model = new Post();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Post();\n\n if ($this->request->isPost) {\n if ($model->load($this->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->loadDefaultValues();\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function post_create()\n\t{\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'title' => array('required'),\n\t\t\t'content' => array('required'),\n\t\t\t'urlslug' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$blog = new Blog;\n\n\t\t\t$blog->title = Input::get('title');\n\t\t\t$blog->content = Input::get('content');\n\t\t\t$blog->urlslug = Input::get('urlslug');\n\n\t\t\t$blog->save();\n\n\t\t\tSession::flash('message', 'Added blog #'.$blog->id);\n\n\t\t\treturn Redirect::to('blogs');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blogs/create')\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}", "public function actionCreate()\n {\n// if (Yii::$app->user->can('createPost'))\n if (true)\n {\n $model = new Posts();\n $model->status = Posts::STATUS_PUBLISHED;\n $model->author_id = Yii::$app->user->id;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'category' => Categories::find()->all(),\n 'tags' => Tags::find()->all(),\n 'authors' => User::find()->all()\n ]);\n }\n }\n else\n {\n// Yii::$app->session->setFlash('error', 'Access denied.');\n// throw new ForbiddenHttpException('Access denied');\n throw new HttpException(403,'Access denied');\n }\n }", "public function actionDefaultcreate()\n {\n $model = new BlogComment();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n\t$this->layout='wide';\n $post=new Post;\n if(isset($_POST['Post']))\n {\n $post->attributes=$_POST['Post'];\n if(isset($_POST['previewPost']))\n $post->validate();\n else if(isset($_POST['submitPost']) && $post->save())\n {\n if(Yii::app()->user->status==User::STATUS_VISITOR)\n {\n Yii::app()->user->setFlash('message','Thank you for your post. Your post will be posted once it is approved.');\n $this->redirect(Yii::app()->homeUrl);\n }\n $this->redirect(array('show','slug'=>$post->slug));\n }\n }\n $this->pageTitle=Yii::t('lan','New Post');\n $this->render('create',array('post'=>$post));\n }", "public function actionCreate()\n {\n $model = new Post();\n\n if (Yii::$app->request->isPost) \n {\n $model->attributes = Yii::$app->request->post('Post');\n\n $transaction = Yii::$app->db->beginTransaction();\n\n try \n {\n if($model->save())\n {\n $transaction->commit();\n }\n\n return $this->redirect(['manage']);\n }\n catch (\\Exception $e) \n {\n $transaction->rollBack();\n throw $e;\n }\n } \n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new TwPosts();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new BlogArticle();\n\n $mapCategories = ArrayHelper::map(BlogCategory::find()->all(), 'id', 'metaTitle');\n $mapTags = ArrayHelper::map(Tag::find()->all(), 'id', 'metaTitle');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', compact(\n 'model',\n 'mapCategories',\n 'mapTags'\n )\n );\n }", "public function addAction()\n {\n $isSubmitted = $this->params()->fromPost('submitted', \n null);\n $model = new \\Application\\Model\\BlogPost();\n if($isSubmitted){\n $date = $this->params()->fromPost(\"date\");\n $date = new \\DateTime($date);\n $date = $date->format('Y-m-d');\n //add a new blog entry\n $model ->setBody($this->params()->fromPost('body'))\n ->setCreatedBy(\"Alana Thomas\")\n ->setDate($date)\n ->setTitle($this->params()->fromPost('title'))\n ->setTags($this->params()->fromPost('tags'));\n $model = $this->getServiceLocator()->get(\"Application\\Service\\BlogPost\")->insert($model);\n //redirect the user here\n return $this->redirect()->toRoute('blog-post');\n }\n $view = $this->acceptableViewModelSelector($this->acceptCriteria);\n $view->setVariables(array(\n 'model' => $model\n ));\n return $view;\n }", "public function create()\n\t{\n\t\t$pageDescription = 'Fill out the form and press submit to add a new post to the blog.';\n\n\t\t$breadcrumbs = [\n\t\t\t[\n\t\t\t\t'title' => 'Add a Post',\n\t\t\t\t'location' => '/admin/blogposts/create',\n\t\t\t\t'class' => 'active'\n\t\t\t]\n\t\t];\n\n\t\treturn View::make('admin.blogposts.create')\n\t\t\t->with('pageName', 'Add a New Post')\n\t\t\t->with('pageDescription', $pageDescription)\n\t\t\t->with('breadcrumbs', $breadcrumbs);\n\t}", "public function postCreatePost()\n\t{\n\t\t$post = new Post;\n\n\t\t$post->author_id = Auth::user()->id;\n\t\t$post->title = Input::get('title');\n\t\t$post->content = Input::get('content');\n\t\t$post->commentsEnabled = Input::get('comments_enabled', 0);\n\n\t\tif($post->save())\n\t\t{\n\t\t\t$message = 'Successfully created post. ';\n\t\t\t$message .= '<a href=\"'.Url::to('blog/post/'.$post->id).'\">View post</a>';\n\n\t\t\treturn Redirect::to('admin/blog/post/'.$post->id)\n\t\t\t\t\t->with('message', $message);\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::back()\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($post->errors());\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generates a control group with a search field for a model attribute.
public function searchQueryControlGroup($model, $attribute, $htmlOptions = array()) { $htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions); return BsHtml::activeSearchQueryControlGroup($model, $attribute, $htmlOptions); }
[ "public function generateActiveSearchField($attribute)\n\t{\n\t\t$tableSchema = $this->getTableSchema();\n\t\tif ($tableSchema === false) {\n\t\t\treturn \"\\$form->field(\\$model, '$attribute')\";\n\t\t}\n\t\t\n\t\t// Calculate columns that are foreign keys\n\t\t$foreignKeys = [];\n\t\tforeach ($tableSchema->foreignKeys as $fk)\n\t\t{\n\t\t\t$refTable = array_shift($fk);\n\t\t\t$refId = current($fk);\n\t\t\t$colName = key($fk);\n\t\t\t$foreignKeys[$colName] = [$refTable, $refId];\n\t\t}\n\t\t\n\t\tif (array_key_exists($attribute, $foreignKeys))\n\t\t{\n\t\t\t$crudUrl = '/' . $this->moduleID . '/crud/' . str_replace(\"_\", \"-\", $foreignKeys[$attribute][0]) . '';\n\t\t\tif (strpos($foreignKeys[$attribute][0], \".\") !== false)\n\t\t\t{\n\t\t\t\t$parts = explode(\".\", $foreignKeys[$attribute][0]);\n\t\t\t\tif (count($parts) == 2)\n\t\t\t\t{\n\t\t\t\t\t$schema_parts = explode(\"_\", $parts[0]);\n\t\t\t\t\tif (count($schema_parts) == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t$crudUrl = \"/{$schema_parts[1]}/crud/\" . str_replace(\"_\", \"-\", $parts[1]) . '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn \"\\$form->field(\\$model, '$attribute')->widget(\\common\\yii\\jui\\AutoComplete::className(), [\\n\".\n\t\t\t\"\\t\\t\\t'crudUrl' => \\yii\\helpers\\Url::toRoute(['{$crudUrl}']),\\n\" .\n\t\t\t\"\\t\\t])\";\n\t\t}\n\t\t\n\t\t$column = $tableSchema->columns[$attribute];\n\t\tif ($column->phpType === 'boolean') {\n\t\t\treturn \"\\$form->field(\\$model, '$attribute')->checkbox(null, true, true)\";\n\t\t} else if (SchemaHelper::isWeekDayColumn($column)) {\n\t\t\treturn \"\\$form->field(\\$model, '$attribute')->weekdayInput()\";\n\t\t} else {\n\t\t\treturn \"\\$form->field(\\$model, '$attribute')\";\n\t\t}\n\t}", "function generateSearchComponent($fieldName, $fieldType)\n {\n $inputValue = $this->input->post(\"\" . $fieldName . \"\");\n $this->searchTitle .= '<span>' . lang('' . $fieldName . '') . ' : ' . $inputValue . '</span><br>';\n if ($fieldType == 'text') {\n return '<span class=\"input-group-btn\" style=\"width:160px\"><input value=\"' . $inputValue . '\" type=\"text\" id=\"' . $fieldName . '\" name=\"' . $fieldName . '\" class=\"form-control\" placeholder=\"Galchi : ' . lang($fieldName) . '\"></span>';\n } else if ($fieldType == 'number') {\n return '<span class=\"input-group-btn\" style=\"width:160px\"><input value=\"' . $inputValue . '\" type=\"number\" id=\"' . $fieldName . '\" name=\"' . $fieldName . '\" class=\"form-control\" placeholder=\"Galchi : ' . lang($fieldName) . '\"></span>';\n }\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function urlFieldControlGroup($model, $attribute, $htmlOptions = array())\n {\n $htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);\n return BsHtml::activeUrlFieldControlGroup($model, $attribute, $htmlOptions);\n }", "function uw_boundless_bootstrap_search_form_wrapper($variables) {\n $output = '<div class=\"input-group\">';\n $output .= $variables['element']['#children'];\n $output .= '<span class=\"input-group-btn\">';\n $output .= '<button type=\"submit\" class=\"btn btn-default search\">';\n // We can be sure that the font icons exist in CDN.\n if (theme_get_setting('bootstrap_cdn')) {\n $output .= _bootstrap_icon('search');\n }\n else {\n $output .= t('Search');\n }\n $output .= '</button>';\n $output .= '</span>';\n $output .= '</div>';\n return $output;\n}", "public static function muie_keyword_search( $attr ) {\r\n\t\t$default_arguments = array(\r\n\t\t\t's' => '',\r\n\t\t\t'mla_search_fields' => '',\r\n\t\t\t'mla_search_connector' => '',\r\n\t\t\t'sentence' => '',\r\n\t\t\t'exact' => '',\r\n\t\t);\r\n\r\n\t\t// Make sure $attr is an array, even if it's empty\r\n\t\tif ( empty( $attr ) ) {\r\n\t\t\t$attr = array();\r\n\t\t} elseif ( is_string( $attr ) ) {\r\n\t\t\t$attr = shortcode_parse_atts( $attr );\r\n\t\t}\r\n\r\n\t\t// Accept only the attributes we need and supply defaults\r\n\t\t$arguments = shortcode_atts( $default_arguments, $attr );\r\n\r\n\t\t// Pagination links, e.g. Previous or Next, have muie_filters that encode the form parameters\r\n\t\tif ( !empty( $_REQUEST['muie_filters'] ) ) {\r\n\t\t\t$filters = json_decode( trim( stripslashes( $_REQUEST['muie_filters'] ), '\"' ), true );\r\n\r\n\t\t\tif ( !empty( $filters['muie_keyword_search'] ) ) {\r\n\t\t\t\t$_REQUEST['muie_keyword_search'] = $filters['muie_keyword_search'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// muie_keyword_search has settings from the form or pagination link\r\n\t\tif ( !empty( $_REQUEST['muie_keyword_search'] ) && is_array( $_REQUEST['muie_keyword_search'] ) ) {\r\n\t\t\tforeach ( $arguments as $key => $value ) {\r\n\t\t\t\tif ( !empty( $_REQUEST['muie_keyword_search'][ $key ] ) ) {\r\n\t\t\t\t\t$arguments[ $key ] = stripslashes( $_REQUEST['muie_keyword_search'][ $key ] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Always supply the search text box, with the appropriate quoting\r\n\t\tif ( false !== strpos( $arguments['s'], '\"' ) ) {\r\n\t\t\t$delimiter = '\\'';\r\n\t\t} else {\r\n\t\t\t$delimiter = '\"';\r\n\t\t}\r\n\r\n\t\t$return_value = '<input name=\"muie_keyword_search[s]\" id=\"muie-s\" type=\"text\" size=\"20\" value=' . $delimiter . $arguments['s'] . $delimiter . \" />\\n\";\t\t\r\n\t\tunset( $arguments['s'] );\r\n\r\n\t\t// Add optional parameters\r\n\t\tforeach( $arguments as $key => $value ) {\r\n\t\t\tif ( !empty( $value ) ) {\r\n\t\t\t\t$id_value = str_replace( '_', '-', substr( $key, 4 ) );\r\n\t\t\t\t$return_value .= sprintf( '<input name=\"muie_keyword_search[%1$s]\" id=\"muie-%2$s\" type=\"hidden\" value=\"%3$s\" />%4$s', $key, $id_value, $value, \"\\n\" );\t\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $return_value;\r\n\t}", "public function searchQuery($model, $attribute, $htmlOptions = array())\n {\n return BsHtml::activeSearchQueryField($model, $attribute, $htmlOptions);\n }", "public function defineSearchableAttributes()\n\t{\n\t\treturn array('id', 'title', 'formName');\n\t}", "public function advanced() {\n\t\t\t$this->db->join('attribute_type at', 'at.attribute_type_id = a.attribute_type_id');\n\t\t\t$this->db->where('a.attribute_search', 1);\n\t\t\t$attributes = $this->db->select('attribute a', 'a.attribute_id, a.attribute_name, a.attribute_search_method, at.attribute_type_name');\n\t\t\tif($attributes) {\n\t\t\t\tforeach($attributes as $attribute) {\n\t\t\t\t\t$arr[$attribute->attribute_type_name][] = new attribute_($attribute); // Group by attribute_type name.\n\t\t\t\t}\n\t\t\t\t$this->viewModel->add('attributes', $arr);\n\t\t\t}\n\t\t\treturn $this->viewModel;\n\t\t}", "public function searchAction() {\n\t\t$this->_helper->layout()->disableLayout();\n\n\t\t$labelRepo = $this->_entityManager->getRepository('Model\\Label');\n\n\t\t$form = new Dis_Form_SearchPassenger();\n\t\t$form->getElement('label')->setMultiOptions($labelRepo->findAllArray());\n\n\t\t$this->view->form = $form;\n\t}", "private function _form_search_box() {\n $this->CI->form->init();\n $this->CI->form->set_name('search');\n $this->CI->form->set_uri($this->properties['uri']);\n $this->CI->form->open();\n $this->CI->form->hidden(array('name' => 'crud_action', 'value' => 'search'));\n $this->CI->form->dropdown(array('name' => 'form_search_field', 'options' => $this->fields['search'], 'selected' => $this->CI->input->post('form_search_field')));\n $this->CI->form->input(array('name' => 'form_search_content', 'value' => $this->CI->input->post('form_search_content')));\n $this->CI->form->submit(array('value' => 'Search', 'class' => 'crud_button'));\n $this->CI->form->close();\n $form = $this->CI->form->render();\n $returns = '<div id=\"form_search_box\">';\n $returns .= $form;\n $returns .= '</div>';\n return $returns;\n }", "static public function ic_search_form( $atts ) { \n\n $attributes = shortcode_atts( array(\n 'action_path' => '/',\n 'post_types' => '',\n 'search_field_label' => 'Search for: ',\n 'search_button_label'=>'Search',\n ), $atts );\n\n\n return self::get_search_form( $attributes );\n }", "private function defineSearchGroups(){\n foreach($this->_search_groups as $key => $val){\n $this->_search_terms_grouped[$key] = array();\n $this->_search_terms_found[$key] = 0;\n }\n \n return $this;\n }", "public function searchModel()\n\t{\n\t\t$className = get_class($this);\n\t\t$model = new $className('search');\n\t\t$model->unsetAttributes();\n\t\tif(isset($_GET[$className]))\n\t\t\t$model->attributes = $_GET[$className];\n\t\treturn $model;\n\t}", "public function getSearchModel();", "protected function addSearchableAttributes()\n {\n foreach($this->getSearchableAttributes() as $attribute) {\n if(in_array($attribute->getAttributeCode(), $this->_systemAttributes)) {\n continue;\n }\n if($this->getSourceModel()->getData($attribute->getAttributeCode())) {\n $value = $this->getSourceModel()\n ->getAttributeText($attribute->getAttributeCode());\n if(!$value) {\n $value = $this->getSourceModel()\n ->getData($attribute->getAttributeCode());\n }\n try {\n $this->getField($attribute->getAttributeCode())->isTokenized = true;\n $this->getField($attribute->getAttributeCode())->isIndexed = true;\n } catch(Zend_Search_Lucene_Exception $e) {\n $this->addField(Zend_Search_Lucene_Field::UnStored(\n $attribute->getAttributeCode(),\n $value, self::ENCODING)\n );\n }\n }\n }\n return $this;\n }", "public function dateFieldControlGroup($model, $attribute, $htmlOptions = array())\n {\n $htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);\n return BsHtml::activeDateFieldControlGroup($model, $attribute, $htmlOptions);\n }", "public function attributeWidgets()\n\t{\n\t\treturn array(\n\t\t\t\tarray('category', 'textField'), // For choices create variable name proffesion_idChoices\n\t\t\t\tarray('name','textField'),\n\t\t\t\tarray('price','textField'),\n\t\t\t\tarray('picture','fileField'),\n\t\t\t\tarray('detail','textArea'),\n\t\t);\n\t}", "function bpmag_show_groups_search() {\n\t?>\n\t<div class=\"groups-search-result search-result\">\n\t\t<h2 class=\"content-title\"><?php _e( 'Group Search', 'bpmag' ); ?></h2>\n\t<?php bp_locate_template( array( 'groups/groups-loop.php' ), true ); ?>\n\n\t\t<a href=\"<?php echo untrailingslashit( get_permalink( buddypress()->pages->groups->id ) ) . '/?s=' . bpmag_get_search_query() ?>\" ><?php _e( \"View All matched Groups\", \"bpmag\" ); ?></a>\n\t</div>\n\t<?php\n\t//endif;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "DATATYPE" $ANTLR start "BOUND"
function mBOUND(){ try { $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$BOUND; $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL; // Tokenizer11.g:246:3: ( 'bound' ) // Tokenizer11.g:247:3: 'bound' { $this->matchString("bound"); } $this->state->type = $_type; $this->state->channel = $_channel; } catch(Exception $e){ throw $e; } }
[ "abstract public function convertBound($bound);", "public function addBound(Binder $bound)\n\t{\n\t\t$this->_bound[] = $bound;\n\t}", "public function appendBound($value) {\n return $this->append(self::BOUND, $value);\n }", "public function getBound()\n {\n return $this->bound;\n }", "function ora_bind($cursor, $php_variable_name, $sql_parameter_name, $length, $type = null) {}", "public function testBound_returnsLower_ifNumberIsLessThanLower()\n\t{\n\t\t$this->assertEquals(Num::bound(1, 2), 2);\n\t}", "public function setLowerbound($value);", "public function _range($attr,$content,$type='in') {\n $tag = $this->parseXmlAttr($attr,'range');\n $name = $tag['name'];\n $value = $tag['value'];\n $varArray = explode('|',$name);\n $name = array_shift($varArray);\n $name = $this->autoBuildVar($name);\n if(count($varArray)>0)\n $name = $this->tpl->parseVarFunction($name,$varArray);\n\n $type = isset($tag['type'])?$tag['type']:$type;\n\n if('$' == substr($value,0,1)) {\n $value = $this->autoBuildVar(substr($value,1));\n $str = 'is_array('.$value.')?'.$value.':explode(\\',\\','.$value.')';\n }else{\n $value = '\"'.$value.'\"';\n $str = 'explode(\\',\\','.$value.')';\n }\n if($type=='between') {\n $parseStr = '<?php $_RANGE_VAR_='.$str.';if('.$name.'>= $_RANGE_VAR_[0] && '.$name.'<= $_RANGE_VAR_[1]):?>'.$content.'<?php endif; ?>';\n }elseif($type=='notbetween'){\n $parseStr = '<?php $_RANGE_VAR_='.$str.';if('.$name.'<$_RANGE_VAR_[0] && '.$name.'>$_RANGE_VAR_[1]):?>'.$content.'<?php endif; ?>';\n }else{\n $fun = ($type == 'in')? 'in_array' : '!in_array';\n $parseStr = '<?php if('.$fun.'(('.$name.'), '.$str.')): ?>'.$content.'<?php endif; ?>';\n }\n return $parseStr;\n }", "public function getBindType()\n\t{\n\t\treturn (int) $this->bindType;\n\t}", "function mDATATYPE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DATATYPE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:241:3: ( 'datatype' ) \n // Tokenizer11.g:242:3: 'datatype' \n {\n $this->matchString(\"datatype\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function addStartEndBounds(){\n\t\t$this->orderedBounds[0] = $this->STARTBOUND;\n\t\t$e = mb_strlen($this->txtDoc);\n\t\t$this->orderedBounds[$e] = $this->ENDBOUND;\t\t\n\t}", "public function withLowerBound(int $lower_bound): LowerBoundRangeInterface;", "private function injectsBounds(\\DOMElement $node, ResultInterface $bound) {\n $node->setAttribute('loc', $bound->getSum('loc'));\n $node->setAttribute('lloc', $bound->getSum('logicalLoc'));\n $node->setAttribute('cyclomaticComplexity', $bound->getAverage('cyclomaticComplexity'));\n $node->setAttribute('maintenabilityIndex', $bound->getAverage('maintenabilityIndex'));\n $node->setAttribute('volume', $bound->getAverage('volume'));\n $node->setAttribute('vocabulary', $bound->getAverage('vocabulary'));\n $node->setAttribute('difficulty', $bound->getAverage('difficulty'));\n $node->setAttribute('bugs', $bound->getAverage('bugs'));\n $node->setAttribute('time', $bound->getAverage('time'));\n $node->setAttribute('intelligentContent', $bound->getAverage('intelligentContent'));\n }", "public function bind($argument, $value);", "public function addBinding($value, $type = 'where');", "public function getBoundVariables(): array;", "public function openedRQLastTerm()\n {\n $tokens = Analyzer::getDefault()->tokenize($this->_rqFirstTerm, $this->_encoding);\n if (count($tokens) > 1) {\n\n throw new Exception('Range query boundary terms must be non-multiple word terms');\n } else if (count($tokens) == 1) {\n\n $from = new Term(reset($tokens)->getTermText(), $this->_context->getField());\n } else {\n $from = null;\n }\n\n $tokens = Analyzer::getDefault()->tokenize($this->_currentToken->text, $this->_encoding);\n if (count($tokens) > 1) {\n\n throw new Exception('Range query boundary terms must be non-multiple word terms');\n } else if (count($tokens) == 1) {\n\n $to = new Term(reset($tokens)->getTermText(), $this->_context->getField());\n } else {\n $to = null;\n }\n\n if ($from === null && $to === null) {\n\n throw new Exception('At least one range query boundary term must be non-empty term');\n }\n\n $rangeQuery = new Range($from, $to, false);\n $entry = new Subquery($rangeQuery);\n $this->_context->addEntry($entry);\n }", "public function getBindType()\n {\n return $this->_bindType;\n }", "public function getBoundry() {\n if(!array_key_exists('content-type', $this->rawFields)) {\n throw new Exception('Cound not find Boundry in Email');\n } else {\n $boundry = split(\";\", $this->rawFields['content-type']);\n $boundry = split(\"=\", $boundry[1]);\n $boundry = str_replace(\"\\\"\",\"\" ,$boundry[1]);\n $this->rawFields['boundry'] = $boundry;\n }\n return $this->rawFields['boundry'];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the value of the AvailabilityZone and returns this instance
public function withAvailabilityZone($value) { $this->setAvailabilityZone($value); return $this; }
[ "public function setAvailabilityZone($value) \n {\n $this->_fields['AvailabilityZone']['FieldValue'] = $value;\n return $this;\n }", "public function setAvailabilityZone($value)\n {\n return $this->set('AvailabilityZone', $value);\n }", "public function setAvailabilityZoneGroup($value) \n {\n $this->_fields['AvailabilityZoneGroup']['FieldValue'] = $value;\n return $this;\n }", "public function withZoneState($value)\n {\n $this->setZoneState($value);\n return $this;\n }", "public function getAvailabilityZone() \n {\n return $this->_fields['AvailabilityZone']['FieldValue'];\n }", "public function loadTimeZone()\n {\n date_default_timezone_set(config()->app->timezone);\n\n return $this;\n }", "public static function ArubaAmerica(): self\n {\n return static::instance('America/Aruba');\n }", "public function setCustomerTimeZone($val)\n {\n $this->_propDict[\"customerTimeZone\"] = $val;\n return $this;\n }", "public function zone() {\n $this->element_name = \"zones\";\n return $this;\n }", "public function setZone($var)\n {\n @trigger_error('zone is deprecated.', E_USER_DEPRECATED);\n GPBUtil::checkString($var, True);\n $this->zone = $var;\n\n return $this;\n }", "public function setZoneName($value) \n {\n $this->_fields['ZoneName']['FieldValue'] = $value;\n return $this;\n }", "public function loadTimeZone()\n {\n date_default_timezone_set(config()->app->timezone);\n\n if (is_cli()) {\n resolve('benchmark')->here('Setting Time Zone');\n }\n\n return $this;\n }", "public static function createAmericaRegion()\n {\n return new SesRegion('us-east-1');\n }", "public function setToDefaultTimeZone() {\n\t\t$this->setTimezone(self::getDefaultTimeZone());\n\t\treturn $this;\n\t}", "public function setArrivalAt($value)\n {\n return $this->set(self::arrival_at, $value);\n }", "public function setDeliveryTimeZone($value)\n {\n $this->_fields['DeliveryTimeZone']['FieldValue'] = $value;\n return $this;\n }", "public function withRegionName($value)\n {\n $this->setRegionName($value);\n return $this;\n }", "public function setMultiAZ($value)\n {\n return $this->set('MultiAZ', $value);\n }", "public function setTimeZone(?string $value): void {\n $this->getBackingStore()->set('timeZone', $value);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get entity key You must to set constant ENTITY_NAME
public function getKey():string { return self::ENTITY_NAME; }
[ "public function getEntity($key);", "public function testGetEntityKeyFunctionReturnsCorrectKey()\n {\n $testKey = 'storage';\n $this->assertSame(ExS\\Core::ENTITY_KEY_PREFIX . $testKey, ExS\\Core::getEntityKey($testKey));\n }", "public function convertStorageToEntityKey(string $key): string;", "protected function getLabelKey() {\n return $this->entityTypeManager->getDefinition($this->getEntityType())->getKey('label');\n }", "public function getTranslationKeyEntity()\n {\n return $this->getEntityByParentClass('ConnectSB\\\\TranslationBundle\\\\Entity\\\\BaseTranslationKey', 'translation_key_entity');\n }", "public function getIdKey(): string {}", "public function convertEntityToStorageKey(string $key): string;", "public function convertEntityToStorageKey($key);", "public function getEntityName();", "public function fetchKey(): string;", "public function getEntityName(): string\n {\n return $this->entityName;\n }", "public function getTranslationKeyEntity()\n {\n return $this->getEntityByParentClass('ConnectSB\\\\TranslationBundle\\\\Entity\\\\BaseTranslationKey');\n }", "private function getEntityPrimaryKey(&$entity)\n\t{\n\t\t$ref = new \\Nette\\Reflection\\PropertyReflection($this->entity, Metadata::getMetadata($this->entity)->primaryKey);\n\t\t$ref->setAccessible(TRUE);\n\t\t$pk = $ref->getValue($entity);\n\t\t$ref->setAccessible(FALSE);\n\t\treturn $pk;\n\t}", "public function getKey() {}", "protected function getBundleKey() {\n $entity_keys = $this->getEntityStorage()\n ->getEntityType()\n ->get('entity_keys');\n return $entity_keys['bundle'];\n }", "public function getEntityName()\n {\n return $this->entityName;\n }", "public function getEntityKeys()\n {\n return $this->_entityKey;\n }", "protected function getEntityByKey($key) {\n foreach ($this->entities as $entities) {\n if (!empty($entities[$key])) {\n return $entities[$key];\n }\n }\n $msg = 'Key \"' . $key . '\" does not match existing entity key';\n throw new \\Exception($msg);\n }", "public function getProductKey();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exports the whole umbrella project as static site
public function export (SymfonyStyle $io) : void { $outputDir = "{$this->projectDir}/" . self::OUTPUT_DIR; $library = $this->libraryLoader->loadLibrary(); $io->comment(\sprintf( "Generating static site export to <fg=blue>%s</>", self::OUTPUT_DIR )); // region Remove (pre-existing) Export Dir $io->writeln("• removing previous export"); $this->filesystem->remove($outputDir); // endregion // region Dump Index $io->writeln("• Exporting <fg=yellow>index</>"); $this->filesystem->dumpFile( "{$outputDir}/index.html", $this->renderPage("/", UmbrellaController::class . "::index") ); // endregion // region Dump All Components Pages foreach ($library->getCategories() as $category) { foreach ($category->getVisibleComponents() as $component) { $io->writeln(\sprintf( "• Exporting umbrella page <fg=yellow>%s</>", $component->toPath() )); $url = \trim($this->router->generate("umbrella.component", [ "category" => $category->getKey(), "key" => $component->getKey(), ]), "/"); $this->filesystem->dumpFile( "{$outputDir}/{$url}/index.html", $this->renderPage("/{$url}", UmbrellaController::class . "::component", [ "category" => $category->getKey(), "key" => $component->getKey(), ]) ); } } // endregion // region Dump Component Previews foreach ($library->getCategories() as $category) { foreach ($category->getVisibleComponents() as $component) { $io->writeln(\sprintf( "• Exporting preview page <fg=yellow>%s</>", $component->toPath() )); $url = \trim($this->router->generate("umbrella.preview", [ "category" => $category->getKey(), "key" => $component->getKey(), ]), "/"); $this->filesystem->dumpFile( "{$outputDir}/{$url}/index.html", $this->renderPage("/{$url}", UmbrellaController::class . "::preview", [ "category" => $category->getKey(), "key" => $component->getKey(), ]) ); } } // endregion // region Export Docs Pages foreach ($this->docsLoader->load()->getAll() as $docsPage) { $io->writeln(\sprintf( "• Exporting docs page %s (<fg=yellow>%s</>)", $docsPage->getTitle(), $docsPage->getKey() )); $url = \trim($this->router->generate("umbrella.docs", [ "key" => $docsPage->getKey(), ]), "/"); $this->filesystem->dumpFile( "{$outputDir}/{$url}/index.html", $this->renderPage("/{$url}", UmbrellaController::class . "::globalDocs", [ "key" => $docsPage->getKey(), ]) ); } // endregion // region Dump Umbrella Assets foreach ($this->collectUsedAssetNamespaces() as $namespace) { $io->writeln(\sprintf( "• Copy assets for namespace <fg=yellow>%s</>", $namespace )); $this->filesystem->mirror( $this->assetNamespaces->getNamespacePath($namespace), $outputDir . "/assets/{$namespace}" ); } // endregion $io->writeln("<fg=green>✓</> done"); $io->comment(\sprintf( "Export files were written to <fg=blue>%s</>", self::OUTPUT_DIR )); }
[ "public static function buildPages(){\r\n\t\techo \"\\nBuilding static pages\\n--------------------------------------------------------------------------------\\n\";\r\n\r\n\t\t// set the PageController buildMode to SHOW_EXPORT\r\n\t\tModulaiseController::$buildMode = SHOW_EXPORT;\r\n\r\n\t\t// set the static content path to right value\r\n\t\tModulaiseController::$staticContentPath = PATH_MODULES_BUILD;\r\n\t\t\r\n\t\t// Reset global modules\r\n\t\tModulaiseController::initialize();\r\n\r\n\t\t// read all modulenames\r\n\t\t$allPages = ModulaiseUtils::getDirectoryAsArray(ModulaiseController::$DIR_DOCUMENT_ROOT.DIRECTORY_SEPARATOR.PATH_PAGES);\r\n\t\tforeach ($allPages as $file){\r\n\t\t\tif (ModulaiseUtils::EndsWith($file,\".php\")){\r\n\r\n\t\t\t\t// figure out filename to write\r\n\t\t\t\tif (PATH_PAGES_COMPILED!=\"\"){\r\n\t\t\t\t\techo \"Writing static page : \".ModulaiseController::$DIR_DOCUMENT_ROOT.DIRECTORY_SEPARATOR.PATH_PAGES_COMPILED.DIRECTORY_SEPARATOR.substr($file, 0, -4).\".html\\n\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo \"Writing static page : \".ModulaiseController::$DIR_DOCUMENT_ROOT.DIRECTORY_SEPARATOR.substr($file, 0, -4).\".html\\n\";\r\n\t\t\t\t}\r\n\t\t\t\tinclude(ModulaiseController::$DIR_DOCUMENT_ROOT.DIRECTORY_SEPARATOR.PATH_PAGES.DIRECTORY_SEPARATOR.$file);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function exportPublicAssets()\n {\n foreach ($this->publicAssets as $key => $value) {\n copy(\n __DIR__.'/stubs/public/'.$key,\n base_path('public/'.$value)\n );\n }\n }", "public function deployWebapps();", "protected function exportHome()\n {\n if (config('karl.auth.page_home.make_page') == true) {\n foreach ($this->homes as $key => $value) {\n if (file_exists($home = $this->getViewPath($value)) && ! $this->option('force')) {\n if (! $this->confirm(\"The [{$value}] home already exists. Do you want to replace it?\")) {\n return;\n }\n }\n }\n\n $stubView = $this->compileStub(__DIR__.'/stubs/views/'.$key);\n\n $this->files->put($home, $stubView);\n }\n }", "public function generateSite();", "public function make_script() {\n $script_path = $this->site_path().\"/dist/site.js\";\n file_put_contents($script_path, implode(\"\", $this->scripts()));\n file_put_contents($script_path, file_get_contents(REL_ROOT.\"/apis/site-builder/auto-run-page.js\"), FILE_APPEND);\n }", "public function exportContent() {\n\t\t$source = dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . 'fixtures' . DIRECTORY_SEPARATOR;\n\t\t$this->tx_staticpub_export->exportContent ( $source . tx_staticpub_export::TARGET_SEPERATOR . $this->pubDir . tx_staticpub_export::FOLDER_SEPERATOR );\n\t\t$this->assertFileExists ( $this->pubDir . DIRECTORY_SEPARATOR . 'welt.html', 'file not created' );\n\t}", "protected function generateStaticContent()\n {\n $var = $this->getVariables();\n\n $themesParam = \"-t \" . implode(\" -t \", $var[\"project:THEMES\"]);\n $localesParam = implode(\" \", $var[\"project:LOCALES\"]);\n\n $this->log(\"Generating static content for locales $localesParam.\");\n $this->execute(\"cd bin/; /usr/bin/php ./magento setup:static-content:deploy -f $themesParam $localesParam\");\n }", "public function defineFullPublishing()\n {\n $this->publishes([\n SPARK_PATH.'/resources/views' => resource_path('views/vendor/spark'),\n SPARK_PATH.'/resources/assets/js' => resource_path('assets/js/spark'),\n SPARK_PATH.'/resources/assets/sass' => resource_path('assets/sass/spark'),\n SPARK_PATH.'/install-stubs/resources/lang' => resource_path('lang'),\n ], 'spark-full');\n }", "private function publish()\n {\n $this->publishes([\n __DIR__ . '/../resources/views' => resource_path('views/vendor/crm-launcher'),\n ]);\n\n $this->publishes([\n __DIR__ . '/../public' => base_path('public/crm-launcher/'),\n ]);\n\n $this->publishes([\n __DIR__ . '/../config/crm-launcher.php' => config_path('crm-launcher.php'),\n ]);\n }", "public static function exportReactViews()\n {\n File::copyDirectory(__DIR__.'/stubs/resources/js', resource_path('js'));\n }", "protected function copyPublicFolder(){\n $this->recurse_copy(base_path('public'),base_path('public_'.$this->appName));\n $newIndexPath = base_path('public_'.$this->appName.'/index.php');\n $content = File::get($newIndexPath);\n $idx = strpos($content,'define');\n $content = substr_replace($content, \"define('MULTI_APP_NAME','\".$this->appName.\"');\\n\", $idx,0);\n $content = str_replace('app.php', $this->appName.'.php', $content);\n File::put($newIndexPath,$content);\n }", "public function publishAssets()\r\n {\r\n $dir = dirname(__FILE__).DIRECTORY_SEPARATOR.'assets';\r\n \r\n $this->baseUrl = Yii::app()->getAssetManager()->publish($dir);\r\n }", "public function main()\n {\n $this->get('/js/localized-javascript.js');\n $jsFile = new File(WWW_ROOT . '/cache/localized-javascript-static.js');\n $jsFile->write($this->_response);\n }", "public function run()\n {\n if (!file_exists($this->environment->getProjectRoot() . $this->environment->getStaticDirInit())) {\n $this->environment->getLogger()->warning(\n 'Start generating static content. This should NOT be run on live websites. Only for development phase.'\n );\n try {\n $this->environment->log(\n $this->runCommand(\n new ArrayInput(\n [\n 'command' => self::CMD_NAME_STATIC_CONTENT_DEPLOY,\n '--' . DeployStaticOptions::FORCE_RUN => true,\n '--' . DeployStaticOptions::JOBS_AMOUNT =>\n $this->environment->getConfig()['static-content']['jobs'] ?? 1,\n ]\n )\n )->fetch()\n );\n } catch (Exception $e) {\n $this->environment->getLogger()->error($e->getMessage());\n }\n }\n }", "protected function publishFiles()\n {\n // Migrations\n $this->publishes([\n __DIR__ . '/../database/migrations/create_moon_users_table.php' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_moon_users_table.php')\n ], 'migrations');\n\n // Config files\n $this->publishes([\n __DIR__ . '/../config/config.php' => config_path('moonphp.php')\n ], 'config');\n\n // Assets\n $this->publishes([\n __DIR__ . '/../public/css' => public_path('moonphp/css')\n ], 'assets');\n }", "private function assetPublisher() {\n $assetOrigin = $this->getDir().$this->getPathConfig().'/assets';\n if ($this->fs->exists($assetOrigin)) {\n $assetDest = $this->getPublicPath($this->getPathConfig());\n $this->fs->copyDirectory($assetOrigin,$assetDest);\n }\n }", "private function publishHomeController()\n {\n $this->publishes(AdminLTE::homeController(), 'adminlte');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $publicites = $em->getRepository('AppBundle:Publicite')->findAll();\n\n return $this->render('publicite/index.html.twig', array(\n 'publicites' => $publicites,\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the task from the search query
public function removeTask() { if(isset($this->primarySearchData[$this->ref_task])) { unset($this->primarySearchData[$this->ref_task]); } }
[ "public function removeSearch()\n {\n $this->search = null;\n }", "public function removeFromSearch()\n {\n $entries = $this->returnEntries();\n foreach($entries as $entry) {\n $entryId = $entry->id;\n $entry->delete();\n Yii::$app->search->removePage($entryId);\n }\n }", "public function removeTasks() {\n\t\t\t$this->tasks->clear();\n\t\t}", "public function clearSearch(): void {}", "public function removeTask($task)\n {\n $this->tasks->removeElement($task);\n }", "protected function _remove_from_search_index($id) {}", "public function removeTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken();\n\n\t\tif (!User::authorise('core.delete', $this->_option))\n\t\t{\n\t\t\tApp::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));\n\t\t}\n\n\t\t// Incoming (we're expecting an array)\n\t\t$ids = Request::getArray('id', array());\n\t\t$ids = (!is_array($ids) ? array($ids) : $ids);\n\n\t\t$removed = 0;\n\n\t\t// Loop through the IDs and delete the citation\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$citation = Citation::oneOrFail($id);\n\n\t\t\tif (!$citation->destroy())\n\t\t\t{\n\t\t\t\tNotify::error($citation->getError());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Trigger before delete event\n\t\t\tEvent::trigger('onCitationAfterDelete', array($id));\n\n\t\t\t$removed++;\n\t\t}\n\n\t\tif ($removed)\n\t\t{\n\t\t\tNotify::error(Lang::txt('NO_SELECTION'));\n\t\t}\n\n\t\t$this->cancelTask();\n\t}", "public function removeTask($id){\n DB::table('tasks')->where('id', $id)->delete();\n }", "public function removeTask($id)\r\n {\r\n $this->collection->deleteOne(array('_id' => $id));\r\n return 1;\r\n }", "function removeATask($data) {\n global $DB_NAME; \n \n removeTask($DB_NAME, $data[\"id\"]);\n $results = getUsersTasks($DB_NAME, $data[\"email\"]);\n\n // Return the status.\n return array(\n \"status\" => \"success\",\n \"info\" => \"Task removed\",\n\t\"results\" => $results\n );\n}", "function remove_task_tags($task_id) {\n $this->db->where('task_id', $task_id);\n $this->db->delete('tagstasks');\n }", "public function delete(Task $task);", "public function removeTimeKeyword( $query );", "function remove_task_tags($task_id) {\n\t $this->db->where('task_id', $task_id);\n\t $this->db->delete('tagstasks');\n\t}", "function removeTaskInProgress() {\n\t\t$sql = 'DELETE FROM TaskInProgress WHERE TaskId=\"' . $_SESSION['TaskId'] . '\"';\n\t\t$stmt = self::$DB -> prepare($sql);\n\t\tif ($stmt -> execute()) {\n\t\t\t$this->checkForCampaignFinished();\n\t\t} else {\n\t\t\t$arr = array('success' => 0, 'error_msg' => 'Couldn\\'t enter Events');\n\t\t\techo json_encode($arr);\n\t\t}\n\t}", "function task_delete_task()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$task_id = intval( $this->ipsclass->input['task_id'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check\n\t\t//-----------------------------------------\n\t\t\n\t\t$task = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'task_manager', 'where' => \"task_id=$task_id\" ) );\n\t\t\t\n\t\tif ( $task['task_safemode'] and ! IN_DEV )\n\t\t{\n\t\t\t$this->ipsclass->main_msg = \"You are unable to delete this task.\";\n\t\t\t$this->task_show_tasks();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Remove from the DB\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'task_manager', 'where' => 'task_id='.$task_id ) );\n\t\t\n\t\t$this->functions->save_next_run_stamp();\n\t\t\n\t\t$this->ipsclass->main_msg = 'Task deleted';\n\t\t\n\t\t$this->task_show_tasks();\n\t}", "public function deletetask($task_id=null){\n\t\tif(!empty($task_id) && $this->User->Task->exists($task_id)){\n\t\t\t$useruid = $this->Authorize->getUser('User');\n\t\t\t$this->User->contain();\n\t\t\t$user = $this->User->findByUid($useruid, array('id'));\t\t\t\t\n\t\t\t$this->User->Task->deleteAll('Task.id = '.$task_id.' AND Task.user_id = '.$user['User']['id']);\n\t\t}\n\t}", "function task_delete($task) {\n log_assert_valid(task_validate($task));\n\n // Delete task from cache\n _task_cache_delete($task);\n\n // Delete problem page\n textblock_delete($task['page_name']);\n\n // Delete all scores received on task\n db_query('DELETE FROM `ia_score_user_round_task`\n WHERE `task_id` = '.db_quote($task['id']));\n\n // Recompute round scores\n $query = 'SELECT `round_id` FROM `ia_round_task`\n WHERE `task_id` = '.db_quote($task['id']);\n $rounds = db_fetch_all($query);\n\n foreach ($rounds as $round) {\n round_recompute_score($round['round_id']);\n }\n\n // Remove task from all rounds\n task_delete_from_rounds($task['id']);\n\n // Delete task jobs\n $job_ids_fetched = db_fetch_all('\n SELECT `id`\n FROM `ia_job`\n WHERE `task_id` = '.db_quote($task['id']));\n\n $job_ids = array();\n foreach ($job_ids_fetched as $job) {\n $job_ids[] = (int)$job['id'];\n }\n\n if (count($job_ids)) {\n $formated_job_ids = implode(', ', array_map('db_quote', $job_ids));\n db_query(\"DELETE FROM `ia_job_test`\n WHERE `job_id` IN ({$formated_job_ids})\");\n db_query(\"DELETE FROM `ia_job`\n WHERE `id` IN ({$formated_job_ids})\");\n }\n\n // Delete task\n db_query(\"DELETE FROM `ia_task` WHERE `id` = '\".\n db_escape($task['id']).\"'\");\n\n // Delete all task parameters\n task_update_parameters($task['id'], array());\n}", "public function unset_value($task, $key)\n {\n $this->delete_rows(DB::where('task', '=', $task)->and_where('key', '=', $key));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns security permissions option.
function get_enforce_group_permissions() { clearos_profile(__METHOD__, __LINE__); try { $option = $this->_get_global_parameter('FlexshareSecurityPermissions'); } catch (Flexshare_Parameter_Not_Found_Exception $e) { // Ignore } catch (Engine_Exception $e) { // Ignore } if (empty($option)) $option = 'on'; return $option; }
[ "public function getPermission()\n {\n return $this->permission;\n }", "function getPermission(){\n\t\tif (Yii::$app->getUserOpt->Modul_akses(3)){\n\t\t\treturn Yii::$app->getUserOpt->Modul_akses(3)->mdlpermission;\n\t\t}else{\t\t\n\t\t\treturn false;\n\t\t}\t \n\t}", "public function permissions()\n {\n return $this->plan()->permissions;\n }", "public function getProvisionSftpPermission() {\n return @$this->attributes['provision_sftp_permission'];\n }", "public function getPermissionOptions()\n {\n return array_except(parent::getPermissionOptions(), ['publish']);\n }", "public function getPermission()\n {\n return $this->readOneof(2);\n }", "public function getPermissionsOct(): ?string\n {\n if (null === ($perms = $this->getPermissions())) {\n return null;\n }\n\n return decoct($perms & 0777);\n }", "public function getPermLink()\n {\n $mode = $this->tool()->filesystem()->getPermissionsMode();\n \n if ($mode === Aitoc_Aitsys_Model_Core_Filesystem::MODE_ALL) {\n return Aitoc_Aitsys_Model_Core_Filesystem::MODE_NORMAL;\n } else {\n return Aitoc_Aitsys_Model_Core_Filesystem::MODE_ALL;\n }\n }", "private static function _get_option_permission_root(){\n if ( is_null(self::$id_option_permission_root) ){\n /** @var bbn\\appui\\options $opt */\n if ( $opt = bbn\\appui\\options::get_options() ){\n self::$id_option_permission_root = $opt->from_code('options', 'misc', 'bbn_permissions');\n }\n }\n return self::$id_option_permission_root;\n }", "public function getPerm()\n {\n return $this->perm;\n }", "public function getEveryoneAccessMode()\n {\n return $this->chmod_group;\n }", "public function getWorkspacePermission() {}", "public function getProvisionSftpPermission() {\n return $this->attributes['provision_sftp_permission'];\n }", "protected function getCurrentPermission() {}", "private function field_permissions($field_name, $perm_name, $label, $field_values, $is_object, $is_options, $permission) {\n\t $values = self::$FIELD_OPTIONS;\n if ($is_options) {\n unset($values['a']);\n unset($values['d']);\n }\n\n $field = 'permissions-'.$perm_name;\n $params = array();\n if ($is_object) {\n $params['label'] = $label.($is_options ? ' (Options)' : '');\n }\n $params['name'] = $field;\n\t\t$params['values'] = $values;\n $params['value'] = $field_values;\n\t\t$params['placeholder'] = 'No permissions set';\n\t\t$params['is_multiple'] = true;\n\t\t$params['use_template_vars'] = false;\n\t\t$params['is_readonly'] = $permission->has_add() === false && $permission->has_update() === false;\n\t\t$params['attr']['id'] = $field;\n\t\t$params['attr']['class'] = 'permissions';\n\t\t$params['attr']['data-native-menu'] = 'false';\n $params['attr']['data-field'] = $field_name;\n $params['attr']['data-object'] = $is_object ? 1 : 0;\n\t\treturn form_select($params);\n\t}", "public abstract function getPermissions();", "public function getPermissionString()\n {\n $permission = $this->getPermission();\n\n if (!$permission) {\n return \"*\";\n }\n\n return $permission;\n }", "public function permission($permission)\n {\n return $this->plan()->permissions[$permission];\n }", "protected function _buildPermissionsArgument()\n {\n $permissions = $this->_Pdf->permissions();\n\n if ($permissions === false) {\n return false;\n }\n\n $allowed = [];\n\n if ($permissions === true) {\n $allowed[] = 'AllFeatures';\n }\n\n if (is_array($permissions)) {\n foreach ($permissions as $permission) {\n $allowed[] = $this->_permissionsMap[$permission];\n }\n }\n\n return implode(' ', $allowed);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if a Xml Node hast only HTML Tags in it, recursive function
protected static function hasOnlyHtmlTags(SimpleXMLElement $xml) { foreach($xml as $child) { if(!in_array($child->getName(), self::$ignoreTags)) { return false; } if(sizeof($child->children()) > 0) { return self::hasOnlyHtmlTags($child->children()); } } return true; }
[ "function tidy_is_xhtml () {}", "function tidy_is_xml () {}", "function tidy_is_xhtml(tidy $object) {}", "public function hasHtml(): bool;", "function is_html($string){\n\t\t\treturn preg_match(\"/<[^<]+>/\",$string,$m) != 0;\n\t\t}", "public function isXhtml() {}", "public function hasHTML()\n {\n return ($this->getStripedContents() != $this->contents);\n }", "public function isSelfClosingTag();", "public function isHTML(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_HTML );\n\t}", "private function is_html()\n\t{\n\t\treturn TRUE;\n\t}", "public static function hasInnerHtml( SimpleXMLElement $field )\n\t{\n\t\treturn ( isset($field->inner) && '' !== (string)$field->inner ) ? true : false;\n\t}", "public function supports (HtmlNode $node) : bool;", "public function shouldHaveClosingTag(): bool {\r\n return false === $this -> isLanguageNode() && false === $this -> isClosingTag() && false === $this -> isNoBodyNode() && false === $this -> isSelfClosingNode();\r\n }", "function is_html($string)\n {\n return strcasecmp($string, strip_tags($string)) !== 0;\n }", "function hasContent()\n\t{\n\t\tif(version_compare(phpversion(), \"5.0.0\", \"<\"))\n\t\t{\n\t\t\t$content = ereg_replace('&#([0-9]*);', '', $this->nodeData->content);\n\t\t\t$content = html_entity_decode($content);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($this->nodeData->nodeType === XML_TEXT_NODE)\n\t\t\t\treturn true;\n\t\t\t\n\t\t\treturn false;\n\t\t\t//$content = ereg_replace('&#([0-9]*);', '', $this->nodeData->textContent);\n\t\t\t//$content = html_entity_decode($content);\n\t\t}\n\t\t\n//\t\tvar_dump($content);\n\t\t\n\t\t//$content = trim(str_replace('&#160;', '', $this->nodeData->content));\n\t\t//$content = trim(str_replace('&#160;', '', $this->nodeData->content));\n\n\t\treturn $content ? 1 : 0;\n\t}", "public static function is_html_tag($string){\n\t\t$regEx = '/^<([a-z]+)([^<]+)*(?:>(.*)<\\/(?1)>|\\s+\\/>)$/';\n\t\treturn preg_match($regEx, $string);\n\t}", "function is_html( $string )\n\t{\n\t\treturn $string != strip_tags( $string ) ? TRUE : FALSE;\n\t}", "public function bodyIsHtml()\n\t{\n\t\tif ($this->data['body'] != strip_tags($this->data['body']))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function contains_html_tag($string){\n $tag_regex = \"/\\.*<.*>.*<\\/.*>.*/\";\n return preg_match($tag_regex, $string);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for designAtomsServiceCreateDesign Creates new design file with specified parameters and saves it in storage..
public function testDesignAtomsServiceCreateDesign() { // TODO: implement $this->markTestIncomplete('Not implemented'); }
[ "public function createNewDesignAction() {\n $design = Mage::getModel('shirtdesigner/design');\n $param = $this->getRequest()->getParams();\n \n define('UPLOAD_DIR', 'media/shirtdesigner/images/custom-designs/');\n $img = $param['front-image-code'];\n $img = str_replace('data:image/png;base64,', '', $img);\n $img = str_replace(' ', '+', $img);\n $data = base64_decode($img);\n $file = UPLOAD_DIR . 'f-'.$param['design-id'].'.png';\n $success = file_put_contents($file, $data);\n \n \n $img2 = $param['back-image-code'];\n $img2 = str_replace('data:image/png;base64,', '', $img2);\n $img2 = str_replace(' ', '+', $img2);\n $data2 = base64_decode($img2);\n $file2 = UPLOAD_DIR . 'b-'.$param['design-id'].'.png';\n $success2 = file_put_contents($file2, $data2);\n \n $img3 = $param['left-image-code'];\n $img3 = str_replace('data:image/png;base64,', '', $img3);\n $img3 = str_replace(' ', '+', $img3);\n $data3 = base64_decode($img3);\n $file3 = UPLOAD_DIR . 'l-'.$param['design-id'].'.png';\n $success3 = file_put_contents($file3, $data3);\n \n \n $img4 = $param['right-image-code'];\n $img4 = str_replace('data:image/png;base64,', '', $img4);\n $img4 = str_replace(' ', '+', $img4);\n $data4 = base64_decode($img4);\n $file4 = UPLOAD_DIR . 'r-'.$param['design-id'].'.png';\n $success4 = file_put_contents($file4, $data4);\n \n \n \n $design->setShirtColor($param['shirt-color']);\n $design->setSku($param['sku']);\n if(strlen($param['front-text-1']) > 0){\n $design->setFrontText_1($param['front-text-1']);\n $design->setFrontText_1Size($param['front-text-1-size']);\n $design->setFrontText_1Color($param['front-text-1-color']);\n $design->setFrontText_1Font($param['front-text-1-font']);\n $design->setFrontText_1Style($param['front-text-1-style']);\n }\n if(strlen($param['front-text-2']) > 0){\n $design->setFrontText_2($param['front-text-2']);\n $design->setFrontText_2Size($param['front-text-2-size']);\n $design->setFrontText_2Color($param['front-text-2-color']);\n $design->setFrontText_2Font($param['front-text-2-font']);\n $design->setFrontText_2Style($param['front-text-2-style']);\n }\n \n if(strlen($param['front-text-3']) > 0){\n $design->setFrontText_3($param['front-text-3']);\n $design->setFrontText_3Size($param['front-text-3-size']);\n $design->setFrontText_3Color($param['front-text-3-color']);\n $design->setFrontText_3Font($param['front-text-3-font']);\n $design->setFrontText_3Style($param['front-text-3-style']);\n }\n if(strlen($param['back-text-1']) > 0){\n $design->setBackText_1($param['back-text-1']);\n $design->setBackText_1Size($param['back-text-1-size']);\n $design->setBackText_1Color($param['back-text-1-color']);\n $design->setBackText_1Font($param['back-text-1-font']);\n $design->setBackText_1Style($param['back-text-1-style']);\n }\n if(strlen($param['back-text-2']) > 0){\n $design->setBackText_2($param['back-text-2']);\n $design->setBackText_2Size($param['back-text-2-size']);\n $design->setBackText_2Color($param['back-text-2-color']);\n $design->setBackText_2Font($param['back-text-2-font']);\n $design->setBackText_2Style($param['back-text-2-style']);\n }\n if(strlen($param['back-text-3']) > 0){ \n $design->setBackText_3($param['back-text-3']);\n $design->setBackText_3Size($param['back-text-3-size']);\n $design->setBackText_3Color($param['back-text-3-color']);\n $design->setBackText_3Font($param['back-text-3-font']);\n $design->setBackText_3Style($param['back-text-3-style']);\n }\n \n if(strlen($param['left-text-1']) > 0){\n $design->setLeftText_1($param['left-text-1']);\n $design->setLeftText_1Size($param['left-text-1-size']);\n $design->setLeftText_1Color($param['left-text-1-color']);\n $design->setLeftText_1Font($param['left-text-1-font']);\n $design->setLeftText_1Style($param['left-text-1-style']);\n }\n if(strlen($param['left-text-2']) > 0){\n $design->setLeftText_2($param['left-text-2']);\n $design->setLeftText_2Size($param['left-text-2-size']);\n $design->setLeftText_2Color($param['left-text-2-color']);\n $design->setLeftText_2Font($param['left-text-2-font']);\n $design->setLeftText_2Style($param['left-text-2-style']);\n }\n if(strlen($param['left-text-3']) > 0){ \n $design->setLeftText_3($param['left-text-3']);\n $design->setLeftText_3Size($param['left-text-3-size']);\n $design->setLeftText_3Color($param['left-text-3-color']);\n $design->setLeftText_3Font($param['left-text-3-font']);\n $design->setLeftText_3Style($param['left-text-3-style']);\n }\n \n if(strlen($param['right-text-1']) > 0){\n $design->setRightText_1($param['right-text-1']);\n $design->setRightText_1Size($param['right-text-1-size']);\n $design->setRightText_1Color($param['right-text-1-color']);\n $design->setRightText_1Font($param['right-text-1-font']);\n $design->setRightText_1Style($param['right-text-1-style']);\n }\n if(strlen($param['right-text-2']) > 0){\n $design->setRightText_2($param['right-text-2']);\n $design->setRightText_2Size($param['right-text-2-size']);\n $design->setRightText_2Color($param['right-text-2-color']);\n $design->setRightText_2Font($param['right-text-2-font']);\n $design->setRightText_2Style($param['right-text-2-style']);\n }\n if(strlen($param['right-text-3']) > 0){ \n $design->setRightText_3($param['right-text-3']);\n $design->setRightText_3Size($param['right-text-3-size']);\n $design->setRightText_3Color($param['right-text-3-color']);\n $design->setRightText_3Font($param['right-text-3-font']);\n $design->setRightText_3Style($param['right-text-3-style']);\n }\n \n \n $design->setFrontImages($param['arts']);\n $design->setBackImages($param['arts2']);\n $design->setLeftImages($param['arts3']);\n $design->setRightImages($param['arts4']);\n \n $design->setFrontDesignUrl(UPLOAD_DIR . 'f-'.$param['design-id'].'.png');\n $design->setBackDesignUrl(UPLOAD_DIR . 'b-'.$param['design-id'].'.png');\n $design->setLeftDesignUrl(UPLOAD_DIR . 'l-'.$param['design-id'].'.png');\n $design->setRightDesignUrl(UPLOAD_DIR . 'r-'.$param['design-id'].'.png');\n \n $design->setS($param['s-size']);\n $design->setM($param['m-size']);\n $design->setL($param['l-size']);\n $design->setXl($param['xl-size']);\n \n $qty = intval($param['s-size']) + intval($param['m-size']) + intval($param['l-size']) + intval($param['xl-size']);\n \n $design->save(); \n \n Mage::getSingleton('core/session')->setDesignId($param['design-id']);\n Mage::getSingleton('core/session')->setNewPrice($param['product-price-final']);\n Mage::log('product-price-final: '. $param['product-price-final'] );\n $myData = Mage::getSingleton('core/session')->getNewPrice();\n Mage::log('mydata: '. $myData );\n \n $url = Mage::getUrl('',array('_secure'=>true));\n $url = $url.'checkout/cart/add?product='.$param['product-id'].'&qty='.$qty; //checkout/cart/add?product=14&qty=1\n //echo '<script type=\"text/javascript\">alert(\"'.$url.'\");</script>';\n Mage::log('redirect: '. $url);\n $this->_redirectUrl($url);\n \n }", "public function testDesignProcessorExportDesign()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testDesignAtomsServiceSaveDataSchema()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function createDesignx(){\n global $base_secure_url;\n $uid = \\Drupal::currentUser()->id();\n\t\t$user = User::load($uid);\n\t\t$name = $user->get('name')->value;\n\t\t$email = $user->get('mail')->value;\n\t\t$roles = $user->getRoles();\n\t\t$config = \\Drupal::config('media_design_system.kmdsapisettings')->get();\n\t\t$access_check_api = $config['access_check_api'];\n\t\t//$api_key = $this->kmdsAccessToken();\n\t\t$api_key = \\Drupal::service('km_product.templates')->getAuthCode();\n\t\t$adminRole = (in_array('administrator', $roles)) ? 'administrator' : '';\n\t\tif (!$user->user_picture->isEmpty()) {\n $avatar = file_create_url($user->user_picture->entity->getFileUri());\n }else{\n $avatar = 'https://s3.us-west-2.amazonaws.com/kaboodlemedia.com/s3fs_public/styles/thumbnail/public/default_images/default_person_picture.jpg'; \n }\n // default media kit\n $default_media_kit_id = $this->getDefaultMediaKit($uid);\n // default media vault\n $media_vault_id = $this->getDefaultMediaVault($uid);\n $render_data = array();\n $render_data['theme_data'] = array(\n '#theme' => 'kmds_design_tool_templatex', \n '#attached' => [\n 'library' => [\n 'media_design_system/fabric',\n 'media_design_system/bootstrap_cdn',\n 'media_design_system/colorPicker',\n 'media_design_system/kmds_design_toolx',\n // 'media_design_system/kmds_ruler'\n ],\n ],\n );\n $render_data['theme_data']['#attached']['drupalSettings']['media_base_url'] = $base_secure_url;\n $render_data['theme_data']['#attached']['drupalSettings']['access_check_api'] = $access_check_api;\n $render_data['theme_data']['#attached']['drupalSettings']['api_key'] = $api_key;\n $render_data['theme_data']['#attached']['drupalSettings']['uid'] = $uid;\n $render_data['theme_data']['#attached']['drupalSettings']['name'] = $name;\n $render_data['theme_data']['#attached']['drupalSettings']['email'] = $email;\n\t\t$render_data['theme_data']['#attached']['drupalSettings']['adminRole'] = $adminRole;\n $render_data['theme_data']['#attached']['drupalSettings']['avatar'] = $avatar;\n $render_data['theme_data']['#attached']['drupalSettings']['media_vault_id'] = $media_vault_id;\n $render_data['theme_data']['#attached']['drupalSettings']['default_media_kit_id'] = $default_media_kit_id;\n\n return $render_data;\n\t}", "function create_scen ($dir) {\n\t$data = $_POST['data'];\n\t#create the scenario object\n\t$doc = new DOMDocument();\n\t$doc->formatOutput = true;\n\t$eclipse = $doc->createElement(\"org.eclipse.stem.core.scenario:Scenario\");\n\t$dublinCore = $doc->createElement(\"dublinCore\");\n\t$model = $doc->createElement(\"model\");\n\t$sequencer = $doc->createElement(\"sequencer\");\n\t$scenarioDecorators = $doc->createElement(\"scenarioDecorators\");\n\t$solver = $doc->createElement(\"solver\");\n\t$dublin2 = $doc->createElement(\"dublinCore\");\n\t$v = $data[scenario][name];\n\t$n = $data[project_name];\n\t$eclipse->setAttribute(\"xmi:version\",\"2.0\");\n\t$eclipse->setAttribute(\"xmlns:xmi\",\"http://www.omg.org/XMI\");\n\t$eclipse->setAttribute(\"xmlns:xsi\",\"http://www.w3.org/2001/XMLSchema-instance\");\n\t$eclipse->setAttribute(\"xmlns:org.eclipse.stem.core.scenario\",\"http:///org/eclipse/stem/core/scenario.ecore\");\n\t$eclipse->setAttribute(\"xmlns:org.eclipse.stem.core.sequencer\",\"http:///org/eclipse/stem/core/sequencer.ecore\");\n\t$eclipse->setAttribute(\"xmlns:org.eclipse.stem.solvers.fd\",\"http:///org/eclipse/stem/solvers/fd\");\n\t$eclipse->setAttribute(\"uRI\",\"platform:/resource/$n/scenarios/$v.scenario\");\n\t$eclipse->setAttribute(\"typeURI\",\"stemtype://org.eclipse.stem/Scenario\");\n\t$value = $data[scenario][solver];\n\t$n = $data[scenario][name];\n\t$n_s = split($n, \".scenario\");\n\t$dublinCore->setAttribute(\"identifier\", \"platform:/resource/$data[project_name]/scenarios/$n.scenario\");\n\t$dublinCore->setAttribute(\"description\",\"Scenario &quot;$n_s&quot;\");\n\t$dublinCore->setAttribute(\"format\",\"http:///org/eclipse/stem/core/scenario.ecore\");\n\t$dublinCore->setAttribute(\"type\", \"stemtype://org.eclipse.stem/Scenario\");\n\t\n\t$list = array_keys($data[scenario]);\n\tforeach ($list as $i) {\n\t\tif ($i == \"model\") {\n\t\t\t$model->setAttribute(\"href\", \"platform:/resource/$data[project_name]/models/\" . $data[scenario][model] . \"#/\");\n\t\t}\n\t\tif ($i == \"sequencer\") {\n\t\t\t$sequencer->setAttribute(\"xsi:type\", \"org.eclipse.stem.core.sequencer:SequentialSequencer\");\n\t\t\t$sequencer->setAttribute(\"href\", \"platform:/resource/$data[project_name]/sequencers/\" . $data[scenario][sequencer] . \"#/\");\n\t\t}\n\t\tif ($i == \"solver\") {\n\t\t\t$value = $data[scenario][solver];\n\t\t\t#dublin core for scenario object\n\t\t\t#solver for scenario object\n\t\t\tif($value == \"FiniteDifferenceImpl\") {\n\t\t\t\t$solver->setAttribute(\"xsi:type\", \"org.eclipse.stem.solvers.fd:FiniteDifference\");\n\t\t\t\t$solver->setAttribute(\"uRI\", \"stem://org.eclipse.stem/FiniteDifferenceSolver/59D0CC01154C55B8\");\n\t\t\t\t$solver->setAttribute(\"typeURI\", \"stemtype://org.eclipse.stem/Solver\");\n\n\t\t\t\t$dublin2->setAttribute(\"identifier\", \"stem://org.eclipse.stem/FiniteDifferenceSolver/59D0CC01154C55B8\");\n\t\t\t\t$dublin2->setAttribute( \"type\", \"stemtype://org.eclipse.stem/Solver\");\n\t\t\t} else {\n\t\t\t #scince there are only 2 options the answer should be RungeKuttaImpl\n\t\t\t\t$solver->setAttribute(\"xsi:type\", \"org.eclipse.stem.solvers.rk:RungeKutta\");\n\t\t\t\t$solver->setAttribute(\"uRI\", \"stem://org.eclipse.stem/RungeKuttaSolver/46316E0140EE9BA2\");\n\t\t\t\t$solver->setAttribute(\"typeURI\", \"stemtype://org.eclipse.stem/Solver\");\n\t\n\t\t\t\t$dublin2->setAttribute(\"identifier\", \"stem://org.eclipse.stem/RungeKuttaSolver/46316E0140EE9BA2\");\n\t\t\t\t$dublin2->setAttribute( \"type\", \"stemtype://org.eclipse.stem/Solver\");\n\t\t\t}\n\t\t}\n\t\tif ($i == \"infector\") {\n\t\t\t$scenarioDecorators->setAttribute(\"href\",\"platform:/resource/$data[project_name]/decorators/\" . $data[scenario][infector] . \"#/\");\n\t\t}\n\t\tif ($i == \"inoculators\") {\n\t\t\t$arr = $data[scenario][inoculators];\n\t\t\tforeach ($arr as $k) {\n\t\t\t\t$scenarioDecorators->setAttribute(\"href\", \"platform:/resource/$n/decorators/\" . $i . \"#/\");\n\t\t\t}\n\t\t}\n\t}\n\t#save up the scenario object.\n\t$eclipse->appendChild($dublinCore);\n\t$eclipse->appendChild($model);\n\t$eclipse->appendChild($sequencer);\n\t$eclipse->appendChild($scenarioDecorators);\n\t$solver->appendChild($dublin2);\n\t$eclipse->appendChild($solver);\n\t$doc->appendChild($eclipse);\n\t$v = $data[scenario][name];\n\t$doc->save($dir . \"/scenarios/$v.scenario\");\n}", "public function testPrivateDesignsCreateFolder()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function create_every_view($action,$view_file,$entity,$fields_skel){\r\n $file = $view_file;\r\n $function_content = \"generate_\".$action.\"_view\";\r\n $content = $function_content($entity,$fields_skel);\r\n create_file($file, $content);\r\n}", "public function testDesignsCreateCollection()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function designProcessorCreateBlankDesignRequest($tenant_id = null, $create_blank_design_model = null)\n {\n\n $resourcePath = '/api/processor/v1/designs/blank';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($tenant_id !== null) {\n if('form' === 'form' && is_array($tenant_id)) {\n foreach($tenant_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tenantId'] = $tenant_id;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($create_blank_design_model)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($create_blank_design_model));\n } else {\n $httpBody = $create_blank_design_model;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n // aurigmafix 6\n if (gettype($formParamValueItem) === 'object') {\n if (!($formParamValueItem instanceof StreamInterface \n || $formParamValueItem instanceof \\Iterator \n || method_exists($formParamValueItem, '__toString'))) {\n $formParamValueItem = json_encode($formParamValueItem);\n }\n } \n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Key');\n if ($apiKey !== null) {\n $headers['X-API-Key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function createXmlFile()\r\n\t{\r\n\t\t// nothing to do here\r\n\t\treturn true;\r\n\t}", "public function privateDesignProcessorCreateBlankDesignRequest($tenant_id = null, $owner_id = null, $create_blank_design_model = null)\n {\n\n $resourcePath = '/api/processor/v1/private-designs/blank';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($tenant_id !== null) {\n if('form' === 'form' && is_array($tenant_id)) {\n foreach($tenant_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tenantId'] = $tenant_id;\n }\n }\n // query params\n if ($owner_id !== null) {\n if('form' === 'form' && is_array($owner_id)) {\n foreach($owner_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['ownerId'] = $owner_id;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($create_blank_design_model)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($create_blank_design_model));\n } else {\n $httpBody = $create_blank_design_model;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n // aurigmafix 6\n if (gettype($formParamValueItem) === 'object') {\n if (!($formParamValueItem instanceof StreamInterface \n || $formParamValueItem instanceof \\Iterator \n || method_exists($formParamValueItem, '__toString'))) {\n $formParamValueItem = json_encode($formParamValueItem);\n }\n } \n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Key');\n if ($apiKey !== null) {\n $headers['X-API-Key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n // aurigmafix 3\n $token = $this->config->getAccessToken();\n if ($token !== null && $token !== '' && !ctype_space($token)) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function addDesignation() {\n global $REQUEST_DATA;\n\n return SystemDatabaseManager::getInstance()->runAutoInsert('designation', array('designationName','designationCode','description'), array($REQUEST_DATA['designationName'],strtoupper($REQUEST_DATA['designationCode']),$REQUEST_DATA['description']));\n }", "public function createDocx()\n {\n $args = func_get_args();\n if (!empty($args[0])) {\n $fileName = $args[0];\n } else {\n $fileName = 'document';\n }\n self::$log->info('Set DOCX name to: ' . $fileName . '.');\n if (!CreateTemplate::getBlnTemplate()) {\n self::$log->debug('DOCX is a new file, not a template.');\n try {\n GenerateDocx::beginDocx();\n }\n catch (Exception $e) {\n self::$log->fatal($e->getMessage());\n exit();\n }\n $this->generateTemplateRelsRels();\n self::$log->info('Add _rels/.rels content to DOCX file.');\n $this->_zipDocx->addFromString('_rels/.rels', $this->_relsRelsT);\n $this->generateTemplateDocPropsApp();\n self::$log->info('Add docProps/app.xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n 'docProps/app.xml', $this->_docPropsAppT\n );\n $this->generateTemplateDocPropsCore();\n self::$log->info('Add docProps/core.xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n 'docProps/core.xml', $this->_docPropsCoreT\n );\n \n if (!empty($this->_markAsFinal)\n \t|| !empty($this->_docPropsCustomC))\n {\n\t $this->generateTemplateDocPropsCustom();\n\t self::$log->info('Add docProps/custom.xml content to DOCX file.');\n\t $this->_zipDocx->addFromString(\n\t \t'docProps/custom.xml', $this->_docPropsCustomT\n\t );\n }\n $this->addStyle($this->_language);\n $this->generateTemplateWordStyles();\n self::$log->info('Add word/styles.xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n 'word/styles.xml', $this->_wordStylesT\n );\n\n $this->addSettings();\n $this->generateTemplateWordSettings();\n self::$log->info('Add word/settings.xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n 'word/settings.xml', $this->_wordSettingsT\n );\n\n $this->addWebSettings();\n $this->generateTemplateWordWebSettings();\n self::$log->info('Add word/webSettings.xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n 'word/webSettings.xml', $this->_wordWebSettingsT\n );\n\n if (!empty($this->_wordFooterC)) {\n self::$log->debug('There is a footer, add it.');\n $this->generateTemplateWordFooter();\n self::$log->info('Add word/footer.xml content to DOCX file.');\n if (self::$_encodeUTF) {\n $this->_zipDocx->addFromString(\n 'word/footer.xml', utf8_encode($this->_wordFooterT)\n );\n } else {\n $this->_zipDocx->addFromString(\n 'word/footer.xml', $this->_wordFooterT\n );\n }\n if (CreateEndnote::$init == 0) {\n self::$log->debug('There is no endnote, add default one.');\n $this->addDefaultEndnote();\n }\n $this->generateTemplateWordEndnotes();\n self::$log->info('Add word/endnotes.xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n 'word/endnotes.xml', $this->_wordEndnotesT\n );\n if (CreateFootnote::$init == 0) {\n self::$log->debug('There is no footnote, add default one.');\n $this->addDefaultFootnote();\n }\n $this->generateTemplateWordFootnotes();\n self::$log->info(\n 'Add word/footnotes.xml content to DOCX file.'\n );\n $this->_zipDocx->addFromString(\n 'word/footnotes.xml', $this->_wordFootnotesT\n );\n } elseif (\n !empty($this->_wordEndnotesC) ||\n !empty($this->_wordFootnotesC)\n ) {\n self::$log->debug(\n 'There is an endnote or footnote, add them.'\n );\n if (CreateEndnote::$init == 0) {\n self::$log->debug(\n 'There is no endnote, add default one.'\n );\n $this->addDefaultEndnote();\n }\n $this->generateTemplateWordEndnotes();\n self::$log->info(\n 'Add word/endnotes.xml content to DOCX file.'\n );\n $this->_zipDocx->addFromString(\n 'word/endnotes.xml', $this->_wordEndnotesT\n );\n if (CreateFootnote::$init == 0) {\n self::$log->debug(\n 'There is no footnote, add default one.'\n );\n $this->addDefaultFootnote();\n }\n $this->generateTemplateWordFootnotes();\n self::$log->info(\n 'Add word/footnotes.xml content to DOCX file.'\n );\n $this->_zipDocx->addFromString(\n 'word/footnotes.xml', $this->_wordFootnotesT\n );\n }\n\n if (!empty($this->_wordHeaderC)) {\n self::$log->debug('There is a header, add it.');\n $this->generateTemplateWordHeader();\n self::$log->info('Add word/header.xml content to DOCX file.');\n if (self::$_encodeUTF) {\n $this->_zipDocx->addFromString(\n 'word/header.xml', utf8_encode($this->_wordHeaderT)\n );\n } else {\n $this->_zipDocx->addFromString(\n 'word/header.xml', $this->_wordHeaderT\n );\n }\n }\n self::$log->debug('Check for a valid license.');\n GenerateDocx::beginDocx();\n if (!empty($this->_wordRelsHeaderRelsC)) {\n self::$log->debug('There is a header rels, add it.');\n $this->generateTemplateWordRelsHeaderRels();\n self::$log->info(\n 'Add word/_rels/header.xml.rels content to DOCX file.'\n );\n $this->_zipDocx->addFromString(\n 'word/_rels/header.xml.rels', $this->_wordRelsHeaderRelsT\n );\n }\n if (!empty($this->_wordRelsFooterRelsC)) {\n self::$log->debug('There is a footer rels, add it.');\n $this->generateTemplateWordRelsFooterRels();\n self::$log->info(\n 'Add word/_rels/footer.xml.rels content to DOCX file.'\n );\n $this->_zipDocx->addFromString(\n 'word/_rels/footer.xml.rels', $this->_wordRelsFooterRelsT\n );\n }\n if ($this->_extension == 'docm') {\n self::$log->debug('It is a macro, generate a new override');\n $this->generateOVERRIDE(\n '/word/document.xml',\n 'application/vnd.ms-word.document.macroEnabled.main+xml'\n );\n } else {\n self::$log->debug('It isnt a macro, generate a new override');\n $this->generateOVERRIDE(\n '/word/document.xml',\n 'application/vnd.openxmlformats-officedocument.' .\n 'wordprocessingml.document.main+xml'\n );\n }\n\n $this->generateTemplateContentType();\n self::$log->info('Add [Content_Types].xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n '[Content_Types].xml',\n $this->_wordContentTypeT\n );\n \n if (!empty($this->_wordDocumentStyles)) {\n \t$this->generateTemplateWordNumberingStyles();\n } else {\n \t$this->generateTemplateWordNumbering();\n }\n self::$log->info('Add word/numbering.xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n 'word/numbering.xml', $this->_wordNumberingT\n );\n\n $this->generateDefaultWordRels();\n if (!empty($this->_wordRelsDocumentRelsC)) {\n self::$log->debug('There is a word rels, add it.');\n $this->generateTemplateWordRelsDocumentRels();\n self::$log->info(\n 'Add word/_rels/document.xml.rels content to DOCX file.'\n );\n $this->_zipDocx->addFromString(\n 'word/_rels/document.xml.rels',\n $this->_wordRelsDocumentRelsT\n );\n }\n $arrArgsPage = array();\n if (isset($args[1])) {\n self::$log->debug('Page arguments.');\n $arrArgsPage = $args[1];\n }\n $this->generateTemplateWordDocument($arrArgsPage);\n if ($this->_debug->getActive() == 1) {\n self::$log->debug('Debug is active, add messages to objDebug.');\n libxml_use_internal_errors(true);\n simplexml_load_string(\n $this->_wordDocumentT, 'SimpleXMLElement', LIBXML_NOWARNING\n );\n $xmlErrors = libxml_get_errors();\n if (is_array($xmlErrors)) {\n $this->_debug->addMessage($xmlErrors);\n libxml_clear_errors();\n }\n }\n\n self::$log->info('Add word/document.xml content to DOCX file.');\n if (self::$_encodeUTF) {\n $this->_zipDocx->addFromString(\n 'word/document.xml', utf8_encode($this->_wordDocumentT)\n );\n } else {\n $this->_zipDocx->addFromString(\n 'word/document.xml', $this->_wordDocumentT\n );\n }\n\n $this->generateDefaultFonts();\n $this->generateTemplateWordFontTable();\n self::$log->info('Add word/fontTable.xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n 'word/fontTable.xml', $this->_wordFontTableT\n );\n\n $this->generateTemplateWordThemeTheme1();\n self::$log->info('Add word/theme/theme1.xml content to DOCX file.');\n $this->_zipDocx->addFromString(\n 'word/theme/theme1.xml', $this->_wordThemeThemeT\n );\n\n self::$log->info('End of file, close it.');\n $this->_zipDocx->close();\n\n $arrpathFile = pathinfo($fileName);\n self::$log->info('Copy DOCX file using a new name.');\n copy(\n $this->_tempFile,\n $fileName . '.' . $this->_extension\n );\n\n if ($this->_debug->getActive() == 1) {\n self::$log->debug('Debug is active, show messages.');\n echo $this->_debug;\n }\n } else {\n self::$log->debug('DOCX is a template.');\n self::$log->info(\n 'Create a temp copy of the file, to generate a new DOCX.'\n );\n $finalFileName = $fileName . '.' . $this->_extension;\n $fileName = tempnam($this->_tempDir, $fileName);\n copy(CreateTemplate::$path, $fileName);\n $zipDocxTemplate = new ZipArchive();\n try {\n if ($zipDocxTemplate->open($fileName)) {\n if (count(CreateTemplate::getFooter()) > 0) {\n $footers = CreateTemplate::getFooter();\n $i = 1;\n foreach ($footers as $footer) {\n self::$log->info('Footer exists, replace word/footer' . $i . '.xml with a new footer.');\n $zipDocxTemplate->addFromString('word/footer' . $i . '.xml', $footer);\n $i++;\n }\n }\n if (count(CreateTemplate::getHeader()) > 0) {\n $headers = CreateTemplate::getHeader();\n $i = 1;\n foreach ($headers as $header) {\n self::$log->info('Footer exists, replace word/header' . $i . '.xml with a new header.');\n $zipDocxTemplate->addFromString('word/header' . $i . '.xml', $header);\n $i++;\n }\n }\n if (CreateTemplate::getRelsDocumentXMLRels() != '') {\n self::$log->info(\n 'Document.xml.rels exists, replace word/_rels/' .\n 'document.xml.rels with a new document.'\n );\n $zipDocxTemplate->addFromString(\n 'word/_rels/document.xml.rels',\n CreateTemplate::getRelsDocumentXMLRels()\n );\n }\n if (count(CreateTemplate::$placeholderImages) > 0) {\n self::$log->info(\n 'There is one or more images as placeholders, . ' .\n 'replace them.'\n );\n CreateTemplate::replaceImages($zipDocxTemplate);\n }\n if (CreateTemplate::$totalTemplateCharts > 0) {\n self::$log->info(\n 'There is one or more charts as placeholders, . ' .\n 'replace them.'\n );\n for ($i = CreateTemplate::$ridInitTemplateCharts + 1;\n $i <= self::$intIdWord; $i++\n ) {\n $zipDocxTemplate->addFromString(\n 'word/charts/chart' . $i . '.xml',\n $this->graphicTemplate['arrChartXML'][$i]\n );\n CreateTemplate::replaceVariableChart(\n $this->graphicTemplate['arrGraphics'][$i],\n $i\n );\n $zipDocxTemplate->addFile(\n $this->_tempFileXLSX[$i],\n $this->fileGraphicTemplate['datos' . $i . '.xlsx']\n );\n $zipDocxTemplate->addFromString(\n 'word/charts/_rels/chart' . $i . '.xml.rels',\n $this->fileGraphicTemplate['word/charts/_rels/chart' . $i . '.xml.rels']\n );\n\n CreateTemplate::addContentTypes(\n $this->graphicTemplate['arrGenerateOVERRIDE'][$i]\n );\n CreateTemplate::addContentTypes(\n $this->graphicTemplate['arrGenerateDEFAULT'][$i]\n );\n CreateTemplate::addRelationship(\n $this->graphicTemplate['arrRelationships'][$i]\n );\n }\n\n }\n self::$log->info(\n 'Replace [Content_Types].xml with a new document.'\n );\n $zipDocxTemplate->addFromString(\n '[Content_Types].xml',\n CreateTemplate::getContentTypes()\n );\n self::$log->info(\n 'Replace word/_rels/document.xml.rels with a new ' .\n 'document.'\n );\n $zipDocxTemplate->addFromString(\n 'word/_rels/document.xml.rels',\n CreateTemplate::getRelsDocumentXMLRels()\n );\n self::$log->info(\n 'Replace word/document.xml with a new document.'\n );\n if (self::$_encodeUTF) {\n $zipDocxTemplate->addFromString(\n 'word/document.xml',\n utf8_encode(CreateTemplate::getDocument())\n );\n } else {\n $zipDocxTemplate->addFromString(\n 'word/document.xml', CreateTemplate::getDocument()\n );\n }\n self::$log->info(\n 'Add embedded files.'\n );\n foreach (CreateTemplate::$embedFiles as $files) {\n if (isset($files['src_string'])) {\n $zipDocxTemplate->addFromString(\n 'word/' . $files['dest_file'], $files['src_string']\n );\n } elseif (isset($files['src_file'])) {\n $zipDocxTemplate->addFile($files['src_file'], 'word/' . $files['dest_file']);\n }\n }\n self::$log->info('End of file, close it.');\n $zipDocxTemplate->close();\n copy($fileName, $finalFileName);\n } else {\n throw new Exception('Unable to create DOCX file.');\n }\n CreateTemplate::reset();\n }\n catch (Exception $e) {\n self::$log->fatal($e->getMessage());\n exit();\n }\n }\n }", "public function doCreateSpreadsheet(){\n\n\t}", "function CreateDocument(){}", "protected function createFile() {}", "public function testCreatePaymentDesign()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function saveXML() {\n\t\t\t$xmlArray = $this->t3dkptw;\n\t\t\t$xmlDescription = $this->t3dkptw['xmlFileDesc'];\n\t\t\tunset($xmlArray['createNew']);\n\t\t\tunset($xmlArray['gotoStep3']);\n\t\t\tunset($xmlArray['gotoStep4']);\n\t\t\tunset($xmlArray['parentPage']);\n\t\t\tunset($xmlArray['xmlContent']);\n\t\t\tunset($xmlArray['xmlFileName']);\n\t\t\tunset($xmlArray['xmlFileDesc']);\n\t\t\tunset($xmlArray['saveXML']);\n\t\t\tunset($xmlArray['preset']);\n\t\t\t$this->t3dkptw['xmlFileName']=strtolower($this->t3dkptw['xmlFileName']);\n\t\t\t$xmlTree .= t3lib_div::array2xml($xmlArray);\n\t\t\tif (!file_exists('preset/custom/'.$this->t3dkptw['xmlFileName'])) {\n\t\t\t\tmkdir('preset/custom/'.$this->t3dkptw['xmlFileName'], 0744);\n\t\t\t}\n\t\t\tif (!file_exists('preset/custom/'.$this->t3dkptw['xmlFileName'].'/structure.xml')) {\n\t\t\t\t$xmlFile = fopen('preset/custom/'.$this->t3dkptw['xmlFileName'].'/structure.xml', 'x');\n\t\t\t\tfwrite($xmlFile, $xmlTree);\n\t\t\t} else {\n\t\t\t\t$xmlFile = fopen('preset/custom/'.$this->t3dkptw['xmlFileName'].'/structure.xml', 'w');\n\t\t\t\tfwrite($xmlFile, $xmlTree);\n\t\t\t}\n\t\t\tfclose($xmlFile);\n\t\t\tif (!file_exists('preset/custom/'.$this->t3dkptw['xmlFileName'].'/description.txt')) {\n\t\t\t\t$descFile = fopen('preset/custom/'.$this->t3dkptw['xmlFileName'].'/description.txt', 'x');\n\t\t\t\tfwrite($descFile, $xmlDescription);\n\t\t\t} else {\n\t\t\t\t$descFile = fopen('preset/custom/'.$this->t3dkptw['xmlFileName'].'/description.txt', 'w');\n\t\t\t\tfwrite($descFile, $xmlDescription);\n\t\t\t}\n\t\t\tfclose($descFile);\n\t\t}", "public function upload_design($store_id, $design) {\n\t\t$params = array(\n\t\t\t'store_id'\t\t\t=> $store_id,\n\t\t\t'design_file' => new Dizzyjam_File($design)\n\t\t);\n\t\treturn $this->api->request('manage/upload_design', $params, true);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getStreamFileAppConfig Retrieves the specified Stream File configuration.
public function getStreamFileAppConfig($serverName, $vhostName, $streamfileName, $appName) { list($response) = $this->getStreamFileAppConfigWithHttpInfo($serverName, $vhostName, $streamfileName, $appName); return $response; }
[ "public function getStreamFileAppConfigAsync($server_name, $vhost_name, $streamfile_name, $app_name)\n {\n return $this->getStreamFileAppConfigAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $app_name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getStreamFileAppConfigAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $app_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\StreamFileAppConfig';\n $request = $this->getStreamFileAppConfigRequest($server_name, $vhost_name, $streamfile_name, $app_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "protected function getStreamFileAppConfigRequest($server_name, $vhost_name, $streamfile_name, $app_name)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling getStreamFileAppConfig'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling getStreamFileAppConfig'\n );\n }\n // verify the required parameter 'streamfile_name' is set\n if ($streamfile_name === null || (is_array($streamfile_name) && count($streamfile_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $streamfile_name when calling getStreamFileAppConfig'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling getStreamFileAppConfig'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/streamfiles/{streamfileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($streamfile_name !== null) {\n $resourcePath = str_replace(\n '{' . 'streamfileName' . '}',\n ObjectSerializer::toPathValue($streamfile_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'appName' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getStreamFileAppConfigAdvAsync($server_name, $vhost_name, $streamfile_name, $app_name)\n {\n return $this->getStreamFileAppConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $app_name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getStreamFileConfigAsync($server_name, $vhost_name, $streamfile_name)\n {\n return $this->getStreamFileConfigAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public static function getApplicationConfigFilePath() {\n\t\treturn self::$application_config_file_path;\n\t}", "public function getStreamFileConfigWithHttpInfo($server_name, $vhost_name, $streamfile_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\StreamFileConfig';\n $request = $this->getStreamFileConfigRequest($server_name, $vhost_name, $streamfile_name);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\StreamFileConfig',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getFsConfig()\n {\n if (!$this->_fsConfig) {\n $config = $this->getServiceLocator()->get('Config');\n $this->_fsConfig = $config['filesystem']['file'];\n }\n return $this->_fsConfig;\n }", "public function readConfigurationFile()\n {\n return file_get_contents(config_path() . '/app.php');\n }", "protected function getStreamFileConfigRequest($server_name, $vhost_name, $streamfile_name)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling getStreamFileConfig'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling getStreamFileConfig'\n );\n }\n // verify the required parameter 'streamfile_name' is set\n if ($streamfile_name === null || (is_array($streamfile_name) && count($streamfile_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $streamfile_name when calling getStreamFileConfig'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/streamfiles/{streamfileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($streamfile_name !== null) {\n $resourcePath = str_replace(\n '{' . 'streamfileName' . '}',\n ObjectSerializer::toPathValue($streamfile_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getStreamFileAppConfigAdvWithHttpInfo($server_name, $vhost_name, $streamfile_name, $app_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\StreamFileAppConfigAdv';\n $request = $this->getStreamFileAppConfigAdvRequest($server_name, $vhost_name, $streamfile_name, $app_name);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\StreamFileAppConfigAdv',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getStreamingConfig()\n {\n return $this->readOneof(1);\n }", "public function getCameraStreamConfig(){\n $retval = [\n 'cameraStreamFormat' => null,\n 'cameraStreamDefaultUrl' => null,\n ];\n\n if($this->shortname != 'CameraStream'){\n return $retval;\n }\n\n $config = Collection::make(json_decode($this->pivot->config, true));\n if($config->get('cameraStreamFormat')){\n $retval['cameraStreamFormat'] = $config->get('cameraStreamFormat');\n }else{\n $retval['cameraStreamFormat'] = 'hls';\n }\n\n if($config->get('cameraStreamDefaultUrl')){\n $retval['cameraStreamDefaultUrl'] = $config->get('cameraStreamDefaultUrl');\n }\n\n return $retval;\n }", "public function getStreamFilesAppConfigAsync($server_name, $vhost_name, $app_name)\n {\n return $this->getStreamFilesAppConfigAsyncWithHttpInfo($server_name, $vhost_name, $app_name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getConfigFile()\n\t{\n\t\treturn $this->configfile;\n\t}", "public function getStreamFileAppConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $app_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\StreamFileAppConfigAdv';\n $request = $this->getStreamFileAppConfigAdvRequest($server_name, $vhost_name, $streamfile_name, $app_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public static function get()\n\t{\n\t\t$configFile = Yii::$app->params[Enum::CONFIG_FILE];\n\t\t$config = require($configFile);\n\n\t\tif (!is_array($config))\n\t\t\treturn [];\n\n\t\treturn $config;\n\t}", "public static function getConfigurationFile() {\n\t\treturn self::$configurationFile;\n\t}", "public function config()\n {\n return $this->miner_getfile(self::FILE_CONFIG);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return set of required form fields used to manage a DataObject's data
public function getFrontEndRequiredFields();
[ "abstract protected function getRequiredFields();", "public function getRequiredFields()\n {\n return [\n ];\n }", "public function getRequiredFields(): array;", "public function getRequiredFields()\n {\n return array();\n }", "public function getRequiredFields()\n\t{\n\t\treturn $this->_required;\n\t}", "public function getRequiredFields()\n {\n return $this->schema->required;\n }", "public function getRequiredFields(): array\n {\n $this->getModel()->getRequiredFields();\n }", "public static function getRequiredFields()\n\t{\n\t\t$requiredFields = [\n\t\t\t'title' => 'string',\n\t\t\t'description' => 'string',\n\t\t\t'price' => 'float',\n\t\t\t'devise' => 'string',\n\t\t\t'console_idConsole' => 'int',\n\t\t];\n\n\t\treturn $requiredFields;\n\t}", "public static function getRequiredFields()\n\t{\n\t\t$requiredFields = [\n\t\t\t'name' => 'string',\n\t\t\t'content' => 'string',\n\t\t\t'console_idConsole' => 'int',\n\t\t];\n\n\t\treturn $requiredFields;\n\t}", "public function getConditionalRequiredFields()\n {\n return [\n ];\n }", "protected function getRequiredFields()\n {\n $required = [];\n foreach($this->schema as $field => $fieldSchema) {\n if(isset($fieldSchema['options']['required']) && $fieldSchema['options']['required']) {\n $required[] = $field;\n }\n }\n return $required;\n }", "public function getRequiredFields()\n {\n return $this->_rootElement->getElements(\"div .field._required\");\n }", "public static function getRequiredFields()\n\t{\n\t\t$requiredFields = [\n\t\t\t'support' => 'string',\n\t\t];\n\n\t\treturn $requiredFields;\n\t}", "public function getFormRequirements() {\r\n\t\treturn new RequiredFields('Amount', 'Currency');\r\n\t}", "public function getAllowedFields();", "public function requiredFieldsProvider()\n {\n return [\n ['id'],\n ['nonce'],\n ['realm'],\n ['signature'],\n ['version'],\n ];\n }", "public function getFillableFields();", "public function getRequired() {\r\n\t\t\t// Se as Propriedades ainda nao foram criadas, retorna nulo\r\n\t\t\tif( !$this->loaded ) return NULL;\r\n\t\t\t\r\n\t\t\t// Se o meto'do Create e loadedNames nao foram executados \r\n\t\t\tif( !$this->create && !$this->loaded_names ) {\r\n\t\t\t\t// executa o me'todo loadedNames\r\n\t\t\t\t$this->loadNames( $this->formList );\r\n\t\t\t\t// O me'todo loadedNames foi executado\r\n\t\t\t\t$this->loaded_names = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Retorna o array com os campos obrigato'rios\r\n\t\t\treturn isset( $this->names[ 'required' ] ) ? $this->names[ 'required' ] : array();\r\n\t\t}", "public function fields()\n {\n return $this->getSpecification()->getConstraints()['allowedFields'];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for postOutboundAttemptlimits Create attempt limits.
public function testPostOutboundAttemptlimits() { }
[ "public function postOutboundAttemptlimits($body)\n {\n list($response) = $this->postOutboundAttemptlimitsWithHttpInfo($body);\n return $response;\n }", "public function testPutOutboundAttemptlimit()\n {\n }", "protected function postOutboundAttemptlimitsRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling postOutboundAttemptlimits'\n );\n }\n\n $resourcePath = '/api/v2/outbound/attemptlimits';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function postOutboundAttemptlimitsAsync($body)\n {\n return $this->postOutboundAttemptlimitsAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function postOutboundAttemptlimitsWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\AttemptLimits';\n $request = $this->postOutboundAttemptlimitsRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\AttemptLimits',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function testFormLimits() {\n $own_submission_user = $this->drupalCreateUser([\n 'view own webform submission',\n 'edit own webform submission',\n 'delete own webform submission',\n 'access webform submission user',\n ]);\n\n $webform_limit = Webform::load('test_form_limit');\n\n /**************************************************************************/\n\n $this->drupalGet('webform/test_form_limit');\n\n // Check webform available.\n $this->assertFieldByName('op', 'Submit');\n\n // Check submission limit blocks.\n $this->assertRaw('0 user submission(s)');\n $this->assertRaw('1 user limit (every minute)');\n $this->assertRaw('0 webform submission(s)');\n $this->assertRaw('4 webform limit (every minute)');\n\n $this->drupalLogin($own_submission_user);\n\n // Check that draft does not count toward limit.\n $this->postSubmission($webform_limit, [], t('Save Draft'));\n $this->drupalGet('webform/test_form_limit');\n $this->assertFieldByName('op', 'Submit');\n $this->assertRaw('A partially-completed form was found. Please complete the remaining portions.');\n $this->assertNoRaw('You are only allowed to have 1 submission for this webform.');\n\n // Check submission limit blocks do not count draft.\n $this->assertRaw('0 user submission(s)');\n $this->assertRaw('0 webform submission(s)');\n\n // Check limit reached and webform not available for authenticated user.\n $sid = $this->postSubmission($webform_limit);\n $this->drupalGet('webform/test_form_limit');\n $this->assertNoFieldByName('op', 'Submit');\n $this->assertRaw('You are only allowed to have 1 submission for this webform.');\n\n // Check submission limit blocks do count submission.\n $this->assertRaw('1 user submission(s)');\n $this->assertRaw('1 webform submission(s)');\n\n // Check authenticated user can edit own submission.\n $this->drupalGet(\"admin/structure/webform/manage/test_form_limit/submission/$sid/edit\");\n $this->assertNoRaw('You are only allowed to have 1 submission for this webform.');\n $this->assertFieldByName('op', 'Save');\n\n $this->drupalLogout();\n\n // Check admin post submission.\n $this->drupalLogin($this->rootUser);\n $sid = $this->postSubmission($webform_limit);\n $this->drupalGet(\"admin/structure/webform/manage/test_form_limit/submission/$sid/edit\");\n $this->assertFieldByName('op', 'Save');\n $this->assertNoRaw('No more submissions are permitted.');\n\n // Check submission limit blocks.\n $this->assertRaw('1 user submission(s)');\n $this->assertRaw('2 webform submission(s)');\n\n $this->drupalLogout();\n\n // Allow anonymous users to edit own submission.\n $role = Role::load('anonymous');\n $role->grantPermission('edit own webform submission');\n $role->save();\n\n // Check webform is still available for anonymous users.\n $this->drupalGet('webform/test_form_limit');\n $this->assertFieldByName('op', 'Submit');\n $this->assertNoRaw('You are only allowed to have 1 submission for this webform.');\n\n // Add 1 more submissions as an anonymous user making the total number of\n // submissions equal to 3.\n $sid = $this->postSubmission($webform_limit);\n\n // Check submission limit blocks.\n $this->assertRaw('1 user submission(s)');\n $this->assertRaw('3 webform submission(s)');\n\n // Check limit reached and webform not available for anonymous user.\n $this->drupalGet('webform/test_form_limit');\n $this->assertNoFieldByName('op', 'Submit');\n $this->assertRaw('You are only allowed to have 1 submission for this webform.');\n\n // Check authenticated user can edit own submission.\n $this->drupalGet(\"admin/structure/webform/manage/test_form_limit/submission/$sid/edit\");\n $this->assertNoRaw('You are only allowed to have 1 submission for this webform.');\n $this->assertFieldByName('op', 'Save');\n\n // Add 1 more submissions as an root user making the total number of\n // submissions equal to 4.\n $this->drupalLogin($this->rootUser);\n $this->postSubmission($webform_limit);\n $this->drupalLogout();\n\n // Check total limit.\n $this->drupalGet('webform/test_form_limit');\n $this->assertNoFieldByName('op', 'Submit');\n $this->assertRaw('Only 4 submissions are allowed.');\n $this->assertNoRaw('You are only allowed to have 1 submission for this webform.');\n\n // Check submission limit blocks.\n $this->assertRaw('0 user submission(s)');\n $this->assertRaw('4 webform submission(s)');\n\n // Check admin can still post submissions.\n $this->drupalLogin($this->rootUser);\n $this->drupalGet('webform/test_form_limit');\n $this->assertFieldByName('op', 'Submit');\n $this->assertRaw('Only 4 submissions are allowed.');\n $this->assertRaw('Only submission administrators are allowed to access this webform and create new submissions.');\n\n // Check submission limit blocks.\n $this->assertRaw('2 user submission(s)');\n $this->assertRaw('4 webform submission(s)');\n\n // Change submission completed to 1 hour ago.\n \\Drupal::database()->query('UPDATE {webform_submission} SET completed = :completed', [':completed' => strtotime('-1 minute')]);\n\n // Check submission limit blocks are removed because the submission\n // intervals have passed.\n $this->drupalGet('webform/test_form_limit');\n $this->assertRaw('0 user submission(s)');\n $this->assertRaw('0 webform submission(s)');\n }", "public function testAllowedMethodNotLimited() {\n\t\t//Exceed method and total limits\n\t\t$this->fakeRequest('rate_limiter_test', 'method_a', 'method_a');\n\t\t$this->fakeRequest('rate_limiter_test', 'method_a', 'method_a');\n\t\t$this->fakeRequest('rate_limiter_test', 'method_a', 'method_a');\n\t\t$this->fakeRequest('rate_limiter_test', 'method_a', 'method_a');\n\t\t$this->fakeRequest('rate_limiter_test', 'method_a', 'method_a');\n\t\t$this->fakeRequest('rate_limiter_test', 'method_a', 'method_a');\n\t}", "public function testMaxPlayersCountInferiorToMinPlayersCountRejection()\n {\n $inventoryItem = factory(InventoryItem::class)->create();\n $response = $this->json('PATCH', route('inventoryItems.update', $inventoryItem->id), [\n 'playersMin' => 20,\n 'playersMax' => 5\n ]);\n $response->assertJsonValidationErrors('playersMax');\n }", "public function testScheduleCreationLimit()\n {\n $date = Carbon::now()->add(5, 'day');\n config(['subby.schedule.schedules_per_subscription' => 0]);\n $this->expectExceptionMessage('Subscription has reached it\\'s schedules limit.');\n $this->testUser->subscription('main')->toPlan($this->testPlanPro)->onDate($date)->setSchedule();\n }", "public function testRateLimits()\n {\n $results[] = self::$adminApi->ping();\n $results[] = self::$adminApi->rootFolders();\n $results[] = self::$adminApi->assetTypes();\n\n foreach ($results as $result) {\n self::assertObjectStructure(\n $result,\n [\n 'rateLimitResetAt' => IsType::TYPE_INT,\n 'rateLimitAllowed' => IsType::TYPE_INT,\n 'rateLimitRemaining' => IsType::TYPE_INT\n ]\n );\n\n self::assertGreaterThan(0, $result->rateLimitAllowed);\n self::assertGreaterThan(0, $result->rateLimitRemaining);\n self::assertGreaterThan(0, $result->rateLimitResetAt);\n }\n }", "public function test_initiation_rate_limit_exceeded()\n {\n config(['phone-verification.manager.rate_limits.initiate' => ['count' => 0, 'period_secs' => 3600]]);\n $response = $this->postJson('/phone-verification/initiate', ['to' => '+15417543010']);\n\n $response->assertStatus(406);\n\n $response->assertJson(['ok' => false, 'message' => trans(self::LANG_MESSAGES.'initiation_rate_limit', ['sms' => 0, 'hours' => 1])]);\n }", "public function testBackupsCanNotBeTaskedIfLimit0()\n {\n [$user, $server] = $this->generateTestAccount();\n\n /** @var \\Pterodactyl\\Models\\Schedule $schedule */\n $schedule = Schedule::factory()->create(['server_id' => $server->id]);\n\n $this->actingAs($user)->postJson($this->link($schedule, '/tasks'), [\n 'action' => 'backup',\n 'time_offset' => 0,\n ])\n ->assertStatus(Response::HTTP_FORBIDDEN)\n ->assertJsonPath('errors.0.detail', 'A backup task cannot be created when the server\\'s backup limit is set to 0.');\n\n $this->actingAs($user)->postJson($this->link($schedule, '/tasks'), [\n 'action' => 'backup',\n 'payload' => \"file.txt\\nfile2.log\",\n 'time_offset' => 0,\n ])\n ->assertStatus(Response::HTTP_FORBIDDEN)\n ->assertJsonPath('errors.0.detail', 'A backup task cannot be created when the server\\'s backup limit is set to 0.');\n }", "public function testLimiterThrottle(): void\n {\n $apiOptions = new options;\n\n $limiter = $this->limiterConstructor;\n $limiter->setOptions($this->options);\n $limiter->setupOptions();\n\n $exceptionMessage = json_encode($apiOptions->getExceptionMessage('TOO_MANY_REQUESTS'),\n JSON_PRETTY_PRINT);\n $this->expectException(responsibleException::class);\n $this->expectExceptionMessage($exceptionMessage);\n\n for ($i = 0; $i < 100; $i++) {\n $limiter->throttleRequest();\n }\n }", "public function maxAttempts(): int\n {\n return 15;\n }", "public function setMaxAttempts($maxAttempts);", "function claim($limits) {\n $batch_size = $options['batch_size'];\n $this->queue->claimBatch($this->create_batch());\n }", "private function limitTest($limits)\n {\n foreach ($limits as $parameter => $limit) {\n $this->assertRegExp('/^ ([[(]) (.+) , (.+?) ([])]) $/x', $limit);\n }\n }", "public function testMaxDurationInferiorToMinDurationRejection()\n {\n $response = $this->json('POST', route('inventoryItems.store'), [\n 'durationMin' => 20,\n 'durationMax' => 5\n ]);\n $response->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY);\n $response->assertJsonValidationErrors('durationMax');\n }", "public function maxlimitAction(){\n \t$limit=$this->getRequest()->getParam(\"limit\");\n \t// check how much account available \n \t$get_totalacc=Signupmaxaccount::getallmaxaccounts();\n \t$totalfreeacc=$get_totalacc[0]['no_of_acc'];\n \t$current_acc=Visitor::Visitortotal_acc();\n \t//$available_acc=$totalfreeacc-$current_acc;\n \t$save_acc=$limit-$current_acc;\n \tif($save_acc>=0)\n \t{\n \t$userid=Zend_Auth::getInstance()->getIdentity()->roleId;\n \tSignupmaxaccount::updatemaxlimit($limit,$userid);\n \t}\n \telse\n \t{\n \t\t$avail=$current_acc.\",\".$totalfreeacc;\n \techo Zend_Json::encode($avail);\n \t}\n \tdie;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CURDATE includes timezone, use UTC_DATE() for UTC date
public static function curdate() { return new static(date('Y-m-d')); }
[ "function current_datetime ()\n {\n return date(mysql_datetime_format());\n }", "static function getCurrentDate() {\n $current_date = \\DateTime::createFromFormat('U.u', sprintf('%.4f', microtime(true)));\n $current_date->setTimezone(new \\DateTimeZone(\\Config::get('app.timezone')));\n return $current_date->format('Y-m-d\\TH:i:s.uP');\n }", "public static function GetCurrentDate()\n {\n return date(self::DB_DATE_FORMAT);\n }", "public function now_date_by_timezone()\n {\n\n $date = new DateTime();\n //$tz = new DateTimeZone('Europe/London');\n //$tz = new DateTimeZone('Europe/Paris');\n $tz = new DateTimeZone('UTC');\n $date->setTimezone($tz);//et l'heure est modifiée en fonction :-)\n return $date;\n }", "function today( $date_format = 'd-m-Y H:i:s') \n{\n\t$offset = $GLOBALS['_time_offset'] * 60 * 60;\n\treturn date( $date_format, time() + $offset );\n}", "public static function getDateMySQLToday()\n {\n return \\date('Y-m-d');\n }", "private function currentDate() {\n return new DrupalDateTime();\n }", "public static function currentDateTime()\n {\n return date(self::DATE_ISO8601_UTC, time());\n }", "public static function currentUTCDateTime()\n {\n return new \\DateTime('now', new \\DateTimeZone('UTC'));\n }", "public static function currentSqlDate(){\n return static::dateTimeToSqlDate(new DateTime());\n }", "function getCurrentDate()\n\t\t{\n\t\t\t$date = date('y-m-d');\n\t\t\treturn $date;\n\t\t}", "public static function today()\n {\n return new Date(strtotime(date(\"Y-m-d 00:00:00\")));\n }", "function getCurrentDate() {\n $sysCurrentDate = '2014-01-25 10:15:35';\n return $sysCurrentDate;\n}", "static public function now()\n {\n return date(DT_DATETIME1);\n }", "function erp_current_datetime() {\n if ( function_exists( 'current_datetime' ) ) {\n return current_datetime();\n }\n\n return new DateTimeImmutable( 'now', erp_wp_timezone() );\n}", "function date_today_db() {\n return date('Y-m-d H:i:s'); //in the format yyyy-mm-dd\n}", "public static function getCurrentDateDefaultTimezone()\n {\n $date = new \\DateTime(\"now\", new \\DateTimezone(Yii::$app->formatter->timeZone));\n return $date->format(\"Y-m-d\");\n }", "function now()\n{\n return date('Y-m-d H:i:s');\n}", "public function getCurrentDateTimeUsingTimezone()\n {\n // Lookup configured timezone\n $timezone = Mage::getStoreConfig('general/locale/timezone');\n // Get current time\n $curDateTime = new DateTime('now', new DateTimeZone($timezone));\n\n // Return\n return $curDateTime;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the factories used to build remote object instances.
public function getRemoteFactories() { return $this->remoteFactories; }
[ "public function getFactories();", "public function factories()\n {\n return $this->factories;\n }", "public function getFactories()\n {\n return $this->factories;\n }", "public function getFactories() {\n\t\treturn $this->factories;\n\t}", "public function getFactorys()\n {\n return $this->factorys;\n }", "public static function getFactories(): array\n\t{\n\t\treturn static::$factories;\n\t}", "abstract protected function getFactoryFunctions();", "public static function getFactoryMethods()\n {\n return array(\n new ReflectionMethod(get_called_class(), 'createGET'),\n new ReflectionMethod(get_called_class(), 'createHEAD'),\n new ReflectionMethod(get_called_class(), 'createPOST')\n );\n }", "private function createFactories() : array\n {\n return [\n new CreateTicketDirTaskFactory(),\n new RemoveFinishedTicketTaskFactory(),\n new UpdateTicketTaskFactory(),\n ];\n }", "public function getFactory();", "abstract public function getFactory();", "public static function getFactoryMethods()\n {\n return array(\n new ReflectionMethod(get_called_class(), 'createHeaders'),\n new ReflectionMethod(get_called_class(), 'createPage'),\n new ReflectionMethod(get_called_class(), 'createStatusPage'),\n new ReflectionMethod(get_called_class(), 'createTimeoutPage'),\n new ReflectionMethod(get_called_class(), 'createUnknownPage')\n );\n }", "public function getDefinedFactories()\n {\n return array_filter(get_declared_classes(), array($this, 'isFactory'));\n }", "public function getFactories()\n {\n if (! empty($factories = $this->getOption('factories'))) {\n $factories = explode(',', $factories);\n\n return array_map(function ($factory) {\n $definition = explode(':', $factory);\n\n return [$definition[0] => intval($definition[1])];\n }, $factories);\n }\n\n return $factories;\n }", "public static function getFactoryMethods()\n {\n return array(\n new ReflectionMethod(get_called_class(), 'createRead'),\n new ReflectionMethod(get_called_class(), 'createWrite')\n );\n }", "public function factoryTypeProvider() {\n return [\n '::createFromFieldStorageDefinition factory' => [\n 'createFromFieldStorageDefinition',\n ],\n '::create factory' => [\n 'create',\n ],\n '::createFromDataType factory' => [\n 'createFromDataType',\n ],\n '::createFromItemType factory' => [\n 'createFromItemType',\n ],\n ];\n }", "public function scheduleFactories()\n {\n $options = array();\n $options['scheme_name'] = 'File';\n $options['product_name'] = basename(__DIR__);\n $options['product_namespace'] = $this->product_namespace;\n $options['valid_file_extensions'] = array();\n $options['handler_options'] = array();\n\n $this->schedule_factory_methods['Resourceadapter'] = $options;\n\n return $this->schedule_factory_methods;\n }", "public function loadFactories()\n {\n\n }", "public function registerFactories()\n {\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation duplicatesSuppressWithHttpInfo Duplicates: Suppress
public function duplicatesSuppressWithHttpInfo($api_key, $v, $account_id, $duplicate_id) { $returnType = ''; $request = $this->duplicatesSuppressRequest($api_key, $v, $account_id, $duplicate_id); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $request->getUri() ), $statusCode, $response->getHeaders(), $response->getBody() ); } return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { } throw $e; } }
[ "public function clearIdempotentResponses(): void {\n $dt = new \\DateTime();\n $now = $dt->format(\"Y-m-d H:i:s\");\n $exists = Nova::$db\n ->select()\n ->from(\"idempotent_requests\")\n ->where([\"<\", \"expiry\"], [\"expiry\" => $now])\n ->exists();\n if ($exists) {\n Nova::$db\n ->delete()\n ->from(\"idempotent_requests\")\n ->where([\"<\", \"expiry\"], [\"expiry\" => $now])\n ->execute();\n }\n }", "public function resetRequestIds()\n {\n foreach ($this->options as $op => $junk) {\n if (preg_match('#ReportRequestIdList#', $op)) {\n unset($this->options[$op]);\n }\n }\n }", "public function notDuplicate(Request $request): void\n\t{\n\t\t$ad_id_1 = $request->ad_id_1;\n\t\t$ad_id_2 = $request->ad_id_2;\n\n\t\t/* @var User $user */\n\t\t$user = Auth::user();\n\n\t\t//Mark the ad as NOT A duplicate\n\t\tDB::table('duplicates')->insert(\n\t\t\t[\n\t\t\t\t'user_id' => $user->id,\n\t\t\t\t'ad_id_1' => $ad_id_1,\n\t\t\t\t'ad_id_2' => $ad_id_2,\n\t\t\t]\n\t\t);\n\t}", "public function testSuppressDuplicate()\n {\n\n }", "public function testNoRecordsAreGeneratedOnPreRequests()\n {\n $client = static::createRestClient();\n $client->request('OPTIONS', '/core/app/?limit(1)');\n $response = $client->getResponse();\n $this->assertArrayNotHasKey('x-total-count', $response->headers->all());\n\n $client = static::createRestClient();\n $client->request('HEAD', '/core/app/?limit(1)');\n $response = $client->getResponse();\n $this->assertArrayNotHasKey('x-total-count', $response->headers->all());\n }", "public function skip($uniqueName) {\r\n $patch = $this->get($uniqueName);\r\n $patch->skip();\r\n }", "public function get_duplicate_responses() {\n return $this->duplicate_responses;\n }", "public function disableVerbose() {\n\t\t$this->curl->disableVerbose();\n\t}", "public function excludeFromApiIndex(): self;", "public function omitResponseInfo()\n {\n $this->app['dispatcher']->removeSubscriber($this);\n }", "public function deleteDuplicateRemoteFiles(): void\n {\n $duplicates = $this->getDuplicateRemoteFiles();\n\n foreach ($duplicates as $set) {\n $this->deleteDuplicateRemoteFile($set[0]);\n }\n }", "public function dismiss_request_api_notice() {\n\t\t\tupdate_option( 'wc_nps_show_request_api_notice', 'no' );\n\t\t}", "function duplicate_status($response);", "public function testAddBatchResponseWithNoEndpointDoesNotModifyStatuses()\n {\n $statuses = [\n 'endpoint1' => PushNotificationStatus::ERROR,\n 'endpoint2' => PushNotificationStatus::SUCCESS,\n ];\n\n $this->set_reflection_property_value('statuses', $statuses);\n\n $this->class->add_batch_response($this->batch_response, []);\n\n $this->assertPropertySame('statuses', $statuses);\n }", "private function bulk_duplicate() {\n\n\t\t// get params\n\t\t$bookingID = $this->bookingID;\n\t\t$booking_info = $this->booking_info;\n\t\t$blockID = $this->blockID;\n\t\t$lessons = $this->lessons;\n\n\t\t// duplicate\n\t\t$lessons_duplicated = $this->crm_library->duplicate_lessons($lessons);\n\n\t\t// tell user\n\t\tif ($lessons_duplicated == 0) {\n\t\t\t$this->error = 1;\n\t\t\t$this->message = \"No sessions could be duplicated.\";\n\t\t} else {\n\n\t\t\t$lessons_text = $lessons_duplicated . ' session';\n\n\t\t\tif($lessons_duplicated == 1) {\n\t\t\t\t$lessons_text .= ' has';\n\t\t\t} else {\n\t\t\t\t$lessons_text .= 's have';\n\t\t\t}\n\t\t\t$this->message = $lessons_text . ' been duplicated successfully.';\n\t\t}\n\n\t\t// calc targets\n\t\t$this->crm_library->calc_targets($blockID);\n\t}", "public function testCanNotTakeOrderAlreadyTaken()\n {\n\n $response = $this->put(\"/api/v1/order/2?status=taken\" );\n\n $response\n ->receiveJson()\n ->seeStatusCode(Response::HTTP_CONFLICT)\n ->seeJsonContains([\n 'error' => \"ORDER_ALREADY_BEEN_TAKEN\"\n ]);\n }", "function payment_log_fix_duplicates() {\n\t\tApp::import('Model', 'PaymentLog');\n\t\t$this->PaymentLog = new PaymentLog;\n\t\t$this->PaymentLog->deleteAll(array(\n\t\t\t'status' => '0',\n\t\t\t'returned_info' => ''\n\t\t));\n\t\t\n\t\t$this->PaymentLog->updateAll(array('status' => PAYMENT_LOG_FAILED), array('status' => '0'));\n\t\t$this->PaymentLog->updateAll(array('status' => PAYMENT_LOG_SUCCESSFUL), array('status' => '1'));\n\t\techo \"duplicates & status fixed!\" . \"\\n\";\n\t}", "public function testBatchDeleteEmptyModel() {\n\t\t\n\t\t$this->ApiResource->Api\n\t\t\t->expects($this->once())\n\t\t\t->method('setResponseCode')\n\t\t\t->with($this->equalTo(5002));\n\t\t\n\t\t$test = $this->ApiResource->batchDelete();\n\t\t\n\t\t$this->assertFalse($test);\n\t\t\n\t}", "public function unsetDiscrepancyResponse($index)\n {\n unset($this->discrepancyResponse[$index]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add the Documentation link to the admin bar
function admin_bar_menu( WP_Admin_Bar $wp_admin_bar ) { $wp_admin_bar->add_menu( [ 'parent' => 'altis', 'id' => 'documentation', 'title' => __( 'Documentation', 'altis' ), 'href' => add_query_arg( 'page', PAGE_SLUG, admin_url( 'admin.php' ) ), ] ); }
[ "public function addDocumentationMenuItem()\n {\n add_menu_page('Editor Docs', 'Editor Docs', 'manage_options', 'link-to-docs', array($this,'redirectToDocs'), 'dashicons-admin-links', 100);\n }", "public function add_documentation_menu_item() {\n\t\tadd_menu_page(\n\t\t\t'Editor Docs',\n\t\t\t'Editor Docs',\n\t\t\t'manage_options',\n\t\t\t'link-to-docs',\n\t\t\tarray( $this, 'redirect_to_docs' ),\n\t\t\t'dashicons-admin-links',\n\t\t\t100\n\t\t);\n\t}", "public function documentation()\n\t{\n\t\tif(defined(\"CMS_BACKEND\"))\n\t\t{\n\t\t\tAuthUser::load();\n\t\t\tif ( ! AuthUser::isLoggedIn()) {\n\t\t\t\tredirect(get_url('login'));\n\t\t\t}\n\t\t\t$this->display('mbblog/views/admin/docs');\n\t\n\t\t} else\n\t\t{\n\t\t\tFlash::set('error', __('You do not have permission to access the requested page!'));\n\t\t\tredirect(get_url());\n\t\t}\n\t}", "function ncstate_theme_documentation($wp_admin_bar) {\n\t$args = array(\n\t\t'id' => 'ncstate_theme_docs',\n\t\t'title' => 'NC State Theme Documentation', \n\t\t'href' => 'https://github.com/ncstate/wordpress-template/blob/master/README.md',\n\t\t'meta' => array(\n\t\t\t'target' => '_blank',\n\t\t),\n\t);\n\t$wp_admin_bar->add_node($args);\n}", "function admin_bar_menu( $bar ) {\n\n\t\tif ( WP_LOCAL_DEV || WP_DEVELOP )\n\t\t\t$bar->add_node( array(\n\t\t\t\t'id' => THEME_PREFIX . '-docs',\n\t\t\t\t'title' => 'View Docs',\n\t\t\t\t'parent' => 'site-name',\n\t\t\t\t'href' => get_template_directory_uri() . '/includes/_dev/docs',\n\t\t\t\t'meta' => array(\n\t\t\t\t\t'target' => '_blank',\n\t\t\t\t),\n\t\t\t) );\n\n\t}", "public function documentation() {\n $this->display(ACCOUNT_VIEWS.'/documentation');\n }", "protected function adminSidebarLink()\n {\n $lowSinName = strtolower($this->argument('name'));\n $lowName = strtolower($this->argument('name').'s');\n $title = $this->getTitleName().'s';\n\n $path = base_path('resources/views/admin/includes/sidebar/management.blade.php');\n $delimiter = '{{--END OF MANAGEMENT LINKS - DO NOT REMOVE/MODIFY THIS COMMENT--}}';\n $content = file_get_contents($path);\n\n // What to add\n $link = '@if(authorized(\\''.$lowSinName.'_index\\'))';\n $link .= \"\\n\\t\".'<li class=\"{{ activeRoute(\\'admin.'.$lowName.'.index\\') }}\">';\n $link .= \"\\n\\t\\t\".'<a href=\"{{ route(\\'admin.'.$lowName.'.index\\') }}\">';\n $link .= \"\\n\\t\\t\\t\".'<i class=\"ion ion-bug\" aria-hidden=\"true\"></i>';\n $link .= \"\\n\\t\\t\\t\".'<span> '.$title.'</span>';\n $link .= \"\\n\\t\\t\".'</a>';\n $link .= \"\\n\\t\".'</li>';\n $link .= \"\\n\".'@endif';\n\n\n // Add the link\n $endOfPos = strpos($content, $delimiter);\n $pre = substr($content, 0, $endOfPos);\n $post = substr($content, $endOfPos, strlen($content));\n\n file_put_contents($path, $pre.$link.\"\\n\\n\".$post);\n\n $this->info('Added sidebar link in the admin panel');\n }", "public function link_documentation() {\n\t\treturn sprintf( 'https://p.sva.wiki/%1$s', $this->slug() );\n\t}", "public function render_documentation_page() {\n\t\techo '<iframe class=\"sliderpro-documentation\" src=\"' . plugins_url( 'sliderpro/documentation/documentation.html' ) . '\" width=\"100%\" height=\"100%\"></iframe>';\n\t}", "function ozy_add_extra_page() {\n\tadd_menu_page(\n\t\t__('Enjooy Documentation','vp_textdomain'), \n\t\t__('Enjooy Documentation','vp_textdomain'), \n\t\t'read',\n\t\t'ozy-enjooy-documentation', \n\t\t'ozy_enjooy_documentation', \n\t\t'dashicons-editor-help' \n\t);\n}", "function bd_devlink_toolbar_link($wp_admin_bar) \n{\n $devlink = get_option('bd_devlink_setting');\n if($devlink != '') \n {\n \t$args = array(\n \t\t'id' => 'bd_devlink_top',\n \t\t'title' => 'Brandefined', \n \t\t'href' => '#', \n \t\t'meta' => array(\n \t\t\t'class' => 'bd_devlink_parent', \n \t\t\t'title' => 'Brandefined Links'\n \t\t\t)\n \t);\n \t$wp_admin_bar->add_node($args);\n \t\n \t$args = array(\n \t\t'id' => 'bd_devlink',\n \t\t'title' => 'Open C9 IDE', \n \t\t'href' => $devlink,\n \t\t'parent' => 'bd_devlink_top', \n \t\t'meta' => array(\n \t\t\t'class' => 'bd-devlink-href', \n \t\t\t'title' => 'Open C9 IDE',\n \t\t\t'target' => '_blank'\n \t\t\t)\n \t);\n \t$wp_admin_bar->add_node($args);\n }\n}", "function support_toolbar_link($wp_admin_bar) {\n\tglobal $current_user;\n\t$args = array(\n\t\t'id' => 'wpbeginner',\n\t\t'title' => 'Help Desk',\n\t\t'href' => 'http://drumcreative.com/?scrollto=support&first_name=' . $current_user->user_firstname . '&last_name=' . $current_user->user_lastname . '&email=' . $current_user->user_email . '&website=' . get_site_url(),\n\t\t'meta' => array(\n\t\t\t'class' => 'help-desk',\n\t\t\t'title' => 'The Help Desk is for Drum Creative clients to submit Emergency, Change or Feature requests for their websites.',\n\t\t\t'target' => '_blank'\n\t\t\t)\n\t);\n\t$wp_admin_bar->add_node($args);\n}", "public function getOverviewUrl()\n {\n return Mage::helper(\"adminhtml\")->getUrl('adminhtml/mzeis_documentation_module/view', array('module' => $this->getName()));\n }", "public function generateAdminLink()\n\t\t{\n\t\t\t$navText = $this->getNavLabel();\n\t\t\t$html = ($this->getProperty('active')) ? '<a href=\"' . $this->path . '\" target=\"_blank\">'.$navText .'</a>'\n\t\t\t\t: $navText;\n\n\t\t\t$module = $this->getProperty('module');\n\t\t\t$html .= (strtolower($module) !== 'page') ? ' [' . $module .']' : '';\n\t\t\t$html .= $this->getProperty('isHomepage') ? ' [Homepage]' : '';\n\t\t\t$html .= $this->getProperty('isErrorPage') ? ' [404 error page]' : '';\n\t\t\t$html .= $this->isRedirect ? ' [Redirect]' : '';\n\t\t\t$html .= $this->isDuplicate ? ' [Duplicate]' : '';\n\n\t\t\treturn $html;\n\t\t}", "public function getDocumentationIndexLink()\n {\n return $this->Link($this->getRequestedVersion() . '/all');\n }", "function dynamo_support_admin_bar_links() {\n global $wp_admin_bar;\n if(current_user_can('access_tickets')) {\n $links['View Tickets'] = get_bloginfo('wpurl').'/wp-admin/edit.php?post_type=ticket';\n $links['New Ticket'] = get_bloginfo('wpurl').'/wp-admin/post-new.php?post_type=ticket';\n }\n if(current_user_can('access_knowledgebase')) {\n $links['View Knowledgebase'] = get_bloginfo('wpurl').'/wp-admin/edit.php?post_type=knowledgebase';\n $links['New Knowledgebase Article'] = get_bloginfo('wpurl').'/wp-admin/post-new.php?post_type=knowledgebase';\n }\n $menu_item = array(\n 'title' => 'Support',\n 'href' => get_bloginfo('wpurl').'/wp-admin/admin.php?page=support-dashboard',\n 'id' => 'sd_links'\n );\n if(dynamo_support_manual_count('open') != '0' && dynamo_support_manual_count('open') != '') {\n //$menu_item['title'] .=' <span id=\"ab-ticket-count\" class=\"update-count\">'.dynamo_support_manual_count('open').'</span>';\n $menu_item['title'] .=' <span id=\"\" class=\"update-count\">'.dynamo_support_manual_count('open').'</span>';\n }\n $wp_admin_bar->add_menu( $menu_item );\n\n foreach($links as $label => $url) {\n $wp_admin_bar->add_menu( array(\n 'title' => $label,\n 'href' => $url,\n 'parent' => 'sd_links',\n\t\t\t'id' => 'sd_links'\n ));\n }\n }", "public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }", "function bp_docs_item_docs_link() {\n\techo bp_docs_get_item_docs_link();\n}", "public function config_page() {\n\t\trequire HS_DOCS_API_DIR_PATH . 'admin/views/admin-page.php';\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Change thousand format to number
function to_number($thousand_format = 0) { return str_replace(".", "", $thousand_format); }
[ "function thousands_format($number, $override_decimal_count = false)\n{\n\tforeach (['', ' k', ' M', ' G', ' T'] as $kb)\n\t{\n\t\tif ($number < 1000)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\n\t\t$number /= 1000;\n\t}\n\n\treturn comma_format($number, $override_decimal_count) . $kb;\n}", "function num($value, $format = false)\n{\n $farsi_nums = array('۰','۱','۲','۳','۴','۵','۶','۷','۸','۹');\n $en_nums = range(0,9);\n\n if($format)$value = number_format($value, 0, ',',',');\n // ،\n\n return str_replace($en_nums, $farsi_nums, $value);\n}", "function number_format ($number, $decimals = 0, $dec_point = '.', $thousands_sep = ',') {}", "function number_format($number, $num_decimal_places = null, $dec_seperator = null, $thousands_seperator) {}", "function format_num($value, $unit) {\n\t$num = get_field($value);\n\t// format number comma\n\t$formattedNum = number_format((int)$num);\n\techo($formattedNum.\" \".$unit);\n}", "function format_currency($num) {\n if($num>1000) {\n $x = round($num);\n $x_number_format = number_format($x);\n $x_array = explode(',', $x_number_format);\n $x_parts = array('k', 'm', 'b', 't');\n $x_count_parts = count($x_array) - 1;\n $x_display = $x;\n $x_display = $x_array[0] . ((int) $x_array[1][0] !== 0 ? '.' . $x_array[1][0] : '');\n $x_display .= $x_parts[$x_count_parts - 1];\n\n return $x_display;\n }\n \n return $num;\n}", "public function formatNumber($number);", "function separateur_millier($number){\r\n\t\treturn number_format ( $number , $decimals = 0 , $dec_point = '.' , $thousands_sep = ' ' );\r\n\t}", "function g_numberFormatWithUnit($number) {\n if ($number < 10000) {\n $temp = explode('.', $number);\n if (!empty($temp[1])) {\n if (count($temp[1]) >= 2 && substr($temp[1],1,1) >= 5) {\n return number_format($number + 0.1, 1, '.', ',');\n } else {\n return number_format($number, 1, '.', ',');\n }\n } else {\n return number_format($number, 0, '.', ',');\n }\n } elseif ($number > 10000 && $number < 1000000) {\n $number = $number/10000;\n $temp = explode('.', $number);\n if (!empty($temp[1])) {\n if (count($temp[1]) >= 2 && substr($temp[1],1,1) >= 5) {\n return number_format($number + 0.1, 1, '.', ',') . '만';\n } else {\n return number_format($number, 1, '.', ',') . '만';\n }\n } else {\n return number_format($number, 0, '.', ',') . '만';\n }\n } elseif ($number > 1000000 && $number < 100000000) {\n $number = $number/10000;\n $temp = explode('.', $number);\n if (!empty($temp[1])) {\n if (count($temp[1]) >= 2 && substr($temp[1],1,1) >= 5) {\n return number_format($number + 0.1, 1, '.', ',') . '만';\n } else {\n return number_format($number, 1, '.', ',') . '만';\n }\n } else {\n return number_format($number, 0, '.', ',') . '만';\n }\n } elseif ($number > 100000000 && $number < 10000000000) {\n $number = $number/100000000;\n $temp = explode('.', $number);\n if (!empty($temp[1])) {\n if (count($temp[1]) >= 2 && substr($temp[1],1,1) >= 5) {\n return number_format($number + 0.1, 1, '.', ',') . '억';\n } else {\n return number_format($number, 1, '.', ',') . '억';\n }\n } else {\n return number_format($number, 0, '.', ',') . '억';\n }\n } else {\n $number = $number/100000000;\n $temp = explode('.', $number);\n if (!empty($temp[1])) {\n if (count($temp[1]) >= 2 && substr($temp[1],1,1) >= 5) {\n return number_format($number + 0.1, 1, '.', ',') . '억';\n } else {\n return number_format($number, 1, '.', ',') . '억';\n }\n } else {\n return number_format($number, 0, '.', ',') . '억';\n }\n }\n}", "function smarty_modifier_number_format($number, $decimals = 2, $dec_point = '.', $thousands_sep = ',')\n{\n return number_format($number, $decimals, $dec_point, $thousands_sep);\n}", "function numberFormat($value) {\n\tglobal $setup;\n\t\n\treturn(number_format($value, $setup -> format_number, $setup -> format_point, $setup -> format_sep));\n}", "function _add_thousands_separator($number) {\n\treturn $number[1] . number_format($number[2], 0, ',', ' ');\n}", "function number_unformat($number, $force_number = true)\n{\n if ($force_number) {\n $number = preg_replace('/^[^\\d]+/', '', $number);\n } elseif (preg_match('/^[^\\d]+/', $number)) {\n return false;\n }\n $dec_point = get_option('decimal_separator');\n $thousands_sep = get_option('thousand_separator');\n $type = (strpos($number, $dec_point) === false) ? 'int' : 'float';\n $number = str_replace(array(\n $dec_point,\n $thousands_sep\n ), array(\n '.',\n ''\n ), $number);\n settype($number, $type);\n \n return $number;\n}", "function smarty_modifier_system_numeric_format($number,$decimals = null) {\n\n\t\tglobal $system;\n\t\t\n\t\t$thousandsSeparator = $system['config']['system']['parameters']['thousandsSeparator'];\n\t\t$decimalSeparator = $system['config']['system']['parameters']['decimalSeparator'];\n\t\tif (empty($decimals))\n\t\t\t$decimals = $system['config']['system']['parameters']['numberOfDecimals'];\n\n\t\treturn number_format($number,$decimals,$decimalSeparator,$thousandsSeparator);\r\n}", "function _formatNum( $number ) {\n return number_format( $number * 1000, 4 );\n }", "function format_number( $number ) {\n\t\t\tif ( $number >= 1000 ) {\n\t\t\t\treturn $number / 1000 . \"k\"; // NB: you will want to round this\n\t\t\t} else {\n\t\t\t\treturn $number;\n\t\t\t}\n\t\t}", "function convert_million_for_display_round($million){\n\treturn number_format(round($million));\n}", "function smarty_modifier_number_format($string, $decimals = 0, $dec_sep = ',', $thous_sep = '.')\n{\n return number_format($string, $decimals, $dec_sep, $thous_sep);\n}", "function disp_money($var){ return number_format($var, 2, '.', ','); }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the current Page status in the database.
public function updateStatus() { // Does the Page object have an ID? if ( is_null( $this->id ) ) trigger_error ( "Page::update(): Attempt to update a Page object that does not have it\'s ID property set.", E_USER_ERROR ); // Update the Page $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD ); $sql = "UPDATE " . DB_PREFIX . "pages SET status = :status WHERE id = :id"; $st = $conn->prepare ( $sql ); $st->bindValue( ":id", $this->id, PDO::PARAM_INT ); $st->bindValue( ":status", $this->status, PDO::PARAM_INT ); $st->execute(); $conn = null; }
[ "public function updateTestingPageStatus() \n\t{\n\t\t$pageId = intval($_REQUEST['update_status']['id']);\n\t\t$updateData = array(\n\t\t\t'status' => sanitize_text_field($_REQUEST['update_status']['status'])\t\n\t\t);\n\t\t$updateData = apply_filters('nst_update_page_status', $updateData, $pageId);\n\t\t\n\t\tNstQueries::update(\n\t\t\tHelper::getDbTableName('urls'),\n\t\t\t$updateData,\n\t\t\t$pageId\n\t\t);\n\t\t\n\t\tdo_action('nst_updated_page_status', $pageId, $updateData);\n\t\t\n\t\twp_send_json_success(array(\n\t\t\t'message' => __('Status changed successfully', 'ninja-split-testing')), \n\t\t200);\n\t}", "public function toggleStatus()\n {\n $pageId = Tools::getValue('id_page');\n\n Db::getInstance()->update(\n $this->module->table_name,\n ['active' => !$this->module->getHTMLPageStatus($pageId)],\n 'id_page = ' . $pageId\n );\n }", "function update_page_status($filename = '', $status = '') {\n\t\tif ($this->_is_valid_status('page', $status)) {\n\t\t\t$filebase = preg_replace('/\\.(.+)$/', '', $filename);\n\t\t\t$data = array('status' => $status);\n\t\t\t$this->db->where('filebase', $filebase);\n\t\t\t$this->db->where('item_id', $this->id);\n\t\t\t$this->db->set($data);\n\t\t\t$this->db->update('page');\n\t\t\t$this->logging->log('book', 'info', 'Updated page '.$filebase.' status to '.$status.'.', $this->barcode);\n\t\t} else {\n\t\t\t$this->last_error = 'Invalid page status: '.$status.'.';\n\t\t\tthrow new Exception($this->last_error);\n\t\t}\n\t}", "public function setStatusAction() {\n if (!isset($this->post['id'])) { die ('Не указаны данные записи'); }\n $status = (int) Arr::get( $this->post, 'current', 0 );\n if( $status ) {\n $status = 0;\n } else {\n $status = 1;\n }\n $id = Arr::get( $this->post, 'id', 0 );\n $table = Arr::get( $this->post, 'table', 0 );\n DB::update($table)->set(['status' => $status])->where('id', '=', $id)->execute();\n $this->success([\n 'status' => $status\n ]);\n }", "public function updated(Page $page)\n {\n //\n }", "public function updateDraftPage(){\n if (Auth::validToken($this->db,$this->token,$this->username)){\n $role = Auth::getRoleID($this->db,$this->token);\n $newusername = strtolower(filter_var($this->username,FILTER_SANITIZE_STRING));\n $newpageid = Validation::integerOnly($this->pageid);\n \n \t\ttry {\n\t \t\t$this->db->beginTransaction();\n\t\t\t\t\tif ($role > 2){\n\t\t\t\t\t\t$sql = \"UPDATE data_page \n SET Title=:title,Image=:image,Description=:description,Content=:content,Tags=:tags,\n StatusID='52',Updated_by=:username,\n Updated_at=current_timestamp\n\t\t\t\t\t\t\tWHERE PageID=:pageid AND Username=:username;\";\n\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':title', $this->title, PDO::PARAM_STR);\n\t\t\t\t\t\t$stmt->bindParam(':image', $this->image, PDO::PARAM_STR);\n\t\t\t\t\t\t$stmt->bindParam(':description', $this->description, PDO::PARAM_STR);\n\t\t\t\t\t\t$stmt->bindParam(':content', $this->content, PDO::PARAM_STR);\n\t\t\t\t\t\t$stmt->bindParam(':tags', $this->tags, PDO::PARAM_STR);\n\t\t\t\t\t\t$stmt->bindParam(':pageid', $newpageid, PDO::PARAM_STR);\n\t\t\t\t\t\t$stmt->bindParam(':username', $newusername, PDO::PARAM_STR);\n\t\t\t\t\t\tif ($stmt->execute()) {\n\t\t \t\t\t\t$data = [\n\t\t\t \t\t\t\t'status' => 'success',\n\t\t\t\t \t\t\t'code' => 'RS103',\n\t\t\t\t\t \t\t'message' => CustomHandlers::getreSlimMessage('RS103',$this->lang)\n\t\t\t\t\t\t ];\t\n \t\t\t\t\t} else {\n\t \t\t\t\t\t$data = [\n\t\t \t\t\t\t\t'status' => 'error',\n\t\t\t \t\t\t\t'code' => 'RS203',\n\t\t\t\t \t\t\t'message' => CustomHandlers::getreSlimMessage('RS203',$this->lang)\n\t\t\t\t\t \t];\n \t\t\t\t\t}\n\t \t\t\t $this->db->commit();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$data = [\n\t\t\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t\t\t'code' => 'RS404',\n\t\t\t\t\t\t\t'message' => CustomHandlers::getreSlimMessage('RS404',$this->lang)\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t} catch (PDOException $e) {\n\t\t\t $data = [\n \t\t\t \t'status' => 'error',\n \t\t\t \t'code' => $e->getCode(),\n\t \t\t\t 'message' => $e->getMessage()\n \t\t \t];\n\t \t\t $this->db->rollBack();\n \t \t} \n } else {\n $data = [\n\t \t\t\t'status' => 'error',\n\t\t\t\t\t'code' => 'RS401',\n \t \t'message' => CustomHandlers::getreSlimMessage('RS401',$this->lang)\n\t\t\t\t];\n }\n\n\t\t\treturn JSON::encode($data,true);\n\t\t\t$this->db = null;\n\n }", "public function updateStatus()\n {\n $query = $this->db->getQuery(true);\n\n $query\n ->update($this->db->quoteName(\"#__crowdf_transactions\"))\n ->set($this->db->quoteName(\"txn_status\") . \" = \" . $this->db->quote($this->txn_status))\n ->where($this->db->quoteName(\"id\") . \" = \" . (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n }", "public function update() {\n\n // Does the Page object have an ID?\n if ( is_null( $this->id ) ) trigger_error ( \"Page::update(): Attempt to update a Page object that does not have it\\'s ID property set.\", E_USER_ERROR );\n \n // Update the Page\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"UPDATE \" . DB_PREFIX . \"pages SET title = :title, slug = :slug, override = :override, summary = :summary, content = :content, metaDescription = :metaDescription, metaKeywords = :metaKeywords, sort = :sort, status = :status, parent = :parent, siteIndex = :siteIndex, botAction = :botAction, menu = :menu WHERE id = :id\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n $st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\n $st->bindValue( \":slug\", $this->slug, PDO::PARAM_STR );\n $st->bindValue( \":override\", $this->override, PDO::PARAM_STR );\n $st->bindValue( \":summary\", $this->summary, PDO::PARAM_STR );\n $st->bindValue( \":content\", $this->content, PDO::PARAM_STR );\n $st->bindValue( \":metaDescription\", $this->metaDescription, PDO::PARAM_STR );\n $st->bindValue( \":metaKeywords\", $this->metaKeywords, PDO::PARAM_STR );\n $st->bindValue( \":sort\", $this->sort, PDO::PARAM_INT );\n $st->bindValue( \":status\", $this->status, PDO::PARAM_INT );\n $st->bindValue( \":parent\", $this->parent, PDO::PARAM_INT );\n $st->bindValue( \":siteIndex\", $this->siteIndex, PDO::PARAM_INT );\n $st->bindValue( \":botAction\", $this->botAction, PDO::PARAM_STR );\n $st->bindValue( \":menu\", $this->menu, PDO::PARAM_INT );\n \n $st->execute();\n $conn = null;\n \n }", "public function rescanSystemPageStatus()\n {\n $systemPage = false;\n $db = Database::connection();\n $cID = $this->getCollectionID();\n if (!$this->isHomePage()) {\n if ($this->getSiteTreeID() == 0) {\n $systemPage = true;\n } else {\n $cID = ($this->getCollectionPointerOriginalID() > 0) ? $this->getCollectionPointerOriginalID() : $this->getCollectionID();\n $db = Database::connection();\n $path = $db->fetchColumn('select cPath from PagePaths where cID = ? and ppIsCanonical = 1', [$cID]);\n if ($path) {\n // Grab the top level parent\n $fragments = explode('/', $path);\n $topPath = '/' . $fragments[1];\n $c = \\Page::getByPath($topPath);\n if (is_object($c) && !$c->isError()) {\n if ($c->getCollectionParentID() == 0 && !$c->isHomePage()) {\n $systemPage = true;\n }\n }\n }\n }\n }\n\n if ($systemPage) {\n $db->executeQuery('update Pages set cIsSystemPage = 1 where cID = ?', [$cID]);\n $this->cIsSystemPage = true;\n } else {\n $db->executeQuery('update Pages set cIsSystemPage = 0 where cID = ?', [$cID]);\n $this->cIsSystemPage = false;\n }\n }", "public function updated(Pages $Pages)\n {\n //code...\n }", "public function updateStatus()\n {\n }", "public function change_cms_status()\n\t{\n\t\tif ($this->checkLogin('A') == '')\n\t\t{\n\t\t\tredirect('admin');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$mode = $this->uri->segment(4,0);\n\t\t\t$cms_id = $this->uri->segment(5,0);\n\t\t\t$status = ($mode == '0')?'Unpublish':'Publish';\n\t\t\t$newdata = array('status' => $status);\n\t\t\t$condition = array('id' => $cms_id);\n\t\t\t$this->cms_model->update_details(CMS,$newdata,$condition);\n\t\t\t$this->setErrorMessage('success','Page Status Changed Successfully');\n\t\t\tredirect('admin/cms/display_cms');\n\t\t}\n\t}", "public function update() {\n\n\t\t// Does the Page object have an ID?\n\t\tif ( is_null( $this->id ) ) trigger_error ( \"Page::update(): Attempt to update an Page object that does not have its ID property set.\", E_USER_ERROR );\n\n\t\t// Update the Page\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n\t\t$sql = \"UPDATE pages SET publicationDate=FROM_UNIXTIME(:publicationDate), title=:title, slug=:slug, template=:template, summary=:summary, content=:content WHERE id = :id\";\n\t\t$st = $conn->prepare ( $sql );\n\t\t$st->bindValue( \":publicationDate\", $this->publicationDate, PDO::PARAM_INT );\n\t\t$st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\n\t\t$st->bindValue( \":slug\", $this->slug, PDO::PARAM_STR );\n\t\t$st->bindValue( \":template\", $this->template, PDO::PARAM_STR );\n\t\t$st->bindValue( \":summary\", $this->summary, PDO::PARAM_STR );\n\t\t$st->bindValue( \":content\", $this->content, PDO::PARAM_STR );\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n\t\t$st->execute();\n\t\t$conn = null;\n\n\t}", "public function mass_update_current_page() {\r\n \tforeach ($this->handlers as $handler) {\r\n \t\t$handler->set_current_page($this->current_page);\r\n \t}\r\n }", "function updateStatus() {\n \n }", "public function statusUpdate()\n {\n try {\n $status = $this->paynow->processStatusUpdate();\n\n if ($status->paid()) {\n // Find the transaction which has been paid for\n $transaction = Transaction::find($status->reference());\n\n // Update the transaction of the transaction\n $transaction->paid = true;\n\n // Persist the new status\n $transaction->save();\n\n $this->runPaidTransactionActions($transaction);\n }\n } catch (HashMismatchException $e) {\n logger()->error(\"Hash mismatch exception when trying to process status update\");\n }\n }", "public function updatepage()\n {\n if(isset($_POST['draft'])){\n $draft = \"no\";\n $id_page = $this->request->getParameter(\"id\");\n $title = $this->request->getParameter(\"title\");\n $slug = $_POST['slug'];\n $content = $this->request->getParameter(\"content\");\n $delimiter = '-';\n $slug = $this->slugify($title, $delimiter);\n $this->page->changePage($title, $slug, $content, $draft, $id_page);\n $this->message->pageUpdated();\n }\n else {\n $id_page = $this->request->getParameter(\"id\");\n $draft = \"yes\";\n $title = $this->request->getParameter(\"title\");\n $slug = $_POST['slug'];\n $content = $this->request->getParameter(\"content\");\n $delimiter = '-';\n $slug = $this->slugify($title, $delimiter);\n $this->page->changePage($title, $slug, $content, $draft, $id_page);\n $this->message->pageUpdated();\n }\n }", "public function update_page() {\n if (!Visitor::current()->group->can(\"edit_page\"))\n show_403(__(\"Access Denied\"), __(\"You do not have sufficient privileges to edit pages.\"));\n\n if (!isset($_POST['hash']) or $_POST['hash'] != Config::current()->secure_hashkey)\n show_403(__(\"Access Denied\"), __(\"Invalid security key.\"));\n\n if (empty($_POST['title']) and empty($_POST['slug']))\n error(__(\"Error\"), __(\"Title and slug cannot be blank.\"));\n\n $page = new Page($_POST['id']);\n\n if ($page->no_results)\n Flash::warning(__(\"Page not found.\"), \"/admin/?action=manage_pages\");\n\n $page->update($_POST['title'], $_POST['body'], null, $_POST['parent_id'], !empty($_POST['public']), !empty($_POST['show_in_list']), $page->list_order, null, $_POST['slug']);\n\n if (!isset($_POST['ajax']))\n Flash::notice(_f(\"Page updated. <a href=\\\"%s\\\">View Page &rarr;</a>\",\n array($page->url())),\n \"/admin/?action=manage_pages\");\n }", "public function static_page_status()\r\n\t{\r\n\t\t$id = $this->encrypt->decode(base64_decode($this->input->post(\"static_page\")));\r\n\t\t$status = is_numeric($this->input->post(\"status\")) ? $this->input->post(\"status\") : \"0\";\r\n\t\t$response = array(\"status\" => \"false\", \"msg_status\" => \"danger\", \"title\" => \"Invalid\", \"msg\" => \"Invalid Operation.\");\r\n\t\tif(is_numeric($id) && $id > 0)\r\n\t\t{\r\n\t\t\t$response[\"title\"] = $this->data[\"page_main_title\"].($status === \"1\" ? \" - Static Page Activate\" : \" - Static Page Deactivate\");\r\n\t\t\t$result = $this->Cms_model->update_page($id, array(\"status\" => $status));\r\n\t\t\tif($result !== false)\r\n\t\t\t{\r\n\t\t\t\t$response[\"status\"] = \"true\";\r\n\t\t\t\t$response[\"msg\"] = $status === \"0\" ? \"Static page deactivated successfully.\" : \"Static page activated successfully.\";\r\n\t\t\t\t\t$response[\"msg_status\"] = $status === \"0\" ? \"info\" : \"success\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$response[\"msg\"] = \"Failed to update Static page status.\";\r\n\t\t}\r\n\t\techo json_encode($response);exit;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Devuelve el id del rol
public function getRolId() { if (! is_null($this->roles)) { return $this->roles->first()->id; } }
[ "public function getRol_id()\n {\n return $this->rol_id;\n }", "public function getRolId()\r\n {\r\n return $this->rol_id;\r\n }", "public function getRolId()\n {\n return $this->rol_id;\n }", "public function getIdRol(){\n return $this->idRol;\n }", "public function getIdRol()\n\t\t{\n\t\t\t\treturn $this->IdRol;\n\t\t}", "public function getIdrol(){\n return $this->idrol;\n }", "public function getIdrol()\n {\n return $this->idrol;\n }", "public function setIdrol($idrol){\n $this->idrol = $idrol;\n }", "public static function getRol() {\n if (Auth::user()) {\n $idRol = \\App\\Rol::where('id_rol', Auth::user()->id_rol)->get();\n foreach ($idRol as $idRol) {\n return $idRol->nombre_rol;\n }\n }\n }", "public function get_role_id();", "private function ObtenerRol()\n\t\t{\n\t\t\t$bd = BD::Instancia();\n\t\t\t\n\t\t\t$consulta = \"SELECT rol_id,rol_nombre,rol_descripcion,rol_basico FROM rol WHERE rol_id = '\" . intval($this->rol_id) . \"' LIMIT 1\";\n\t\t\t\n\t\t\t$datos = $bd->Ejecutar($consulta);\n\t\t\t$fila = $bd->ObtenerFila($datos);\n\t\t\t\n\t\t\tif ($fila['rol_id']!='')\n\t\t\t{\n\t\t\t\t$this->rol_id \t = $fila['rol_id'];\n\t\t\t\t$this->rol_nombre \t= $fila['rol_nombre'];\n\t\t\t\t$this->rol_descripcion\t= $fila['rol_descripcion'];\n\t\t\t\t$this->rol_basico = $fila['rol_basico'];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function getID () {\n\t\treturn $this->usu_id;\n\t}", "public function getRole_id ()\n {\n return $this->role_id;\n }", "public static function getLastRolId() {\n $conexion = new ConexionAnaliizoPostgres();\n $conexion->exec(\"set names utf8\");\n \n $consulta = $conexion->prepare('select * from analiizo_interventoria.spgetlastrolid();');\n $consulta->execute();\n $registros = $consulta->fetchAll();\n $conexion = null;\n return $registros;\n }", "public function buscarId( ){\n\t\t$sql = \"SELECT DISTINCT U.idusuario, U.nombres, U.apellidos, U.usuario, R.idrol, R.nombrerol\n\t\t\t\tFROM usuario U\n\t\t\t\tINNER JOIN usuariofacultad UF ON ( UF.usuario = U.usuario )\n\t\t\t\tINNER JOIN UsuarioTipo UT ON (UT.UsuarioId = U.idusuario)\n INNER JOIN usuariorol UR ON (UR.idusuariotipo = UT.UsuarioTipoId)\n\t\t\t\tINNER JOIN rol R ON ( R.idrol = UR.idrol )\n\t\t\t\tWHERE U.idusuario = ?\n\t\t\t\tAND U.codigorol = 13\";\n\t\t\t\t\n\t\t$this->persistencia->crearSentenciaSQL( $sql );\n\t\t$this->persistencia->setParametro( 0 , $this->getId( ) , false );\n\t\t$this->persistencia->ejecutarConsulta( );\n\t\tif( $this->persistencia->getNext( ) ){\n\t\t\t$this->setId( $this->persistencia->getParametro( \"idusuario\" ) );\n\t\t\t$this->setNombres( $this->persistencia->getParametro( \"nombres\" ) );\n\t\t\t$this->setApellidos( $this->persistencia->getParametro( \"apellidos\" ) );\n\t\t\t$this->setUser( $this->persistencia->getParametro( \"usuario\" ) );\n\t\t\t\n\t\t\t$rol = new Rol( null );\n\t\t\t$rol->setId( $this->persistencia->getParametro( \"idrol\" ) );\n\t\t\t$rol->setNombre( $this->persistencia->getParametro( \"nombrerol\" ) );\n\t\t\t$this->setRol( $rol );\n\t\t}\n\t\t//echo $this->persistencia->getSQLListo( );\n\t\t$this->persistencia->freeResult( );\n\t\t\n\t}", "public function getRoleid()\n {\n return $this->role_id;\n }", "public function getRole_id()\n {\n return $this->role_id;\n }", "public function getIdRole()\n {\n return $this->id_role;\n }", "function get_role_id(){\n return $this->role_id;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stores the current reflection data related to classes of the specified package in the PrecompiledReflectionData directory for the current context. This method is used by the package manager.
public function freezePackageReflection($packageKey): void { if (!$this->initialized) { $this->initialize(); } if (empty($this->availableClassNames)) { $this->availableClassNames = $this->reflectionDataRuntimeCache->get('__availableClassNames'); } $reflectionData = [ 'classReflectionData' => $this->classReflectionData, 'classSchemata' => $this->classSchemata, 'annotatedClasses' => $this->annotatedClasses, 'classesByMethodAnnotations' => $this->classesByMethodAnnotations ]; $reflectionData['classReflectionData'] = $this->filterArrayByClassesInPackageNamespace($reflectionData['classReflectionData'], $packageKey); $reflectionData['classSchemata'] = $this->filterArrayByClassesInPackageNamespace($reflectionData['classSchemata'], $packageKey); $reflectionData['annotatedClasses'] = $this->filterArrayByClassesInPackageNamespace($reflectionData['annotatedClasses'], $packageKey); $methodAnnotationsFilters = function ($className) use ($packageKey): bool { return (isset($this->availableClassNames[$packageKey]) && in_array($className, $this->availableClassNames[$packageKey], true)); }; foreach ($reflectionData['classesByMethodAnnotations'] as $annotationClassName => $classNames) { $reflectionData['classesByMethodAnnotations'][$annotationClassName] = array_filter($classNames, $methodAnnotationsFilters); } $precompiledReflectionStoragePath = $this->getPrecompiledReflectionStoragePath(); if (!is_dir($precompiledReflectionStoragePath)) { Files::createDirectoryRecursively($precompiledReflectionStoragePath); } $pathAndFilename = $precompiledReflectionStoragePath . $packageKey . '.dat'; file_put_contents($pathAndFilename, extension_loaded('igbinary') ? igbinary_serialize($reflectionData) : serialize($reflectionData)); }
[ "protected function saveProductionData(): void\n {\n $this->reflectionDataRuntimeCache->flush();\n $this->classSchemataRuntimeCache->flush();\n\n $classNames = [];\n foreach ($this->classReflectionData as $className => $reflectionData) {\n $classNames[$className] = true;\n $cacheIdentifier = $this->produceCacheIdentifierFromClassName($className);\n $this->reflectionDataRuntimeCache->set($cacheIdentifier, $reflectionData);\n if (isset($this->classSchemata[$className])) {\n $this->classSchemataRuntimeCache->set($cacheIdentifier, $this->classSchemata[$className]);\n }\n }\n $this->reflectionDataRuntimeCache->set('__classNames', $classNames);\n $this->reflectionDataRuntimeCache->set('__annotatedClasses', $this->annotatedClasses);\n\n $this->reflectionDataRuntimeCache->getBackend()->freeze();\n $this->classSchemataRuntimeCache->getBackend()->freeze();\n\n $this->log(sprintf('Built and froze reflection runtime caches (%s classes).', count($this->classReflectionData)), LogLevel::INFO);\n }", "public function saveToCache() {\n\t\tif (!is_object($this->dataCache)) throw new \\TYPO3\\FLOW3\\Reflection\\Exception('A cache must be injected before initializing the Reflection Service.', 1232044697);\n\n\t\t$nonCachedClassNames = array_diff_assoc($this->reflectedClassNames, $this->cachedClassNames);\n\t\t$emergedClassesCount = count($nonCachedClassNames);\n\t\tif ($emergedClassesCount > 0) {\n\t\t\t$this->log(sprintf('Found %s classes whose reflection data was not cached previously.', $emergedClassesCount), LOG_DEBUG);\n\n\t\t\tforeach (array_keys($nonCachedClassNames) as $className) {\n\t\t\t\t$this->statusCache->set(str_replace('\\\\', '_', $className), '', array(\\TYPO3\\FLOW3\\Cache\\CacheManager::getClassTag($className)));\n\t\t\t}\n\n\t\t\t$data = array();\n\t\t\t$propertyNames = array(\n\t\t\t\t'reflectedClassNames',\n\t\t\t\t'abstractClasses',\n\t\t\t\t'classPropertyNames',\n\t\t\t\t'classSchemata',\n\t\t\t\t'classTagsValues',\n\t\t\t\t'classAnnotations',\n\t\t\t\t'subClasses',\n\t\t\t\t'finalClasses',\n\t\t\t\t'finalMethods',\n\t\t\t\t'staticMethods',\n\t\t\t\t'interfaceImplementations',\n\t\t\t\t'methodParameters',\n\t\t\t\t'methodVisibilities',\n\t\t\t\t'propertyTagsValues',\n\t\t\t\t'propertyAnnotations',\n\t\t\t\t'taggedClasses',\n\t\t\t\t'annotatedClasses'\n\t\t\t);\n\t\t\tforeach ($propertyNames as $propertyName) {\n\t\t\t\t$data[$propertyName] = $this->$propertyName;\n\t\t\t}\n\t\t\t$this->dataCache->set('ReflectionData', $data);\n\t\t\t$this->cachedClassNames = $this->reflectedClassNames;\n\t\t}\n\t}", "public function saveToCache(): void\n {\n if ($this->hasFrozenCacheInProduction()) {\n return;\n }\n if (!$this->initialized) {\n $this->initialize();\n }\n if ($this->loadFromClassSchemaRuntimeCache === true) {\n return;\n }\n\n if (!empty($this->availableClassNames)) {\n $this->reflectionDataRuntimeCache->set('__availableClassNames', $this->availableClassNames);\n }\n\n if ($this->updatedReflectionData !== []) {\n $this->updateReflectionData();\n }\n\n if ($this->context->isProduction()) {\n $this->saveProductionData();\n return;\n }\n\n $this->saveDevelopmentData();\n }", "private static function _addSingleFileToCache($package)\n {\n foreach ($GLOBALS['searchPaths'] as $path) {\n $fullPathFileName = $path . $package . self::classExtension;\n if (file_exists($fullPathFileName)) {\n $classes = self::_extractClassNamesFromFile($fullPathFileName);\n for ($index = 0; $index < sizeof($classes[0]); $index++) {\n self::_appendToCache($fullPathFileName, $classes[0][$index]);\n }\n }\n }\n }", "public function injectDataFolder() {\n $this->util->deepCopy($this->iliasDataFolder, \"data\");\n }", "protected function saveToCache()\n {\n if (!is_object($this->dataCache)) {\n throw new Exception('A cache must be injected before initializing the Reflection Service.', 1232044697);\n }\n $data = [];\n $propertyNames = [\n 'reflectedClassNames',\n 'classPropertyNames',\n 'classMethodNames',\n 'classTagsValues',\n 'methodTagsValues',\n 'methodParameters',\n 'propertyTagsValues',\n 'taggedClasses',\n 'classSchemata'\n ];\n foreach ($propertyNames as $propertyName) {\n $data[$propertyName] = $this->{$propertyName};\n }\n $this->dataCache->set($this->cacheIdentifier, $data);\n $this->dataCacheNeedsUpdate = false;\n }", "protected function reflect()\n {\n $scanner = new CachingFileScanner($this->filePath);\n $this->docComment = $scanner->getDocComment();\n $this->requiredFiles = $scanner->getIncludes();\n $this->classes = $scanner->getClassNames();\n $this->namespaces = $scanner->getNamespaces();\n $this->uses = $scanner->getUses();\n }", "function storePackageContents()\n {\n }", "public function unfreezePackageReflection(string $packageKey): void\n {\n if (!$this->initialized) {\n $this->initialize();\n }\n $pathAndFilename = $this->getPrecompiledReflectionStoragePath() . $packageKey . '.dat';\n if (file_exists($pathAndFilename)) {\n unlink($pathAndFilename);\n }\n }", "protected function savePackage()\n {\n $dir = defined('THREADS_DIR') ? THREADS_DIR : 'threads';\n file_put_contents($dir . '/' . $this->identifier . '.pid', json_encode($this->package));\n }", "public static function setPackage(WarderPackage $package)\n {\n static::$package = $package;\n }", "function loadClassMetadataFromCache(\\ReflectionClass $class);", "public function cacheSchema(): void\n {\n $this->files->put($this->getCachedSchemaPath(), serialize($this->selectSchema()));\n }", "public function __destruct() {\n $this->cacheBackend->set(self::BIN_REFLECTED_CLASSES, $this->reflectedClasses);\n $this->cacheBackend->set(self::BIN_REFLECTED_SUBCLASSES, $this->reflectedSubClasses);\n }", "public function getPackageMetaData() {}", "public function add_package(Package $package)\n {\n $this->packages[$package->get_context()] = $package;\n }", "public function enableReflectionCache()\n {\n $this->_reflectionCacheEnabled = true;\n }", "public function setPackage(Package $package)\n {\n $this->package = $package;\n }", "private static function _addDirectoryToCache($rootDir)\n {\n foreach ($GLOBALS['searchPaths'] as $path) {\n if (is_dir($path . $rootDir)) {\n\n//Find classes defined in files in this dir\n $handle = opendir($path . $rootDir);\n while ($entry = readdir($handle)) {\n if ($entry != '.' && $entry != '..' && strpos($entry, '.class.php') != -1) {\n $classes = self::_extractClassNamesFromFile($path . $rootDir . '/' . $entry);\n for ($index = 0; $index < sizeof($classes[0]); $index++) {\n self::_appendToCache($path . $rootDir . '/' . $entry, $classes[0][$index]);\n }\n }\n }\n\n//Recursively process any sub dirs\n if (self::processSubDirs) {\n $subDirs = glob($path . $rootDir . '/*', GLOB_ONLYDIR);\n foreach ($subDirs as $dir) {\n $dir = substr($dir, strpos($dir, $rootDir));\n self::_addDirectoryToCache($dir);\n }\n }\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the shipping discount amount.
public function setShippingDiscountAmount($amount);
[ "public function setShippingDiscount($value) \n {\n $this->_fields['ShippingDiscount']['FieldValue'] = $value;\n return;\n }", "public function setShippingDiscount($value)\n {\n $this->_fields['ShippingDiscount']['FieldValue'] = $value;\n return $this;\n }", "public function setDiscountAmount(?float $discountAmount);", "public function setDiscountAmount(?string $value): void {\n $this->getBackingStore()->set('discountAmount', $value);\n }", "public function setDiscount(float $discount): void\n {\n $this->_discount = $discount;\n }", "public function withShippingDiscount($value)\n {\n $this->setShippingDiscount($value);\n return $this;\n }", "public function setShippingDiscount($var)\n {\n GPBUtil::checkDouble($var);\n $this->shippingDiscount = $var;\n\n return $this;\n }", "public function setDiscountAmount($amount);", "public function setUpDiscountAmount()\n\t{\n\t\t$defaultCurrency = GetDefaultCurrency();\n\t\t$discount = $this->quote->getDiscountAmount();\n\t\tif($discount == 0) {\n\t\t\t$GLOBALS['HideDiscountAmount'] = 'display: none';\n\t\t\treturn;\n\t\t}\n\n\t\t$GLOBALS['DiscountAmount'] = currencyConvertFormatPrice($discount * -1);\n\t}", "protected function setShippingCharges()\n {\n $this->shippingCharges = 0;\n $orderAmount = $this->subtotal - $this->discount;\n\n if ($orderAmount > 0 && $orderAmount < config('cart_manager.shipping_charges_threshold')) {\n $shippingCharges = config('cart_manager.shipping_charges');\n\n if ($shippingCharges > 0) {\n $this->shippingCharges = $shippingCharges;\n }\n }\n }", "public function setBaseShippingDiscountAmount($baseShippingDiscountAmount);", "public function setPromotionDiscount($value)\n {\n $this->_fields['PromotionDiscount']['FieldValue'] = $value;\n return $this;\n }", "private function updateDiscount()\n {\n $discount = 0;\n\n if ($this->coupon) {\n $expiry = Carbon::parse($this->coupon->expires_at);\n\n if (!$expiry->isPast()) {\n $discount = $this->coupon->type === 'percent'\n ? $this->coupon->discount * .01 * $this->cost\n : $this->coupon->discount;\n }\n }\n\n $this->discount = $discount;\n }", "public function getShippingDiscountAmount();", "public function setTransferDiscountAsItem()\n {\n $this->_setTransferFlag(self::AMOUNT_DISCOUNT, true);\n }", "public function setShippingAmount($amount);", "public function getShippingDiscount()\n {\n return $this->shippingDiscount;\n }", "public function getCalculatedShippingDiscount()\n {\n return $this->calculatedShippingDiscount;\n }", "public function setDiscountAction()\n\t{\n\t\t$id = FrontController::getParams();\n\t\tif(!$_POST['update'])\n\t\t{\n\t\t\t$this -> view -> discountForm($id);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this -> facade -> updateDisc($id, $_POST['disc']);\n\t\t\tif($result === true)\n\t\t\t{\n\t\t\t\theader(\"Location: /~user8/book_shop/admin/discounts\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Executes this Choreo. Execution object provides access to results appropriate for this SearchVenues Choreo.
public function execute($inputs = array(), $async = false, $store_results = true) { return new Foursquare_Venues_SearchVenues_Execution($this->session, $this, $inputs, $async, $store_results); }
[ "protected function runSearch()\n {\n return $this->connection->search($this->toDsl());\n }", "public function run_search()\n {\n ee()->load->library('logger');\n ee()->load->library('Rr_v2_form_service', null, 'Rr_forms');\n\n $params = array();\n\n if(isset($_POST)) {\n $resoParams = ee()->Rr_forms->toReso($_POST);\n\n $data = array(\n 'params' => $resoParams,\n 'site_id' => $this->siteId\n );\n\n // Check if doing a server scope by short code first\n if(isset($_POST['short_code']) && $_POST['short_code']) {\n $data['short_code'] = $_POST['short_code'];\n } elseif(isset($_POST['all']) && $_POST['all']) {\n $data['all'] = $_POST['all'];\n }\n\n ee()->Rr_search->insert($data);\n\n $resultsPath = $_POST['results_path'];\n preg_match_all(\"/:([^\\)]*):/\", $resultsPath, $matches);\n\n if(sizeof($matches) == 2) {\n $match = trim($matches[0][0]);\n\n if($match == ':search_id:') {\n $resultsPath = str_replace($matches[0][0], ee()->Rr_search->id, $resultsPath);\n } else {\n ee()->output->fatal_error('You must use :search_id: in your results path as the target search id token. You supplied the following token: ' . $match, 500);\n }\n } else {\n if(substr($resultsPath, -1) !== '/') {\n $resultsPath .= '/';\n }\n\n $resultsPath .= ee()->Rr_search->id;\n }\n \n ee()->functions->redirect($resultsPath);\n }\n }", "public function execute(): SearchResult\n {\n if ($this->searchResult === null) {\n try {\n $jsonResponse = $this->executeInternal($this->request);\n $this->searchResult = SearchResult::fromElasticsearchJsonResponse($jsonResponse, $this->contextNode);\n } catch (ApiException $exception) {\n if ($this->handleElasticsearchExceptions === 'throw') {\n throw $exception;\n }\n\n $this->searchResult = SearchResult::error();\n }\n }\n return $this->searchResult;\n }", "public function search(){\n\t\t\t$this->autoRender = false;\n\n\t\t\t$searchText = Sanitize::escape($this->data['Search']['text']);\n\t\t\t$modelname = $this->data['Search']['model'];\n\t\t\t\n\t\t\tif(! $this->Common->validModel($modelname))\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\n\t\t\t$this->paginate = array('limit' \t\t => 25,\n\t\t 'conditions' => \"MATCH(SearchIndex.data) AGAINST('$searchText' IN BOOLEAN MODE)\");\n\t\t\n\t\t\t$this->SearchIndex->searchModels(array($modelname));\n\t\t\t$results \t\t\t\t= $this->paginate('SearchIndex'); #returns the only the id fields of the matches\n\t\t\t$ids \t\t\t\t= $this->Common->toIdArray($results, $modelname);\n\t\t\t$this->paginate = array('limit'=>25,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order'=>array(\"{$modelname}.created\" => 'asc'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array(\"{$modelname}.id\" =>$ids));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$results = $this->paginate($modelname);\n\t\t\t$this->set('results', $results);\n\t\t\t\n\t\t\t$this->set('modelname', $modelname);\t\t\t\n\t\t\t$this->set('user_id', '');\n\t\t\t$this->set('uservotes', array());\n\t\t\t$user_id = $this->Auth->user('id');\n\t\t\tif($user_id){\n\t\t\t\t$this->set('user_id', $user_id);\n\t\t\t\t$uservotes = $this->Vote->getUserVotes($modelname, $this->Common->toIdArray($results, $modelname), $user_id);\n\t\t\t\t$this->set('uservotes', $uservotes);\n\t\t\t}\n\t\t\t\n\t\t\t$this->render('/elements/searchresults');\n\t\t}", "public function execute($searchRequest);", "public function recherche() {\n $praticiens = $this->praticiens->getPraticiens();\n $praticiensType = $this->typePraticiens->getTypePraticien();\n $this->genererVue(array('praticiens' => $praticiens, 'praticiensType' => $praticiensType));\n }", "public function search() {\n\t\t\t$Recherches = $this->Components->load( 'WebrsaRecherchesRendezvous' );\n\t\t\t$Recherches->search();\n\t\t}", "abstract public function executeSearch(PhabricatorSearchQuery $query);", "public function doSearch();", "private function searchCommand() {\n $name = $this->getParam(\"name=\", \"([a-zA-Z]+)\");\n\n if ($name != null) {\n $this->farm->search($name);\n } else {\n echo \"Error!: A name is required to search a animal\" . PHP_EOL;\n $this->searchCommandHelp();\n }\n }", "public function searchAction()\n {\n $result = $this->model->search(input_data_handler($_GET['search']));\n if (!empty($result)) {\n $vars = [\n 'data' => $result\n ];\n $this->view->render('Searching result', $vars);\n } else {\n $vars = [\n 'data' => null\n ];\n $this->view->render('Searching result', $vars);\n }\n }", "public function search_result()\n {\n // TODO: change $_POST to standard post function in CI\n // retrieval of search_results is done from User_functions_model->show_search_results\n $this->Home_model->show_search_result();\n }", "protected function searchReservesIndex()\n {\n global $interface;\n\n $searchObject = SearchObjectFactory::initSearchObject('SolrReserves');\n $searchObject->init();\n // Process Search\n $result = $searchObject->processSearch(true, true);\n if (PEAR::isError($result)) {\n PEAR::raiseError($result->getMessage());\n }\n $interface->assign('qtime', round($searchObject->getQuerySpeed(), 2));\n $interface->assign(\n 'spellingSuggestions', $searchObject->getSpellingSuggestions()\n );\n $interface->assign(\n 'sideRecommendations',\n $searchObject->getRecommendationsTemplates('side')\n );\n $interface->assign('reservesLookfor', $searchObject->displayQuery());\n $interface->assign('searchType', $searchObject->getSearchType());\n $interface->assign('sortList', $searchObject->getSortList());\n\n if ($searchObject->getResultTotal() < 1) {\n // No record found\n $interface->assign('recordCount', 0);\n\n // Was the empty result set due to an error?\n $error = $searchObject->getIndexError();\n if ($error !== false) {\n // If it's a parse error or the user specified an invalid field, we\n // should display an appropriate message:\n if (stristr($error, 'org.apache.lucene.queryParser.ParseException')\n || preg_match('/^undefined field/', $error)\n ) {\n $interface->assign('parseError', true);\n } else {\n // Unexpected error -- let's treat this as a fatal condition.\n PEAR::raiseError(\n new PEAR_Error(\n 'Unable to process query<br />Solr Returned: ' . $error\n )\n );\n }\n }\n } else {\n $interface->assign('recordSet', $result['response']['docs']);\n $summary = $searchObject->getResultSummary();\n $interface->assign('recordCount', $summary['resultTotal']);\n $interface->assign('recordStart', $summary['startRecord']);\n $interface->assign('recordEnd', $summary['endRecord']);\n // Process Paging\n $link = $searchObject->renderLinkPageTemplate();\n $options = array('totalItems' => $summary['resultTotal'],\n 'fileName' => $link,\n 'perPage' => $summary['perPage']);\n $pager = new VuFindPager($options);\n $interface->assign('pageLinks', $pager->getLinks());\n }\n }", "public function searchAction()\r\n {\r\n $uo = new UserOptions($this->request);\r\n if ( $this->request->getParam('Submit') == 'GO' )\r\n {\r\n // initialise the session for a new search\r\n $sid = $this->engine->initializePazpar2Client();\r\n $uo->setSessionData('pz2session', $sid);\r\n }\r\n else\r\n {\r\n $sid = $uo->getSessionData('pz2session');\r\n }\r\n // kick the search off\r\n $this->query->sid = $sid;\r\n $max_records = $uo->getSessionData('max_records');\r\n try\r\n {\r\n $this->engine->search($this->query, $max_records); // non-blocking call\r\n }\r\n catch( \\Exception $e)\r\n {\r\n $this->flashMessenger->addMessage('Error|Session timeout: ' . $e->getMessage());\r\n // assume the session died - cab't initialise a new one\r\n // as might be infinite loop\r\n // Need to generate an error message\r\n // and routing back to search start page \r\n $this->engine->clearPazpar2Client( $sid );\r\n $params = $this->query->getAllSearchParams();\r\n $params['lang'] = $this->request->getParam('lang');\r\n $params['controller'] = $this->request->getParam('controller');\r\n $params['action'] = 'index';\r\n $url = $this->request->url_for($params);\r\n return $this->redirect()->toUrl($url);\r\n }\r\n // set the url params for where we are going to redirect,\r\n // usually to the results action, but can be overriden\r\n $base = $this->helper->searchRedirectParams();\r\n $params = $this->query->getAllSearchParams();\r\n $params = array_merge($base, $params);\r\n $params['lang'] = $this->request->getParam('lang');\r\n $params['action'] = 'status';\r\n $params['Submit'] = '';\r\n // check spelling\r\n $this->checkSpelling();\r\n // construct the actual url and redirect\r\n $url = $this->request->url_for($params);\r\n return $this->redirect()->toUrl($url);\r\n }", "public function search()\n {\n if (!$this->validate()) {\n $response = ['errors' => $this->errors];\n } else {\n $data = $this->getData();\n if (empty($data)) {\n $response = \"No results found\";\n }\n else {\n $response = [\n 'searchQuery' => $this->request,\n 'searchResults' => $data\n ];\n }\n }\n\n echo (json_encode($response));\n }", "public function search() {\n // debug ( $this->request->params );\n \n $seoText = array();\n $seoText['term'] = null;\n $searchTerm = array();\n \n // check if city/city_region/neighbourhood/etc passed in \n if ( isset($this->request->params['named']['city'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['city'] , array( '_', '-') );\n $result = $this->Venue->City->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) ); \n $cityId = $result['City']['id']; \n $seoText['location'][] = ' in city of ' . $result['City']['name'];\n } \n if ( isset($this->request->params['named']['city_neighbourhood'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['city_neighbourhood'] , array( '_', '-') ); \n $result = $this->Venue->CityNeighbourhood->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) ); \n $cityNeighbourhoodId = $result['CityNeighbourhood']['id'];\n $seoText['location'][] = ' in '. $result['CityNeighbourhood']['name'];\n }\n if ( isset($this->request->params['named']['city_region'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['city_region'] , array( '_', '-') ); \n $result = $this->Venue->CityRegion->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) ); \n $cityRegionId = $result['CityRegion']['id'];\n $seoText['location'][] = ' in '. $result['CityRegion']['name'];\n }\n if ( isset($this->request->params['named']['province'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['province'] , array( '_', '-') ); \n $result = $this->Province->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) );\n $provinceId = $result['Province']['id'];\n $seoText['location'][] = ' in '. $result['Province']['name'];\n }\n \n // check for product / service / amenity / etc.\n $featureId = null;\n \n if ( isset($this->request->params['named']['product'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['product'] , array( '_', '-') ); \n $result = $this->Venue->VenueFeature->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) ); \n $featureId = $result['VenueFeature']['id']; \n $seoText['term'][] = $result['VenueFeature']['name'];\n $searchTerm[] = $result['VenueFeature']['name'];\n }\n if ( isset($this->request->params['named']['service'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['service'] , array( '_', '-') ); \n $result = $this->Venue->VenueFeature->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) ); \n $featureId = $result['VenueFeature']['id']; \n $seoText['term'][] = $result['VenueFeature']['name'];\n $searchTerm[] = $result['VenueFeature']['name'] . ' service';\n } \n if ( isset($this->request->params['named']['amenity'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['amenity'] , array( '_', '-') ); \n $result = $this->Venue->VenueFeature->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) ); \n $featureId = $result['VenueFeature']['id']; \n $seoText['term'][] = $result['VenueFeature']['name'];\n $searchTerm[] = $result['VenueFeature']['name'];\n } \n if ( isset($this->request->params['named']['store_type'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['store_type'] , array( '_', '-') ); \n $result = $this->Venue->VenueFeature->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) ); \n $featureId = $result['VenueFeature']['id']; \n $seoText['term'][] = $result['VenueFeature']['name'];\n $searchTerm[] = $result['VenueFeature']['name'];\n } \n \n // store category ( computer store, video games, etc. )\n if ( isset($this->request->params['named']['business_category'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['business_category'] , array( '_', '-') ); \n $result = $this->Venue->BusinessType1->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) );\n $storeCategoryId = $result['BusinessType1']['id']; \n $seoText['term'][] = $result['BusinessType1']['name'];\n $searchTerm[] = $result['BusinessType1']['name'];\n }\n \n // chain\n if ( isset($this->request->params['named']['chain'])) {\n $slug = Sanitize::paranoid($this->request->params['named']['chain'] , array( '_', '-') ); \n $result = $this->Venue->Chain->find('first', array('conditions' => array('slug' => $slug), 'contain' => false) );\n $chainId = $result['Chain']['id']; \n $seoText['term'][] = $result['Chain']['name'];\n $searchTerm[] = $result['Chain']['name']. ' locations';\n } \n \n \n \n // now build query\n $this->Venue->bindModel(array('hasOne' => array('VenuesVenueFeature')), false );\n $this->Venue->contain(array('VenuesVenueFeature'));\n \n $this->paginate = array( 'Venue' => array(\n 'limit' => 8,\n 'conditions' => array('Venue.publish_state_id' => VENUE_PUBLISHED,\n 'VenuesVenueFeature.venue_feature_id' => $featureId, \n //'Venue.city_id' => 36,\n //'Venue.city_region_id',\n //'Venue.city_neighbourhood_id',\n //'Venue.province_id'\n \n ), // conditions for city, region, neighbourhood \n 'fields' => array('id', 'name', 'sub_name', 'address', 'slug', 'geo_lat','geo_lng', 'seo_desc'),\n 'contain' => array(\n 'VenuesVenueFeature',\n 'BusinessType1.name', 'BusinessType2.name', 'BusinessType3.name',\n 'City.name', 'Intersection.name',\n 'VenueFeature' => array('conditions' => array('VenueFeature.id' => $featureId ), 'fields' => 'name')\n ),\n 'group' => array('Venue.id')\n \n )\n );\n \n if ( isset($storeCategoryId)) {\n $this->paginate['Venue']['conditions']['OR'] = array(\n 'Venue.business_type_1_id' => $storeCategoryId,\n 'Venue.business_type_2_id' => $storeCategoryId,\n 'Venue.business_type_3_id' => $storeCategoryId\n );\n }\n \n if (!isset($featureId)) {\n unset($this->paginate['Venue']['conditions']['VenuesVenueFeature.venue_feature_id']); \n unset($this->paginate['Venue']['contain']['VenueFeature']); \n unset($this->paginate['Venue']['contain']['VenuesVenueFeature']); \n }\n \n if ( isset($cityId)) {\n $this->paginate['Venue']['conditions']['Venue.city_id'] = $cityId;\n } \n if ( isset($cityRegionId)) {\n $this->paginate['Venue']['conditions']['Venue.city_region_id'] = $cityRegionId;\n } \n if ( isset($cityNeighbourhoodId)) {\n $this->paginate['Venue']['conditions']['Venue.city_neighbourhood_id'] = $cityNeighbourhoodId;\n } \n if ( isset($provinceId)) {\n $this->paginate['Venue']['conditions']['Venue.province_id'] = $provinceId;\n } \n if ( isset($chainId)) {\n $this->paginate['Venue']['conditions']['Venue.chain_id'] = $chainId;\n } \n \n //debug( $this->paginate['Venue'] ); \n //debug( $this->paginate('Venue') );\n $this->VenueFeature->recursive = 0;\n $this->set('venues', $this->paginate('Venue')); \n \n \n if ( isset($this->request->params['paging']['Venue']['page'])) {\n $pageNumber = $this->request->params['paging']['Venue']['page'] . ' - ' . $this->request->params['paging']['Venue']['pageCount'];\n }\n \n \n $default = 'Bookstore services and amenities'; \n $seo = $this->Seo->setSearchMeta( $seoText['term'] ,$seoText['location'], $pageNumber, $default);\n \n $searchTerm = $seo['keywords'];\n $metaDescription = $seo['desc'];\n $metaKeywords = $seo['keywords'];\n \n $this->set('title_for_layout', $seo['title']);\n \n $openGraph = $this->Seo->setOpengraph( array(\n 'seo' => $seo, \n 'url' => Configure::read('Website.url') . $this->request->here\n ) ); \n \n \n \n $this->set( compact( 'searchTerm', 'seo', 'openGraph', 'metaDescription', 'metaKeywords'));\n }", "public function actionSearch()\n\t\t {\n\t\t \t\n\t\t\t\t\t\t\t\t//LOADING INDEX TO PERFORM SEARCH IN DOCUMENT\n\t\t \t $this->layout='column2';\n\t\t\t\t\t\t $_indexFiles = '\\runtime\\search';\n\t\t\t\t\t\t $index = Zend_Search_Lucene::create($_indexFiles);\n\t\t\t\t\t\t $index = new Zend_Search_Lucene(Yii::getPathOfAlias('application.' . $this->_indexFiles), true);\n\t\t\t\t\t\t \t$index = new Zend_Search_Lucene($this->_indexFiles,true);\n\t\t\t\t\t\t $this->layout='column2';\n\t\t\n\t\t\t\t\t\t // GETING THE PARAMETER STRING TO SEARCH IN DOCUMENT\n\t\t\t\t\t\t\t \tif ((($term = Yii::app()->getRequest()->getParam('q', null)) !== null)) {\n\t\t\t\t\t\t\t \t\t\n\t\t\t\t\t\t\t \t\t//calling create() to create search index at run time. \n\t\t\t\t\t\t\t \t $this->actionCreate();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \t $index = Zend_Search_Lucene::open($_indexFiles);\n\t\t\t\t\t\t\t \t\t\n\t\t\t\t\t\t\t \t\t$results = $index->find($term);\n\t\t\t\t\t\t\t \t\t$query = Zend_Search_Lucene_Search_QueryParser::parse($term,'utf-8');\n\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t \t\t$this->render('search',compact('results', 'term', 'query'));\n\t\t\t\t\t\t\t \t}\n\t\t\t\t \t \n\t\t \t\n\t\t }", "public function index(){\n $search_on = array();\n foreach($this->structure as $name=>$details){\n $class = $details['class'];\n if($class::$searchable){\n $controller = new $class(false, false);\n $search_on[$name] = array('model'=>$controller->model_class, 'cols'=>$class::$global_search_columns);\n }\n }\n if($q = Request::param('q')){\n foreach($search_on as $name=>$info){\n $class = $info['model'];\n $model = new $class;\n $res = array();\n $sql = \"\";\n foreach($info['cols'] as $col) $sql .= $col.\" LIKE ? OR \";\n $sql = trim($sql, \"OR \");\n foreach($model->filter($sql, array_fill(0, count($info['cols']), \"%\".$q.\"%\"), \"raw\")->limit(5)->all() as $row) $res[$row->primval] = $row;\n if(count($res)) $this->search_results[$name] = $res;\n }\n }\n }", "function ajaxVehicleVinSearch() {\n $term = $this->requestPtr->getProperty('term');\n $vehicles = $this->ladeLeitWartePtr->vehiclesPtr->newQuery()\n ->multipleAndWhere('vin', 'ILIKE', '%' . $term . '%')\n ->get(\"vin as label,vin as value\");\n echo json_encode($vehicles);\n exit(0);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is the $output of $hostname HTTP check a correct one or not. Required for automatic adding of new hosts
abstract protected function outputIsOk($hostname, $output);
[ "function checkHost ($host) {\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $host);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t//curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\tcurl_setopt($ch, CURLOPT_HEADER, 1);\n\tcurl_setopt($ch,CURLOPT_TIMEOUT,5);\n\t$result=curl_exec($ch);\n\n\t$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);\n\t$header = substr($result, 0, $headerSize);\n\tif (strpos($header, \"HTTP/1.1 200 OK\") !== false){\n\t\treturn TRUE;\n\t} else {\n\t\treturn FALSE;\n\t}\n\n}", "function is_hostname ($hostname = \"\"){\n\t\tif ($this->CLEAR) { $this->clear_error(); }\n\n\t\t$web = false;\n\n\t\tif (empty($hostname)){\n\t\t\t$this->ERROR = \"Provide Correct Email Id\";\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only a-z, 0-9, and \"-\" or \".\" are permitted in a hostname\n\n\t\t// Patch for POSIX regex lib by Sascha Schumann sas@schell.de\n\t\t$Bad = eregi_replace(\"[-A-Z0-9\\.]\",\"\",$hostname);\n\n\t\tif (!empty($Bad)){\n\t\t\t$this->ERROR = \"invalid chars [$Bad]\";\n\t\t\treturn false;\n\t\t}\n\n\t\t// See if we're doing www.hostname.tld or hostname.tld\n\t\tif (eregi(\"^www\\.\",$hostname)){\n\t\t\t$web = true;\n\t\t}\n\n\t\t// double \".\" is a not permitted\n\t\tif (ereg(\"\\.\\.\",$hostname)){\n\t\t\t$this->ERROR = \"Double dot in [$hostname]\";\n\t\t\treturn false;\n\t\t}\n\t\tif ( ereg(\"^\\.\", $hostname )) {\n\t\t\t$this->ERROR = \"leading dot in [$hostname]\";\n\t\t\treturn false;\n\t\t}\n\n\t\t$chunks = explode(\".\",$hostname);\n\n\t\tif ( (gettype($chunks)) != \"array\"){\n\t\t\t$this->ERROR = \"Invalid hostname, no dot seperator [$hostname]\";\n\t\t\treturn false;\n\t\t}\n\n\t\t$count = ( (count($chunks)) - 1);\n\n\t\tif ($count < 1){\n\t\t\t$this->ERROR = \"Invalid hostname [$count] [$hostname]\\n\";\n\t\t\treturn false;\n\t\t}\n\n\t}", "function validateHostname () {\n if ( preg_match('/^([^.]+)\\.(.+)$/', $this->full_hostname,$hostname_parts ) ) {\n $this->host_name = $hostname_parts[1];\n $this->domain_name = $hostname_parts[2];\n $this->validateDomain();\n return 1;\n } else {\n return 0;\n }\n }", "public function validate_host() {\n if (isset($this->initial_data[\"host\"])) {\n # Ensure it is a valid hostname\n if (is_hostname($this->initial_data[\"host\"])) {\n $this->validated_data[\"host\"] = $this->initial_data['host'];\n } else {\n $this->errors[] = APIResponse\\get(2046);\n }\n } else {\n $this->errors[] = APIResponse\\get(2007);\n }\n }", "public function is_resolvable()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $hostname = $this->get_actual() . '.';\n\n $retval = gethostbyname($hostname);\n\n if ($retval == $hostname)\n return FALSE;\n\n return TRUE;\n }", "function _is_valid_host($address='')\n {\n $result = false;\n\n\n if ($this->_host)\n {\n $known_hosts = array('gmail.com','live.com','hotmail.com','yahoo.com','aol.com','me.com','inbox.com',);\n $invalid_hosts = array('example.com','example.net','example.org','example.edu',);\n\n if (in_array($this->_host, $known_hosts)) {\n $this->__ez_debug(\"not checking host {$this->_host} since its in known hosts.\");\n $result = true;\n }\n elseif (in_array($this->_host, $this->_validated_hosts)) {\n $this->__ez_debug(\"not checking host {$this->_host} since it was previously validated.\");\n $result = true;\n }\n elseif (in_array($this->_host, $invalid_hosts)) {\n $this->__ez_debug(\"not checking host {$this->_host} since its in invalid hosts.\");\n $this->errors[(string) microtime(true)] = array('not-valid-host' => \"The email address `{$this->_host}` does not use a valid DNS host.\");\n }\n else {\n\n if (function_exists('checkdnsrr')) {\n $this->__ez_debug(\"checkdnsrr() of {$this->_host}\");\n\n $this->__ez_debug(\"network-connection: checkdnsrr (twice)\");\n if (checkdnsrr($this->_host,'ANY') || checkdnsrr($this->_host,'MX')) { // TODO: $checkdnsrr_mx is probably redundant.\n $this->_validated_hosts[] = $this->_host;\n $result = true;\n }\n }\n else {\n $this->__ez_debug(\"Missing function: checkdnsrr()\");\n }\n\n\n if (!$result) {\n $debug_message = \"Check \".__function__.\":\";\n $debug_message .= ($result)? 'pass':'fail';\n $this->__ez_debug($debug_message);\n $this->__ez_debug(\"network-connection: dns_get_record (debug display)\");\n $this->__ez_debug(\"complete DNS for {$this->_host}:\".var_export(@ dns_get_record($this->_host), true));\n\n $this->errors[(string) microtime(true)] = array('not-valid-host' => \"The email address `{$this->_host}` does not use a valid DNS host.\");\n }\n }\n }\n\n\n return $result;\n }", "function process_host_detail($in_hostname)\n{\n\tglobal $NagiosData; \n\tglobal $NagiosUser; \n\t$hd = $NagiosData->get_details_by('host', $in_hostname); \n\t$hostname = $hd['host_name'];\n\tif(!$NagiosUser->is_authorized_for_host($hostname)) return false; //bail if not authorized \n\n\t$duration = calculate_duration($hd['last_state_change']);\n\t$current_state = return_host_state($hd['current_state']);\n\t$statetype = return_state_type($hd['state_type']); //calculate state \n\t$current_check = $hd['current_attempt'].' of '.$hd['max_attempts'];\n\n\t$date_format = 'M d H:i\\:s\\s Y';\n\t$last_check = date($date_format, $hd['last_check']);\n\t$next_check = date($date_format, $hd['next_check']);\n\t$last_state_change = date($date_format, $hd['last_state_change']);\n\t\n\tif($hd['last_notification']==0){$last_notification='Never';} \n\telse {$last_notification = date($date_format, $hd['last_notification']);}\n\t\n\t$check_type = ($hd['check_type'] == 0) ? 'Active' : 'Passive';\n\n\t$check_latency = $hd['check_latency'].' seconds';\n\t$execution_time = $hd['check_execution_time'].' seconds';\n\t$state_change = $hd['percent_state_change'].'%';\n\t\n\t$membership = check_membership($hostname);\n\t$state = return_host_state($hd['current_state']);\n\n\t//host attributes \n\t//if else statements generate links for Nagios core commands based on status \n\t$active_checks = return_enabled($hd['active_checks_enabled']);\n\n\tif($active_checks == 'Enabled') \n\t{ $cmd_active_checks = core_function_link('DISABLE_HOST_CHECK', $hostname); }\n\telse{ $cmd_active_checks = core_function_link('ENABLE_HOST_CHECK', $hostname); }\n\t\n\t$passive_checks = return_enabled($hd['passive_checks_enabled']);\n\tif($passive_checks == 'Enabled')\n\t{$cmd_passive_checks = core_function_link('DISABLE_PASSIVE_HOST_CHECKS', $hostname); }\n\telse{$cmd_passive_checks = core_function_link('ENABLE_PASSIVE_HOST_CHECKS', $hostname); }\n\t\n\t$notifications = return_enabled($hd['notifications_enabled']);\n\tif($notifications == 'Enabled')\n\t{$cmd_notifications = core_function_link('DISABLE_HOST_NOTIFICATIONS', $hostname); }\n\telse {$cmd_notifications = core_function_link('ENABLE_HOST_NOTIFICATIONS', $hostname); }\n\t\n\t$flap_detection = return_enabled($hd['flap_detection_enabled']);\n\tif($flap_detection == 'Enabled')\n\t{$cmd_flap_detection = core_function_link('DISABLE_HOST_FLAP_DETECTION', $hostname); }\n\telse{$cmd_flap_detection = core_function_link('ENABLE_HOST_FLAP_DETECTION', $hostname); }\n\t\n\t$process_perf_data = return_enabled($hd['process_performance_data']);\n\n\t$obsession = return_enabled($hd['obsess_over_host']);\n\tif($obsession == 'Enabled')\n\t{$cmd_obsession = core_function_link('STOP_OBSESSING_OVER_HOST', $hostname); }\n\telse{$cmd_obsession = core_function_link('START_OBSESSING_OVER_HOST', $hostname); }\n\t\n\t$add_comment = core_function_link('ADD_HOST_COMMENT', $hostname);\n\t\n\tif($hd['problem_has_been_acknowledged'] == 0)\n\t{\n\t\t$cmd_acknowledge = core_function_link('ACKNOWLEDGE_HOST_PROBLEM', $hostname);\n\t\t$ack_title = 'Acknowledge Problem';\n\t} \n\telse\n\t{\n\t\t$cmd_acknowledge = core_function_link('REMOVE_HOST_ACKNOWLEDGEMENT', $hostname);\n\t\t$ack_title = 'Remove Acknowledgement';\t\n\t} \n\t\n\t$cmd_custom_notification = core_function_link('SEND_CUSTOM_HOST_NOTIFICATION', $hostname);\n\t$cmd_schedule_downtime = core_function_link('SCHEDULE_HOST_DOWNTIME', $hostname);\n\t$cmd_schedule_dt_all = core_function_link('SCHEDULE_HOST_SVC_DOWNTIME', $hostname);\n\t$cmd_schedule_checks = core_function_link('SCHEDULE_HOST_SVC_CHECKS', $hostname);\n\n\t$cmd_map = CORECGI.'statusmap.cgi?host='.$hostname;\n\t$core_link = CORECGI.'extinfo.cgi?type=1&host='.$hostname;\n\n\t$details = array( \n\t\t\t\t\t'Host'\t=> $hostname,\n\t\t\t\t\t'MemberOf' => $membership,\n\t\t\t\t\t'StatusInformation' => $hd['plugin_output'],\n\t\t\t\t\t'State' => $current_state,\n\t\t\t\t\t'Duration' => $duration,\n\t\t\t\t\t'StateType' => $statetype,\n\t\t\t\t\t'CurrentCheck' => $current_check,\n\t\t\t\t\t'LastCheck' => $last_check,\n\t\t\t\t\t'NextCheck' => $next_check,\n\t\t\t\t\t'LastStateChange' => $last_state_change,\n\t\t\t\t\t'LastNotification' => $last_notification,\n\t\t\t\t\t'CheckType' => $check_type,\n\t\t\t\t\t'CheckLatency' => $check_latency,\n\t\t\t\t\t'ExecutionTime' => $execution_time,\n\t\t\t\t\t'StateChange' => $state_change,\n\t\t\t\t\t'PerformanceData' => $hd['performance_data'],\n\t\t\t\t\t'ActiveChecks' => $active_checks,\n\t\t\t\t\t'PassiveChecks' => $passive_checks,\n\t\t\t\t\t'Notifications' => $notifications,\n\t\t\t\t\t'FlapDetection' => $flap_detection,\n\t\t\t\t\t'ProcessPerformanceData' => $process_perf_data,\n\t\t\t\t\t'Obsession'\t\t=> $obsession,\n\t\t\t\t\t'AddComment'\t=> htmlentities($add_comment),\n\t\t\t\t\t'MapHost'\t\t=> htmlentities($cmd_map),\n\t\t\t\t\t'CmdActiveChecks'\t=> htmlentities($cmd_active_checks),\n\t\t\t\t\t'CmdPassiveChecks' => htmlentities($cmd_passive_checks),\n\t\t\t\t\t'CmdNotifications' => htmlentities($cmd_notifications),\n\t\t\t\t\t'CmdFlapDetection' => htmlentities($cmd_flap_detection),\n\t\t\t\t\t'CmdObsession'\t\t=> htmlentities($cmd_obsession),\n\t\t\t\t\t'CmdAcknowledge' => htmlentities($cmd_acknowledge),\n\t\t\t\t\t'CmdCustomNotification'\t=> htmlentities($cmd_custom_notification),\n\t\t\t\t\t'CmdScheduleDowntime'\t=> htmlentities($cmd_schedule_downtime),\n\t\t\t\t\t'CmdScheduleDowntimeAll' => htmlentities($cmd_schedule_dt_all),\n\t\t\t\t\t'CmdScheduleChecks'\t\t=> htmlentities($cmd_schedule_checks),\n\t\t\t\t\t'AckTitle'\t\t\t\t=> $ack_title,\n\t\t\t\t\t'CoreLink'\t\t\t\t=> htmlentities($core_link),\n\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\treturn $details;\n}", "public static function checkHostnameChanged($ip, $hostnameIX)\n\t{\n\t\t$cmd = 'getent hosts '.$ip;\n\t\t//echo \"<br/>Finding hosthame for: \".$ip;\n\t\t$output = shell_exec($cmd);\n\t\t$response = array(\n\t\t\t\t\"status\"=>0,\n\t\t\t\t\"hostname\"=>\"\"\n\t\t\t\t);\n\n\t\tif($output==\"\"){\n\t\t\t//echo \"<br/>No hostname found\";\n\t\t\treturn $response;\n\t\t} else {\n\n\t\t\t$spaces = '';\n\n\t\t\t//echo \"<pre>$output</pre>\";\n\t\t\t$hostname_data = explode(' ', $output);\n\t\t\t\n\t\t\t//print_r($hostname_data);\n\n\t\t\t// remove spaces before comparison\n\t\t\t$hostnameNew= trim($hostname_data[count($hostname_data)-1]);\n\t\t\t$hostnameIX = trim($hostnameIX);\n\n\t\t\t// normanize to lowerCase\n\t\t\t$hostnameNew = strtolower($hostnameNew);\n\t\t\t$hostnameIX = strtolower($hostnameIX);\n\n\t\t\tif($hostnameIX==$hostname_data[1]){\n\t\t\t\t$response['status']=1;\n\t\t\t\t$response['hostname']=$hostnameNew;\n\t\t\t\treturn $response;\n\t\t\t\n\t\t\t} else if($hostnameIX!=$hostnameNew){\n\t\t\t\t$response['status']=2;\n\t\t\t\t$response['hostname']=$hostnameNew;\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\t}", "public function CheckHost($HN=false) \n {\n $H = empty($HN)?trim(strtolower(gethostname())):$HN;\n $Q = $this->DB->GET('MUP.hardware.servers',['type'=>'PMTA','active'=>1,'name'=>$H],['name','id'],1);\n if(isset($Q['name'])){\n $this->hostname = $Q['name'];\n define('hostname',$this->hostname);\n $this->hostID = $Q['id'];\n define('hostID',$this->hostID);\n }else{\n Quit('Invalid Hostname!');\n }\n }", "public function checkHost() {\n\n\t\t\t//Get the host\n\t\t\t$host = $_SERVER['HTTP_HOST'];\n\n\t\t\t//Verify if host is permited or no\n\t\t\treturn in_array($host, $this->hosts ) ? true : false;\n\n\t\t}", "function hasHostNameNeverUsed($name = null)\n{\n global $pearDB, $form, $centreon;\n\n $id = null;\n if (isset($form)) {\n $id = (int) $form->getSubmitValue('host_id');\n }\n\n $prepare = $pearDB->prepare(\n \"SELECT host_name, host_id FROM host \"\n . \"WHERE host_name = :host_name AND host_register = '1'\"\n );\n $hostName = CentreonDB::escape($centreon->checkIllegalChar($name));\n\n $prepare->bindValue(':host_name', $hostName, \\PDO::PARAM_STR);\n $prepare->execute();\n $result = $prepare->fetch(\\PDO::FETCH_ASSOC);\n $totals = $prepare->rowCount();\n\n if ($totals >= 1 && ($result[\"host_id\"] == $id)) {\n /**\n * In case of modification\n */\n return true;\n } elseif ($totals >= 1 && ($result[\"host_id\"] != $id)) {\n return false;\n } else {\n return true;\n }\n}", "function gethostname(): string|false {}", "function server_check($ip,$http=\"http://\")\n\t{\n\t\t$data = $http.$ip;\n\t\t// Create a curl handle to a non-existing location\n\t\t$ch = curl_init($data);\n\t\t// Execute\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_exec($ch);\n\t\t// Check if any error occured\n\t\tif(curl_errno($ch))\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t\t// Close handle\n\t\tcurl_close($ch);\n\t}", "protected function detectHostname()\n {\n if ($hostname = gethostname()) {\n $this->hostname = $hostname;\n }\n }", "function is_valid_hostname($p_host)\n{\n $l_hostnames = explode(\".\", $p_host);\n\n if (empty($p_host)) return false;\n\n if (count($l_hostnames) > 1)\n {\n foreach ($l_hostnames as $l_host)\n {\n if ($l_host != \"*\")\n {\n if (!preg_match('/^[a-z\\d\\-]+$/i', $l_host))\n {\n return false;\n } // if\n } // if\n } // foreach\n\n return true;\n }\n else\n {\n return match_hostname($p_host);\n } // if\n}", "private static function webhost() {\n\n\t\t$response = self::$client->get( self::$hostname_url );\n\n\t\t$data = json_decode((string) $response->getBody(), true);\n\n\t\treturn $data['host'] ?: false;\n\n\t}", "public function testHostname()\n\t{\n\t\t$this->assertTrue(valid_hostname('myhost.com'), 'myhost.com is a valid hostname.');\n\n\t\t$this->assertTrue(valid_hostname('myhost.com.'), 'myhost.com. is a valid hostname.');\n\n\t\t$this->assertFalse(valid_hostname('my host.com'), 'my host.com is not a valid hostname');\n\n\t\t$this->assertFalse(valid_hostname('O@O'), 'O@O is not a valid hostname');\n\t}", "static private function CheckCorrectHost() {\n\t\tif (count($_POST) > 0) {\n\t\t\treturn;\n\t\t}\n\t\t$correct_host = str_replace('https://', '', self::getURL());\n\n\t\tif ($_SERVER[\"SERVER_NAME\"] !== $correct_host) {\n\t\t\tself::redirect(self::getCurrentURL() . $_SERVER[\"REQUEST_URI\"]);\n\t\t}\n\t}", "private function __validate_host() {\n if (isset($this->initial_data[\"host\"])) {\n # Ensure the `host` value is a valid IP or hostname\n if (is_ipaddr($this->initial_data[\"host\"]) or is_hostname($this->initial_data[\"host\"])) {\n $this->validated_data[\"host\"] = $this->initial_data[\"host\"];\n } else {\n $this->errors[] = APIResponse\\get(5012);\n }\n } else {\n $this->errors[] = APIResponse\\get(5011);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get the count of alloted profiles per agent
public function getAgentAllotedProfileCount($profileArray){ $tempCount = array(); foreach($profileArray as $key=>$value){ if(is_array($profileArray[$key])){ $tempCount[$key] = count($profileArray[$key]); } else { $tempCount[$key] = 0; } } return $tempCount; }
[ "public function count()\n {\n return count($this->profileList);\n }", "public function getAgentsCount()\n {\n return $this->count(self::AGENTS);\n }", "public function getTotalUnscreenedProfileCount()\n {\n $PROFILE_VERIFICATION_DOCUMENTS = new PROFILE_VERIFICATION_DOCUMENTS;\n\t\t$whereCondition[\"VERIFIED_FLAG\"] = PROFILE_VERIFICATION_DOCUMENTS_ENUM::$VERIFIED_FLAG_ENUM[\"UNDER_SCREENING\"];\n\t $whereCondition[\"DELETED_FLAG\"] = PROFILE_VERIFICATION_DOCUMENTS_ENUM::$DELETED_FLAG_ENUM[\"NOT_DELETED\"];\n\t\t$result=$PROFILE_VERIFICATION_DOCUMENTS->getDocuments(\"count(distinct(`PROFILEID`))\",$whereCondition);\n\t\treturn $result[0][\"count(distinct(`PROFILEID`))\"];\n }", "public static function populate_agent_alert_counts(){\n\n foreach(Process_Data::$agent_ids as $id){\n $current_alerts = json_decode(Nb_Alerts::current_alerts(array(\"agent_id\" => $id)));\n Process_Data::$agent_table_object[$id]['open_alerts_count'] = count($current_alerts->{'current_alerts'});\n }\n\n }", "public function getTotalCompleted(){\n\n $profiles = UserProfile::where('gender', '<>', '')\n ->where('gender', '<>', 'none')\n ->where('city', '<>', '')\n ->where('skill', '<>', '')\n ->where('skill', '<>', 'none')\n ->where('racquet', '<>', '')\n ->where('racquet', '<>', 'none')\n ->where('dominant_hand', '<>', '')\n ->where('dominant_hand', '<>', 'none')\n ->where('bio', '<>', '')\n ->get();\n\n $cnt=0; \n foreach ($profiles as $profile) {\n\n if ($profile->is_avatar_unique){\n $cnt++;\n } \n }\n\n return $cnt;\n }", "public function getTotalOccupiedLots() {}", "function sp_count_profiles($type = 1)\n{\n\t$db = database();\n\n\t$request = $db->query('', '\n\t\tSELECT COUNT(*)\n\t\tFROM {db_prefix}sp_profiles\n\t\tWHERE type = {int:type}',\n\t\tarray(\n\t\t\t'type' => $type,\n\t\t)\n\t);\n\tlist ($total_profiles) = $db->fetch_row($request);\n\t$db->free_result($request);\n\n\treturn $total_profiles;\n}", "public function countJobAgents()\n\t{\n\t\treturn Call::communicate('GET', [\n\t\t\t\"organizations/$this->organizationId/email/jobagents\" => []\n\t\t]);\n\t}", "function _stanford_cap_api_profiles_get_group_profiles_count($type, $name) {\n $count = 0;\n switch ($type) {\n case 'organization':\n $params = array('orgCodes' => $name);\n $data = stanford_cap_api_request('/profiles/v1', $params);\n if ($data) {\n $count = $data['totalCount'];\n }\n break;\n\n case 'workgroup':\n $params = array('privGroups' => $name);\n $data = stanford_cap_api_request('/profiles/v1', $params);\n if ($data) {\n $count = $data['totalCount'];\n }\n break;\n\n case 'school':\n break;\n }\n\n return $count;\n}", "function getOffice365ActivationCounts(){\n return $this->addReportQuery(\"getOffice365ActivationCounts\");\n }", "function get_objectives_count()\n {\n \tif($this->debug>1){error_log('New LP - In learnpathItem::get_objectives_count()',0);}\n \t$res = 0;\n \tif(!empty($this->objectives_count)){\n \t\t$res = $this->objectives_count;\n \t}\n \treturn $res;\n }", "function getTotalGrantsApplied() {\n\t\treturn $this->getMovieCount();\n\t}", "public function actorCount(){\n $base_match = [];\n if( $this->has_lrs ){\n $base_match['lrs_id'] = $this->lrs->id;\n }\n\n $count_array = ['mbox' => '', 'openid' => '', 'mbox_sha1sum' => '', 'account' => ''];\n \n $count_array['mbox'] = $this->db->statements->aggregate([\n ['$match' => array_merge($base_match, ['statement.actor.mbox' => ['$exists' => true]])],\n ['$group' => ['_id' => '$statement.actor.mbox']],\n ['$group' => ['_id' => 1, 'count' => ['$sum' => 1]]]\n ]);\n \n $count_array['openid'] = $this->db->statements->aggregate([\n ['$match' => array_merge($base_match, ['statement.actor.openid' => ['$exists' => true]])],\n ['$group' => ['_id' => '$statement.actor.openid']],\n ['$group' => ['_id' => 1, 'count' => ['$sum' => 1]]]\n ]);\n \n $count_array['mbox_sha1sum'] = $this->db->statements->aggregate([\n ['$match' => array_merge($base_match, ['statement.actor.mbox_sha1sum' => ['$exists' => true]])],\n ['$group' => ['_id' => '$statement.actor.mbox_sha1sum']],\n ['$group' => ['_id' => 1, 'count' => ['$sum' => 1]]]\n ]);\n \n $count_array['account'] = $this->db->statements->aggregate([\n ['$match' => array_merge($base_match, ['statement.actor.account' => ['$exists' => true]])],\n ['$group' => ['_id' => ['accountName' => '$statement.actor.account.name', 'accountHomePage' => '$statement.actor.account.homePage']]],\n ['$group' => ['_id' => 1, 'count' => ['$sum' => 1]]]\n ]);\n\n $summary = 0;\n foreach ($count_array as $key => $val) {\n if( isset($val['result'][0]) ){\n $summary += $val['result'][0]['count'];\n }\n }\n\n return $summary;\n }", "public function countByBookingScore()\n {\n return $this->tutor\n ->live()\n ->whereHas('profile', function($q) {\n $q->where('quality', '!=', '0');\n })\n \n ->count();\n }", "function countProperties();", "public function count()\n {\n return count($this->advisors);\n }", "public function getStatsAboutProfiles() {\n \n try {\n $stats = array();\n // Total number of users\n $sql = \"\n SELECT COUNT(sup_u_id) AS total\n FROM showcase_user_profile\n \";\n $stats['totalUsers'] = $this->conn->query($sql)[0]['total'];\n\n return $stats;\n } catch(\\Exception $e) {\n $this->logger->error(\"Failed to get stats for profiles: \" . $e->getMessage());\n return false;\n }\n }", "public function countMembers()\n\t{\n\t\t#init\t\t\n\t\t$stats\t\t= $this->cache->getCache('ibEco_stats');\n\t\t$ecoPoints \t= $this->settings['eco_general_pts_field'];\n\t\t$ptsDB\t\t= ( $ecoPoints == 'eco_points' ) ? 'pc' : 'm';\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t#get count\n\t\t$max\t= $this->DB->buildAndFetch( array(\n\t\t\t\t\t\t\t\t\t\t\t\t'select'\t=> 'COUNT( m.member_id ) as memCount',\n\t\t\t\t\t\t\t\t\t\t\t\t'from'\t\t=> array( 'members' => 'm' ),\n\t\t\t\t\t\t\t\t\t\t\t\t'where' \t=> $ptsDB.'.'.$ecoPoints.' > 0 OR pc.eco_worth > 0 OR pc.eco_welfare > 0',\n\t\t\t\t\t\t\t\t\t\t\t\t'add_join'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray( 'from'\t=> array( 'pfields_content' => 'pc' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where'\t=> 'm.member_id=pc.member_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t)\t\t);\t\t\t\t\t\t\t\t\t\t\n\t\treturn $max['memCount'];\n\t}", "public function getAssuredCount()\n {\n return isset($this->assured_count) ? $this->assured_count : 0;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get generated fields map
final public function getFieldsMap(){ return $this->arFieldsMap; }
[ "abstract public function _getFieldsMap();", "private static function getFieldMap()\n {\n return array(\n 'user_id' => 'UserID',\n 'contact_id' => 'ContactID',\n 'first_name' => 'FirstName',\n 'last_name' => 'LastName',\n 'location_id' => 'LocationID',\n 'commitment' => 'Commitment',\n 'is_new' => 'IsNew',\n 'source' => 'Source',\n 'interest' => 'Interest',\n 'engage' => 'Engage',\n 'current_status_id' => 'CurrentStatusID',\n 'source_id' => 'ExternalSourceIdentifier',\n 'notes' => 'Notes',\n 'has_photo' => 'Photo',\n );\n }", "public function getFields(){ return $this->field_map; }", "function field_info_field_map() {\n $cache = _field_info_field_cache();\n return $cache->getFieldMap();\n}", "public function getFieldMapping();", "public function getFieldMappings();", "public function getFieldMap()\n {\n return $this->fieldMap;\n }", "public static function getFormFieldMap() {\n return array(\n 'user_name' => 'name',\n 'user_email' => 'email',\n 'user_password_1' => 'password',\n 'user_password_2' => 'password',\n );\n }", "static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'make' => array(\n 'type' => 'string',\n 'required' => true,\n ),\n 'model' => array(\n 'type' => 'string',\n 'required' => false,\n ),\n 'created_at' => array(\n 'type' => 'date',\n ),\n 'updated_at' => array(\n 'type' => 'date',\n ),\n 'slug' => array(\n 'type' => 'string',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }", "public function getDataMap()\n {\n $dataMap = array();\n /** @var $field FieldInterface */\n foreach ($this->getFields() as $field) {\n $dataMap[$field->getName()] = $field->getValue();\n }\n return $dataMap;\n }", "public static function getMap()\n {\n return array(\n new Entity\\IntegerField('ID', array(\n 'primary' => true,\n 'autocomplete' => true,\n )),\n new Entity\\TextField('ENTITY_ID'),\n new Entity\\TextField('FIELD_NAME'),\n new Entity\\TextField('USER_TYPE_ID'),\n new Entity\\TextField('XML_ID'),\n new Entity\\TextField('SORT'),\n new Entity\\TextField('MULTIPLE'),\n new Entity\\TextField('MANDATORY'),\n new Entity\\TextField('SHOW_FILTER'),\n new Entity\\TextField('SHOW_IN_LIST'),\n new Entity\\TextField('EDIT_IN_LIST'),\n new Entity\\TextField('IS_SEARCHABLE'),\n new Entity\\TextField('SETTINGS'),\n );\n }", "protected function getFieldMap()\n {\n return array(\n QueryBuilder::FILTER => array(\n QueryBuilder::PROP_GROUP => $this->getFilterGroups(),\n QueryBuilder::PROP_CHECK_EMPTY => true,\n ),\n );\n }", "public function getFieldNameMapping(): array;", "public static function getMap()\r\n {\r\n return array(\r\n 'ID' => array(\r\n 'data_type' => 'integer',\r\n 'primary' => true,\r\n 'autocomplete' => true,\r\n ),\r\n\t\t\t'UF_TIMENOW' => array(\r\n 'data_type' => 'datetime',\r\n\t\t\t\t'default_value' => new \\Bitrix\\Main\\Type\\DateTime(),\r\n ),\r\n\t\t\t'UF_PAYMENT_ID' => array(\r\n 'data_type' => 'integer',\r\n\t\t\t\t'required' => true\r\n ),\r\n\t\t\t'UF_TRANSACTID' => array(\r\n 'data_type' => 'integer'\r\n ),\r\n\t\t\t'UF_SUM' => array(\r\n 'data_type' => 'float',\r\n\t\t\t\t'required' => true\r\n ),\r\n\t\t\t'UF_USERID' => array(\r\n 'data_type' => 'integer',\r\n\t\t\t\t'required' => true\r\n )\r\n );\r\n\r\n }", "public static function getFormFieldMap() {\n return array(\n 'email' => 'email',\n 'location' => 'location',\n 'phone' => 'phone',\n );\n }", "public function map()\n {\n $rf = new \\ReflectionObject($this->valObj);\n foreach($rf->getProperties(\\ReflectionProperty::IS_PUBLIC) as $prop)\n {\n $this->dbFields[$prop->name] = $this->valObj->{$prop->name};\n }\n return $this->dbFields;\n }", "public static function getMap()\n\t{\n\t\treturn array(\n\t\t\t'ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t\t'title' => Loc::getMessage('REST_ENTITY_ID_FIELD'),\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'data_type' => 'string',\n 'required' => true,\n\t\t\t\t'title' => Loc::getMessage('REST_ENTITY_NAME_FIELD'),\n\t\t\t),\n\t\t\t'address' => array(\n\t\t\t\t'data_type' => 'string',\n 'required' => true,\n\t\t\t\t'title' => Loc::getMessage('REST_ENTITY_ADDRESS_FIELD'),\n\t\t\t),\n\t\t\t'updated_at' => array(\n\t\t\t\t'data_type' => 'datetime',\n\t\t\t\t'title' => Loc::getMessage('REST_ENTITY_UPDATED_FIELD'),\n\t\t\t),\n\t\t\t'created_at' => array(\n\t\t\t\t'data_type' => 'datetime',\n\t\t\t\t'title' => Loc::getMessage('REST_ENTITY_CREATED_FIELD'),\n\t\t\t),\n\t\t);\n\t}", "public static function GetFieldMaps()\r\n\t{\r\n\t\tstatic $fm = null;\r\n\t\tif ($fm == null)\r\n\t\t{\r\n\t\t\t$fm = Array();\r\n\t\t\t$fm[\"Provisioningid\"] = new FieldMap(\"Provisioningid\",\"provisioning\",\"provisioningID\",true,FM_TYPE_INT,11,null,false);\r\n\t\t\t$fm[\"Salesorder\"] = new FieldMap(\"Salesorder\",\"provisioning\",\"salesOrder\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Rack\"] = new FieldMap(\"Rack\",\"provisioning\",\"rack\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Shelf\"] = new FieldMap(\"Shelf\",\"provisioning\",\"shelf\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Clientaddress\"] = new FieldMap(\"Clientaddress\",\"provisioning\",\"clientAddress\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Arguments\"] = new FieldMap(\"Arguments\",\"provisioning\",\"Arguments\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Exesequence\"] = new FieldMap(\"Exesequence\",\"provisioning\",\"exeSequence\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Scriptid\"] = new FieldMap(\"Scriptid\",\"provisioning\",\"scriptID\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Returncode\"] = new FieldMap(\"Returncode\",\"provisioning\",\"returnCode\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Returnstdout\"] = new FieldMap(\"Returnstdout\",\"provisioning\",\"returnStdout\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Returnstderr\"] = new FieldMap(\"Returnstderr\",\"provisioning\",\"returnStderr\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Executionflag\"] = new FieldMap(\"Executionflag\",\"provisioning\",\"executionFlag\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Logtime\"] = new FieldMap(\"Logtime\",\"provisioning\",\"logTime\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Exectime\"] = new FieldMap(\"Exectime\",\"provisioning\",\"execTime\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Scriptname\"] = new FieldMap(\"Scriptname\",\"provisioning\",\"scriptName\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Scriptcontent\"] = new FieldMap(\"Scriptcontent\",\"provisioning\",\"scriptContent\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Remotecommandid\"] = new FieldMap(\"Remotecommandid\",\"provisioning\",\"remoteCommandID\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Interpreter\"] = new FieldMap(\"Interpreter\",\"provisioning\",\"interpreter\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t\t$fm[\"Version\"] = new FieldMap(\"Version\",\"provisioning\",\"version\",false,FM_TYPE_TINYINT,4,null,false);\r\n\t\t}\r\n\t\treturn $fm;\r\n\t}", "protected function userFieldMap(): array\n {\n return [\n 'firstName' => 'given_name',\n 'lastName' => 'family_name',\n 'email' => 'email',\n 'username' => 'email'\n ];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Encode binary data before returning it from an UDF
function sqlite_udf_encode_binary($data) { }
[ "function sqlite_udf_encode_binary ($data) {}", "public function toBinaryString() : string;", "public abstract function encode($data);", "public function encode();", "public function getBinary();", "function blobEncode($blob)\n\t{\n\t\treturn \"0x\" . bin2hex($blob);\n\t}", "protected function getBinaryData() {\n return '';\n }", "function encode($value){\n return base64_encode(call_user_func($this->encoder, $value));\n }", "static public function encode($data);", "public function binary();", "function base64Encode($plain) {\r\n // Initialise output variable\r\n $output = \"\";\r\n \r\n // Do encoding\r\n $output = base64_encode($plain);\r\n \r\n // Return the result\r\n return $output;\r\n}", "function encode()\n {\n\n //encode using the appropriate protocol handler\n return $this->M->encode($this->data);\n \n }", "function pg_unescape_bytea ($data) {}", "function pg_unescape_bytea($data) {}", "function base64Encode($plain) {\n // Initialise output variable\n $output = \"\";\n \n // Do encoding\n $output = base64_encode($plain);\n \n // Return the result\n return $output;\n}", "public function testEncodeFunction()\n {\n $input = new DataType\\ErlFunction(\n new DataType\\Pid(new DataType\\Atom('nonode@nohost'), 31, 0, 0),\n new DataType\\Atom('ilia_atom'), 1, 1, null\n );\n $expected = array(\n 131, 117, 0, 0, 0, 0, 103, 115, 13, 110, 111, 110, 111, 100,\n 101, 64, 110, 111, 104, 111, 115, 116, 0, 0, 0, 31, 0, 0, 0,\n 0, 0, 115, 9, 105, 108, 105, 97, 95, 97, 116, 111, 109, 97,\n 1, 97, 1\n );\n\n $stream = new StreamEmulator();\n Util::encode($input, $stream);\n $actual = Util::from_binary($stream->data);\n\n $this->assertEquals($expected, $actual);\n }", "public function encodeString($data);", "public function blobEncode( $blob )\n\t{\n\t\t$blobid = fbird_blob_create( $this->_connectionID);\n\t\tfbird_blob_add( $blobid, $blob );\n\t\treturn fbird_blob_close( $blobid );\n\t}", "function crypto_encode($data): string\n{\n $data = (is_array($data) || is_object($data)) ? serialize($data) : $data;\n return Cryptor::getInstance()->encrypt($data);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies a function to each codepoint in the string
function eachCodePoint(Func $func) { # :: (Str, Func) -> Str $this -> codePoints () -> each ($func); return $this; }
[ "public function stringToCodepoints($string);", "function postCode($string) {\n\n\n\t\t}", "public function codepointsToCharacters(array $codepoints);", "public static function chr_map($callback, $str)\n {\n $chars = self::split($str);\n\n return array_map($callback, $chars);\n }", "private function _convert_code_markers($str)\n\t{\n\t\tif (count($this->code_chunks) > 0)\n\t\t{\n\t\t\tforeach ($this->code_chunks as $key => $val)\n\t\t\t{\n\t\t\t\tif ($this->text_format == 'legacy_typography')\n\t\t\t\t{\n\t\t\t\t\t// First line takes care of the line break that might be\n\t\t\t\t\t// there, which should be a line break because it is just a\n\t\t\t\t\t// simple break from the [code] tag.\n\n\t\t\t\t\t// Note: [div class=\"codeblock\"] has been converted to\n\t\t\t\t\t// <div class=\"codeblock\"> at this point\n\t\t\t\t\t$str = str_replace('<div class=\"codeblock\">{'.$key.'yH45k02wsSdrp}</div>'.\"\\n<br />\", '</p><div class=\"codeblock\">'.$val.'</div><p>', $str);\n\t\t\t\t\t$str = str_replace('<div class=\"codeblock\">{'.$key.'yH45k02wsSdrp}</div>', '</p><div class=\"codeblock\">'.$val.'</div><p>', $str);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$str = str_replace('{'.$key.'yH45k02wsSdrp}', $val, $str);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->code_chunks = array();\n\t\t}\n\n\t\treturn $str;\n\t}", "private function parseCode($str) \n\t{\n\t\tpreg_match_all(\"/{(.*?)}/\",$str,$args);\n\t\tforeach($args[1] as $code) \n\t\t{\n\t\t\t// Document data\n\t\t\tif(strlen($code) && $code{0}=='$') \n\t\t\t{\n\t\t\t\t$str = str_replace('{'.\"$code\".'}',$this->get(substr($code,1)),$str);\n\t\t\t}\n\t\t\t// Functions and global variables\n\t\t\telseif(substr($code,0,5) == 'exec:') \n\t\t\t{\n\t\t\t\t$code = substr($code,5);\n\t\t\t\tif(strlen($code) && $code{0} == '$')\n\t\t\t\t{\n\t\t\t\t\teval(\"global $code;\");\n\t\t\t\t}\n\t\t\t\tif(strlen($code) && $code{0} != '$') \n\t\t\t\t{\n\t\t\t\t\tif(!defined($code) && !preg_match(\"/^(.*)\\((.*)\\)$/\",$code))\n\t\t\t\t\t{\n\t\t\t\t\t\t$code = \"null\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\teval(\"\\$replace = $code;\");\n\t\t\t\t$str = str_replace('{'.\"exec:$code\".'}',$this->parseCode($replace),$str);\n\t\t\t}\n\t\t\telseif(substr($code,0,8) == 'include:') \n\t\t\t{\n\t\t\t\t$code = substr($code,8);\n\t\t\t\teval(\"\\$file = $code;\");\n\t\t\t\tif(file_exists( $this->getPath($file) )) \n\t\t\t\t{\n\t\t\t\t\t$this->parseTemplate(file( $this->getPath($file)));\n\t\t\t\t}\n\t\t\t\t$str = str_replace('{'.\"include:$code\".'}','',$str);\n\t\t\t}\n\t\t}\n\t\treturn $str;\n\t}", "public function eval(string $code);", "function utf8_codepoints( $arg , $u_style = false )\n {\n if( is_string( $arg ) )\n {\n $arg = utf8_split( $arg );\n }\n \n $arg = array_map( 'utf8_ord' , $arg );\n \n if( $u_style )\n {\n $arg = array_map( 'utf8_int_to_unicode_style' , $arg );\n }\n \n return $arg;\n }", "public function processString($src) {\n $this->output = '';\n $token = token_get_all($src);\n $buffer = '';\n $lastIdent = \"\";\n \n $ident = \"\";\n //$o = array();\n //$r = 0;\n //exec('pcregrep -M -N LF -e \"function [^\\}]{1,}\\}\" testfile.php | head -n 2 | tail -n -1',$o,$r);\n //$funcbody = trim(implode(\"\\n\", $o));\n \n \n foreach($token as &$tok) {\n //print_r($tok);\n if ($tok[0] == T_FUNCTION) {\n $lastIdent = $ident;\n $ident = $tok[1]; \n //print \"$ident $lastIdent \\n\";\n }\n \n if ($tok[0] == T_STRING ) {\n $lastIdent = $ident;\n $ident = $tok[1];\n \n if (in_array($ident, $this->inlinedFunctions)) {\n if ($lastIdent != \"function\") {\n //if ($ident == \"myfunc\" && $lastIdent != \"function\") {\n $tok[1] = $this->inlinedFuncData[$ident] . \" //\";\n echo \"* Inlined call to $ident \\n\";\n }\n }\n //print \"$ident $lastIdent \\n\";\n \n }\n \n if (is_array($tok) && ($tok[0]==T_COMMENT) && ($tok[1][0]=='#')) {\n if (isset($tok[1][0]) && ($tok[1][1]=='$')) {\n if ($ret = $this->handleVariable($tok[1])) {\n $tok[1] = \"#$ret\"; \n //continue; \n }\n } else {\n //default behavior\n if ($this->handleDirective($tok[1])) continue;\n }\n }\n\n if ($this->skipOver) {\n continue;\n }\n $this->output .= is_array($tok) ? $tok[1] : $tok;\n }\n return $this->output;\n }", "function coder_exec_processors($code, $prefix = '') {\n if (empty($prefix)) {\n return;\n }\n $tasks = get_defined_functions();\n $tasks = $tasks['user'];\n for ($c = 0, $cc = count($tasks); $c < $cc; ++$c) {\n if (strpos($tasks[$c], $prefix) === FALSE) {\n unset($tasks[$c]);\n }\n else {\n $tasks[$tasks[$c]] = call_user_func($tasks[$c]);\n unset($tasks[$c]);\n }\n }\n uasort($tasks, 'coder_order_processors');\n foreach ($tasks as $func => $task) {\n if (!isset($task['#search']) || (!isset($task['#replace']) && !isset($task['#replace_callback']))) {\n continue;\n }\n if (isset($task['#debug'])) {\n // Output regular expression results if debugging is enabled.\n preg_match_all($task['#search'], $code, $matches, PREG_SET_ORDER);\n echo \"<pre>\";\n var_dump($matches);\n echo \"</pre>\\n\";\n // Exit immediately in debugging mode.\n exit;\n }\n if (isset($task['#replace_callback'])) {\n $code = preg_replace_callback($task['#search'], $task['#replace_callback'], $code);\n }\n else {\n $code = preg_replace($task['#search'], $task['#replace'], $code);\n }\n }\n\n return $code;\n}", "public function process_string($string)\n\t{\n\t\t$this->original_string = $string;\n\t\t$this->adapted_string = $string;\n\t\t$pattern = \"/(?<=\\[\\[)[\\w \\!\\?\\&\\+'=@:\\/\\.\\\\\\-]+(?=\\]\\])/\"; // [[ ... ]] regex\n\t\t$short_code_info = null;\n\n\t\t// find all the links in $string\n\t\t// execute the regex on string and populate $links array storing the offset with the match\n\t\tpreg_match_all ( $pattern, $string, $short_code_info, PREG_OFFSET_CAPTURE );\n\n\t\t// loop through the results of the regex and process shortcodes\n\t\tforeach($short_code_info[0] as $info)\n\t\t{\n\t\t\t$sc = new Shortcode($info[0], $info[1]);\n\t\t\t$this->add_short_code($sc);\n\t\t}\n\t}", "function fixCodeHighlighting($post) {\n\t// For single line markdowns\n\t$post = preg_replace(\"/<code(.*?)>/is\", \"<C><s>`</s>\", $post);\n\t$post = str_replace(\"</code>\", \"<e>`</e></C>\", $post);\n\n\t// For code blocks with multiple line\n\t$array = explode(\"```\", $post);\n\t$count = 0;\n\t$result = \"\";\n\tforeach ($array as $split) {\n\t\ttry {\n\t\t\tif ($count == 0 || $count + 1 == sizeof($array)) {\n\t\t\t\t$result = \"$result$split\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$result = \"$result<CODE><s>```</s>$split<e>```</e></CODE>\";\n\t\t} finally {\n\t\t\t$count++;\n\t\t}\n\t}\n\treturn $result;\n}", "function COM_handleCode( $str )\n{\n $search = array( '&', '\\\\', '<', '>', '[', ']' );\n $replace = array( '&amp;', '&#92;', '&lt;', '&gt;', '&#91;', '&#93;' );\n\n $str = str_replace( $search, $replace, $str );\n\n return( $str );\n}", "public function replaceCode($string, $key)\n {\n if( ! isset($this->codes[$key]))\n {\n JFactory::getApplication()->enqueueMessage(sprintf(jgettext('AutoCode %s not found'), $key), 'error');\n\n return $string;\n }\n\n $sA = explode(NL, $string);\n $result = array();\n\n $started = false;\n\n foreach($sA as $s)\n {\n if(strpos($s, str_replace('TTTT', $key, $this->_endTag)) !== false)\n {\n //-- End tag found\n if( ! $started)\n {\n JFactory::getApplication()->enqueueMessage(sprintf(jgettext('Match mismatch on %s'), $key), 'error');\n\n return $string;\n }\n\n $started = false;\n\n continue;\n }\n\n if(strpos($s, str_replace('TTTT', $key, $this->_startTag)) !== false)\n {\n //-- Start tag found\n $result = array_merge($result, explode(NL, $this->codes[$key]));\n\n $started = true;\n\n continue;\n }\n\n if( ! $started)\n {\n $result[] = $s;\n }\n }\n\n return implode(NL, $result);\n }", "private function encode_code($message)\n {\n $count = preg_match_all(\"#(\\[code=*(.*?)\\])(.*?)(\\[\\/code\\])#si\", $message, $code);\n // with $message=\"[code=php,start=25]php code();[/code]\" the array $code now contains\n // [0] [code=php,start=25]php code();[/code]\n // [1] [code=php,start=25]\n // [2] php,start=25\n // [3] php code();\n // [4] [/code]\n\n if ($count > 0 && is_array($code)) {\n $codebodyblock ='<!--code--><div class=\"dz-code\"><div class=\"dz-codeheader\">%h</div><div class=\"dz-codetext\">%c</div></div><!--/code-->';\n $codebodyinline ='<!--code--><code>%c</code><!--/code-->';\n\n for ($i = 0; $i < $count; $i++) {\n // the code in between incl. code tags\n $str_to_match = \"/\" . preg_quote($code[0][$i], \"/\") . \"/\";\n\n $after_replace = trim($code[3][$i]);\n $containsLineEndings = !strstr($after_replace, PHP_EOL) ? false : true;\n\n if ($containsLineEndings) {\n $after_replace = '<pre class=\"pre-scrollable\">' . DataUtil::formatForDisplay($after_replace) . '</pre>';\n // replace %h with 'Code'\n $codetext = str_replace(\"%h\", $this->__('Code'), $codebodyblock);\n // replace %c with code\n $codetext = str_replace(\"%c\", $after_replace, $codetext);\n // replace %e with urlencoded code (prepared for javascript)\n $codetext = str_replace(\"%e\", urlencode(nl2br($after_replace)), $codetext);\n } else {\n $after_replace = DataUtil::formatForDisplay($after_replace);\n // replace %c with code\n $codetext = str_replace(\"%c\", $after_replace, $codebodyinline);\n // replace %e with urlencoded code (prepared for javascript)\n $codetext = str_replace(\"%e\", urlencode(nl2br($after_replace)), $codetext);\n }\n\n $message = preg_replace($str_to_match, $codetext, $message);\n }\n }\n return $message;\n }", "static function center_eval($string) {\n global $settings;\n \n if(preg_match_all('/<?php(.*)\\?>/',$string, $matches)) {\n $executed = array();\n foreach($matches[1] as $code) {\n ob_start();\n eval($code);\n $executed[$code] = ob_get_clean();\n }\n \n $returning = '';\n foreach($executed as $code => $parsed) {\n $returning .= str_replace('<?php' . $code . '?>', $parsed, $string);\n }\n return $returning; \n } else {\n return $string;\n }\n \n \n \n }", "public function map(string $pattern, callable $callable);", "abstract function _evalPhp($code);", "public function getCodepoints();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ JsonSerializable interface Return items for JSON serialization
public function jsonSerialize() { return $this->items; }
[ "public function jsonSerialize() \n {\n return $this->items;\n }", "public function getItemsAsJson()\n {\n $data = $this->getItems();\n\n return json_encode($data);\n }", "public function jsonSerialize() : string\n {\n return json_encode($this->items);\n }", "public function __toString() {\n return json_encode($this->getItems());\n }", "public function serialize() \n {\n return serialize($this->items);\n }", "public function _jsonSerialize();", "public function jsonSerialize()\n {\n return $this->extract($this->visibleProperties());\n }", "public function jsonSerialize() {\n return $this->collection;\n }", "abstract public function jsonSerialize();", "public function jsonSerialize()\n {\n return $this->data;\n }", "public function GetJsonSerializable() \n {\n return [ 'text' => $this->text ];\n }", "function jsonSerialize()\n {\n return $this->attributes;\n }", "public function getObjectItems();", "public function jsonSerialize (): array {\n $array = get_object_vars($this);\n foreach ($array as &$value) {\n if ($value instanceof Entity) {\n $value = $value->jsonSerialize();\n }\n }\n\n return $array;\n }", "public function getJson() {\n\t\t\treturn json_encode($this->getIterator());\n\t\t}", "public function jsonSerialize()\n {\n $json = [];\n foreach (static::SERIALIZABLE_PROPS as $jsonProp => $propName) {\n $json[$jsonProp] = $this->{$propName};\n }\n return $json;\n }", "public function serialize()\n {\n $list = [];\n\n foreach ($this->objects as $object) {\n $list[] = $object->serialize($this->bundle);\n }\n\n return $list;\n }", "public function jsonSerialize() {\n return $this->getSkeleton() + [\n 'transactions' => $this->store\n ];\n }", "public function jsonSerialize(): array\n {\n return $this->getAttributes();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a constant value.
public function getConstant($name);
[ "private function getConstant() {\n\n\t\t/* @var \\com\\mohiva\\common\\lang\\AnnotationToken $token */\n\t\tif ($this->stream->isNext(AnnotationLexer::T_NS_SEPARATOR)) {\n\t\t\t$token = $this->next(AnnotationLexer::T_NS_SEPARATOR);\n\t\t\t$constant = $token->getValue();\n\t\t} else {\n\t\t\t$constant = '';\n\t\t}\n\n\t\t$token = $this->next(AnnotationLexer::T_NAME);\n\t\t$constant .= $token->getValue();\n\t\twhile ($this->stream->isNext(AnnotationLexer::T_NS_SEPARATOR)) {\n\t\t\t$token = $this->next(AnnotationLexer::T_NS_SEPARATOR);\n\t\t\t$constant .= $token->getValue();\n\t\t\t$token = $this->next(AnnotationLexer::T_NAME);\n\t\t\t$constant .= $token->getValue();\n\t\t}\n\n\t\t// Get a class constant\n\t\t$colon = $this->stream->isNext(AnnotationLexer::T_DOUBLE_COLON);\n\t\tif ($colon && $constant == 'self') {\n\t\t\t$constant = $this->context->getClass();\n\t\t\t$token = $this->next(AnnotationLexer::T_DOUBLE_COLON);\n\t\t\t$constant .= $token->getValue();\n\t\t\t$token = $this->next(AnnotationLexer::T_NAME);\n\t\t\t$constant .= $token->getValue();\n\t\t} else if ($colon) {\n\t\t\t$constant = $this->getFullyQualifiedName($constant);\n\t\t\t$token = $this->next(AnnotationLexer::T_DOUBLE_COLON);\n\t\t\t$constant .= $token->getValue();\n\t\t\t$token = $this->next(AnnotationLexer::T_NAME);\n\t\t\t$constant .= $token->getValue();\n\t\t}\n\n\t\ttry {\n\t\t\treturn constant($constant);\n\t\t} catch (ClassNotFoundException $e) {\n\t\t\t$snippet = preg_replace('/[\\r\\n\\t]*/', '', substr($this->stream->getSource(), $token->getOffset(), 50));\n\t\t\t$message = \"The class for constant `{$constant}` cannot be found; \";\n\t\t\t$message .= \"called in DocBlock for: {$this->context->getLocation()}; \";\n\t\t\t$message .= \"found at offset `{$token->getOffset()}` near `{$snippet}`\";\n\t\t\tthrow new ClassNotFoundException($message, null, $e);\n\t\t} catch (Exception $e) {\n\t\t\t$snippet = preg_replace('/[\\r\\n\\t]*/', '', substr($this->stream->getSource(), $token->getOffset(), 20));\n\t\t\t$message = \"The constant `{$constant}` is not defined; \";\n\t\t\t$message .= \"called in DocBlock for: {$this->context->getLocation()}; \";\n\t\t\t$message .= \"found at offset `{$token->getOffset()}` near `{$snippet}`\";\n\t\t\tthrow new UndefinedConstantException($message, null, $e);\n\t\t}\n\t}", "function constant ($name) {}", "public function fieldConstant();", "public function getConstantName(): string\n {\n return $this->constant;\n }", "public function getDefaultValueConstantName () {}", "protected function parseConstantDeclaratorValue()\n {\n return $this->parseStaticValue();\n }", "function olc_constant($constant) {\n\tif (function_exists('constant')) {\n\t\t$temp = constant($constant);\n\t} else {\n\t\teval(\"\\$temp=$constant;\");\n\t}\n\treturn $temp;\n}", "function define_constant($constant,$value){\n\t$value=filter_text($value);$costant=filter_text($constant);\n\tdefine($constant,$value);\n\treturn $cnst;\n}", "public static function GetConstantValue($const_key) {\n\t\t\n\t\t\t//singleton function returning database object to local variable $dbconn\n\t\t\t$dbconn=db::singleton();\n\t\t\t$query = \"select * from tbl_constant where Constant_key='$const_key'\";\n\n\t\t\t//print($query); exit;\n\t\t\t$dbconn->SetQuery($query);\n\t\t\t\n\t\t\tif($dbconn->GetNumRows()) {\t\t\n\t\t\t\t\n\t\t\t\t$obj = $dbconn->LoadObject();\n\t\t\t\t\n\t\t\t\tConstrain::$const_msg = $obj->Description;\n\t\t\t\treturn $obj->Constant_value;\n\t\t\t\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t//returning Error Message\n\t\t\t\treturn \"This Constant Key is not available.\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "function g_const($constant)\n {\n $g = new Gravatar();\n\n return $g->_const($constant);\n }", "public function getConstant($name) {\n return $this->declaration->getConstant($name);\n }", "function c($name)\n{\n\tglobal $_CONSTANTS;\n\tif (!isset($_CONSTANTS[$name]))\n\t{\n\t\t// the equivalent of a parse error, since this should be caught before the fact\n\t\ttrigger_error('cannot resolve symbol: constant ' . $name, E_USER_ERROR);\n\t}\n\n\treturn $_CONSTANTS[$name];\n}", "public function get_constant($name)\r\n {\r\n return constant($this->constants_list[$name]);\r\n }", "protected function parseConstant()\n {\n $this->tokenStack->push();\n switch ($type = $this->tokenizer->peek()) {\n case Tokens::T_STRING:\n // TODO: Separate node classes for magic constants\n case Tokens::T_DIR:\n case Tokens::T_FILE:\n case Tokens::T_LINE:\n case Tokens::T_NS_C:\n case Tokens::T_FUNC_C:\n case Tokens::T_CLASS_C:\n case Tokens::T_METHOD_C:\n case Tokens::T_TRAIT_C:\n $token = $this->consumeToken($type);\n\n return $this->setNodePositionsAndReturn(\n $this->builder->buildAstConstant($token->image)\n );\n }\n\n return null;\n }", "public function getConstantsCode(){\n\t\treturn $this->constants;\n\t}", "private static function __getval($val) {\n if (is_string ( $val ) and strpos ( $val, 'SPH_' ) === 0 and defined ( $val ))\n return constant ( $val );\n return $val;\n }", "public static function get($constant)\n\t{\n\t\tself::logInvocation($constant);\n\n\t\tif (! empty(self::$patches_to_apply[$constant]))\n\t\t{\n\t\t\tif (! self::checkCalledMethod($constant))\n\t\t\t{\n\t\t\t\tMonkeyPatchManager::log(\n\t\t\t\t\t'invoke_const: ' . $constant . ' not patched (out of scope)'\n\t\t\t\t);\n\t\t\t\treturn constant($constant);\n\t\t\t}\n\t\t}\n\n\t\tif (array_key_exists($constant, self::$patches))\n\t\t{\n\t\t\tMonkeyPatchManager::log('invoke_const: ' . $constant . ' patched');\n\t\t\treturn self::$patches[$constant];\n\t\t}\n\n\t\tMonkeyPatchManager::log(\n\t\t\t'invoke_const: ' . $constant . ' not patched (no patch)'\n\t\t);\n\t\treturn constant($constant);\n\t}", "static function getConstants()\n {\n }", "public static function createConst(): self\n {\n $cv = new self();\n $cv->constant = TRUE;\n \n return $cv;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates whether repositories should be locked (to prevent manipulation) while migrating data.
public function getLockRepositories() : bool { return $this->lockRepositories; }
[ "private function is_locked()\n\t\t{\n\t\t\treturn $this->connection_lock;\n\t\t}", "public function isLocked() {\n return $this->lock->get('enable', false);\n }", "public function isLocked()\n\t\t{\n\t\t\treturn $this->getStatus() === Status::LOCKED;\n\t\t}", "public function isLocked() {\r\n\t\t\r\n\t\treturn (FALSE);\r\n\t\t\r\n\t\t/*$DB = DBFactory::getInstance('system');\r\n\t\t$sNodeUUID = $this->getUUID();\r\n\t\t$stmtClearLocks = $DB->prepareKnown('sb_system/node/locking/clearLocks');\r\n\t\t$stmtClearLocks->execute();\r\n\t\t$stmtClearLocks->close();\r\n\t\t$stmtCheckLockLocal = $DB->prepareKnown('sb_system/node/locking/clearLocks');\r\n\t\t$stmtCheckLockLocal->bindParam('node_uuid', $sNodeUUID, PDO::PARAM_STR);\r\n\t\t$stmtCheckLockLocal->execute();\r\n\t\tforeach ($stmtCheckLockLocal as $unused) {\r\n\t\t\t*/\r\n\t\t\r\n\t}", "protected function isUnlockedOrUserCanChangeLockStatus(){\n return !$this->isLocked() || parent::can(PERM_SOCIALQUESTION_UPDATE_LOCKED, $this->getQuestionShell());\n }", "public function getLockStatus(): bool\n {\n return $this->locked;\n }", "public function isLocked()\n {\n return $this->account->getIsLocked();\n }", "public function isLocked();", "protected function isLocking()\n {\n return $this->getRuntimeConfig()->isLocking();\n }", "public function isLocked()\n {\n foreach ($this->getItems() as $item) {\n if (!$item->Locked) {\n return false;\n }\n }\n \n return true;\n }", "public function isLocked()\n {\n return $this->modelLock\n && $this->modelLock->locked_until->isFuture();\n }", "protected function canUpdateLock() {\n return $this->canUserModify() &&\n !$this->isDeleted() && parent::can(PERM_SOCIALQUESTION_UPDATE_LOCKED, $this->getQuestionShell());\n }", "private function is_locked($key)\n {\n return $this->db[$key]['locked'];\n }", "public function isLocked(): bool\n {\n $dir = $this->getDir();\n\n return $this->filesystem->exists($dir . '.lock');\n }", "private function isPaymentLocked()\n {\n return $this -> lock_payments;\n }", "public function isLocked()\n {\n $record = $this->getInvoker();\n $lockedAt = $this->_options['locked_at']['name'];\n $lockedBy = $this->_options['locked_by']['name'];\n \n return $record->$lockedAt !== null\n && strtotime($record->$lockedAt) + $this->getOption('expires_after') \n > time();\n }", "public function getIsLock()\n {\n return $this->is_lock;\n }", "public function isUnlocked(): bool\n {\n $data = $this->data['unlock'] ?? [];\n\n return in_array($this->user()->id(), $data) === true;\n }", "function getIsLocked() {\n return $this->getFieldValue('is_locked');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Starts the element output. The $args parameter holds additional values that may be used with the child class methods. Also includes the element output.
public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) { }
[ "protected function output()\n {\n $mode = func_get_arg(0);\n \n if ($mode == Element::OUTPUT_CONTAINER_START ||\n $mode == Element::OUTPUT_COMPONENT) {\n printf(\"<%s\", $this->tag);\n if (isset($this->class)) {\n printf(\" class=\\\"%s\\\"\", $this->class);\n }\n if (isset($this->id)) {\n printf(\" id=\\\"%s\\\"\", $this->id);\n }\n if (isset($this->style)) {\n printf(\" style=\\\"%s\\\"\", $this->style);\n }\n if (count($this->attr) != 0) {\n foreach ($this->attr as $name => $value) {\n if (isset($name)) {\n if (isset($value)) {\n printf(\" %s=\\\"%s\\\"\", $name, $value);\n } else {\n printf(\" %s\", $name);\n }\n }\n }\n }\n if (count($this->event) != 0) {\n foreach ($this->event as $event => $code) {\n printf(\" %s=\\\"%s\\\"\", $event, $code);\n }\n }\n if (isset($this->title)) {\n printf(\" title=\\\"%s\\\"\", $this->title);\n }\n\n if ($mode == Element::OUTPUT_COMPONENT) {\n printf(\"/>\\n\");\n } else {\n printf(\">\");\n }\n }\n if ($mode == Element::OUTPUT_CONTAINER_END) {\n printf(\"</%s>\\n\", $this->tag);\n }\n }", "public function output() // other parameters picked up via func_get_args()\n\t{\n\t\t$args = func_get_args();\n\t\t$this->output_array($args);\n\t}", "public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {}", "public function render($args)\n {\n }", "public function printXML(){\n echo \"\\t<instruction order=\\\"$this->order\\\" opcode=\\\"$this->opcode\\\">\\n\";\n for($i = 0; $i < $this->argCount; $i++){\n $index = $i + 1;\n echo \"\\t\\t<arg$index type=\\\"{$this->argType[$i]}\\\">{$this->args[$i]}</arg$index>\\n\";\n }\n echo \"\\t</instruction>\\n\";\n }", "function printElement()\n {\n // Loop and call.\n if (is_array($this->_elements)) {\n foreach ($this->_elements as $child) {\n $child->printElement();\n }\n }\n }", "public function output()\n {\n echo \"<{$this->container} class='{$this->class}'>\";\n echo $this->menuHtml;\n echo \"</{$this->container}>\";\n }", "public function run() {\n // keep this line\n if (!parent::run()) { return false ; }\n\n\n // remove everything from here to the end of this ---------------------++\n // function and replace with your own content //\n echo \"Passed options: \" ; //\n if (empty($this->opts)) //\n echo \"none\\n\\n\" ; //\n else { //\n print_r($this->opts) ; //\n echo \"\\n\" ; //\n } //\n //\n echo \"Passed arguments: \" ; //\n if (empty($this->args)) //\n echo \"none\\n\\n\" ; //\n else { //\n print_r($this->args) ; //\n echo \"\\n\" ; //\n } //\n //\n echo \"\\nType `gr example -h` for usage and available options.\\n\\n\" ; //\n //------------------------------------------------------------------------++\n }", "public abstract function renderMetabox($args);", "public static function tag() {\n\t\t// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\techo self::get_tag( ...func_get_args() );\n\t}", "function printElement()\r\n {\r\n // Loop and call\r\n if (is_array($this->mElements)) {\r\n foreach ($this->mElements as $child) {\r\n \t//vérification lié à un problème de construction \r\n \tif($child){\r\n\t $child->printElement();\r\n \t}\r\n }\r\n }\r\n }", "function widgetOutput( $args ) {\r\n\t\t\textract( $args, EXTR_SKIP );\r\n\t\t\techo $before_widget;\r\n\t\t\t\r\n\t\t\t$options = get_option( 'ILuvWalking.com Widget' );\r\n\t\t\t$widgetData = $this->getWidgetOutputData( $options[ 'name' ] );\r\n\t\t\tif( false === $widgetData ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( !empty( $options[ 'title' ] ) ) {\r\n\t\t\t\techo $before_title . $options[ 'title' ] . $after_title;\r\n\t\t\t} else {\r\n\t\t\t\techo $before_title . __( 'I\\'ve Been Busy Walking' ) . $after_title;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo '<ul id=\"walker-tracker-widget-stats\">';\r\n\t\t\techo '<li><strong>' . __( 'Total Steps' ) . '</strong>' . $widgetData->total . '</li>';\r\n\t\t\techo '<li><strong>' . __( 'Average Steps/Day' ) . '</strong>' . sprintf( '%d', $widgetData->average ) . '</li>';\r\n\t\t\techo '<li><strong>' . __( 'Busiest Month' ) . ' (' . date( 'Y' ) . ')</strong>' . $widgetData->month . '</li>';\r\n\t\t\techo '<li><strong>' . __( 'Busiest Day' ) . ' (' . date( 'Y' ) . ')</strong>' . $widgetData->day . '</li>';\r\n\t\t\techo '</ul>';\r\n\t\t\techo '<img id=\"walker-tracker-widget-logo\" src=\"' . WP_PLUGIN_URL . '/' . basename( dirname( __FILE__ ) ) . '/resources/iluvwalking-widget-logo.gif' . '\" alt=\"Walking\" />';\r\n\t\t\techo '<p id=\"walker-tracker-widget-get\"><a href=\"http://iluvwalking.com/get-the-widget/\">Get this widget</a> or <a href=\"http://iluvwalking.com/add-your-steps\">log your steps</a><br /><a href=\"http://iluvwalking.com\">ILuvWalking.com</a></p>';\r\n\t\t\techo $after_widget;\r\n\t\t}", "public static function create_element( $element_name, $args, $inner_content = false ) {\n\t\tarray_walk( $args, array( 'CPT_Meta_Helper', 'convert_to_html_element_values' ) );\n\t\t$properties = implode( $args, ' ' );\n\t\t$final_content = \"<$element_name $properties >\";\n\n\t\tif ( false !== $inner_content ) {\n\t\t\tif ( is_string( $inner_content ) ) {\n\t\t\t\t$final_content .= $inner_content;\n\t\t\t} elseif ( is_array( $inner_content ) ) {\n\t\t\t\t$final_content .= implode( $inner_content, \"\\n\" );\n\t\t\t}\n\n\t\t\t$final_content .= \"</$element_name>\";\n\t\t}\n\n\t\treturn $final_content;\n\t}", "private function renderEventArgs(array $args): void\n {\n if (!empty($args)) {\n $eventArgIsFirst = true;\n\n foreach ($args as $eventArgName => $eventArgType) {\n if ($eventArgIsFirst) {\n $eventArgIsFirst = false;\n } else {\n echo ', ';\n }\n\n echo '<span class=\"devkit-type\">' . _e($eventArgType) . '</span> ' . _e($eventArgName);\n }\n } else {\n echo '-';\n }\n }", "public function _echo()\n\t{\n\t\t$args = func_get_args();\n\t\tforeach ($args as $val) echo $val;\n\n\t\treturn '';\n\t}", "function draw(){\n $this->build();\n echo $this->output;\n }", "function __call($name,$args){\n\t\tcall_user_func_array(array(&$this->__childWidget,$name),$args);\n\t}", "public function end_el(&$output, $data_object, $depth = 0, $args = array())\n {\n }", "public function hook_sitemapXmlPageOutput(&$args, $obj) {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the current number of registered glyphs.
public function getNumGlyphs() {}
[ "public function count() {\n return count($this->_icons);\n }", "public function getNumberIcons(): int {\n return count($this->getIcons());\n }", "function GetIconCount(){}", "public function getCoveredCharactersGlyphs()\n {\n $glyphNumbers = [];\n for ($code = $this->_startCode; $code <= $this->_endCode; $code++) {\n $glyphNumbers[$code] = $this->_glyphIndexArray[$code - $this->_startCode];\n }\n\n return $glyphNumbers;\n }", "public function getTopLevelGlyphs() {}", "public function getAcceleratorCount()\n {\n return isset($this->accelerator_count) ? $this->accelerator_count : 0;\n }", "public function getCount() : int\n {\n //there is no good recursive count implementation in php, so we improvise one:\n $count = 0;\n array_walk_recursive($this->registry, function ($pair) use (&$count) {\n $count++;\n });\n return $count;\n }", "public function totalIcons()\n {\n return count($this->formats);\n }", "public function getActualFontId(): int\n\t{\n\t\treturn ++$this->actualFontId;\n\t}", "function IconCount() { return 1;}", "public function getGlyphIndex(int $character) : int {}", "public function getFormatCountInBuffer() : int\n {\n return (int) $this->data[self::POS_FORMATS_IN_BUFFER];\n }", "public function numberOfCharactersProvider()\n {\n return [[1]];\n }", "public function count()\n{\n\treturn count($this->registry);\n}", "protected function getNumberOfCurrentExtensions() {}", "public function peekCount()\n {\n return $this->get('cmd-peek');\n }", "function CountRange($NumofGlyphs, $Type){\n $num=0;\n $Sid;\n $i=1;\n $nLeft = 0;\n $Places = 0;\n while ($i<$NumofGlyphs){\n $num++;\n $Sid = getCard16();\n if ($Type==1)\n $nLeft = getCard8();\n else\n $nLeft = getCard16();\n $i += ord($nLeft)+1;\n }\n return $num;\n }", "public function count()\n {\n return $this->cell_count;\n }", "public function getCharCount()\n {\n return $this->char_count;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ARCHIVING Checks to see if a user can archive. Currently, only administrators can do this.
function userCanArchive( $sessionID ){ return $this->getAccessLevel() == ADMINISTRATOR; }
[ "function does_user_have_access_archive() {\n\n\t// Grab the current user's info so that we can compare it to the \"allowed\" users from the ACF \"User\" field later.\n\t$current_user = wp_get_current_user();\n\t//var_dump($current_user);\n\n\t// Store the ACF \"User\" info\n\t$values = get_field('user');\n\n\tif($values) {\n\t\t// Create an array of users that will be able to access the page from the ACF \"User\" field\n\t\t$users_that_can_access_this_post = array();\n\t\tforeach($values as $value) {\n\t\t\t$user_IDs_that_can_access_this_post[] = $value['ID'];\n\t\t}\n\t\t// Check to see if the current user is in the \"User\" field's array\n\t\tif (in_array($current_user->ID, $user_IDs_that_can_access_this_post, false) ) {\n\t\t\t// Display the post\n\t\t\tinclude( 'workouts-archive-template.php' );\n\t\t} else {\n\t\t\t// Hide the post content if the user is not in the ACF \"User\" array\n\t\t}\n\t}\n}", "public function canArchive()\n {\n\n if ($this->container instanceof Space) {\n if ($this->canWrite())\n return true;\n return ($this->container->isAdmin());\n } elseif ($this->container instanceof User) {\n return false; // Not available on user profiels because there are no filters?\n }\n\n return false;\n }", "private function checkArchiveAccount() {\r\n\r\n if ($this->user->isLoggedIn() && $this->user->getEntity()->archive == 1) {\r\n $this->flashMessage(\"Tento účet bol deaktivovaný\", \"danger\");\r\n $this->handleLogout();\r\n }\r\n\r\n }", "public function canArchive();", "function canArchive(User $user) {\n // project object which is not visible cannot be archived\n if ($this->object->getState() < STATE_VISIBLE) {\n return false;\n } // if\n\n if($this->object instanceof IComplete && !$this->object->complete()->isCompleted()) {\n return false;\n } else {\n $project = $this->object->getProject();\n if($project instanceof Project) {\n if($user->isProjectManager() || $project->isLeader($user)) {\n return true; // Project manager, administrator or project leader\n } else {\n return $user->canSee($this->object) && ProjectObjects::canManage($user, $this->object->getProject(), $this->object->getProjectPermissionName());\n } // if\n } else {\n $this->can_delete[$user->getId()] = false;\n } // if\n \n return false;\n } // if\n }", "public function checkPermission()\n {\n\n if ($this->User->isAdmin)\n {\n return;\n }\n\n // Set root IDs\n if (!is_array($this->User->downloadarchives) || empty($this->User->downloadarchives))\n {\n $root = array(0);\n }\n else\n {\n $root = $this->User->downloadarchives;\n }\n\n $GLOBALS['TL_DCA']['tl_downloadarchive']['list']['sorting']['root'] = $root;\n\n\n // Check permissions to add downloadarchives\n if (!$this->User->hasAccess('create', 'downloadarchivep'))\n {\n $GLOBALS['TL_DCA']['tl_downloadarchive']['config']['closed'] = true;\n }\n\n // Check current action\n switch ($this->Input->get('act'))\n {\n case 'create':\n case 'select':\n // Allow\n break;\n\n case 'edit':\n // Dynamically add the record to the user profile\n if (!in_array($this->Input->get('id'), $root))\n {\n $arrNew = $this->Session->get('new_records');\n\n if (is_array($arrNew['tl_downloadarchive']) && in_array($this->Input->get('id'), $arrNew['tl_downloadarchive']))\n {\n\n // Add permissions on user level\n if ($this->User->inherit == 'custom' || !$this->User->groups[0])\n {\n $objUser = $this->Database->prepare(\"SELECT downloadarchives, downloadarchivep FROM tl_user WHERE id=?\")\n ->limit(1)\n ->execute($this->User->id);\n\n $arrDownloadarchivep = deserialize($objUser->downloadarchivep);\n\n if (is_array($arrDownloadarchivep) && in_array('create', $arrDownloadarchivep))\n {\n $arrdownloadarchives = deserialize($objUser->downloadarchives);\n $arrdownloadarchives[] = $this->Input->get('id');\n\n $this->Database->prepare(\"UPDATE tl_user SET downloadarchives=? WHERE id=?\")\n ->execute(serialize($arrdownloadarchives), $this->User->id);\n }\n }\n\n // Add permissions on group level\n elseif ($this->User->groups[0] > 0)\n {\n $objGroup = $this->Database->prepare(\"SELECT downloadarchives, downloadarchivep FROM tl_user_group WHERE id=?\")\n ->limit(1)\n ->execute($this->User->groups[0]);\n\n $arrDownloadarchivep = deserialize($objGroup->downloadarchivep);\n\n if (is_array($arrDownloadarchivep) && in_array('create', $arrDownloadarchivep))\n {\n $arrdownloadarchives = deserialize($objGroup->downloadarchives);\n $arrdownloadarchives[] = $this->Input->get('id');\n\n $this->Database->prepare(\"UPDATE tl_user_group SET downloadarchives=? WHERE id=?\")\n ->execute(serialize($arrdownloadarchives), $this->User->groups[0]);\n }\n }\n\n // Add new element to the user object\n $root[] = $this->Input->get('id');\n $this->User->downloadarchives = $root;\n }\n }\n // No break;\n\n case 'copy':\n case 'delete':\n case 'show':\n if (!in_array($this->Input->get('id'), $root) || ($this->Input->get('act') == 'delete' && !$this->User->hasAccess('delete', 'downloadarchivep')))\n {\n $this->log('Not enough permissions to '.$this->Input->get('act').' calendar ID \"'.$this->Input->get('id').'\"', 'tl_downloadarchive checkPermission', TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n break;\n\n case 'editAll':\n case 'deleteAll':\n case 'overrideAll':\n $session = $this->Session->getData();\n if ($this->Input->get('act') == 'deleteAll' && !$this->User->hasAccess('delete', 'downloadarchivep'))\n {\n $session['CURRENT']['IDS'] = array();\n }\n else\n {\n $session['CURRENT']['IDS'] = array_intersect($session['CURRENT']['IDS'], $root);\n }\n $this->Session->setData($session);\n break;\n\n default:\n if (strlen($this->Input->get('act')))\n {\n $this->log('Not enough permissions to '.$this->Input->get('act').' downloadarchives', 'tl_downloadarchive checkPermission', TL_ERROR);\n $this->redirect('contao/main.php?act=error');\n }\n break;\n }\n }", "function canUnarchive(User $user) {\n // cannot unarchive company which is not archived\n if ($this->object->getState() != STATE_ARCHIVED) {\n return false;\n } // if\n\n return $this->object->isOwner() ? false : $user->isPeopleManager();\n }", "public function willBeArchived()\n {\n if ($this->isEmpty()) {\n return true;\n }\n\n $idSites = $this->idSites;\n if (!is_array($idSites)) {\n $idSites = array($this->idSites);\n }\n\n return Rules::isRequestAuthorizedToArchive()\n || Rules::isBrowserArchivingAvailableForSegments()\n || Rules::isSegmentPreProcessed($idSites, $this);\n }", "public function checkPermission()\n\t{\n\t\t// HOOK: comments extension required\n\t\tif (!in_array('comments', ModuleLoader::getActive()))\n\t\t{\n\t\t\tunset($GLOBALS['TL_DCA']['tl_news_archive']['fields']['allowComments']);\n\t\t}\n\n\t\tif ($this->User->isAdmin)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Set root IDs\n\t\tif (!is_array($this->User->news) || empty($this->User->news))\n\t\t{\n\t\t\t$root = array(0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$root = $this->User->news;\n\t\t}\n\n\t\t$GLOBALS['TL_DCA']['tl_news_archive']['list']['sorting']['root'] = $root;\n\n\t\t// Check permissions to add archives\n\t\tif (!$this->User->hasAccess('create', 'newp'))\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_news_archive']['config']['closed'] = true;\n\t\t}\n\n\t\t// Check current action\n\t\tswitch (Input::get('act'))\n\t\t{\n\t\t\tcase 'create':\n\t\t\tcase 'select':\n\t\t\t\t// Allow\n\t\t\t\tbreak;\n\n\t\t\tcase 'edit':\n\t\t\t\t// Dynamically add the record to the user profile\n\t\t\t\tif (!in_array(Input::get('id'), $root))\n\t\t\t\t{\n\t\t\t\t\t$arrNew = $this->Session->get('new_records');\n\n\t\t\t\t\tif (is_array($arrNew['tl_news_archive']) && in_array(Input::get('id'), $arrNew['tl_news_archive']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Add the permissions on group level\n\t\t\t\t\t\tif ($this->User->inherit != 'custom')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objGroup = $this->Database->execute(\"SELECT id, news, newp FROM tl_user_group WHERE id IN(\" . implode(',', array_map('intval', $this->User->groups)) . \")\");\n\n\t\t\t\t\t\t\twhile ($objGroup->next())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$arrNewp = deserialize($objGroup->newp);\n\n\t\t\t\t\t\t\t\tif (is_array($arrNewp) && in_array('create', $arrNewp))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$arrNews = deserialize($objGroup->news, true);\n\t\t\t\t\t\t\t\t\t$arrNews[] = Input::get('id');\n\n\t\t\t\t\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_user_group SET news=? WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute(serialize($arrNews), $objGroup->id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Add the permissions on user level\n\t\t\t\t\t\tif ($this->User->inherit != 'group')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objUser = $this->Database->prepare(\"SELECT news, newp FROM tl_user WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t ->execute($this->User->id);\n\n\t\t\t\t\t\t\t$arrNewp = deserialize($objUser->newp);\n\n\t\t\t\t\t\t\tif (is_array($arrNewp) && in_array('create', $arrNewp))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$arrNews = deserialize($objUser->news, true);\n\t\t\t\t\t\t\t\t$arrNews[] = Input::get('id');\n\n\t\t\t\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_user SET news=? WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t\t ->execute(serialize($arrNews), $this->User->id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Add the new element to the user object\n\t\t\t\t\t\t$root[] = Input::get('id');\n\t\t\t\t\t\t$this->User->news = $root;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// No break;\n\n\t\t\tcase 'copy':\n\t\t\tcase 'delete':\n\t\t\tcase 'show':\n\t\t\t\tif (!in_array(Input::get('id'), $root) || (Input::get('act') == 'delete' && !$this->User->hasAccess('delete', 'newp')))\n\t\t\t\t{\n\t\t\t\t\t$this->log('Not enough permissions to '.Input::get('act').' news archive ID \"'.Input::get('id').'\"', __METHOD__, TL_ERROR);\n\t\t\t\t\t$this->redirect('contao/main.php?act=error');\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'editAll':\n\t\t\tcase 'deleteAll':\n\t\t\tcase 'overrideAll':\n\t\t\t\t$session = $this->Session->getData();\n\t\t\t\tif (Input::get('act') == 'deleteAll' && !$this->User->hasAccess('delete', 'newp'))\n\t\t\t\t{\n\t\t\t\t\t$session['CURRENT']['IDS'] = array();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$session['CURRENT']['IDS'] = array_intersect($session['CURRENT']['IDS'], $root);\n\t\t\t\t}\n\t\t\t\t$this->Session->setData($session);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif (strlen(Input::get('act')))\n\t\t\t\t{\n\t\t\t\t\t$this->log('Not enough permissions to '.Input::get('act').' news archives', __METHOD__, TL_ERROR);\n\t\t\t\t\t$this->redirect('contao/main.php?act=error');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "function api_check_archive_dir() {\n if (is_dir(api_get_path(SYS_ARCHIVE_PATH)) && !is_writable(api_get_path(SYS_ARCHIVE_PATH))) {\n $message = Display::return_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'),'warning');\n api_not_allowed(true, $message);\n }\n}", "public function isAuthorized($user = array())\n\t{\n\t\t// All registered users can add dumps\n\t\tif ($this->action === 'add')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// The only the owner of a dump can view and delete it\n\t\tif (in_array($this->action, array('view', 'download', 'delete'))) \n\t\t{\n\t\t\t$dumpId = $this->request->params['pass'][0];\n\t\t\t$this->Dump->id = $dumpId;\n\t\t\tif (!$this->Dump->exists()) \n\t\t\t{\n\t\t\t\tthrow new NotFoundException(__('Invalid dump'));\n\t\t\t}\n\t\t\tif ($this->Dump->isOwnedBy($dumpId, AuthComponent::user('id')))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn parent::isAuthorized($user);\n\t}", "public function isArchived() {\n return $this->status->value == ScheduledUpdateInterface::STATUS_SUCCESSFUL\n || $this->status->value === ScheduledUpdateInterface::STATUS_UNSUCESSFUL;\n }", "private function checkArchive(){\n\n $isArchiveExisting = file_exists($this->getArchiveFullPath());\n\n if( !$isArchiveExisting ){\n $this->setIsArchivedSuccessfully(false);\n $this->setArchivingStatus(self::EXPORT_MESSAGE_EXPORT_FILE_DOES_NOT_EXIST);\n }else{\n $archiveSize = filesize($this->getArchiveFullPath());\n\n if( self::MINIMUM_ARCHIVE_SIZE > $archiveSize ){\n $this->setIsArchivedSuccessfully(false);\n $this->setArchivingStatus(self::EXPORT_MESSAGE_EXPORTED_DATABASE_IS_TO_SMALL);\n return;\n }\n\n $this->setIsArchivedSuccessfully(true);\n $this->setArchivingStatus(self::EXPORT_MESSAGE_SUCCESS);\n }\n\n }", "public function isArchive();", "public function archivingAction() {\n\t\tif (Minz_Request::isPost()) {\n\t\t\tFreshRSS_Context::$user_conf->old_entries = Minz_Request::param('old_entries', 3);\n\t\t\tFreshRSS_Context::$user_conf->keep_history_default = Minz_Request::param('keep_history_default', 0);\n\t\t\tFreshRSS_Context::$user_conf->ttl_default = Minz_Request::param('ttl_default', -2);\n\t\t\tFreshRSS_Context::$user_conf->save();\n\t\t\tinvalidateHttpCache();\n\n\t\t\tMinz_Request::good(_t('feedback.conf.updated'),\n\t\t\t array('c' => 'configure', 'a' => 'archiving'));\n\t\t}\n\n\t\tMinz_View::prependTitle(_t('conf.archiving.title') . ' · ');\n\n\t\t$entryDAO = FreshRSS_Factory::createEntryDao();\n\t\t$this->view->nb_total = $entryDAO->count();\n\t\t$this->view->size_user = $entryDAO->size();\n\n\t\tif (FreshRSS_Auth::hasAccess('admin')) {\n\t\t\t$this->view->size_total = $entryDAO->size(true);\n\t\t}\n\t}", "private function _getPostingPermissions()\n\t{\n\t\tif ($this->group->published != 1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ($this->params->get('posting'))\n\t\t{\n\t\t\tcase 1:\n\t\t\t\tif ($this->authorized == 'manager' || $this->authorized == 'admin')\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 0:\n\t\t\tdefault:\n\t\t\t\tif ($this->authorized == 'member' || $this->authorized == 'manager' || $this->authorized == 'admin')\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isArchive(): bool;", "function publisher_userIsAdmin()\r\n{\r\n global $xoopsUser;\r\n $publisher = PublisherPublisher::getInstance();\r\n\r\n static $publisher_isAdmin;\r\n\r\n if (isset($publisher_isAdmin)) {\r\n return $publisher_isAdmin;\r\n }\r\n\r\n if (!$xoopsUser) {\r\n $publisher_isAdmin = false;\r\n } else {\r\n $publisher_isAdmin = $xoopsUser->isAdmin($publisher->getModule()->getVar('mid'));\r\n }\r\n\r\n return $publisher_isAdmin;\r\n}", "public function canExport()\n {\n return $this->securityContext->isGranted($this->exportRole);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Step 3 Deploy Action
public static function step3($exit = true) { //Direct output mode. ob_implicit_flush(); self::$direct_output = true; printf(self::HTMLPAGE_HEADER); //Checking Environment. self::output(''); self::output('Starting Deployment. MultiDeploy v.'. self::VERSION); self::output(''); self::output('Running as <b>' . trim(shell_exec('whoami')) . '</b>.'); //Build Queue self::buildQueue(self::$project); if (count(self::getParam('RUN_AFTER', self::$project)) > 0) { foreach(self::getParam('RUN_AFTER', self::$project) as $project){ $project_name = self::getParam("PROJECT_NAME", $project); if (!empty($project_name)) { self::buildQueue($project); } } } //Deploy foreach(self::$queue as $project => $cmds){ self::output(''); self::output('Deploying: ' . self::getParam('PROJECT_NAME', $project)); self::output('Branch: ' . self::getParam('PROJECT_BRANCH', $project)); self::output('Path: ' . self::getParam('PROJECT_PATH', $project)); self::output(''); //Change to the project directory chdir(self::getParam('PROJECT_PATH', $project)); //Deploy from stage 1 to 5. for($i = 1; $i <= 5; ++$i) { if(isset($cmds[$i])){ foreach ($cmds[$i] as $cmd) { if($cmd->check_run($project)){ $run = $cmd->get(); set_time_limit(MD::CMD_TIME_LIMIT); // Reset the time limit for each command self::output(sprintf('<span class="prpt">$</span> <span class="cmd">%s</span>' , htmlentities(trim($run), ENT_QUOTES, "UTF-8") )); $tmp = array(); exec($run . ' 2>&1', $tmp, $return_code); // Execute the command // Output the result self::output(sprintf('<div class="out">%s</div>' , htmlentities(trim(implode("\n", $tmp)), ENT_QUOTES, "UTF-8") )); // Error handling and cleanup if ($return_code !== 0) { self::output(sprintf('<div class="err"> Error encountered! Stopping the script to prevent possible data loss. CHECK THE DATA IN YOUR TARGET DIR! </div>')); error_log(sprintf( 'Deployment error! %s' , __FILE__ )); if(isset($cmds[MD::ON_FAIL])) { foreach ($cmds[MD::ON_FAIL] as $cmd){ if($cmd->check_run($project)){ $run = $cmd->get(); set_time_limit(MD::CMD_TIME_LIMIT); // Reset the time limit for each command $tmp = array(); exec($run . ' 2>&1', $tmp, $return_code); // Execute the command // Output the result self::output(sprintf('<span class="prpt">$</span> <span class="cmd">%s</span> <div class="out">%s</div>' , htmlentities(trim($run), ENT_QUOTES, "UTF-8") , htmlentities(trim(implode("\n", $tmp)), ENT_QUOTES, "UTF-8") )); if ($return_code !== 0) { break; } } } } self::$state = "FAIL"; break 3; } } } } } } if(self::$state == "SUCCESS") { self::output(''); self::output('<span class="prpt">Deployment succeeded !</span>'); }else{ self::output(''); self::output('<span class="err">Deployment failed !</span>'); } printf(self::HTMLPAGE_FOOTER); //Email result if (self::$email == true) { self::mailOutput(); } }
[ "public function deploy();", "public function preDeploy() {}", "public function deploy()\n {\n try{\n $this->siteData();\n $deploy = new Process($this->site,$this->config,$this->app['hooks.log']);\n $deploy->execute();\n }catch (ErrorException $e){\n $this->app['hooks.log']->error($e->errorMessage());\n }\n }", "public function deployAction()\n {\n $api = $this->api();\n $db = $this->db();\n\n $checksum = $this->params->get('checksum');\n if ($checksum) {\n $config = IcingaConfig::load(Util::hex2binary($checksum), $db);\n } else {\n $config = IcingaConfig::generate($db);\n $checksum = $config->getHexChecksum();\n }\n\n $api->wipeInactiveStages($db);\n $current = $api->getActiveChecksum($db);\n if ($current === $checksum) {\n if ($this->params->get('force')) {\n echo \"Config matches active stage, deploying anyway\\n\";\n } else {\n echo \"Config matches active stage, nothing to do\\n\";\n\n return;\n }\n\n } else {\n if ($api->dumpConfig($config, $db)) {\n $this->printf(\"Config '%s' has been deployed\\n\", $checksum);\n } else {\n $this->fail(\n sprintf(\"Failed to deploy config '%s'\\n\", $checksum)\n );\n }\n }\n }", "private static function beforeDeploy()\n {\n }", "private static function doDeploy()\n {\n self::$bucket = self::requireEnv('GOOGLE_STORAGE_BUCKET');\n return self::$fn->deploy([], '--trigger-bucket=' . self::$bucket);\n }", "public function deploy()\n {\n $this->taskCopyDir(array($this->getSrcDir() => $this->getDeployDir()))->run();\n }", "function drush_provision_git_project_post_provision_install() {\n // Spot the deployment property.\n if (d()->git_project_deployment) {\n $deployment = d()->git_project_deployment;\n\n // Take action if a site is being installed.\n if (d()->type == 'site') {\n if (d()->platform->git_project_deployment) {\n // Site is being installed on / migrated to a git project platform.\n drush_log(\"Git Project: linking this site to the deployment \" . $deployment->name, 'ok');\n $deployment->site = d()->name;\n $deployment->status = 'deployed';\n\n if (d()->git_project_deployment->platform->name != d()->platform->name) {\n // Site is being migrated to a platform that is out of sync.\n drush_log(\"Git Project: updating platform reference as well\");\n $deployment->platform = d()->platform->name;\n }\n }\n else {\n drush_log(\"Site is being migrated to a platform that does not using Git Project, breaking all relations\", 'ok');\n // Site is being installed on / migrated to a platform that is not a\n // Git Project platform, break relation to the project.\n $deployment->site = '';\n $deployment->status = 'defined';\n d()->git_project_deployment = '';\n\n d()->write_alias();\n }\n\n }\n else {\n // Unknown context, do nothing.\n return TRUE;\n }\n\n // Update the deployment drush-alias.\n $deployment->write_alias();\n if (drush_get_error()) {\n return drush_set_error(\"ALIAS_SAVE_FAILED\",\n dt(\"Could not save alias for deployment !deployment\",\n array('!deployment' => $deployment->name))\n );\n }\n }\n}", "function devshop_projects_post_hosting_devshop_deploy_task($task, $data) {\n\n // Save the deployed git ref to the environment record.\n drush_log('[DEVSHOP] Environment Deployed. Saving record.');\n\n $environment = $task->task_args['environment'];\n $git_ref = $task->task_args['git_ref'];\n\n $return = db_query('UPDATE {hosting_devshop_project_environment} SET git_ref = \"%s\" WHERE project_nid = %d AND name = \"%s\"', $git_ref, $task->ref->nid, $environment);\n\n if ($return) {\n drush_log('[DEVSHOP] New git ref saved to environment..');\n }\n else {\n return drush_set_error('[DEVSHOP] Environment update failed!');\n }\n\n hosting_add_task($task->ref->project->environments[$environment]->platform, 'verify');\n}", "private function deploy_project(): void {\n\n\t\tif (empty($this->project_data)) {\n\t\t\tCLI::display_error(\"Failed to deploy project: project data is empty.\");\n\t\t\texit;\n\t\t}\n\n\t\tif (empty($this->project_dir)) {\n\t\t\tCLI::display_error(\"Failed to deploy project: project directory path is empty.\");\n\t\t\texit;\n\t\t}\n\n\t\tif (!is_dir($this->project_dir)) {\n\t\t\tCLI::display_error(\"Failed to deploy project: project directory doesn't exist.\");\n\t\t\texit;\n\t\t}\n\t\n\t\tif (empty($this->project_data['url'])) {\n\t\t\tCLI::display_error(\"Failed to deploy project: project URL is empty.\");\n\t\t\texit;\n\t\t}\n\n\t\tif (empty($this->project_data['netlify_id'])) {\n\t\t\tCLI::display_error(\"Failed to deploy project: Netlify ID is empty.\");\n\t\t\texit;\n\t\t}\n\n\t\t// Increment project version.\n\t\t$this->set_project_version(true);\n\t\t\n\t\techo \"Deploying project {$this->project_data['netlify_id']} v{$this->project_data['version']} to {$this->project_data['url']}\";\n\t\t\n\t\t// Execute Netlify CLI deployment.\n\t\t$output = [];\n\t\texec(\"npx netlify deploy --prod --dir={$this->project_dir} --site={$this->project_data['netlify_id']}\", $output);\n\t\t$result = array_filter($output, fn($output_line) => stripos($output_line, 'Deploy URL') !== false);\n\n\t\tif (empty($result)) {\n\t\t\tCLI::display_error(\"Failed to deploy project.\");\n\t\t\texit;\n\t\t}\n\n\t\techo CLI::$verbose ? \"\\nDeploying project {$this->project_data['url']} DONE\\n\" : \"\";\n\t}", "protected function onDeploy()\r {\r\r (new PackageCopy())->copyPackage(new DockerPackage(),$this->dockerPath);\r\r\r }", "public function deployWebapps();", "public function deploy()\n {\n $this->log('Start deploy.');\n \n $this->_init();\n \n $this->log('Copying read/write directories back.');\n \n foreach ($this->platformReadWriteDirs as $dir) {\n $magentoDir = $this->getMagentoFilePath($dir);\n \n $this->execute(sprintf('mkdir -p %s', $magentoDir));\n $this->log(sprintf('Copying back ./init/%s to %s', $dir, $magentoDir));\n $this->execute(sprintf('/bin/bash -c \"shopt -s dotglob; cp -R ./init/%s/* %s/ || true\"', $dir, $magentoDir));\n $this->log(sprintf('Copied directory: %s', $magentoDir));\n }\n \n if (!$this->isMagentoInstalled()) {\n $this->installMagento();\n } else {\n $this->updateMagento();\n }\n \n $this->updateConfiguration();\n $this->processMagentoMode();\n \n $this->executeMagentoCommand('setup:static-content:deploy');\n }", "public function deploy()\n {\n $this->log(\"Start deploy.\");\n\n $this->_init();\n\n $this->log(\"Copying read/write directories back.\");\n\n foreach ($this->platformReadWriteDirs as $dir) {\n $this->execute(sprintf('mkdir -p %s', $dir));\n $this->execute(sprintf('/bin/bash -c \"shopt -s dotglob; cp -R ./init/%s/* %s/ || true\"', $dir, $dir));\n $this->log(sprintf('Copied directory: %s', $dir));\n }\n\n $this->updateMagento();\n $this->processMagentoMode();\n $this->disableGoogleAnalytics();\n }", "public function beforeFinishingDeploy()\n {\n $this->runRemote('{{ console_bin }} app:my-task-name');\n $this->runLocal('say \"The deployment has finished.\"');\n }", "public function main() {\n if($this->config['testing']) {\n $this->out(\"WARNING: You are in test mode. No deployment will actually take place.\");\n }\n\n $this->out(\"INPUT oldrev: {$this->oldrev}, newrev: {$this->newrev}, ref: {$this->ref}\");\n\n // If we're deleting something, don't deploy.\n if($this->isDeleting($this->newrev)) {\n $this->out(\"Deleting a ref does not trigger deployment.\");\n exit;\n }\n\n // Make sure the remote exists\n $remote = $this->config['deployment_remote_name'];\n $this->out(\"Checking to make sure the $remote remote exists in the target work area.\");\n if(!$this->remoteExists($remote)) {\n $this->out(\"The $remote remote is not set up in the target work area.\");\n $this->out(\"CANNOT COMPLETE DEPLOYMENT\");\n exit;\n } else {\n $this->out(\"It exists. So we're ok.\");\n }\n\n $deployStrategy = $this->getDeploymentStrategy();\n // Now do pre-deployment processing, which\n // might include executing a pre-deployment script\n // that backs up a database.\n if(!$deployStrategy->preDeployment($this)) {\n $this->out(\"DeploymentStrategy::preDeployment() told me to abort. Aborting deployment.\");\n exit;\n }\n \n\n // Deal with locally modified files.\n $this->out(\"Preparing to deal with locally modified files if there are any.\");\n $LMFStrategy = $this->getLocallyModifiedFileStrategy();\n if(!$LMFStrategy->preDeploy($this)) {\n $this->out(\"LocallyModifieldFileStrategy::preDeploy() told me to abort. Aborting deployment.\");\n exit;\n }\n\n // Bring the repository up to date with origin.\n $this->out(\"Bringing the work area up to date with origin.\");\n echo $this->fetchOrigin();\n\n // Set up tag strategy\n $this->out(\"Preparing tag strategy.\");\n $tagStrategy = $this->getTagStrategy();\n // Get the version number that we want to tag.\n $version = $tagStrategy->getVersion($this);\n\n // Now deploy the version to the work area\n $reftype = $this->isBranch($this->ref) ? \"branch\":\"tag\";\n $this->out(\"Deploying the $reftype you pushed ({$this->baseref}) to work area {$this->config['target']}.\");\n if(!$deployStrategy->deploy($this,$version)) {\n $this->out(\"DeploymentStrategy::deploy() told me to abort. Aborting deployment.\");\n exit;\n }\n\n // Handle any LM files that might have been stashed earlier.\n if(!$LMFStrategy->preTag($this)) {\n $this->out(\"LocallyModifiedFileStrategy::preTag() told me to abort. Aborting deployment.\");\n exit;\n }\n\n // Now tag that deployed branch or tag, push to remotes, and check it out\n if(!$tagStrategy->tag($this,$version)) {\n $this->out(\"TagStrategy::tag() told me to abort. Aborting deployment.\");\n exit;\n }\n\n // Now do post-deployment processing, which\n // might include executing a deployment script\n // and merging the deployed tag into another\n // branch.\n if(!$deployStrategy->postDeployment($this,$version)) {\n $this->out(\"DeploymentStrategy::postDeployment() told me to abort. Aborting deployment.\");\n exit;\n }\n\n $this->out(\"DEPLOYMENT SUCCESSFUL!!\");\n\n }", "public function beforeFinishingDeploy()\n {\n $this->runRemote('export DATABASE_URL=\"mysql://root:password99__@127.0.0.1:3306/newws\" && ./bin/console doctrine:schema:update --force');\n // $this->runLocal('say \"The deployment has finished.\"');\n }", "public function deploySite() {\n // Ask for which application to deploy in.\n $this->writeln('Getting Applications...');\n $appHelper = new ChoiceQuestion('Select which Acquia Cloud Application you want to deploy a site on', $this->getApplicationsId());\n $appName = $this->doAsk($appHelper);\n // Attempt to get the UUID of this application.\n try {\n $appUuId = $this->getUuidFromName($appName);\n }\n catch (Exception $e) {\n $this->say('Incorrect Application ID.');\n }\n // Get a list of environments for this App UUID.\n $this->writeln('Getting Environment ID\\'s...');\n $envList = $this->getEnvironments($appUuId);\n // Get the From Env for this deploy.\n $fromEnvHelper = new ChoiceQuestion('Select which Environment to deploy from', $envList);\n $fromEnv = $this->doAsk($fromEnvHelper);\n // Get the To Env for this deploy.\n $toEnvHelper = new ChoiceQuestion('Select which Environment to deploy to', array_diff($envList, [$fromEnv]));\n $toEnv = $this->doAsk($toEnvHelper);\n // Get th Site to deploy.\n $siteDbList = $this->getDatabases($appUuId);\n $siteHelper = new ChoiceQuestion('Select which Site to deploy.', $siteDbList);\n $siteDb = $this->doAsk($siteHelper);\n try {\n $envUuidFrom = $this->getEnvUuIdFromApp($appUuId, $fromEnv);\n }\n catch (Exception $e) {\n }\n try {\n $envUuidTo = $this->getEnvUuIdFromApp($appUuId, $toEnv);\n }\n catch (Exception $e) {\n }\n if (count($siteDbList) > 1) {\n $this->yell(\"This will not work on a multi site, use deploy:multisite instead\", 80, \"red\");\n }\n $verifyAnswer = $this->ask(\"You are about to deploy ${siteDb} from {$fromEnv} to ${toEnv} in the application ${appName}, do you wish to continue? (y/n)\");\n if ($verifyAnswer === 'y') {\n $this->say(\"Creating Backup in Destination Environment\");\n // DO the site deploy with DB backup in destination environment.\n $this->createDbBackup($siteDb, $envUuidTo);\n // Need to wait for task.\n $this->say(\"Coping Database from ${fromEnv} to ${toEnv}.\");\n // Copy DB to destination environment.\n $this->copyDb($siteDb, $envUuidFrom, $envUuidTo);\n // Need to wait for task.\n // Copy files\n $this->say(\"Coping files from ${fromEnv} to ${toEnv}.\");\n $this->copyFiles($envUuidFrom, $envUuidTo);\n }\n else {\n exit();\n }\n }", "protected function workflowInitialisation() {\n\t\t$deploymentSource = $this->replaceMarkers( $this->workflowConfiguration->getDeploymentSource() );\n\t\t$localDownloadTargetFolder = rtrim($this->replaceMarkers( $this->instanceConfiguration->getDeliveryFolder() ),'/').'/';\n\n\t\t$this->addTask('check that we are on correct deploy node',new \\EasyDeployWorkflows\\Tasks\\Common\\CheckCorrectDeployNode());\n\n\n\t\t$downloadTask = new \\EasyDeployWorkflows\\Tasks\\Common\\Download();\n\t\t$downloadTask->addServerByName('localhost');\n\t\t$downloadTask->setDownloadSource( $deploymentSource );\n\t\t$downloadTask->setTargetFolder( $localDownloadTargetFolder );\n\t\t$this->addTask('Download tracker war to local delivery folder', $downloadTask);\n\n\n\n\t\t$copyTask = new \\EasyDeployWorkflows\\Tasks\\Common\\Download();\n\t\t$copyTask->addServersByName($this->workflowConfiguration->getServletServers());\n\t\t$copyTask->setDownloadSource( $localDownloadTargetFolder.$this->getFilenameFromPath($deploymentSource) );\n\t\t$copyTask->setTargetFolder( '/tmp/' );\n\t\t$copyTask->setDeleteBeforeDownload(true);\n\t\t$this->addTask('Load tracker war to tmp folder on servlet servers',\t$copyTask);\n\n\t\t$tmpWarLocation \t\t\t= '/tmp/'.$this->getFilenameFromPath($deploymentSource);\n\t\t$deployWarTask = new \\EasyDeployWorkflows\\Tasks\\Servlet\\DeployWarInTomcat();\n\t\t$deployWarTask->addServersByName($this->workflowConfiguration->getServletServers());\n\t\t$deployWarTask->setWarFileSourcePath( $tmpWarLocation );\n\t\t$deployWarTask->setTomcatPassword( $this->workflowConfiguration->getTomcatPassword() );\n\t\t$deployWarTask->setTomcatUser( $this->workflowConfiguration->getTomcatUsername() );\n\t\t$deployWarTask->setTomcatPath( $this->workflowConfiguration->getTargetPath() );\n\t\t$deployWarTask->setTomcatPort( $this->workflowConfiguration->getTomcatPort() );\n\t\t$deployWarTask->setTomcatVersion( $this->workflowConfiguration->getTomcatVersion() );\n\n\t\t$this->addTask('deploy the war file to the tomcat servers',$deployWarTask);\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the excludeLocations property value. Location IDs excluded from scope of policy.
public function setExcludeLocations(?array $value): void { $this->getBackingStore()->set('excludeLocations', $value); }
[ "public function setExcluded($exclude = true)\n {\n $this->exclude = $exclude;\n }", "public function setExcluded($value);", "function setRegionsExcluded($regionsExcluded) {\n\t\t$this->setData('regionsExcluded', array_filter($regionsExcluded, array(&$this, '_removeEmptyElements')));\n\t}", "public function setExcluded(?bool $exclude = true): void\n {\n $this->exclude = $exclude;\n }", "public function setExcludedUris($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->excluded_uris = $arr;\n\n return $this;\n }", "public function setExcludedDirectories(array $excludedDirectories): self\n {\n $this->excludedDirectories = $excludedDirectories;\n return $this;\n }", "public function setExcludes($excludes)\n {\n $this->clearExcludes();\n $this->addExcludes($excludes);\n }", "function SetExcludes(array $stringList){}", "function setExclude($exclude)\n\t{\n\t\t$this->excludeClasses = explode(\" \", $exclude);\n\t}", "public function setExcludes($attrs)\n {\n if (!is_array($attrs))\n $attrs = func_get_args();\n\n $this->m_excludes = $attrs;\n $this->m_includes = NULL;\n }", "public function exclude($dirs): self;", "public function SetExcludedMonitoringRoles( $roles ) {\n\t\t$this->_excluded_roles = $roles;\n\t\t$this->_plugin->SetGlobalSetting( 'excluded-roles', esc_html( implode( ',', $this->_excluded_roles ) ) );\n\t}", "public function setExcludes($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->excludes = $arr;\n\n return $this;\n }", "public function setExcludedSites(?\\ArrayType\\ApiArrayOfString $excludedSites = null): self\n {\n if (is_null($excludedSites) || (is_array($excludedSites) && empty($excludedSites))) {\n unset($this->ExcludedSites);\n } else {\n $this->ExcludedSites = $excludedSites;\n }\n \n return $this;\n }", "public function setExcludedTemplates($excludedTemplates)\n {\n $this->excludedTemplates = $excludedTemplates;\n }", "public function exclude($exclude) {\n\t\t$this->excludeTags = array_merge($this->excludeTags, SimpleSAML_Utilities::arrayize($exclude));\n\t}", "public function setAllowedDataIngestionLocations($val)\n {\n $this->_propDict[\"allowedDataIngestionLocations\"] = $val;\n return $this;\n }", "function setExcludeVars($names = array()){\r\n\t\t$this->exclude_vars = $names;\r\n\t}", "public function setExclude($exclude)\n {\n $this->_exclude = $exclude;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of idClase
public function getIdClase() { return $this->idClase; }
[ "public function getIdClasi()\n {\n return $this->id_clasi;\n }", "public function get_id_clases(){ \n return (isset($this->_id_clases)) ? $this->_id_clases: null;\n}", "public function getIdclasse()\n\t{\n\t\treturn $this->idclasse;\n\t}", "public function getHorarioClaseId()\n {\n return $this->horarioClaseId;\n }", "public function getIdCidade()\n {\n return $this->idCidade;\n }", "public function getIdCita()\n {\n return $this->idCita;\n }", "public function getIdCargadisca()\n {\n return $this->id_cargadisca;\n }", "public function getIdCidade()\n {\n return $this->id_cidade;\n }", "public function getColasId(){\n\t\treturn $this->colas_id;\n\t}", "public function getIdcuenta()\n {\n return $this->idcuenta;\n }", "public function getIdColecao() {\n return $this->idColecao;\n }", "public function getIdSeccion() {\r\n return $this->idSeccion;\r\n }", "public function getIdSeccion()\n {\n return $this->idSeccion;\n }", "public function getCampusCursoId()\r\n {\r\n return $this->CampusCurso_id;\r\n }", "public function getIdcategoria()\n {\n return $this->idcategoria;\n }", "public function getId_clasificacion()\r\n\t{\r\n\t\treturn($this->id_clasificacion);\r\n\t}", "function get_idC($id){\n $this->DB->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"SELECT * FROM carreras where id = ?\";\n $q = $this->DB->prepare($sql);\n $q->execute(array($id));\n $data = $q->fetch(PDO::FETCH_ASSOC);\n return $data;\n }", "public function getCidade()\n {\n return $this->cidade;\n }", "public function getId_categoria()\n {\n return $this->id_categoria;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Returns the partial diff for the specificed sequences, in reverse order. The parameters are: $table the table returned by the computeTable function $sequence1 the first sequence $sequence2 the second sequence $start the starting index
private static function generatePartialDiff( $table, $sequence1, $sequence2, $start, $ignoreIndent = true){ // initialise the diff $diff = array(); // initialise the indices $index1 = count($table) - 1; $index2 = count($table[0]) - 1; // loop until there are no items remaining in either sequence while ($index1 > 0 || $index2 > 0){ // check what has happened to the items at these indices if ($index1 > 0 && $index2 > 0 && static::compareLine($sequence1[$index1 + $start - 1], $sequence2[$index2 + $start - 1], $ignoreIndent)){ // update the diff and the indices $diff[] = array($sequence1[$index1 + $start - 1], self::UNMODIFIED); $index1 --; $index2 --; }elseif ($index2 > 0 && static::compareLine($table[$index1][$index2], $table[$index1][$index2 - 1], $ignoreIndent)){ // update the diff and the indices $diff[] = array($sequence2[$index2 + $start - 1], self::INSERTED); $index2 --; }else{ // update the diff and the indices $diff[] = array($sequence1[$index1 + $start - 1], self::DELETED); $index1 --; } } // return the diff return $diff; }
[ "private static function generatePartialDiff(\n $table, $sequence1, $sequence2, $start){\n\n // initialise the diff\n $diff = array();\n\n // initialise the indices\n $index1 = count($table) - 1;\n $index2 = count($table[0]) - 1;\n\n // loop until there are no items remaining in either sequence\n while ($index1 > 0 || $index2 > 0){\n\n // check what has happened to the items at these indices\n if ($index1 > 0 && $index2 > 0\n && $sequence1[$index1 + $start - 1]\n == $sequence2[$index2 + $start - 1]){\n\n // update the diff and the indices\n $diff[] = array($sequence1[$index1 + $start - 1], self::UNMODIFIED);\n $index1 --;\n $index2 --;\n\n }elseif ($index2 > 0\n && $table[$index1][$index2] == $table[$index1][$index2 - 1]){\n\n // update the diff and the indices\n $diff[] = array($sequence2[$index2 + $start - 1], self::INSERTED);\n $index2 --;\n\n }else{\n\n // update the diff and the indices\n $diff[] = array($sequence1[$index1 + $start - 1], self::DELETED);\n $index1 --;\n\n }\n\n }\n\n // return the diff\n return $diff;\n }", "public function diff(self $sequence): self;", "private static function computeTable(\n $sequence1, $sequence2, $start, $end1, $end2){\n\n // determine the lengths to be compared\n $length1 = $end1 - $start + 1;\n $length2 = $end2 - $start + 1;\n\n // initialise the table\n $table = array(array_fill(0, $length2 + 1, 0));\n\n // loop over the rows\n for ($index1 = 1; $index1 <= $length1; $index1 ++){\n\n // create the new row\n $table[$index1] = array(0);\n\n // loop over the columns\n for ($index2 = 1; $index2 <= $length2; $index2 ++){\n\n // store the longest common subsequence length\n if ($sequence1[$index1 + $start - 1]\n == $sequence2[$index2 + $start - 1]){\n $table[$index1][$index2] = $table[$index1 - 1][$index2 - 1] + 1;\n }else{\n $table[$index1][$index2] =\n max($table[$index1 - 1][$index2], $table[$index1][$index2 - 1]);\n }\n\n }\n }\n\n // return the table\n return $table;\n\n }", "protected function createIndexDifference($table)\n {\n $currentIndexes = $this->_currentDb->getIndexList($table);\n $publishedIndexes = $this->_publishedDb->getIndexList($table);\n\n\n foreach ($currentIndexes as $curIndex) {\n $indexForCompare = $this->checkIndexExists($curIndex, $publishedIndexes);\n if (!$indexForCompare) {\n $this->down(Core_Db_Database::dropConstraint($curIndex));\n $this->down(Core_Db_Database::dropIndex($curIndex));\n $this->up(Core_Db_Database::dropConstraint($curIndex));\n $this->up(Core_Db_Database::dropIndex($curIndex));\n $this->up(Core_Db_Database::addIndex($curIndex));\n $this->up(Core_Db_Database::addConstraint($curIndex));\n } elseif ($indexForCompare === $curIndex) {\n continue;\n } else {\n $this->down(Core_Db_Database::dropConstraint($curIndex));\n $this->down(Core_Db_Database::dropIndex($curIndex));\n $this->down(Core_Db_Database::addIndex($indexForCompare));\n $this->down(Core_Db_Database::addConstraint($indexForCompare));\n $this->up(Core_Db_Database::dropConstraint($curIndex));\n $this->up(Core_Db_Database::dropIndex($curIndex));\n $this->up(Core_Db_Database::addIndex($curIndex));\n $this->up(Core_Db_Database::addConstraint($curIndex));\n }\n }\n }", "public static function diff()\n {\n if (!self::$part) {\n $end = end(self::$partials);\n $now = self::partial();\n } else {\n self::$part = false;\n $end = self::$partials[count7(self::$partials) - 2];\n $now = end(self::$partials);\n }\n $mili = (float)$now - (float)$end;\n return number_format($mili, 3);\n }", "public function testSubtract1(): void\n {\n $sequenceA = new Sequence(\n Period::fromDate(new DateTime('2000-01-01'), new DateTime('2000-01-10')),\n Period::fromDate(new DateTime('2000-01-12'), new DateTime('2000-01-20'))\n );\n $sequenceB = new Sequence(\n Period::fromDate(new DateTime('2000-01-05'), new DateTime('2000-01-08')),\n Period::fromDate(new DateTime('2000-01-11'), new DateTime('2000-01-25'))\n );\n $diff = $sequenceA->subtract($sequenceB);\n\n self::assertCount(2, $diff);\n self::assertSame('[2000-01-01, 2000-01-05)', $diff->get(0)->toIso80000('Y-m-d'));\n self::assertSame('[2000-01-08, 2000-01-10)', $diff->get(1)->toIso80000('Y-m-d'));\n self::assertEquals($diff, $sequenceA->subtract($sequenceB));\n }", "public function getReverseDiff()\n {\n $diff = new self();\n\n // columns\n $diff->setFromField($this->toField);\n $diff->setToField($this->fromField);\n\n // properties\n $changedProperties = [];\n foreach ($this->changedProperties as $name => $propertyChange) {\n $changedProperties[$name] = array_reverse($propertyChange);\n }\n $diff->setChangedProperties($changedProperties);\n\n return $diff;\n }", "public static function compare( $string1, $string2 ) {\n\t\t// Initialise the sequences and comparison start and end positions.\n\t\t$start = 0;\n\t\t$sequence1 = preg_split( '/\\R/', $string1 );\n\t\t$sequence2 = preg_split( '/\\R/', $string2 );\n\t\t$end1 = count( $sequence1 ) - 1;\n\t\t$end2 = count( $sequence2 ) - 1;\n\n\t\t// Skip any common prefix.\n\t\twhile ( $start <= $end1 && $start <= $end2 && $sequence1[ $start ] == $sequence2[ $start ] ) {\n\t\t\t$start ++;\n\t\t}\n\n\t\t// Skip any common suffix.\n\t\twhile ( $end1 >= $start && $end2 >= $start && $sequence1[ $end1 ] == $sequence2[ $end2 ] ) {\n\t\t\t$end1 --;\n\t\t\t$end2 --;\n\t\t}\n\n\t\t// Compute the table of longest common subsequence lengths.\n\t\t$table = self::computeTable( $sequence1, $sequence2, $start, $end1, $end2 );\n\n\t\t// Generate the partial diff.\n\t\t$partialDiff = self::generatePartialDiff( $table, $sequence1, $sequence2, $start );\n\n\t\t// Generate the full diff.\n\t\t$diff = array();\n\t\tfor ( $index = 0; $index < $start; $index++ ) {\n\t\t\t$diff[] = array( $sequence1[ $index ], self::UNMODIFIED );\n\t\t}\n\n\t\twhile ( count( $partialDiff ) > 0 ) {\n\t\t\t$diff[] = array_pop( $partialDiff );\n\t\t}\n\n\t\tfor ( $index = $end1 + 1; $index < count( $sequence1 ); $index ++ ) {\n\t\t\t$diff[] = array( $sequence1[ $index ], self::UNMODIFIED );\n\t\t}\n\t\t// Return the diff.\n\t\treturn $diff;\n\t}", "function MyMod_Search_Table_Double_Make($table)\n {\n if ($this->MyMod_Search_Table_Two_Col)\n {\n $rtbl=array();\n while ($row=array_shift($table))\n {\n $rrow=array_shift($table);\n while (count($row)>2) { array_pop($row); }\n while (count($rrow)>2) { array_pop($rrow); }\n\n if (is_array($rrow))\n {\n $row=array_merge($row,$rrow);\n }\n array_push($rtbl,$row);\n }\n\n $table=$rtbl;\n }\n\n return $table;\n }", "function triBulleDecroissant($tab) {\n \n $tampon = 0;\n $permut;\n \n do {\n // hypothèse : le tableau est trié\n $permut = false;\n for ( $i = 0; $i < count($tab) - 1; $i++) {\n // Teste si 2 éléments successifs sont dans le bon ordre ou non\n if ( intval($tab[$i]['score']) < intval($tab[$i+1]['score']) ) {\n\n // s'ils ne le sont pas, on échange leurs positions\n $tampon = $tab[$i];\n $tab[$i] = $tab[$i + 1];\n $tab[$i+1] =$tampon;\n $permut = true;\n }\n }\n } while ($permut);\n return $tab;\n }", "function compareseq ($xoff, $xlim, $yoff, $ylim, $minimal) {\n\n\n $xv = $this->string[0][\"data\"];\t/* Help the compiler. */\n $yv = $this->string[1][\"data\"];\n\n if ($this->string[1][\"edit_count\"] + $this->string[0][\"edit_count\"] > $this->max_edits)\n return;\n\n\n /* Slide down the bottom initial diagonal. */\n while (($xoff < $xlim) && ($yoff < $ylim) && ($xv[$xoff] == $yv[$yoff]))\n {\n ++$xoff;\n ++$yoff;\n }\n\n /* Slide up the top initial diagonal. */\n while ($xlim > $xoff && $ylim > $yoff && $xv[$xlim - 1] == $yv[$ylim - 1])\n {\n --$xlim;\n --$ylim;\n }\n\n /* Handle simple cases. */\n if ($xoff == $xlim)\n {\n while ($yoff < $ylim)\n \t{\n \t ++$this->string[1][\"edit_count\"];\n \t ++$yoff;\n \t}\n }\n else if ($yoff == $ylim)\n {\n while ($xoff < $xlim)\n \t{\n \t ++$this->string[0][\"edit_count\"];\n \t ++$xoff;\n \t}\n }\n else\n {\n\n /* Find a point of correspondence in the middle of the strings. */\n $c = $this->diag ($xoff, $xlim, $yoff, $ylim, $minimal, $part);\n if ($c == 1)\n \t{\n #if 0\n \t /* This should be impossible, because it implies that one of\n \t the two subsequences is empty, and that case was handled\n \t above without calling `diag'. Let's verify that this is\n \t true. */\n \t exit;\n #else\n \t /* The two subsequences differ by a single insert or delete;\n \t record it and we are done. */\n \t if ($part[\"xmid\"] - $part[\"ymid\"] < $xoff - $yoff)\n \t ++$this->string[1][\"$edit_count\"];\n \t else\n \t ++$this->string[0][\"edit_count\"];\n #endif\n \t}\n else\n \t{\n \t /* Use the partitions to split this problem into subproblems. */\n \t $this->compareseq ($xoff, $part[\"xmid\"], $yoff, $part[\"ymid\"], $part[\"lo_minimal\"]);\n \t $this->compareseq ($part[\"xmid\"], $xlim, $part[\"ymid\"], $ylim, $part[\"hi_minimal\"]);\n \t}\n }\n }", "private function getSequencedStartValue($table) {\r\n $select = 'max(uid) as max';\r\n $where = '1=1';\r\n $currentMax = (int)current($GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow($select, $table, $where));\r\n $start = $this->defaultStart + ($this->defaultOffset * ceil ($currentMax / $this->defaultOffset));\r\n return $start;\r\n }", "private function parseChangedTable( SimpleXMLElement $table )\n {\n $addedFields = array();\n foreach ( $table->{'added-fields'}->field as $field )\n {\n $fieldName = (string) $field->name;\n $addedFields[$fieldName] = $this->parseField( $field ); \n }\n\n $changedFields = array();\n foreach ( $table->{'changed-fields'}->field as $field )\n {\n $fieldName = (string) $field->name;\n $changedFields[$fieldName] = $this->parseField( $field ); \n }\n\n $removedFields = array();\n foreach ( $table->{'removed-fields'}->field as $field )\n {\n $fieldName = (string) $field->name;\n if ( (string) $field->removed == 'true' )\n {\n $removedFields[$fieldName] = true;\n }\n }\n\n $addedIndexes = array();\n foreach ( $table->{'added-indexes'}->index as $index )\n {\n $indexName = (string) $index->name;\n $addedIndexes[$indexName] = $this->parseIndex( $index ); \n }\n\n $changedIndexes = array();\n foreach ( $table->{'changed-indexes'}->index as $index )\n {\n $indexName = (string) $index->name;\n $changedIndexes[$indexName] = $this->parseIndex( $index ); \n }\n\n $removedIndexes = array();\n foreach ( $table->{'removed-indexes'}->index as $index )\n {\n $indexName = (string) $index->name;\n if ( (string) $index->removed == 'true' )\n {\n $removedIndexes[$indexName] = true;\n }\n }\n\n return new ezcDbSchemaTableDiff(\n $addedFields, $changedFields, $removedFields, $addedIndexes,\n $changedIndexes, $removedIndexes\n );\n }", "private function diff()\n\t{\n\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t\t$onlyLeft = $onlyRight = $noMatch = $equalFinds = 0;\n\n\t\tHTML_showTableHeader(true);\n\n\t\t// Package status files\n\t\t$file1 = $this->getStatusFile($this->clientOrFile1, $this->isFile1Set());\n\t\t$file2 = $this->getStatusFile($this->clientOrFile2, $this->isFile2Set());\n\n\t\t// Generate files, that only contain the package names\n\t\t$file1Packages = \"$file1.packages\";\n\t\t$file2Packages = \"$file2.packages\";\n\t\texec(\"sed 's/°.*//' $file1 | sort > $file1Packages\");\n\t\texec(\"sed 's/°.*//' $file2 | sort > $file2Packages\");\n\t\n\t\t// Run diff on the package only index files\n\t\t$pin = popen(\"diff -y $file1Packages $file2Packages\", 'r');\n\n\t\tHTML_showTableHeading($I18N_package_name, $I18N_version, $I18N_status, '&lt;=|&gt;' , $I18N_package_name, $I18N_version, $I18N_status);\n\t\t\n\t\t\n\n\n\n\n\t\t// Get the lines from the side by side diff\n\t\twhile ($line = fgets($pin))\n\t\t{\n\t\t\t$type = '=';\n\t\n\t\t\t// Left and right column are separated by tabulators and white spaces, in between is the diff type symbol\n\t\t\t$leftTypeRight = preg_split(\"/[\\t ]/\", $line);\n\t\n\t\t\t// Search for the diff type in this line (<,>,|,=)\n\t\t\tfor ($i = 1; $i < count($leftTypeRight) -1; $i++)\n\t\t\t{\n\t\t\t\tif (isset($leftTypeRight[$i]{0}))\n\t\t\t\t{\n\t\t\t\t\t$type = $leftTypeRight[$i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get the package name on the left and right panel\n\t\t\t$left = trim($leftTypeRight[0]);\n\t\t\t$right = trim($leftTypeRight[count($leftTypeRight) - 1]);\n\n\t\t\t// There is no package name on the right side, this is the diff type\n\t\t\tif ('<' == $right)\n\t\t\t{\n\t\t\t\t$type = '<';\n\t\t\t\t$right = '-';\n\t\t\t}\n\n\t\t\t// Show differnt columns by diff type\n\t\t\tswitch($type)\n\t\t\t{\n\t\t\t\tcase '=':\n\t\t\t\t\t$leftVersionStatus = $this->getVersionStatus($file1, $left);\n\t\t\t\t\t$rightVersionStatus = $this->getVersionStatus($file2, $right);\n\t\t\t\t\t$reallyEqual = $this->showStatusRow($left, $leftVersionStatus[1], $leftVersionStatus[2], $type , $right, $rightVersionStatus[1], $rightVersionStatus[2]);\n\t\t\t\t\tif ($reallyEqual)\n\t\t\t\t\t\t$equalFinds++;\n\t\t\t\t\telse\n\t\t\t\t\t\t$noMatch++;\n\t\t\t\tbreak;\n\n\t\t\t\tcase '|':\n\t\t\t\t\t$leftVersionStatus = $this->getVersionStatus($file1, $left);\n\t\t\t\t\t$rightVersionStatus = $this->getVersionStatus($file2, $right);\n\t\t\t\t\t$this->showStatusRow($left, $leftVersionStatus[1], $leftVersionStatus[2], '|' , $right, $rightVersionStatus[1], $rightVersionStatus[2]);\n\t\t\t\t\t$noMatch ++;\n\t\t\t\tbreak;\n\n\t\t\t\tcase '<':\n\t\t\t\t\t$leftVersionStatus = $this->getVersionStatus($file1, $left);\n\t\t\t\t\t$this->showStatusRow($left, $leftVersionStatus[1], $leftVersionStatus[2], '<' , '-', '', '');\n\t\t\t\t\t$onlyLeft ++;\n\t\t\t\tbreak;\n\n\t\t\t\tcase '>':\n\t\t\t\t\t$rightVersionStatus = $this->getVersionStatus($file2, $right);\n\t\t\t\t\t$this->showStatusRow('-', '', '', '>' , $right, $rightVersionStatus[1], $rightVersionStatus[2]);\n\t\t\t\t\t$onlyRight ++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\tHTML_showTableRow(\"$I18N_onlyLeft: $onlyLeft\", \"$I18N_equal: $equalFinds\", '', '' , \"$I18N_onlyRight: $onlyRight\", \"$I18N_noMatch $noMatch\", '');\n\n\t\tpclose($pin);\n\n\t\tHTML_showTableEnd(true);\n\t}", "public static function fetch_diff($passage, $alternatives, $transcript,$fulltranscript, $language,$passagephonetic, $debug = false) {\n global $DB, $CFG;\n\n //turn the passage and transcript into an array of words\n $passagebits = diff::fetchWordArray($passage);\n $alternatives = diff::fetchAlternativesArray($alternatives);\n $transcriptbits = diff::fetchWordArray($transcript);\n $wildcards = diff::fetchWildcardsArray($alternatives);\n $passagephonetic_bits = diff::fetchWordArray($passagephonetic);\n\n //If this is Japanese we want to segment it into \"words\"\n if($language == constants::M_LANG_JAJP) {\n $region='tokyo'; //TO DO: should pass region in and not hard code it\n list($transcript_phonetic,$transcript_segments) = utils::fetch_phones_and_segments($transcript,constants::M_LANG_JAJP,$region);\n $transcriptbits = diff::fetchWordArray($transcript_segments);\n }else{\n $transcript_phonetic ='';\n $transcript_segments='';\n }\n $transcriptphonetic_bits = diff::fetchWordArray($transcript_phonetic);\n\n //fetch sequences of transcript/passage matched words\n // then prepare an array of \"differences\"\n $passagecount = count($passagebits);\n $transcriptcount = count($transcriptbits);\n $sequences = diff::fetchSequences($passagebits, $transcriptbits, $alternatives, $language,$transcriptphonetic_bits,$passagephonetic_bits);\n\n $debugsequences = array();\n if ($debug) {\n $diff_info = diff::fetchDiffs($sequences, $passagecount, $transcriptcount, $debug);\n $diffs = diff::applyWildcards($diff_info[0], $passagebits, $wildcards);\n $debugsequences = $diff_info[1];\n } else {\n $diffs = diff::fetchDiffs($sequences, $passagecount, $transcriptcount, $debug);\n $diffs = diff::applyWildcards($diffs, $passagebits, $wildcards);\n }\n\n //from the array of differences build error data, match data, markers, scores and metrics\n $errors = new \\stdClass();\n $matches = new \\stdClass();\n $currentword = 0;\n $lastunmodified = 0;\n //loop through diffs\n // (could do a for loop here .. since diff count = passage words count for now index is $currentword\n foreach ($diffs as $diff) {\n $currentword++;\n switch ($diff[0]) {\n case Diff::UNMATCHED:\n //we collect error info so we can count and display them on passage\n $error = new \\stdClass();\n $error->word = $passagebits[$currentword - 1];\n $error->wordnumber = $currentword;\n $errors->{$currentword} = $error;\n break;\n\n case Diff::MATCHED:\n //we collect match info so we can play audio from selected word\n $match = new \\stdClass();\n $match->word = $passagebits[$currentword - 1];\n $match->pposition = $currentword;\n $match->tposition = $diff[1];\n $match->audiostart = 0;//we will assess this from full transcript shortly\n $match->audioend = 0;//we will assess this from full transcript shortly\n $match->altmatch = $diff[2];//was this match an alternatives match?\n $matches->{$currentword} = $match;\n $lastunmodified = $currentword;\n break;\n\n default:\n //do nothing\n //should never get here\n\n }\n }\n $sessionendword = $lastunmodified;\n\n //discard errors that happen after session end word.\n $errorcount = 0;\n $finalerrors = new \\stdClass();\n foreach ($errors as $key => $error) {\n if ($key < $sessionendword) {\n $finalerrors->{$key} = $error;\n $errorcount++;\n }\n }\n //finalise and serialise session errors\n $sessionerrors = json_encode($finalerrors);\n\n //also capture match information for debugging and audio point matching\n //we can only map transcript to audio from match data\n $matches = utils::fetch_audio_points($fulltranscript, $matches, $alternatives);\n\n return[$matches,$sessionendword,$sessionerrors,$errorcount,$debugsequences];\n\n }", "function rt($seq)\r\n\t{\r\n\t\tarray_shift($seq);\r\n\t\treturn $seq;\r\n\t}", "function diffC($fileName, $page, $startPage){\n\n //Make sure the array is empty\n unset($transcriptText);\n\n //Make a new Database handle\n $dbHandle = dbConnection();\n\n //Grab the transcripts for this page for Task A\n $statement = 'SELECT `text`,`sid` FROM `studentTranscripts` WHERE `task` = ? AND `filename` = ? AND `page` = ? ORDER BY `tid` DESC';\n $exec = $dbHandle->prepare($statement);\n $exec->execute(array(\"A\", $fileName, $page));\n $transcriptResultA = $exec->fetch(PDO::FETCH_ASSOC);\n\t\n\t//Check if the transcript is done for A\n\t$statement = 'SELECT `completed` FROM `assignedPages` WHERE `sid` = ? AND `filename` = ? AND `pageStart` = ?';\n $exec = $dbHandle->prepare($statement);\n $exec->execute(array($transcriptResultA['sid'], $fileName, $startPage));\n $doneA = $exec->fetch(PDO::FETCH_ASSOC);\n\n //Remove most tags\n $transcriptResultA['text'] = strip_tags($transcriptResultA['text'], '<p>');\n\n //Remove nbsp\n $transcriptResultA['text'] = str_replace('&nbsp;', \"\", $transcriptResultA['text']);\n\n //Remove the </p> tags\n $transcriptResultA['text'] = str_replace(\"</p>\", \"\", $transcriptResultA['text']);\n //Separate each p into an array item (each line)\n $transcriptResultA[] = explode(\"<p>\", $transcriptResultA['text']);\n\n //Build the original div for comparision\n $return = '<div id=\"baseText\" style=\"visibility:hidden; display:none;\">';\n $first=TRUE;\n foreach($transcriptResultA[0] as $transcriptLine){\n if($first==FALSE){$return .=$transcriptLine.'&#13;';}\n else{$first=FALSE;}\n }\n $return .= '</div>';\n\n //Grab the transcripts for this page for Task B\n $statement = 'SELECT `text`,`sid` FROM `studentTranscripts` WHERE `task` = ? AND `filename` = ? AND `page` = ? ORDER BY `tid` DESC';\n $exec = $dbHandle->prepare($statement);\n $exec->execute(array(\"B\", $fileName, $page));\n $transcriptResultB = $exec->fetch(PDO::FETCH_ASSOC);\n\t\n\t//Check if the transcript is done for B\n\t$statement = 'SELECT `completed` FROM `assignedPages` WHERE `sid` = ? AND `filename` = ? AND `pageStart` = ?';\n $exec = $dbHandle->prepare($statement);\n $exec->execute(array($transcriptResultB['sid'], $fileName, $startPage));\n $doneB = $exec->fetch(PDO::FETCH_ASSOC);\n\n //Remove most tags\n $transcriptResultB['text'] = strip_tags($transcriptResultB['text'], '<p>');\n\n //Remove nbsp\n $transcriptResultB['text'] = str_replace('&nbsp;', \"\", $transcriptResultB['text']);\n\n //Replace the </p> tags\n $transcriptResultB['text'] = str_replace(\"</p>\", \"\",$transcriptResultB['text']);\n //Separate each p into an array item (each line)\n $transcriptResultB[] = explode(\"<p>\", $transcriptResultB['text']);\n\n //Build the second div for comparision\n $return .= '<div id=\"newText\" style=\"visibility:hidden; display:none;\">';\n $first=TRUE;\n foreach($transcriptResultB[0] as $transcriptLine){\n if($first==FALSE){$return .=$transcriptLine.'&#13;';}\n else{$first=FALSE;}\n }\n $return .= '</div>';\n\n //Include the output div\n $return .= '<div id=\"diffoutput\"> </div>';\n\n //JSDiff Includes and initialization\n $return .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"js/jsdifflib/diffview.css\"/>\n <script type=\"text/javascript\" src=\"js/jsdifflib/diffview.js\"></script>\n <script type=\"text/javascript\" src=\"js/jsdifflib/difflib.js\"></script>\n\n <script type=\"text/javascript\">\n\n function diffUsingJS(viewType) {\n \"use strict\";\n var byId = function (id) { return document.getElementById(id); },\n base = difflib.stringAsLines(byId(\"baseText\").innerHTML),\n newtxt = difflib.stringAsLines(byId(\"newText\").innerHTML),\n sm = new difflib.SequenceMatcher(base, newtxt),\n opcodes = sm.get_opcodes(),\n diffoutputdiv = byId(\"diffoutput\"),\n contextSize = \"\";\n\n diffoutputdiv.innerHTML = \"\";\n contextSize = contextSize || null;\n\n diffoutputdiv.appendChild(diffview.buildView({\n baseTextLines: base,\n newTextLines: newtxt,\n opcodes: opcodes,\n baseTextName: \"Transcript A\",\n newTextName: \"Transcript B\",\n contextSize: contextSize,\n viewType: viewType\n }));\n }\n window.onload = diffUsingJS();\n </script>';\n\n\t//If the transcripts are not done we can't show them. Come back later.\n\tif($doneA['completed'] !== \"TRUE\" || $doneB['completed'] !== \"TRUE\"){\n\t\t\n\t\treturn FALSE;\n\t}\n\telse{\n\n\t\t//Otherwise show the transcripts\t\t\t\t\t\n\t\treturn $return;\n\t}\n}", "function update_route_sequence($rid, $sequence, $update_type, $sid = null) {\n // it is the position before the new record\n $new_record_sequence = $sequence + 1;\n\n if ($update_type == 'delete') {\n\n $query = <<<SQL\n update stop_times\n set stop_sequence = stop_sequence - 1\n where tid in (\n select tid\n\t from trips\n where rid = :rid)\n and stop_sequence > :sq\nSQL;\n\n db_query($query, array(':rid' => $rid, ':sq' => $new_record_sequence));\n\n } elseif ($update_type == 'new') {\n\n //check to see if the given sequence number already exists\n $query =<<<SQL\n select 1\n from stop_times st\n join trips t\n on t.tid = st.tid\n where t.rid = :rid\n and st.stop_sequence = :sq\nSQL;\n\n $exists =\n db_query($query, array(':rid' => $rid, ':sq' => $new_record_sequence))\n ->fetchField();\n\n if ($exists || ($sequence == 0)) {\n\n $query = <<<SQL\n update stop_times\n set stop_sequence = stop_sequence + 1\n where tid in (\n select tid\n\t from trips\n where rid = :rid)\n and stop_sequence > :sq\nSQL;\n\n db_query($query, array(':rid' => $rid, ':sq' => $new_record_sequence));\n } else {\n // if the record will go last in the sequence then we don't need\n // to increment new_record_sequence\n $new_record_sequence = $new_record_sequence - 1;\n }\n\n } elseif ($update_type = 'edit') {\n $current_position = fetch_stop_position($sid);\n\n //move down the list\n if ($current_position > $sequence) {\n $query = <<<SQL\n update stop_times\n set stop_sequence = stop_sequence + 1\n where tid in (\n select tid\n\t from trips\n where rid = :rid)\n and stop_sequence >= :new\n and stop_sequence < :cur\nSQL;\n\n db_query($query,\n array(':rid' => $rid,\n\t ':new' => $new_record_sequence,\n\t ':cur' => $current_position\n\t)\n );\n\n //move up the list\n } elseif ($current_position < $sequence) {\n $new_record_sequence = $new_record_sequence - 1;\n\n $query = <<<SQL\n update stop_times\n set stop_sequence = stop_sequence - 1\n where tid in (\n select tid\n\t from trips\n where rid = :rid)\n and stop_sequence <= :new\n and stop_sequence > :cur\nSQL;\n\n db_query($query, array(':rid' => $rid,\n\t\t\t ':new' => $new_record_sequence,\n\t\t\t ':cur' => $current_position\n\t\t\t )\n\t );\n\n }\n }\n\n return $new_record_sequence;\n}", "private function calculateReverse()\n\t{\n\t\tif (isset($this->columns) && !isset($this->reverse)) {\n\t\t\t$this->reverse = [];\n\t\t\tforeach ($this->columns as $key => $column_name) {\n\t\t\t\tif (is_string($column_name) && ($column_name[0] === '-')) {\n\t\t\t\t\t$column_name = substr($column_name, 1);\n\t\t\t\t\t$this->reverse[$column_name] = $column_name;\n\t\t\t\t\t$this->columns[$key] = $column_name;\n\t\t\t\t}\n\t\t\t\telseif (strpos(SP . $column_name . SP, SP . 'reverse' . SP) !== false) {\n\t\t\t\t\t$column_name = trim(str_replace(SP . 'reverse' . SP, '', SP . $column_name . SP));\n\t\t\t\t\t$this->reverse[$column_name] = $column_name;\n\t\t\t\t\t$this->columns[$key] = $column_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
andWith function. adds another compressor
public function andWith(string $compressor) { $this->backup->compressWith($compressor); return $this; }
[ "public function compressWith($compressor)\n\t\t{\n\t\t\t$this->compressor = $compressor;\n\t\t\t$this->compress();\n\n\t\t\t/**\n\t\t\t * Anonymous class to enable compressor chaining.\n\t\t\t * That means you can compress your archive with tar,\n\t\t\t * then with gzip for example.\n\t\t\t * This class provides a \"andWith()\" method. All other\n\t\t\t * calls will be applied to the original backup,\n\t\t\t * so once you call \"saveAt\" for example, you will\n\t\t\t * receive the backup object again.\n\t\t\t */\n\t\t\treturn new class($this) {\n\t\t\t\tprotected $backup;\n\n\t\t\t\t/**\n\t\t\t\t * creates a new instance and sets the backup\n\t\t\t\t *\n\t\t\t\t * @param Backup $backup\n\t\t\t\t */\n\t\t\t\tpublic function __construct(Backup $backup)\n\t\t\t\t{\n\t\t\t\t\t$this->backup = $backup;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * andWith function.\n\t\t\t\t * adds another compressor\n\t\t\t\t *\n\t\t\t\t * @access public\n\t\t\t\t * @param string $compressor\n\t\t\t\t *\n\t\t\t\t * @return $this\n\t\t\t\t */\n\t\t\t\tpublic function andWith(string $compressor)\n\t\t\t\t{\n\t\t\t\t\t$this->backup->compressWith($compressor);\n\t\t\t\t\treturn $this;\n\t\t\t\t}\n\n\t\t\t\tpublic function __call(string $method, array $arguments): Backup\n\t\t\t\t{\n\t\t\t\t\treturn $this->backup->$method(...$arguments);\n\t\t\t\t}\n\t\t\t};\n\t\t}", "protected function _f_and()\n {\n }", "public function _and() {\n\t\t$args = func_get_args();\n\t\t$this->add($args, GlueDB_Fragment_Operand_Bool::_AND);\n\t\treturn $this;\n\t}", "function variant_and($left, $right) {}", "function gmp_and($a, $b) {}", "function variant_and ($left, $right) {}", "protected function getCompressor() {}", "function union($other)\n\t{\n\t\t$n = Integers::min( count($this->bits), count($other->bits) );\n\t\tfor($i = $n - 1; $i >= 0; $i--)\n\t\t\t$this->bits[$i] |= $other->bits[$i];\n\t\tif( $other->size() > $this->size() ){\n\t\t\tfor($i = count($other->bits) - 1; $i >= $n; $i--)\n\t\t\t\t$this->bits[$i] = $other->bits[$i];\n\t\t\t$this->size = $other->size;\n\t\t}\n\t\t$this->resetCache();\n\t}", "private function _appendOperator($useAnd){\n\t\tif($this->_condition!='')\n\t\t\t$this->_condition .= $useAnd ? ' AND' : ' OR';\n\t\t\n\t}", "public function zz_concatenateWithAnd( $param_1, $param_2 )\n {\n // RETURN $param_2\n if ( empty( $param_1 ) )\n {\n // 3.9.25, 120605, dwildt+\n if ( substr( $param_2, 0, 4 ) == 'AND ' )\n {\n $param_2 = substr( $param_2, 4 );\n }\n // 3.9.25, 120605, dwildt+\n return $param_2;\n }\n // RETURN $param_2\n // RETURN $param_1\n if ( empty( $param_2 ) )\n {\n // 3.9.25, 120605, dwildt+\n if ( substr( $param_1, 0, 4 ) == 'AND ' )\n {\n $param_1 = substr( $param_1, 4 );\n }\n // 3.9.25, 120605, dwildt+\n return $param_1;\n }\n // RETURN $param_1\n // Cut the ' AND' of the end of param_1\n $param_1 = trim( $param_1 );\n if ( substr( $param_1, -4 ) == ' AND' )\n {\n $param_1 = substr( $param_1, 0, strlen( $param_1 ) - 4 );\n }\n // Cut the ' AND' of the end of param_1\n // Cut the 'AND ' of the beginning of param_2\n $param_2 = trim( $param_2 );\n if ( substr( $param_2, 0, 4 ) == 'AND ' )\n {\n $param_2 = substr( $param_2, 4 );\n }\n // Cut the 'AND ' of the beginning of param_2\n // RETURN $param_1 AND $param_2\n $param_1 = $param_1 . \" AND \" . $param_2;\n // Cut the 'AND ' of the beginning of param_1\n // 3.9.25, 120605, dwildt+\n if ( substr( $param_1, 0, 4 ) == 'AND ' )\n {\n $param_1 = substr( $param_1, 4 );\n }\n // 3.9.25, 120605, dwildt+\n // Cut the 'AND ' of the beginning of param_1\n return $param_1;\n }", "function mergingOf($a, $b){\n\t\t\t\t\t$c = $a . bin2hex($b);\n\t\t\t\t\treturn $c;\n\t\t\t\t\t}", "protected function _prepareCompression()\n {\n $path = str_replace(Mage::getBaseDir(), '', $this->newFile->getPathname());\n\n /** @var Tiny_CompressImages_Model_Image */\n $this->_model = Mage::getModel('tiny_compressimages/image');\n $this->_model->setPath($path);\n $this->_model->setImageType($this->destinationSubdir);\n $this->_model->setHashBefore($this->hashBefore);\n $this->_model->setBytesBefore($this->bytesBefore);\n\n return $this;\n }", "function key_filter_and(array $filter) {\n\t\t$args = func_get_args ();\n\t\tarray_unshift ( $args, 'and' );\n\t\treturn call_user_func_array ( array (\n\t\t\t\t$this,\n\t\t\t\t'key_filter_operator' \n\t\t), $args );\n\t}", "abstract protected function perform_and($first, $second);", "public function createConcatenation();", "function compressor($options=false) {\n\n\t\t//Allow merging of other classes with this one\n\t\tforeach($options AS $key=>$value) {\n\t\t$this->$key = $value;\n\t\t}\n\n\t\t//Set options\n\t\t$this->set_options();\n\t\t\n\t\t//Define the gzip headers\n\t\t$this->set_gzip_headers();\n\t\t\n\t\t//Start things off\n\t\t$this->start();\n\t\n\t}", "public function combine($criterions = array(), $operator = \"AND\", $name = null);", "function Compress(){\r\n\r\n\t // Compress the code with gzip\r\n\t $Code = base64_encode(gzdeflate($this->GetCompiledCode()));\r\n\r\n\t // This is the code to reverse obfuscation and run the code\r\n\t $reverseCode = 'gzinflate(base64_decode('.$this->InsertCodeTag.'))';\r\n\r\n\t // Build the code all nice and formatted\r\n\t $Code = $this->MakeCode($Code, $reverseCode);\r\n\r\n\t // Save the changes made to the obfuscated code\r\n\t $this->SetCompiledCode($Code);\r\n }", "function and_ () {\n $this->where_ .= ' AND ';\n $this->conjunked = true;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compile a "where null" clause.
protected function whereNull(Builder $query, $where) { return $this->wrap($where['column']).' is null'; }
[ "function null()\n{\n return new Expr\\Expression('%s IS NULL', []);\n}", "public static function whereIsNull($parameter);", "public function where_null($field,$is_null=true)\n {\n $is_txt=\" IS NULL\";\n if(!$is_null)\n {\n $is_txt = \" IS NOT NULL\";\n }\n if($this->where!=\"\")\n {\n if($this->check_bracket())\n {\n $this->where = $this->where.\" \".$field.\" \".$is_txt;\n }\n else {\n $this->where = $this->where.\" AND \".$field.\" \".$is_txt;\n }\n }\n else {\n $this->where = $field.\" IS NULL\";\n }\n return $this;\n }", "protected function whereNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is null';\n }", "public function orWhereNull($col);", "public function whereNull($field) {\n\t\treturn $this->addCondition('AND', $field, new Expr('NULL'), 'IS');\n\t}", "public function get_where_clause() {\n\t\treturn ' 1 = 0 ';\n\t}", "function blank()\n{\n return new Expr\\Expression('%s IS NULL OR NOT %s', []);\n}", "public function whereNull($key = null);", "public function whereNull($field);", "protected function buildWhereNullConstraint(Builder|EloquentBuilder $query): Builder|EloquentBuilder\n {\n if ($this->logical() === FieldCriteria::OR) {\n return $query->orWhereNull($this->field());\n }\n\n return $query->whereNull($this->field());\n }", "public static function whereNull($column);", "public static function orWhereNull($column) {\n \n }", "function nullCondition($field, $emptyStringIsNull=false)\n {\n $result = \"$field IS NULL\";\n if ($emptyStringIsNull)\n $result = \"($result OR $field = '')\";\n return $result;\n }", "public function where_null($column_name) {\n $column_name = $this->_quote_identifier($column_name);\n return $this->_add_where(\"{$column_name} IS NULL\");\n }", "function selectFromWhereNull($element,$table,$whereEl, $whereVal, $colIsNull) {\r\n \r\n if((isset($whereEl) && $whereEl != '') && (isset($whereVal) && $whereVal != '')) $where = \" WHERE \".$whereEl.\"='\".$whereVal.\"' AND $colIsNull IS NULL\";\r\n else $where = \"WHERE $colIsNull IS NULL\";\r\n \r\n $isNull = \r\n \r\n $pdo = $this -> getConn();\r\n \r\n $query = \"SELECT \".$element.\" FROM \".$table.$where;\r\n $reponse = $pdo->query($query);\r\n \r\n $reponses = NULL;\r\n while($message = $reponse->fetch()) {\r\n \r\n $reponses[] = $message;\r\n \r\n }\r\n $reponse->closeCursor();\r\n \r\n return $reponses;\r\n \r\n }", "protected function getCompiledWhereClause()\n {\n if (empty($this->where)) {\n return '';\n }\n \n $conditions = '';\n \n foreach ($this->where as $key => $where) {\n $conditions .= $where['logic_operator'] . ' '\n . $where['params']['field'] . ' '\n . $where['params']['operator'] . ' '\n . \"'\" .$where['params']['value'] . \"'\" .' ';\n }\n \n $conditions = '(' . ltrim(ltrim($conditions, 'or'), 'and') . ')';\n \n return 'where ' . trim($conditions);\n }", "public function whereNull($key = null)\n {\n return $this->whereStrict($key, null);\n }", "protected function whereNotNull(Builder $builder, $where): string\n {\n return $this->wrap($where['column']).' is not null';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }