query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
use test delete comment ok compare with code 200 | public function test_delete_comment_notok() {
$rs = Comment::delete_comment(0);
$this->assertEquals('3003', $rs['meta']['code']);
} | [
"public function testCommentDelete()\n {\n }",
"public function testDeleteComment()\n {\n }",
"public function testDeleteComment()\n {\n\n }",
"public function testDelete()\n {\n $this->actingAs($this->user)\n ->visit($this->project->getSlug())\n ->type('Screw you guys I\\'m going home.', 'comment_body')\n ->press('submit-comment')\n ->press('comment-delete')\n ->dontSeeInDatabase('project_comments', ['comment_body' => 'Screw you guys I\\'m going home.'])\n ->see('Comment deleted');\n }",
"public function testDeleteTaskComment()\n {\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 }",
"public function testDeleteComment() {\n\t\t$userParams = [ \n\t\t\t\t\"username\" => \"kaiqiang-test\",\n\t\t\t\t\"email\" => \"kaiqiang-test@gmail.com\",\n\t\t\t\t\"passwd\" => \"test-delete\"\n\t\t];\n\t\t\n\t\t$id = $this->usersDAO->insert ( $userParams );\n\t\t\n\t\t$result = $this->usersDAO->delete ( $id );\n\t\t\n\t\t// expect delete to delete 0 rows\n\t\t$this->assertEqual ( $result, 1 );\n\t}",
"function test_UnidadMedidas_Delete_Validate_Id()\n { \n $this->json('DELETE', 'api/v1/unidadmedida/31', ['Content-Type' =>'application/json', 'Accept' => 'application/json'])\n ->assertStatus(404)\n ->assertJson([\n 'message' => 'Detalle de la UnidadMedida',\n 'status'=>'not found'\n ]);\n }",
"public function testDeleteCommentFailure()\n\t{\n\t\t$exception = false;\n\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 500;\n\t\t$returnData->body = $this->errorString;\n\n\t\t$this->client->expects($this->once())\n\t\t\t->method('delete')\n\t\t\t->with('/gists/comments/254')\n\t\t\t->will($this->returnValue($returnData));\n\n\t\ttry\n\t\t{\n\t\t\t$this->object->comments->delete(254);\n\t\t}\n\t\tcatch (DomainException $e)\n\t\t{\n\t\t\t$exception = true;\n\n\t\t\t$this->assertThat(\n\t\t\t\t$e->getMessage(),\n\t\t\t\t$this->equalTo(json_decode($this->errorString)->message)\n\t\t\t);\n\t\t}\n\t\t$this->assertTrue($exception);\n\t}",
"public function test_delete_204() {\n $response = $this->put('/api/books', [[\"id\" => 1], [\"id\" => 2]]);\n $response->assertStatus(204);\n }",
"public function testPostPrototypeDeleteComments()\n {\n\n }",
"public function testDeleteEnvelopeComment()\n {\n }",
"public function test_postPrototypeDeleteComments() {\n\n }",
"public function testDeleteComments()\n {\n $remoteDataFolder = self::$baseRemoteFolderPath . \"/Comments\";\n $localFile = \"Common/test_multi_pages.docx\";\n $remoteFileName = \"TestDeleteComment.docx\";\n\n $this->uploadFile(\n realpath(__DIR__ . '/../../..') . \"/TestData/\" . $localFile,\n $remoteDataFolder . \"/\" . $remoteFileName\n );\n\n $request = new DeleteCommentsRequest(\n $remoteFileName,\n $remoteDataFolder,\n NULL,\n NULL,\n NULL,\n NULL,\n self::$baseTestOutPath . \"/\" . $remoteFileName,\n NULL,\n NULL\n );\n\n Assert::assertNull($this->words->deleteComments($request));\n }",
"public function test_news_delete()\n {\n // Given data\n\n $row = News::factory()->create([\n \"title\" => \"New news title\",\n \"content\" => \"New news content\"\n ]);\n\n // acting \n $this->json('DELETE', 'api/news/'. $row->id, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"success\",\n \"message\"\n ])\n ->assertJson([\n \"success\" => true,\n \"message\" => 'News record successfully deleted!'\n ]);\n }",
"public function fseo_tt_delete_comment()\n {\n $id = $_POST['commentId'];\n $res = wp_delete_comment($id);\n\n echo json_encode(['status' => $res ? 'success' : 'fail']);\n die();\n }",
"public function testDeleteValidRequest()\n {\n $response = $this->delete('/shop/1',[],[\n 'Authorization' => \"bearer \" . $this->token\n ]);\n\n\n $response\n ->assertStatus(200);\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 test_deleteAsn() {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a nice css name | public function getCSSName()
{
return strtolower(preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $this->getClassName()));
} | [
"abstract public function getCssName();",
"public function getCssName(){\n return $this->dir.$this->palette.$this->styles.'.css';\n }",
"public function generateStyleName()\n {\n self::$styleNameMaxNumber ++;\n return self::styleNamePrefix . self::$styleNameMaxNumber;\n }",
"public function generateStyleName() {\n\t\tself::$styleNameMaxNumber ++;\n\t\treturn self::styleNamePrefix . self::$styleNameMaxNumber;\n\t}",
"private function format_css(): string {\r\n return JKNCSS::tag('\r\n \r\n div.'.self::cl_iss_meta.' span {\r\n display: block;\r\n }\r\n\r\n span.'.self::cl_iss_name.' {\r\n font-size: 14px;\r\n }\r\n\r\n div.'.self::cl_iss_thumb.' {\r\n padding-top: 5px;\r\n }\r\n\r\n div.'.self::cl_iss_panel.' {\r\n text-align: center;\r\n }\r\n\r\n div.'.self::cl_iss_panel.' a {\r\n display: block;\r\n }\r\n\r\n div.'.self::cl_iss_panel.' a:hover {\r\n background-color: rgba(17,65,111,0.15);\r\n }\r\n \r\n ');\r\n }",
"abstract protected function get_css_file_name();",
"public function getCssClassName()\n\t{\n\t\treturn $this->cssClassName . $this->counter;\n\t}",
"public function getName(){\n\t\treturn 'SCSS';\n\t}",
"function cssuni($name)\n{\n\t$cssbegin = '<link rel=\"stylesheet\" href=\"';\n\t$cssend = '\">';\n\t$csspath = '/css/';\n//\tif (current_user_can('administrator')) $csspath = '/css/';\n//\telse $csspath = '/css-min/'; //$csspath='/css-min/';\n\t$filename = get_stylesheet_directory() . $csspath . $name;\n\tif (file_exists($filename)) return $cssbegin . get_template_directory_uri() . $csspath . $name . '?v=' . filemtime($filename) . $cssend;\n\treturn $cssbegin . get_template_directory_uri() . $csspath . $name . $cssend;\n}",
"protected function getStyleName() {\n if ($this->realField !== 'type_style') {\n $style_name = str_replace('type_style_', '', $this->realField);\n }\n else {\n $style_name = $this->options['type_style_name'];\n }\n return $style_name;\n }",
"function CSS($name,$hash)\n {\n $comps=array();\n foreach ($hash as $key => $value)\n {\n array_push($comps,\" \".$key.\": \".$value.\";\");\n }\n\n return\n $name.\"\\n\".\n \"{\\n\".\n join(\"\\n\",$comps).\n \"\\n}\\n\";\n }",
"function getStyleName() {\n\t\treturn $this->name;\n\t}",
"public function getStyleName()\n {\n return $this->name;\n }",
"public function cssPrefix() {\n\t\treturn \"\";\n\t}",
"public function getStyleName()\n {\n return $this->style_name;\n }",
"private function format_css(): string {\r\n\r\n \t$main = MJKCommonTools::colour('main');\r\n\r\n return JKNCSS::tag('\r\n div.'.self::cl_embed.' {\r\n margin-bottom: 20px;\r\n }\r\n \r\n div.'.self::cl_embed.' .wpb_wrapper div {\r\n margin: auto;\r\n }\r\n \r\n div.'.self::cl_embed.' {\r\n text-align: center;\r\n }\r\n \r\n p.'.self::cl_notes.' {\r\n font-family: \\'Roboto\\', sans-serif;\r\n margin-top: 25px;\r\n }\r\n \r\n p.'.self::cl_back.' {\r\n display: block;\r\n font-size: small;\r\n font-family: \\'Roboto\\', sans-serif;\r\n }\r\n \r\n p.'.self::cl_back.' a:hover {\r\n text-decoration: underline;\r\n }\r\n \r\n p.'.self::cl_website.' {\r\n font-style: italic;\r\n }\r\n \r\n\t\t\t.'.self::cl_cat_grid.' {\r\n\t\t\t\tpadding-bottom: 10px;\r\n\t\t\t\tmargin-bottom: 30px;\r\n\t\t\t\tborder-bottom: 1px solid #222;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.'.self::cl_cat_row.' {\r\n\t\t\t\tmargin-bottom: 25px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.'.self::cl_post_title.' h4 {\r\n\t\t\t\tmargin-top: 0px;\r\n\t\t\t\tmargin-bottom: 0px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.'.self::cl_post_title.' {\r\n\t\t\t\tmargin-bottom: 10px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.'.self::cl_post_thumb.' {\r\n\t\t\t\theight: 200px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.'.self::cl_post_panel.' {\r\n\t\t\t\tborder: 1px solid '.JKNColours::hex_to_rgba($main, 0.2).';\r\n\t\t\t\tborder-radius: 10px;\r\n\t\t\t\tpadding: 10px;\r\n\t\t\t\tvertical-align: middle;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.'.self::cl_post_panel.':hover {\r\n\t\t\t\tbackground: '.JKNColours::hex_to_rgba($main, 0.1).';\r\n\t\t\t} \r\n ');\r\n }",
"public function convertNameToCssId()\n {\n return hash('adler32', $this->name);\n }",
"public function getStyleName() {\n return $this->stack [$this->index]->getStyleName();\n }",
"public function getCustomCSSAsString()\n {\n // Create CSS String:\n \n $css = implode(\"\\n\", $this->getCustomCSS());\n \n // Remove Empty Lines:\n \n $css = ViewTools::singleton()->removeEmptyLines($css);\n \n // Trim CSS String:\n \n $css = trim($css);\n \n // Minify CSS String:\n \n if (!Director::isDev()) {\n $css = ViewTools::singleton()->minifyCSS($css);\n }\n \n // Answer CSS String:\n \n return $css;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets list of week day names using given width and locale. | public function getDayOfWeekNames($width = null, $locale = null)
{
return $this->localeSettings->getCalendar($locale)->getDayOfWeekNames($width);
} | [
"function dtlDayNames($languageCode = '') {\n // or in the current language if $lanuageCode not specified\n // check language code:\n dtlNormalizeLanguageCode($languageCode);\n if (!dtlIsSupportedLanguage($languageCode)) {\n return false;\n }\n // setup day names array that matches user's week settings:\n global $dtlLanguages;\n $result = [];\n for ($dow = 1; $dow <= 7; $dow++) {\n $result[$dow] = $dtlLanguages[$languageCode]['dayNames'][$dow];\n }\n return $result;\n}",
"public static function get_short_days_names() {\n\t\treturn array(\n\t\t\tesc_html__( 'Su', Forminator::DOMAIN ),\n\t\t\tesc_html__( 'Mo', Forminator::DOMAIN ),\n\t\t\tesc_html__( 'Tu', Forminator::DOMAIN ),\n\t\t\tesc_html__( 'We', Forminator::DOMAIN ),\n\t\t\tesc_html__( 'Th', Forminator::DOMAIN ),\n\t\t\tesc_html__( 'Fr', Forminator::DOMAIN ),\n\t\t\tesc_html__( 'Sa', Forminator::DOMAIN ),\n\t\t);\n\t}",
"public function getWeekdayNames(): array\n {\n return [\n 1 => \"Monday\",\n 2 => \"Tuesday\",\n 3 => \"Wednesday\",\n 4 => \"Thursday\",\n 5 => \"Friday\",\n 6 => \"Saturday\",\n 7 => \"Sunday\"\n ];\n }",
"function api_get_week_days_short($language = null) {\n\t$days = &_api_get_day_month_names($language);\n\treturn $days['days_short'];\n}",
"public function get_weekdays() {\n return array(\n 0 => array(\n 'shortname' => get_string('wday0', 'calendartype_hijri'),\n 'fullname' => get_string('weekday0', 'calendartype_hijri')\n ),\n 1 => array(\n 'shortname' => get_string('wday1', 'calendartype_hijri'),\n 'fullname' => get_string('weekday1', 'calendartype_hijri')\n ),\n 2 => array(\n 'shortname' => get_string('wday2', 'calendartype_hijri'),\n 'fullname' => get_string('weekday2', 'calendartype_hijri')\n ),\n 3 => array(\n 'shortname' => get_string('wday3', 'calendartype_hijri'),\n 'fullname' => get_string('weekday3', 'calendartype_hijri')\n ),\n 4 => array(\n 'shortname' => get_string('wday4', 'calendartype_hijri'),\n 'fullname' => get_string('weekday4', 'calendartype_hijri')\n ),\n 5 => array(\n 'shortname' => get_string('wday5', 'calendartype_hijri'),\n 'fullname' => get_string('weekday5', 'calendartype_hijri')\n ),\n 6 => array(\n 'shortname' => get_string('wday6', 'calendartype_hijri'),\n 'fullname' => get_string('weekday6', 'calendartype_hijri')\n ),\n );\n }",
"public function getDayNames()\n {\n $days = collect($this->definition['days'])->filter()->keys()->map(function ($val) {\n return ucfirst($val);\n });\n\n return $days->count() == 0 ? collect([strtolower($this->getRangeStart()->format('D'))]) : $days;\n }",
"public function get_weekdays() {\n return array(\n 0 => array(\n 'shortname' => get_string('sun', 'calendar'),\n 'fullname' => get_string('sunday', 'calendar')\n ),\n 1 => array(\n 'shortname' => get_string('mon', 'calendar'),\n 'fullname' => get_string('monday', 'calendar')\n ),\n 2 => array(\n 'shortname' => get_string('tue', 'calendar'),\n 'fullname' => get_string('tuesday', 'calendar')\n ),\n 3 => array(\n 'shortname' => get_string('wed', 'calendar'),\n 'fullname' => get_string('wednesday', 'calendar')\n ),\n 4 => array(\n 'shortname' => get_string('thu', 'calendar'),\n 'fullname' => get_string('thursday', 'calendar')\n ),\n 5 => array(\n 'shortname' => get_string('fri', 'calendar'),\n 'fullname' => get_string('friday', 'calendar')\n ),\n 6 => array(\n 'shortname' => get_string('sat', 'calendar'),\n 'fullname' => get_string('saturday', 'calendar')\n ),\n );\n }",
"private function getWeekDays()\n {\n $time = date('Y-m-d', strtotime($this->year . '-' . $this->month . '-' . $this->day));\n if ($this->view == 'week') {\n $sunday = strtotime('last sunday', strtotime($time . ' +1day'));\n $day = date('j', $sunday);\n $startingDay = date('N', $sunday);\n $cnt = 6;\n }\n if ($this->view == 'day') {\n $day = $this->day;\n $cnt = 0;\n }\n\n $this->week_days = array();\n $mlen = $this->daysMonth[intval($this->month) - 1];\n if ($this->month == 2 && ((($this->year % 4) == 0) && ((($this->year % 100) != 0) || (($this->year % 400) == 0)))) {\n $mlen = $mlen + 1;\n }\n $h = \"<tr class='\" . $this->labelsClass . \"'>\";\n $h .= \"<td> </td>\";\n for ($j = 0; $j <= $cnt; $j++) {\n $cs = $cnt == 0 ? 3 : 1;\n $h .= \"<td colspan='$cs'>\";\n if ($this->view == 'day') {\n $getDayNumber = date('w', strtotime($time));\n } else {\n $getDayNumber = $j;\n }\n if ($day <= $mlen) {\n } else {\n $day = 1;\n }\n $h .= $this->dayLabels[$getDayNumber] . ' ';\n $h .= intval($day);\n $this->week_days[] = $day;\n $day++;\n $h .= \"</td>\";\n }\n\n $h .= \"</tr>\";\n return $h;\n }",
"public static function getDayShortList()\n {\n return [1 => _('Mon'), 2 => _('Tue'), 3 => _('Wed'), 4 => _('Thu'), 5 => _('Fri'), 6 => _('Sat'), 7 => _('Sun')];\n }",
"public function getWeekDayName(): string;",
"public function getDaysNames()\n {\n $defaultArray = array(\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday'\n );\n $val = $this->getValue(NumberFormatInfo::DICT_DATETIME_DAYSNAMES);\n return is_null($val) ? $defaultArray : $val;\n }",
"public function daysOfWeek() {\n return array(\n 0 => 'sunday',\n 1 => 'monday',\n 2 => 'tuesday',\n 3 => 'wednesday',\n 4 => 'thursday',\n 5 => 'friday',\n 6 => 'saturday');\n }",
"function dspDayNames ( )\n {\n $names = array('2004-10-24','2004-10-25','2004-10-26','2004-10-27','2004-10-28'\n ,'2004-10-29','2004-10-30',);\n \n $output = '<tr>';\n \n for( $i=0; $i<7; $i++ ) \n {\n $output .= '<th width=\"14%\">'.strftime( $this->dayNameFmt, strtotime($names[$i]) ).'</th>';\n }\n \n $output .= '</tr>';\n return $output;\n }",
"public function getWeekDayName()\r\n {\r\n $days = self::getDaysOfWeek();\r\n\r\n return $days[$this->getDayOfWeek()];\r\n }",
"public function getDaysOfWeek() {\n\t\t$timestamp = strtotime( 'next Sunday' );\n\t\t$days = array();\n\t\tfor ( $i = 0; $i < 7; $i ++ ) {\n\t\t\t$days[] = strftime( '%A', $timestamp );\n\t\t\t$timestamp = strtotime( '+1 day', $timestamp );\n\t\t}\n\n\t\treturn apply_filters( 'wd_scan_get_days_of_week', $days );\n\t}",
"function getDaysOfTheWeek() {\n return array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');\n}",
"public static function daysofWeekOptions()\r\n\t{\r\n\t\tglobal $lang;\r\n\t\treturn \tarray(''=>$lang['survey_416'], \"DAY\"=>$lang['global_96'], \"WEEKDAY\"=>$lang['global_97'], \"WEEKENDDAY\"=>$lang['global_98'], \r\n\t\t\t\t\t\"SUNDAY\"=>$lang['global_99'], \"MONDAY\"=>$lang['global_100'], \"TUESDAY\"=>$lang['global_101'], \r\n\t\t\t\t\t\"WEDNESDAY\"=>$lang['global_102'], \"THURSDAY\"=>$lang['global_103'], \"FRIDAY\"=>$lang['global_104'],\r\n\t\t\t\t\t\"SATURDAY\"=>$lang['global_105']);\r\n\t}",
"protected function renderCalendarDaysOfWeek() {\n\t\t$weekDay = array(\n\t\t\t$this->pi_getLL('sunday'),\n\t\t\t$this->pi_getLL('monday'),\n\t\t\t$this->pi_getLL('tuesday'),\n\t\t\t$this->pi_getLL('wednesday'),\n\t\t\t$this->pi_getLL('thursday'),\n\t\t\t$this->pi_getLL('friday'),\n\t\t\t$this->pi_getLL('saturday')\n\t\t);\n\t\t$week = array();\n\t\tfor ($i = 0; $i <= 6; $i++) {\n\t\t\t$week[] = $weekDay[($i + $this->weekBegins) % 7];\n\t\t}\n\n\t\t$content = '';\n\t\tforeach ($week AS $dayOfWeek) {\n\t\t\t$this->tempCObj->data = array();\n\t\t\t$this->tempCObj->data['dayOfWeek'] = $dayOfWeek;\n\t\t\t$content .= $this->tempCObj->cObjGetSingle($this->confWidget['renderCalendarDaysOfWeek'], $this->confWidget['renderCalendarDaysOfWeek.']);\n\t\t}\n\t\treturn $content;\n\t}",
"public function getWeekDays()\n {\n return $this->weekDayList;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query by a related Area object | public function filterByArea($area, $comparison = null)
{
if ($area instanceof Area) {
return $this
->addUsingAlias(CityPeer::ID, $area->getCityId(), $comparison);
} elseif ($area instanceof PropelObjectCollection) {
return $this
->useAreaQuery()
->filterByPrimaryKeys($area->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByArea() only accepts arguments of type Area or PropelCollection');
}
} | [
"public function filterByArea($area, $comparison = null)\n {\n if ($area instanceof Area) {\n return $this\n ->addUsingAlias(StatePeer::ID, $area->getStateId(), $comparison);\n } elseif ($area instanceof PropelObjectCollection) {\n return $this\n ->useAreaQuery()\n ->filterByPrimaryKeys($area->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByArea() only accepts arguments of type Area or PropelCollection');\n }\n }",
"public function filterByArea($area = null, $comparison = null)\n {\n if (is_array($area)) {\n $useMinMax = false;\n if (isset($area['min'])) {\n $this->addUsingAlias(PropiedadPeer::AREA, $area['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($area['max'])) {\n $this->addUsingAlias(PropiedadPeer::AREA, $area['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PropiedadPeer::AREA, $area, $comparison);\n }",
"public function area()\n {\n return $this->belongsTo(AreaModel::class, 'areaId');\n }",
"public function getAreaFilter()\n {\n return isset($this->area_filter) ? $this->area_filter : null;\n }",
"public function getAreas(){\n $areas = Area::query()->where('estado','A')->orderBy('descripcion', 'asc')->lists('descripcion','id');\n return $areas;\n }",
"public function getArea()\n {\n return $this->hasOne(Area::className(), ['id' => 'area_id']);\n }",
"public function getById($area_id)\n {\n return Area::find($area_id);\n }",
"public function areas()\n {\n return $this->hasMany(CompanyArea::class);\n }",
"public function filterByArea($area = null, $comparison = null)\n {\n if (is_array($area)) {\n $useMinMax = false;\n if (isset($area['min'])) {\n $this->addUsingAlias(AgenciesTableMap::COL_AREA, $area['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($area['max'])) {\n $this->addUsingAlias(AgenciesTableMap::COL_AREA, $area['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AgenciesTableMap::COL_AREA, $area, $comparison);\n }",
"public function setAreaFilter($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Maps\\Playablelocations\\V3\\Sample\\AreaFilter::class);\n $this->area_filter = $var;\n\n return $this;\n }",
"public function Areas()\n {\n return $this->hasMany(Area::class, 'a_governorate_id');\n }",
"public function Area()\n {\n return $this->belongsTo('App\\Area', 'area_name_id','id');\n }",
"public function getAllCitiesByArea()\n {\n return $data=DB::table('city_areas')\n ->join('cities','cities.id','=','city_areas.city_id')\n ->groupby('city_areas.city_id')\n ->select('cities.*')\n ->get();\n }",
"public function getAreasQueryBuilder()\n {\n $builder = $this->getEntityManager()->createQueryBuilder();\n\n return $builder->select(['areas'])\n ->from(\\Shopware\\Models\\Country\\Area::class, 'areas');\n }",
"private function filteredMeetingRoom() {\n\t\treturn $this->center\n\t\t ->where('active_flag', 'Y')\n\t\t ->where('city_id', '!=', 0)\n\t\t ->where(function ($q) {\n\t\t\t\t$q->whereHas('center_filter', function ($q) {\n\t\t\t\t\t\t$q->where('meeting_room', 1);})->orWhere(function ($q) {\n\t\t\t\t\t\t$q->has('center_filter', '<', 1);\n\t\t\t\t\t});\n\t\t\t});\n\t}",
"public function area($id)\n {\n return $this->builder->where('arina_brand_id', $id);\n }",
"public function addActiveFilter()\n {\n $this->addFieldToFilter(AreaInterface::IS_ENABLED, 1);\n return $this;\n }",
"public function filterByAreaId($areaId = null, $comparison = null)\n\t{\n\t\tif (is_array($areaId)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($areaId['min'])) {\n\t\t\t\t$this->addUsingAlias(TicketPeer::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($areaId['max'])) {\n\t\t\t\t$this->addUsingAlias(TicketPeer::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(TicketPeer::AREA_ID, $areaId, $comparison);\n\t}",
"public function scopeByArea(Builder $query, $area)\n {\n if ($area instanceof Area)\n $area = $area->id;\n\n return $query->where('area_id', $area);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transform a faultobject to an array in format array('field' => $this>field, 'message' => $this>message) and return this array. | public function toArray() {
return array('field' => $this->field, 'message' => $this->message);
} | [
"public function to_array() {\n\t\t\t$fields = array();\n\n\t\t\tforeach ( $this->fields as $field ):\n\t\t\t\t$fields[ $field->name() ] = $field->value();\n\t\t\tendforeach;\n\n\t\t\treturn $fields;\n\t\t}",
"public function returnFields()\r\n {\r\n if(!$this->_fields) {\r\n $attributes = $this->attributes;\r\n $fields = [];\r\n foreach($attributes as $attribute) {\r\n $config = Field::normalizeObject($attribute);\r\n $field = Yii::createObject($config);\r\n $fields[] = $field;\r\n }\r\n $this->_fields = $fields;\r\n }\r\n return $this->_fields;\r\n }",
"public function toFieldMessageArray()\n {\n return[\n $this->getFieldName() => $this->getViolationMessage()\n ];\n }",
"public function toFullArray() : array\n {\n //convert the obj to array in order to convert to json\n $result = get_object_vars($this);\n\n $modelPhalconProperties = [\n 'container',\n 'dirtyState',\n 'dirtyRelated',\n 'errorMessages',\n 'modelsManager',\n 'modelsMetaData',\n 'related',\n 'oldSnapshot',\n 'skipped',\n 'snapshot',\n 'transaction',\n 'uniqueKey',\n 'uniqueParams',\n 'uniqueTypes',\n 'auditExcludeFields',\n 'eventsManager',\n 'settingsModel',\n 'operationMade'\n ];\n foreach ($result as $key => $value) {\n if (preg_match('#^_#', $key) === 1 || in_array($key, $modelPhalconProperties)) {\n unset($result[$key]);\n }\n\n //avoid issue with elastic\n if ($value === '0000-00-00 00:00:00') {\n $result[$key] = null;\n }\n }\n\n //remove properties we add\n unset($result['customFields'], $result['uploadedFiles']);\n\n return $result;\n }",
"public function toArray(): array\n {\n return [\n 'message' => $this->message,\n ];\n }",
"public function createObjectAsArray()\n {\n $object = [];\n foreach ($this->fields as $field) {\n $object[$field] = null;\n }\n\n return $object;\n }",
"protected function toArray() {\n $data = [];\n foreach ($this->fillable as $key) {\n $data[$key] = $this->{$key};\n }\n return $data;\n }",
"final public static function getFieldsArray()\n {\n \treturn array_merge(parent::getFieldsArray(), self::$fields);\n }",
"public function getData() {\n $result = array();\n foreach ($this->log_entry_fields as $field) {\n $result[$field] = $this->$field;\n }\n return $result;\n }",
"function getRecord()\n\t\t{\n\n\t\t\t// inizializzo l'array da ritornare\n\t\t\t$result = array();\n\t\t\t// per ogni campo della tabella\n\t\t\tforeach ($this->fields as $key => $value) {\n\t\t\t\t// aggiungo all'array l'associazione campo => valore (eventualmente convertito per la visualizzazione)\n\t\t\t\t$result[$key] = $this->getField($key);\n\t\t\t}\n\t\t\t// ritorno l'array\n\t\t\treturn $result;\n\t\t}",
"public function toArray(): array\n\t{\n\t\treturn [\n\t\t\t'FILTER_ID' => $this->getID(),\n\t\t\t'FILTER' => $this->getFieldArrays(),\n\t\t\t'FILTER_PRESETS' => [],\n\t\t\t'ENABLE_LABEL' => true,\n\t\t\t'THEME' => Theme::LIGHT,\n\t\t\t'CONFIG' => [\n\t\t\t\t'AUTOFOCUS' => false,\n\t\t\t],\n\t\t];\n\t}",
"public function getWholeEntity(): array\n {\n $fields = get_object_vars($this);\n $fieldsWithValues = [];\n\n foreach ($fields as $field => $value) {\n $fieldsWithValues[$field] = $value;\n }\n\n return $fieldsWithValues;\n }",
"public function toArray()\n\t\t\t{\n\n\t\t\t\t$vars = get_class_vars($this);\n\t\t\t\t$return = Array();\n\t\t\t\tforeach ($vars as $var_name => $var_value)\n\t\t\t\t{\n\t\t\t\t\tif ($this->$var_name instanceof BaseObject)\n\t\t\t\t\t{\n\t\t\t\t\t\t$return[$var_name] = $this->$var_name->toArray();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$return[$var_name] = $this->$var_value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $return;\n\n\t\t\t}",
"public function getFillableFields(): array;",
"public function toArray(MessageInterface $message);",
"public function to_array() {\n\t\treturn $this->apply_render_strategy( $this->messages );\n\t}",
"public function toSerializableArray() : array {\n\t\t\t$ret = [];\n\n\t\t\tif (count($this->dbFields) > 0) {\n\t\t\t\tforeach ($this->dbFields as $property => $field) {\n\t\t\t\t\tif ($field->type->is(BaseDbTypes::DATETIME) && $this->{$property} !== null) {\n\t\t\t\t\t\t$ret[$property] = $this->{$property}->format('Y-m-d H:i:s');\n\t\t\t\t\t} else if ($this->{$property} instanceof EnumBase) {\n\t\t\t\t\t\t$ret[$property] = $this->{$property}->getValue();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ret[$property] = $this->{$property};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $ret;\n\t\t}",
"public function toSlackObjectArray(): array;",
"public function to_array()\n\t{\n\t\treturn $this->fields_as_associative_array();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
phasing the project module in time. Phasing is a combination of module standard phasing strategy and project defined milestones | function techproject_phase($project, $style = '') {
global $DB, $COURSE;
$time = time();
$course = $DB->get_record('course', array('id' => $project->course));
$currentgroupid = 0 + groups_get_course_group($COURSE);
// Getting all timed info.
$sql = "
SELECT
m.*,
deadline as phasedate,
'milestone' as type
FROM
{techproject_milestone} as m
WHERE
projectid = ? AND
groupid = ? AND
deadlineenable = 1
";
$dated = $DB->get_records_sql($sql, array($project->id, $currentgroupid));
$adated = new StdClass;
$adated->id = 'projectstart';
$adated->phasedate = $project->projectstart;
$adated->ordering = 0;
$dated[] = $adated;
$adated = new StdClass;
$adated->id = 'projectend';
$adated->phasedate = $project->projectend;
$adated->ordering = count($dated) + 1;
$dated[] = $adated;
function sortbydate($a, $b) {
if ($a->phasedate == $b->phasedate) {
return 0;
}
return ($a->phasedate < $b->phasedate) ? -1 : 1;
}
usort($dated, "sortbydate");
$i = 0;
while ($time > $dated[$i]->phasedate && $i < count($dated) - 1) {
$i++;
}
if ($dated[$i]->id == 'projectstart') {
return get_string('phasestart', 'techproject');
} else if ($dated[$i]->id == 'projectend') {
return get_string('phaseend', 'techproject');
} else {
$formated = format_time($dated[$i]->phasedate - $time);
return "M{$dated[$i]->ordering} : {$dated[$i]->abstract} (<font color=\"green\">".$formated."</font>)";
}
} | [
"function cron() {\n\t\t//look at the clock.\n\t\t$now = strtotime('now');\n\t\t\n\t\t//check for the hack\n\t\tif(Configure::read('debug') != 0 && isset($this->params['named']['time_machine'])){\n\t\t\t$now = strtotime($this->params['named']['time_machine']);\n\t\t}\n\t\t\n\t\t$this->Project->upgradeProjects($now);\n\t}",
"public function schedule()\n\t{\n\t\tif (! $this->is_leader) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$pageno = I('get.p', 1, 'intval');\n $pagesize = C('pagesize');\n $limit = $pageno . ',' . $pagesize;\n\n\t\t$uid \t = $this->uid;\n\t\t$username = $this->username;\n\t\t$time = time();\n\n\t\t$where = array();\n\t\t$where = array(\n\t\t\t'leader_uid' => array('EQ', $uid),\n\t\t\t's_time'\t => array('ELT', $time),\n\t\t\t'status' => array('NEQ', 3)\n\t\t);\n\n\t\t$projectModel = M('project');\n\t\t$projectArr = $projectModel\n\t\t\t->where($where)\n\t\t\t->order('status asc, s_time desc, id asc')\n\t\t\t->page($limit)\n\t\t\t->select();\n\n\t\t$total = $projectModel->where($where)->count();\n $Page = new \\Think\\Page($total, $pagesize);\n $Page->setConfig('prev', '«上一页');\n $Page->setConfig('next', '下一页»');\n $show = $Page->show();\n\n $startable_num = get_startable_projects_num($uid);\n $finished_num = get_markable_projects_num($uid);\n\n $this->assign('data', $projectArr);\n $this->assign('show', $show);\n $this->assign('pagenum', $Page->totalPages);\n $this->assign('index', $Page->firstRow+1);\n $this->assign('startable_num', $startable_num);\n $this->assign('finished_num', $finished_num);\n $this->assign('uid',\t $this->uid);\n $this->assign('truename', $this->truename);\n\t\t$this->display();\n\t}",
"function GanttSave() {\n\t\t$projectid = Request::get('projectid', Request::R_INT);\n\n\t\tif ($this->User->HasUserItemAccess('projects',$projectid,CU_ACCESS_WRITE)) {\n\n\t\t\tif (Request::get('projectDateStart') && Request::get('projectDateEnd')) {\n\t\t\t\t// move project\n\n\t\t\t\t// get the current project start/ end dates\n\t\t\t\t$projectSQL = sprintf(SQL_GET_PROJECT_NAME_DATES_COLOUR,$projectid);\n\t\t\t\t$project = $this->DB->QuerySingle($projectSQL);\n\t\t\t\t$project['StartDate'] = strtotime($project['StartDate']);\n\t\t\t\t$project['EndDate'] = strtotime($project['EndDate']);\n\n\t\t\t\t// get the relativie number of days the project has been moved\n\t\t\t\t$newProjectStartDate = strtotime(Request::get('projectDateStart'));\n\t\t\t\t$newProjectEndDate = strtotime(Request::get('projectDateEnd'));\n\t\t\t\t$daysDifference = round(($newProjectStartDate - $project['StartDate']) / 60 / 60 / 24);\n\n\t\t\t\t// get a list of all the projects tasks and start/ end dates\n\t\t\t\t$projectsTaskDatesSQL = sprintf(SQL_GET_PROJECTS_TASKS_START_END_DATE,$projectid);\n\t\t\t\t$projectsTaskDates = $this->DB->Query($projectsTaskDatesSQL);\n\n\t\t\t\t// move all of the tasks\n\t\t\t\tfor ($i = 0; $i < count($projectsTaskDates); $i++) {\n\n\t\t\t\t\t$projectsTaskDates[$i]['StartDate'] = strtotime($projectsTaskDates[$i]['StartDate']);\n\t\t\t\t\t$newTaskStartDate = date('Y-m-d',mktime(0,0,0,date('m',$projectsTaskDates[$i]['StartDate']),date('d',$projectsTaskDates[$i]['StartDate']) + $daysDifference,date('Y',$projectsTaskDates[$i]['StartDate'])));\n\n\t\t\t\t\t// milestones dont have a end date set\n\t\t\t\t\tif ($projectsTaskDates[$i]['EndDate'] != '0000-00-00') {\n\t\t\t\t\t\t$projectsTaskDates[$i]['EndDate'] = strtotime($projectsTaskDates[$i]['EndDate']);\n\t\t\t\t\t\t$newTaskEndDate = date('Y-m-d',mktime(0,0,0,date('m',$projectsTaskDates[$i]['EndDate']),date('d',$projectsTaskDates[$i]['EndDate']) + $daysDifference,date('Y',$projectsTaskDates[$i]['EndDate'])));\n\t\t\t\t\t}\n\t\t\t\t\telse $newTaskEndDate = '0000-00-00';\n\n\t\t\t\t\t$updateTaskDatesSQL = sprintf(SQL_UPDATE_TASK_DATES,$newTaskStartDate,$newTaskEndDate,$projectsTaskDates[$i]['ID']);\n\t\t\t\t\t$this->DB->Execute($updateTaskDatesSQL);\n\t\t\t\t}\n\t\t\t\t// update the start/ end dates of the project\n\t\t\t\t$updateTaskDatesSQL = sprintf(SQL_UPDATE_PROJECT_DATES,Request::get('projectDateStart'),Request::get('projectDateEnd'),$projectid);\n\t\t\t\t$this->DB->Execute($updateTaskDatesSQL);\n\n\t\t\t\t// tell flash to reload\n\t\t\t\techo 'reloadDataNeeded=YES&';\n\t\t\t}\n\t\t\telse if (Request::get('projectDateEnd')) {\n\t\t\t\t// change project length\n\t\t\t\t$SQL = sprintf(SQL_GANTT_PROJECT_ENDDATE_SAVE,$projectid,Request::get('projectDateEnd'));\n\t\t\t\t$this->DB->Execute($SQL);\n\t\t\t}\n\n\t\t\tif (Request::get('newTask') == 1) {\t// new task\n\t\t\t\t// create the new task (ProjectID, Name, StartDate, EndDate, Duration, Sequence)\n\t\t\t\t$SQL = sprintf(SQL_GANTT_TASK_CREATE,$projectid,Request::get('taskName'),Request::get('taskDateStart'),Request::get('taskDateEnd'),Request::get('taskDuration'),Request::get('taskSequence'));\n\t\t\t\t$this->DB->Execute($SQL);\n\n\t\t\t\t// get the task ID\n\t\t\t\t$taskID = $this->DB->ExecuteScalar(SQL_LAST_INSERT);\n\t\t\t\techo 'taskCreateID='.$taskID.'&';\n\t\t\t}\n\n\t\t\tif (Request::get('taskID', Request::R_INT) && Request::get('taskName')) {\n\t\t\t\t$SQL = sprintf(SQL_GANTT_TASK_NAME_SAVE,Request::get('taskID', Request::R_INT),Request::get('taskName'));\n\t\t\t\t$this->DB->Execute($SQL);\n\t\t\t}\n\n\t\t\tif (Request::get('taskID', Request::R_INT) && Request::get('taskDateStart')) {\n\t\t\t\t$SQL = sprintf(SQL_GANTT_TASK_STARTDATE_SAVE,Request::get('taskID', Request::R_INT),Request::get('taskDateStart'));\n\t\t\t\t$this->DB->Execute($SQL);\n\t\t\t}\n\n\t\t\tif (Request::get('taskID', Request::R_INT) && Request::get('taskDateEnd')) {\n\t\t\t\t$SQL = sprintf(SQL_GANTT_TASK_ENDDATE_SAVE,Request::get('taskID', Request::R_INT),Request::get('taskDateEnd'));\n\t\t\t\t$this->DB->Execute($SQL);\n\t\t\t}\n\n\t\t\tif (Request::get('taskID', Request::R_INT) && (Request::get('taskDateStart') || Request::get('taskDateEnd'))) {\n\t\t\t\t// new code for resources 11/2006\n\n\t\t\t\t// get the new duration of this task that was just saved\n\t\t\t\t$taskSQL = sprintf(GET_TASK_DATES,Request::get('taskID', Request::R_INT));\n\t\t\t\t$task = $this->DB->QuerySingle($taskSQL);\n\n\t\t\t\t// get the day ids for the start and end epoch dates\n\t\t\t\t$taskDaysSQL = sprintf(SQL_GET_DAYID,strtotime($task['StartDate']),strtotime($task['EndDate']));\n\t\t\t\t$taskDays = $this->DB->Query($taskDaysSQL);\n\n\t\t\t\t// delete any task resource days not in the new task day range that have no HoursCompleted\n\t\t\t\t$deleteTaskResourceDaysSQL = sprintf(SQL_DELETE_TASK_RESOURCE_DAY,Request::get('taskID', Request::R_INT),$taskDays[0]['ID'],$taskDays[count($taskDays) - 1]['ID']);\n\t\t\t\t$this->DB->Execute($deleteTaskResourceDaysSQL);\n\t\t\t}\n\n\t\t\tif (Request::get('taskID', Request::R_INT) && Request::get('taskDuration')) {\n\t\t\t\t$SQL = sprintf(SQL_GANTT_TASK_DURATION_SAVE,Request::get('taskID', Request::R_INT),Request::get('taskDuration'));\n\t\t\t\t$this->DB->Execute($SQL);\n\t\t\t}\n\n\t\t\t// *** begin new code added 2006-03 for improvements to Gantt chart\n\t\t\tif (Request::get('taskID', Request::R_INT) && Request::get('taskDependencyID', Request::R_INT) && Request::get('taskDependencyType')) {\n\t\t\t\t\t$SQL = sprintf(SQL_PROJECT_TASK_DEPENDENCY_ADD,Request::get('taskID', Request::R_INT),Request::get('taskDependencyID', Request::R_INT),Request::get('taskDependencyType'));\n\t\t\t\t\t$this->DB->Execute($SQL);\n\t\t\t}\n\n\t\t\tif (Request::get('taskID', Request::R_INT) && Request::get('taskDestinationID', Request::R_INT)) {\n\t\t\t\t\t// get the sequence of the source task\n\t\t\t\t\t$SQL = sprintf(SQL_PROJECT_TASK_GET_SEQUENCE_BY_TASK, Request::get('taskID', Request::R_INT));\n\n\t\t\t\t\t$taskSourceSequence = $this->DB->QuerySingle($SQL);\n\t\t\t\t\t$taskSourceSequence = intval($taskSourceSequence[0]);\n\n\t\t\t\t\t// get the sequence of the destination task\n\t\t\t\t\tif (Request::get('taskDestinationID', Request::R_INT) == -1) $taskDestinationSequence = 1;\n\t\t\t\t\telse {\n\t\t\t\t\t\t\t$SQL = sprintf(SQL_PROJECT_TASK_GET_SEQUENCE_BY_TASK, Request::get('taskDestinationID', Request::R_INT));\n\n\t\t\t\t\t\t\t$taskDestinationSequence = $this->DB->QuerySingle($SQL);\n\t\t\t\t\t\t\t$taskDestinationSequence = intval($taskDestinationSequence[0]);\n\t\t\t\t\t}\n\n\t\t\t\t\t// reorder up or down depending on the source and destination order\n\t\t\t\t\tif ($taskSourceSequence > $taskDestinationSequence) {\n\t\t\t\t\t\t\t$SQL = sprintf(SQL_GANTT_TASK_REORDER_UP,$taskSourceSequence,$taskDestinationSequence);\n\t\t\t\t\t\t\t$this->DB->Execute($SQL);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t\t$SQL = sprintf(SQL_GANTT_TASK_REORDER_DOWN,$taskSourceSequence,$taskDestinationSequence);\n\t\t\t\t\t\t\t$this->DB->Execute($SQL);\n\t\t\t\t\t}\n\t\t\t\t\t// set source task order to destination task order\n\t\t\t\t\t$SQL = sprintf(SQL_GANTT_TASK_REORDER_SET,Request::get('taskID', Request::R_INT),$taskDestinationSequence);\n\t\t\t\t\t$this->DB->Execute($SQL);\n\t\t\t}\n\t\t\t// *** end new code added 2006-03\n\n\t\t\techo 'taskEditSaveStatus=OK';\n\t\t}\n\t\telse {\n\t\t\techo 'taskEditSaveStatus=ERROR&error=Access+Denied';\n\t\t}\n\t}",
"public function getProjectEffort();",
"function promising_print_recent_activity($course, $isteacher, $timestart){\n global $CFG;\n\n // have a look for what has changed in requ\n $changerequcontent = false;\n if (!$isteacher) { // teachers only need to see project\n if ($logs = promising_get_entitychange_logs($course, $timestart, 'changerequ')) {\n // got some, see if any belong to a visible module\n foreach ($logs as $log) {\n // Create a temp valid module structure (only need courseid, moduleid)\n $tempmod = new StdClass;\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n $changerequcontent = true;\n break;\n }\n }\n // if we got some \"live\" ones then output them\n if ($changerequcontent) {\n print_headline(get_string('projectchangedrequ', 'promising').\":\");\n foreach ($logs as $log) {\n //Create a temp valid module structure (only need courseid, moduleid)\n \t$tempmod = new StdClass;\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n if (!has_capability('mod/promising:gradeproject', $context, $log->userid)) { // don't break anonymous rule\n $log->firstname = $course->student;\n $log->lastname = '';\n }\n print_recent_activity_note($log->time, $log, $isteacher, $log->name,\n $CFG->wwwroot.'/mod/promising/'.$log->url);\n }\n }\n }\n }\n }\n\n // have a look for what has changed in specs\n $changespeccontent = false;\n if (!$isteacher) { // teachers only need to see project\n if ($logs = promising_get_entitychange_logs($course, $timestart, 'changespec')) {\n // got some, see if any belong to a visible module\n foreach ($logs as $log) {\n // Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n $changespeccontent = true;\n break;\n }\n }\n // if we got some \"live\" ones then output them\n if ($changespeccontent) {\n print_headline(get_string('projectchangedspec', 'promising').\":\");\n foreach ($logs as $log) {\n //Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n if (!isteacher($course->id, $log->userid)) { // don't break anonymous rule\n $log->firstname = $course->student;\n $log->lastname = '';\n }\n print_recent_activity_note($log->time, $log, $isteacher, $log->name,\n $CFG->wwwroot.'/mod/promising/'.$log->url);\n }\n }\n }\n }\n }\n\n // have a look for what has changed in tasks\n $changetaskcontent = false;\n if (!$isteacher) { // teachers only need to see project\n if ($logs = promising_get_entitychange_logs($course, $timestart, 'changetask')) {\n // got some, see if any belong to a visible module\n foreach ($logs as $log) {\n // Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n $changetaskcontent = true;\n break;\n }\n }\n // if we got some \"live\" ones then output them\n if ($changetaskcontent) {\n print_headline(get_string('projectchangedtask', 'promising').\":\");\n foreach ($logs as $log) {\n //Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n if (!isteacher($course->id, $log->userid)) { // don't break anonymous rule\n $log->firstname = $course->student;\n $log->lastname = '';\n }\n print_recent_activity_note($log->time, $log, $isteacher, $log->name,\n $CFG->wwwroot.'/mod/promising/'.$log->url);\n }\n }\n }\n }\n }\n\n // have a look for what has changed in milestones\n $changemilescontent = false;\n if (!$isteacher) { // teachers only need to see project\n if ($logs = promising_get_entitychange_logs($course, $timestart, 'changemilestone')) {\n // got some, see if any belong to a visible module\n foreach ($logs as $log) {\n // Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n $changemilescontent = true;\n break;\n }\n }\n // if we got some \"live\" ones then output them\n if ($changemilescontent) {\n print_headline(get_string('projectchangedmilestone', 'promising').\":\");\n foreach ($logs as $log) {\n //Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n if (!isteacher($course->id, $log->userid)) { // don't break anonymous rule\n $log->firstname = $course->student;\n $log->lastname = '';\n }\n print_recent_activity_note($log->time, $log, $isteacher, $log->name,\n $CFG->wwwroot.'/mod/promising/'.$log->url);\n }\n }\n }\n }\n }\n\n // have a look for what has changed in milestones\n $changedelivcontent = false;\n if (!$isteacher) { // teachers only need to see project\n if ($logs = promising_get_entitychange_logs($course, $timestart, 'changedeliverable')) {\n // got some, see if any belong to a visible module\n foreach ($logs as $log) {\n // Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n $changedelivcontent = true;\n break;\n }\n }\n // if we got some \"live\" ones then output them\n if ($changedelivcontent) {\n print_headline(get_string('projectchangeddeliverable', 'promising').\":\");\n foreach ($logs as $log) {\n //Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n if (!isteacher($course->id, $log->userid)) { // don't break anonymous rule\n $log->firstname = $course->student;\n $log->lastname = '';\n }\n print_recent_activity_note($log->time, $log, $isteacher, $log->name,\n $CFG->wwwroot.'/mod/promising/'.$log->url);\n }\n }\n }\n }\n }\n\n // have a look for new gradings for this user (grade)\n $gradecontent = false;\n if ($logs = promising_get_grade_logs($course, $timestart)) {\n // got some, see if any belong to a visible module\n foreach ($logs as $log) {\n // Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n $gradecontent = true;\n break;\n }\n }\n // if we got some \"live\" ones then output them\n if ($gradecontent) {\n print_headline(get_string('projectfeedback', 'promising').\":\");\n foreach ($logs as $log) {\n //Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n $log->firstname = $course->teacher; // Keep anonymous\n $log->lastname = '';\n print_recent_activity_note($log->time, $log, $isteacher, $log->name,\n $CFG->wwwroot.'/mod/promising/'.$log->url);\n }\n }\n }\n }\n\n // have a look for new project (only show to teachers) (submit)\n $submitcontent = false;\n if ($isteacher) {\n if ($logs = promising_get_submit_logs($course, $timestart)) {\n // got some, see if any belong to a visible module\n foreach ($logs as $log) {\n // Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n $submitcontent = true;\n break;\n }\n }\n // if we got some \"live\" ones then output them\n if ($submitcontent) {\n print_headline(get_string('projectproject', 'promising').\":\");\n foreach ($logs as $log) {\n //Create a temp valid module structure (only need courseid, moduleid)\n $tempmod->course = $course->id;\n $tempmod->id = $log->projectid;\n //Obtain the visible property from the instance\n if (instance_is_visible('promising',$tempmod)) {\n print_recent_activity_note($log->time, $log, $isteacher, $log->name,\n $CFG->wwwroot.'/mod/promising/'.$log->url);\n }\n }\n }\n }\n }\n return $changerequcontent or $changespeccontent or $changetaskcontent or $changemilescontent or $changedelivcontent or $gradecontent or $submitcontent;\n}",
"function get_milestones($tplan_id)\r\n {\r\n $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;\r\n \r\n $sql=\" /* $debugMsg */ SELECT id, name, a AS high_percentage, b AS medium_percentage, c AS low_percentage, \" .\r\n \"target_date, start_date,testplan_id \" . \r\n// \"FROM {$this->tables['milestones']} \" .\r\n \"FROM \".$this->db->get_table('milestones').\" \" .\r\n \"WHERE testplan_id={$tplan_id} ORDER BY target_date,name\";\r\n return $this->db->get_recordset($sql);\r\n }",
"public function generatePlannings(Turn $turn)\n\t{\n\t\t// nice midtermplannings scopeModules(Turn turn), but mediumterms have to be changed for that\n\t\tif (Entrust::hasRole('Admin') || Entrust::can('generate_planning_midterm_all')) // role Lehrplanung has to be changed to a permission\n\t\t\t$mediumtermplannings = Mediumtermplanning::specificTurn($turn)->get();\n\t\telse {\n\t\t\t// fetch medium term planning which belong to the research group\n\t\t\t$researchgroupIds = Entrust::user()->getResearchgroupIds();\n\t\t\t$mediumtermplanningIds = Mediumtermplanning::forSpecificResearchGroups($turn, $researchgroupIds)->get();\n\t\t}\n\t\t$warnmessage = \"Es konnten nicht alle Veranstaltungen aus der mittelfristige Lehrplanung kopiert werden,\n\t\t\t\t\tda diese bereits im aktuellen Semester geplant wurden.<br> Folgende Veranstaltungen konnten nicht kopiert werden: \";\n\t\t$module = \"\";\n\n\t\tif (sizeof($mediumtermplannings) > 0) {\n\t\t\tforeach ($mediumtermplannings as $mediumtermplanning) {\n\n\t\t\t\t// check if courses are already planned for this turn\n\t\t\t\tforeach ($mediumtermplanning->module->courses as $course) {\n\n\t\t\t\t\tif ($course->coursetype->name == \"Vorlesung\") {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Planning::courseTurn($course,$turn)->count() == 0) \t{\n\t\t\t\t\t\t\t// the course isn't planned yet for this turn\n\t\t\t\t\t\t\t$planning = new Planning;\n\t\t\t\t\t\t\t$planning->generatePlanning($turn, $course, 1);\n\n\t\t\t\t\t\t\t// saving the planning\n\t\t\t\t\t\t\t$planning->save();\n\n\t\t\t\t\t\t\t// log\n\t\t\t\t\t\t\t$planninglog = new Planninglog();\n\t\t\t\t\t\t\t$planninglog->logGeneratedPlanning($planning, $turn);\n\n\t\t\t\t\t\t\t$turn = Turn::findOrFail($turn->id); // refresh turn to get the current modules()\n\t\t\t\t\t\t\t$turn->saveExam($planning->course->module);\n\t\t\t\t\t\t\t// check if there employees assigned to the module\n\t\t\t\t\t\t\tif ($mediumtermplanning->employees->count() > 0) {\n\t\t\t\t\t\t\t\tforeach ($mediumtermplanning->employees as $employee) {\n\t\t\t\t\t\t\t\t\t// if the employee is annulled, he/she can be left out\n\t\t\t\t\t\t\t\t\tif ($employee->pivot->annulled == 0) {\n\t\t\t\t\t\t\t\t\t\t$planning->employees()->attach(\n\t\t\t\t\t\t\t\t\t\t\t$employee->id, \n\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'semester_periods_per_week' => 0,\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t// log\n\t\t\t\t\t\t\t\t\t\t$planninglog = new Planninglog();\n\t\t\t\t\t\t\t\t\t\t$planninglog->logAssignedPlanningEmployee($planning, $turn, $employee, 0);\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} else\n\t\t\t\t\t\t\t$module .= $course->course_number.' ('.$mediumtermplanning->module->short.');';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// generate the number of courses that are needed to match the participant number of the lecture\n\t\t\t\t\t\t$lecture = Course::relatedLecture($course)->first();\n\t\t\t\t\t\tif (sizeof($lecture) > 0) {\n\t\t\t\t\t\t\t$numberOfGroups = ceil($lecture->participants / $course->participants);\n\t\t\t\t\t\t\tfor ($i=1; $i <= $numberOfGroups; $i++) { \n\t\t\t\t\t\t\t\t// $plannings = Planning::courseTurnGroup($course,$turn,$i)->get();\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (Planning::courseTurnGroup($course,$turn,$i)->count() == 0) {\n\t\t\t\t\t\t\t\t\t// the course isn't planned yet for this turn\n\t\t\t\t\t\t\t\t\t$planning = new Planning;\n\t\t\t\t\t\t\t\t\t$planning->generatePlanning($turn, $course, $i);\n\t\t\t\t\t\t\t\t\t// saving the planning\n\t\t\t\t\t\t\t\t\t$planning->save();\n\n\t\t\t\t\t\t\t\t\t// log\n\t\t\t\t\t\t\t\t\t$planninglog = new Planninglog();\n\t\t\t\t\t\t\t\t\t$planninglog->logGeneratedPlanning($planning, $turn);\n\n\t\t\t\t\t\t\t\t\t$turn = Turn::findOrFail($turn->id); // refresh turn to get the current modules()\n\t\t\t\t\t\t\t\t\t$turn->saveExam($planning->course->module);\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t$module .= $course->course_number.' ('.$mediumtermplanning->module->short.');';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// $plannings = Planning::courseTurn($course,$turn)->get();\t\t\t\t\t\n\t\t\t\t\t\t\tif (Planning::courseTurn($course,$turn)->count() == 0) {\n\t\t\t\t\t\t\t\t// the course isn't planned yet for this turn\n\t\t\t\t\t\t\t\t$planning = new Planning;\n\t\t\t\t\t\t\t\t$planning->generatePlanning($turn, $course, 1);\n\n\t\t\t\t\t\t\t\t// saving the planning\n\t\t\t\t\t\t\t\t$planning->save();\n\n\t\t\t\t\t\t\t\t// log\n\t\t\t\t\t\t\t\t$planninglog = new Planninglog();\n\t\t\t\t\t\t\t\t$planninglog->logGeneratedPlanning($planning, $turn);\n\n\t\t\t\t\t\t\t\t$turn = Turn::findOrFail($turn->id); // refresh turn to get the current modules()\n\t\t\t\t\t\t\t\t$turn->saveExam($planning->course->module);\n\t\t\t\t\t\t\t\t// check if there employees assigned to the module\n\t\t\t\t\t\t\t\tif (sizeof($mediumtermplanning->employees) > 0) {\n\t\t\t\t\t\t\t\t\tforeach ($mediumtermplanning->employees as $employee) {\n\t\t\t\t\t\t\t\t\t\t// if the employee is annulled, he/she can be left out\n\t\t\t\t\t\t\t\t\t\tif ($employee->pivot->annulled == 0) {\n\t\t\t\t\t\t\t\t\t\t\t$planning->employees()->attach(\n\t\t\t\t\t\t\t\t\t\t\t\t$employee->id,\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'semester_periods_per_week' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t// log\n\t\t\t\t\t\t\t\t\t\t\t$planninglog = new Planninglog();\n\t\t\t\t\t\t\t\t\t\t\t$planninglog->logAssignedPlanningEmployee($planning, $turn, $employee, 0);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t$module .= $course->course_number.' ('.$mediumtermplanning->module->short.');';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($module == \"\") {\n\t\t\t\tFlash::success('Lehrveranstaltungen erfolgreich aus der mittelfristigen Lehrplanung generiert.');\n\t\t\t\treturn Redirect::back();\n\t\t\t}\t\n\t\t\t\n\t\t\tFlash::error($warnmessage.''.$module);\n\t\t\treturn Redirect::back();\n\t\t}\n\t\t\n\t\tFlash::error('Es existiert keine mittelfristige Planung für dieses Semester.');\n\t\treturn Redirect::back();\n\t\t\n\t}",
"function increaseProjectTimeline($projectId,$newNumDays,$isCallInternal)\n{\n\t\n}",
"function get_projectTime() {\n try {\n\n $this->db->select('name,description,status,prority_id, progress,totalhours, spentours');\n $this->db->from('project');\n $query = $this->db->get();\n\n return $query->result();\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n }",
"private function _make_milestone_row($data) {\n\n //calculate milestone progress\n $progress = $data->total_points ? round(($data->completed_points / $data->total_points) * 100) : 0;\n $class = \"progress-bar-primary\";\n if ($progress == 100) {\n $class = \"progress-bar-success\";\n }\n\n $progress_bar = \"<div class='progress' title='$progress%'>\n <div class='progress-bar $class' role='progressbar' aria-valuenow='$progress' aria-valuemin='0' aria-valuemax='100' style='width: $progress%'>\n </div>\n </div>\";\n\n //define milesone color based on due date\n $due_date = date(\"L\", strtotime($data->due_date));\n $label_class = \"\";\n if ($progress == 100) {\n $label_class = \"label-success\";\n } else if ($progress !== 100 && get_my_local_time(\"Y-m-d\") > $data->due_date) {\n $label_class = \"label-danger\";\n } else if ($progress !== 100 && get_my_local_time(\"Y-m-d\") == $data->due_date) {\n $label_class = \"label-warning\";\n } else {\n $label_class = \"label-primary\";\n }\n\n $day_or_year_name = \"\";\n if (date(\"Y\", strtotime(get_current_utc_time())) === date(\"Y\", strtotime($data->due_date))) {\n $day_or_year_name = lang(strtolower(date(\"l\", strtotime($data->due_date)))); //get day name from language\n } else {\n $day_or_year_name = date(\"Y\", strtotime($data->due_date)); //get current year\n }\n\n $month_name = lang(strtolower(date(\"F\", strtotime($data->due_date)))); //get month name from language\n\n $due_date = \"<div class='milestone pull-left' title='\" . format_to_date($data->due_date) . \"'>\n <span class='label $label_class'>\" . $month_name . \"</span>\n <h1>\" . date(\"d\", strtotime($data->due_date)) . \"</h1>\n <span>\" . $day_or_year_name . \"</span>\n </div>\n \"\n ;\n\n $optoins = \"\";\n if ($this->can_edit_milestones()) {\n $optoins .= modal_anchor(get_uri(\"projects/milestone_modal_form\"), \"<i class='fa fa-pencil'></i>\", array(\"class\" => \"edit\", \"title\" => lang('edit_milestone'), \"data-post-id\" => $data->id));\n }\n\n if ($this->can_delete_milestones()) {\n $optoins .= js_anchor(\"<i class='fa fa-times fa-fw'></i>\", array('title' => lang('delete_milestone'), \"class\" => \"delete\", \"data-id\" => $data->id, \"data-action-url\" => get_uri(\"projects/delete_milestone\"), \"data-action\" => \"delete\"));\n }\n\n\n $title = \"<div><b>\" . $data->title . \"</b></div>\";\n if ($data->description) {\n $title .= \"<div>\" . nl2br($data->description) . \"<div>\";\n }\n\n return array(\n $data->due_date,\n $due_date,\n $title,\n $progress_bar,\n $optoins\n );\n }",
"private function projectProjectCumm($duration) {\n\t\tif (!isset($this->projectCumm['Project'][ $this->projectName() ])) {\n\t\t\t$this->projectCumm['Project'][ $this->projectName() ]['Time'] = 0;\n\t\t}\n\t\t$this->projectCumm['Project'][ $this->projectName() ]['Time'] += $duration;\n\t}",
"function _erpal_employee_helper_get_user_project_time($uid, $year, $month) {\n $monthNull = str_pad($month, 2 ,'0', STR_PAD_LEFT);\n\t$ldom = erpal_lib_date_ldom($month, $year); //last day of month\n\t$range_from = \"$year-$monthNull-01 00:00:00\";\n\t$range_till = \"$ldom 23:59:59\";\n $date_till_unix = strtotime($range_till);\n $date_from_unix = strtotime($range_from);\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'erpal_timetracking')\n ->propertyCondition('uid', $uid)\n ->fieldCondition('field_date_time', 'value', $date_from_unix, '>=')\n ->fieldCondition('field_date_time', 'value', $date_till_unix, '<=')\n ->addMetaData('account', user_load(1)); // Run the query as user 1.\n\n $result = $query->execute();\n\n $timetracking_nodes = array();\n if (isset($result['node'])) {\n $timetracking_nids = array_keys($result['node']);\n $timetracking_nodes = entity_load('node', $timetracking_nids);\n }\n \n //get only the timetrackings that the user booked as employee!\n $timetracking_dates = _erpal_calendar_helper_get_dates_in_range($year, $month, $timetracking_nodes, 'field_date_time', 'field_date_time', array(LANGUAGE_NONE, 0, 'value'), array(LANGUAGE_NONE, 0, 'value'));\n \n //get the sum of all timetrackings (duration, not billing duration)\n $total_duration = 0;\n foreach ($timetracking_nodes as $node) {\n //take only these that are in timetracking_dates!\n $timetracking_date = $node->field_date_time[LANGUAGE_NONE][0]['value'];\n $timetracking_date_str = date('Y-m-d', $timetracking_date);\n $is_valid_date = false;\n foreach ($timetracking_dates as $date) {\n $date_str = date('Y-m-d', $date); \n if ($date_str == $timetracking_date_str) { \n $is_valid_date = true;\n break;\n }\n }\n \n if ($is_valid_date) {\n $duration = $node->field_timetracking_duration[LANGUAGE_NONE][0]['value'];\n $total_duration += $duration;\n }\n }\n \n return $total_duration;\n}",
"function export() {\n $object_visibility = array_var($_GET, 'visibility', VISIBILITY_NORMAL);\n $exportable_modules = explode(',', array_var($_GET,'modules', null));\n if (!is_foreachable($exportable_modules)) {\n $exportable_modules = null;\n } // if\n \n require_once(PROJECT_EXPORTER_MODULE_PATH.'/models/ProjectExporterOutputBuilder.class.php');\n $output_builder = new ProjectExporterOutputBuilder($this->active_project, $this->smarty, $this->active_module, $exportable_modules);\n if (!$output_builder->createOutputFolder()) {\n $this->serveData($output_builder->execution_log, 'execution_log', null, FORMAT_JSON);\n } // if\n $output_builder->createAttachmentsFolder();\n \n $active_milestones = array();\n $completed_milestones = array();\n \n $all_milestones = Milestones::findAllByProject($this->active_project, $object_visibility);\n if(is_foreachable($all_milestones)) {\n $output_builder->setFileTemplate(MILESTONES_MODULE, 'milestones', 'object');\n foreach($all_milestones as $milestone) {\n if ($milestone->isCompleted()) {\n $completed_milestones[] = $milestone;\n } else {\n $active_milestones[] = $milestone;\n } // if\n \n // Build milestone details page\n \n $objects = array();\n event_trigger('on_milestone_objects_by_visibility', array(&$milestone, &$objects, $object_visibility));\n \t \n \t $total_objects = 0;\n \t if (is_foreachable($objects)) {\n \t foreach ($objects as $objects_per_module) {\n \t \t$total_objects += count($objects_per_module);\n \t } // foreach\n \t } // if\n \t \n \t $output_builder->smarty->assign(array(\n \t 'active_milestone' => $milestone,\n \t 'active_milestone_objects' => $objects,\n \t 'total_objects' => $total_objects,\n \t ));\n \t \n \t $output_builder->outputToFile('milestone_'.$milestone->getId());\n } // foreach\n } // if\n \n // export milestones front page\n $output_builder->setFileTemplate(MILESTONES_MODULE, 'milestones', 'index');\n $output_builder->smarty->assign('active_milestones', $active_milestones);\n $output_builder->smarty->assign('completed_milestones', $completed_milestones);\n $output_builder->outputToFile('index');\n\n $this->serveData($output_builder->execution_log, 'execution_log', null, FORMAT_JSON);\n }",
"function finanzen_timesheet( $date = 0 ) {\n\n if ($date == 0) {\n $current_date = time ();\n $first_day_year = _finanzen_first_day_year($current_date);\n }\n else \n $first_day_year = _finanzen_first_day_year($date);\n \n global $user;\n \n if (empty($user->og_groups)) {\n $content .= 'You do not belong to any project. Go and <a href=\"og\">join a project</a>.';\n }\n else {\n \n $content .= _finanzen_timesheet_summary($first_day_year, $user->uid);\n \n $first_month_user = _finanzen_first_day_month($user->created);\n $content .= _finanzen_timesheet_navigator($first_day_year, $user->name, $first_month_user);\n \n $all_projects = $user->og_groups;\n \n $months_curr_year = _finanzen_list_months_year ($first_day_year);\n \n /* Build header */\n $header['date'] = array('data' => \"\", 'class' => 'column_date');\n foreach ($all_projects as $project) {\n $project_code = _finanzen_get_project_code($project[nid]);\n $header[$project_code] = array('data' => $project_code, 'class' => 'column_project');\n }\n $header['total'] = array('data' => \"Total\", 'class' => 'column_total');\n $header['edit'] = t(\"Edit\");\n \n /* Get data */\n foreach ($months_curr_year as $month_name => $month_data) {\n \n if (/*(time() >= $month_data['date']) &&*/ ($first_month_user <= $month_data['date'])) {\n\t $total_hours_worker_month = 0;\n\t \t \n\t \t $rowdata['date'] = date('M Y', $month_data['date']);\n\t \t \n\t foreach ($all_projects as $project) {\n\t $total_hours_worker_month_project = 0;\n\t\t $query = \"SELECT ftwhp.nid, ftwhp.hours FROM {finanzen_timesheet_worker_hours_projects} ftwhp \n\t\t WHERE ftwhp.date>=\" . $month_data['date'] . \" \n\t\t AND ftwhp.date<\" . _finanzen_get_first_day_next_month($month_data['date']) . \" \n\t\t AND ftwhp.uid=\" . $user->uid . \" \n\t\t AND ftwhp.project_id=\" . $project[nid];\n\t\t $queryResult = db_query ( $query );\n\t\t \n\t\t while ($resource = db_fetch_object($queryResult)){\n\t\t $total_hours_worker_month_project += $resource->hours;\n\t\t $total_hours_worker_month += $resource->hours;\n\t\t }\n\t\t \n\t\t $rowdata[$project[title]] = round($total_hours_worker_month_project, 2) . ' hr' ;\n\t }\n\t \n\t $rowdata['total'] = '<strong>' . round($total_hours_worker_month, 2) . ' hr</strong>';\n\t $rowdata['edit'] = '<a href=\"/timesheet/edit-month/' . $month_data['date'] . '\"><img class=\"edit-pencil\" src=\"/'\n\t . drupal_get_path('module', 'finanzen') . '/img/pencil.png\" /></a>';\n\t\n\t\t $rows[] = $rowdata;\n\t }\n }\n \n $content .= theme_table($header, $rows, array('class' => 'finanzen timesheet timesheet-main'));\n }\n \n return $content;\n}",
"public function get_latest_project_milestone()\r\n {\r\n return $this->db->select('p.i_id, p.f_milestone_percentage, p.PROJECTNAME')\r\n ->where('p.i_project_status != 10')\r\n ->order_by('p.dt_created_on' ,'DESC')\r\n ->limit(10)\r\n ->get($this->tbl_pr.' AS p')\r\n ->result_array();\r\n }",
"public function ProjectInformation();",
"function recsys_wb_project_opening_form_submit($form, &$form_state) {\n $date = $form_state['values']['project_opening_date']['year'];\n \n if ( $form_state['values']['project_opening_date']['month'] < 10 ) {\n $date .= \"-0\" . $form_state['values']['project_opening_date']['month'];\n } else {\n $date .= \"-\" . $form_state['values']['project_opening_date']['month'];\n }\n \n if ( $form_state['values']['project_opening_date']['day'] < 10 ) {\n $date .= \"-0\" . $form_state['values']['project_opening_date']['day'];\n } else {\n $date .= \"-\" . $form_state['values']['project_opening_date']['day'];\n }\n\n $date .= \" \" . $form_state['values']['project_opening_time'];\n\n variable_set('project_opening',$date);\n drupal_set_message(\"Project opening date set to: \" . $date);\n}",
"public function project(): object;",
"public function getModule()\n {\n return $this->milestoneModule;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getDirectory returns a listing of the files in the specified directory | public function getDirectory($directory) {
// Get the file listing in the specified directory
$files = $this->ftp->nlist($directory);
// Create a buffer
$result = array();
// For each file, add it to the buffer
foreach($files as $file) {
// Remove the path from the filename
$result[] = substr($file, strlen($directory) + 1);
}
// Return the buffer
return $result;
} | [
"public function getDirectory($directory = Config::DIR_ROOT);",
"public function get_directory_files() {\n global $CFG;\n\n $directory = $CFG->dataroot . '/filedir';\n $files = self::get_files($directory);\n return $files;\n }",
"function ListDirectory()\r\n\t{\r\n\t\t// Get us a return state\r\n\t\t$strReturn = RETURN_NULL;\r\n\t\t// Get the name of the directory to list from the form variables in the request stream.\r\n\t\t$strDirectoryName = $this->GetFormVar($this->att_constFormVarNameDestinationDirectory);\r\n\t\t// Make sure we have a meaningful directory name to list.\r\n\t\tif ($this->PrepDirectoryName($strDirectoryName))\r\n\t\t{\r\n\t\t\t// Hey, is this really a directory?\r\n\t\t\tif (is_dir($strDirectoryName)) \r\n\t\t\t{\r\n\t\t\t\t// Let's open it\r\n\t\t\t\tif ($handleDir = @opendir($strDirectoryName)) \r\n\t\t\t\t{\r\n\t\t\t \t\t// And get all of it's content\r\n\t\t\t\t\twhile (false != ($file = readdir($handleDir))) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// We don't want \".\" or \"..\"\r\n\t\t\t\t\t\tif((\".\" != $file) && (\"..\" != $file))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// If it's a file\r\n\t\t\t\t\t\t\tif(is_file($file))\r\n\t\t\t\t\t\t\t\t// Add ASCII 10\r\n\t\t\t\t\t\t\t\techo $file.VBLF;\r\n\t\t\t\t\t\t\telseif(is_dir($file)) \r\n\t\t\t\t\t\t\t// If it's a directory, add a forward slash and ASCII 10\r\n\t\t\t\t\t\t\t\techo $file.\"/\".VBLF;\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t// Add ASCII 10\r\n\t\t\t\t\t\t\t\techo $file.VBLF;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Remember to close the directory reader\r\n\t\t\t\t\tclosedir($handleDir);\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// We couldn't open the directory, return an error\r\n\t\t\t\t\t$strReturn = RETURN_ERROR;\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// This isn't a directory, return an error\r\n\t\t\t\t$strReturn = RETURN_BADNAME;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// The name is bad, return an error\r\n\t\t\t$strReturn = RETURN_BADNAME;\r\n\t\t}\r\n\t\t// See if we should send an error back\r\n\t\tif(RETURN_NULL != $strReturn)\r\n\t\t\techo $strReturn;\r\n\t\t// phpRequestExecutor::ListDirectory is done.\r\n\t}",
"public function dirList(string $directory) : array;",
"function system_get_directory_content($directory){\n\t$res = array();\n\tif ($handle = opendir($directory)) {\n\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\tif($entry != \".\" && $entry != \"..\"){\n\t\t\t\t$res[] = $entry;\n\t\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t}\n\treturn $res;\n}",
"function GetDirTest($dir = \"\") {\r\n addLog(\"mpd->GetDir()\");\r\n $resp = $this->SendCommand(MPD_CMD_LSDIR,$dir);\r\n #$dirlist = $this->_parseFileListResponse($resp);\r\n $dirlist = $this->_parseFileListResponseHumanReadable($resp);\r\n addLog(\"mpd->GetDir() / return \".print_r($dirlist, true));\r\n return $dirlist;\r\n }",
"function browseDirectory($directory)\n{\n\tif ($handle = opendir($directory)) {\n\t while(false !== ($entry = readdir($handle)))\n\t {\n\t if ($entry != \".\" && $entry != \"..\") $dirArr.=$entry.' ';\n\t }\n\t closedir($handle);\n\t return $dirArr;\n\t}\n\telse return null;\n}",
"function dropbox_dir_list($directory)\n{\n // create an array to hold directory list\n $filenames = array();\n\n $iter = new DirectoryIterator($directory);\n\n foreach ($iter as $fileEntry) {\n if ($fileEntry->isFile()) {\n $filenames[] = $fileEntry->getFilename();\n }\n }\n\n natcasesort($filenames);\n\n return $filenames;\n}",
"function getDirectoryFiles($theDirectory){\n \n $files = scandir($theDirectory);\n \n $arrayFiles = array();\n $idx = 0; \n \n foreach($files as $file){\n \t$filePath = $theDirectory.\"/\".$file;\n \t if (is_file($filePath)){\n $arrayFiles[$idx] = $filePath;\n $idx ++;\n }\n }\n return $arrayFiles;\n \n}",
"public function getDirList();",
"public function allDirectories(string $directory): array;",
"public function listDirs();",
"public function allFiles($directory = '')\r\n\t{\r\n\t\treturn File::allFiles($this->computePath($directory));\r\n\t}",
"public function getDirectoryTreeList();",
"function ReadFolderDirectory($dir) \n { \n $listDir = array(); \n if($handler = opendir($dir)) { \n while (($sub = readdir($handler)) !== FALSE) { \n if ($sub != \".\" && $sub != \"..\" && $sub != \"Thumb.db\") { \n if(is_file($dir.\"/\".$sub)) { \n $listDir[] = $sub; \n }elseif(is_dir($dir.\"/\".$sub)){ \n $listDir[$sub] = $this->ReadFolderDirectory($dir.\"/\".$sub); \n } \n } \n } \n closedir($handler); \n } \n return $listDir; \n }",
"function get_dir_contents ($dir)\n{\n\t$f = opendir($dir); \n\t\n\t$contents = array();\n\twhile (($file = readdir($f)) !== FALSE)\n\t{ \n\t\tif ( substr($file, 0, 1) != \".\") // ignore hidden files and . and ..\n\t\t{ \n\t\t $contents[] = $file;\t\t\t \n\t\t}\n\t}\n\tclosedir($f);\n\treturn $contents;\n}",
"public function directory() {\n $config = \\Drupal::config('webspark_isearch.settings');\n $directory_url = $config->get('directory_path');\n return $this->retriveJsonFromService($directory_url);\n }",
"function readDirectory()\n {\n $dir = $this->browseBase . $this->currentDirectory;\n $this->files = array();\n\n $handle = opendir($dir);\n if ($handle) {\n while (false !== ($file = readdir($handle))) {\n if (strpos($file, '.') === 0) {\n continue;\n }\n if (is_dir($dir . $file)) {\n $this->folders[] = $this->currentDirectory . $file;\n continue;\n }\n if ($this->isAllowedFile($file)) {\n $this->files[] = $file;\n }\n }\n closedir($handle);\n natcasesort($this->folders);\n natcasesort($this->files);\n }\n }",
"function readDirectory($directory)\n{\n $scanned_directory = array_diff(scandir($directory), array('..', '.'));\n return $scanned_directory;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FIX NO POSTERFRAME TO CAPTACION IMAGE | protected function fix_no_posterframe_to_captacion_image_DEPERECATED() {
/*
if(!$this->get_file_exists()){
$RecordObj_reels = new RecordObj_reels($this->reelID);
$captacionID = $RecordObj_reels->get_captacionID();
global $patImages ;
if(!$patImages) die(__METHOD__ ." <br> patImages is not defined!");
$this->name = $captacionID;
$this->media_path = $patImages;
$this->media_path_abs = __ROOT__ . '/' . substr($patImages,3);
}
*/
} | [
"public function stripImage() {\n\t}",
"public function stripImage () {}",
"public function stripimage(){}",
"function despeckleImage(){}",
"function ccImj_noImg($content)\n\t{\n\t\t$content_noImg = preg_replace(\"/\\<img(.*)\\/\\>/\", \"\", $content);\n\t\t\n\t\treturn $content_noImg;\n\t}",
"public function captcha_image()\n {\n require_once('../plugins'.DS.'captcha'.DS.'captcha.php');\n show_captcha();\n }",
"function _cleanup_image_add_caption($matches)\n{\n}",
"private function bbImg(){\n\t\tif($this->img === TRUE OR $this->action === NULL){\n\t\t\tif($this->action === 'pre'){\n\t\t\t\t$match = '#\\[img\\](.*?)\\[\\/img\\]#si';\n\t\t\t\t$replace = '[img:'.$this->uid.']$1[/img:'.$this->uid.']';\n\t\t\t\t$this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n\t\t\t}\n\n\t\t\tif($this->action === 'post' OR $this->action === NULL){\n\t\t\t\t$match = '#\\[img:'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si';\n\t\t\t\t$replace = '<img src=\"$1\" />';\n\t\t\t\t$this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n\t\t\t} \n\t\t}\n\t}",
"public function despeckleimage(){}",
"private function bbImg(){\n if($this->img === TRUE OR $this->action === NULL){\n if($this->action === 'pre'){\n $match = array('#\\[img=(.*?)\\]\\[/img\\]#si',\n \t\t\t '#\\[img\\](.*?)\\[/img\\]#si');\n $replace = array('[img=$1:'.$this->uid.'][/img:'.$this->uid.']',\n \t\t\t\t '[img:'.$this->uid.']$1[/img:'.$this->uid.']');\n $this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n }\n\n if($this->action === 'post' OR $this->action === NULL){\n $match = array('#\\[img:'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si',\n \t\t \t '#\\[img=(.*?):'.$this->uid.'\\]\\[/img:'.$this->uid.'\\]#si');\n $replace = '<img src=\"$1\" />';\n $this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n } \n\n if($this->action === 'reset'){\n $match = array('#\\[img:'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si',\n \t\t\t '#\\[img=(.*?):'.$this->uid.'\\](.*?)\\[/img:'.$this->uid.'\\]#si');\n \t\t\t \n $replace = array('[img]$1[/img]',\n \t\t\t\t '[img=$1]$2[/img]');\n\n $this->str = preg_replace($match, $replace, $this->str, $this->imgLimit);\n \n $this->str = str_replace('"', '', $this->str);\n } \n }\n }",
"public function note_avatar() {\r\n\t\treturn false;\r\n\t}",
"function _cleanup_image_add_caption($matches)\n {\n }",
"private function fixCaptchaImage(){\n\n\t\t# Final equired image width must be\n\t\t# Last _front_text x position + initial_x\n\n\t\t$final_width = $this->_front_text['x'] + $this->_front_text['initial_x'];\n\n\t\t# check if to set final width\n\t\tif( $this->_image_info['width'] > $final_width )\n\t\t\t$this->_image_info['width'] = $final_width;\n\n\n\t\t$this->_final_image = imagecreatetruecolor( $this->_image_info['width'], $this->_image_info['height'] );\n\n\t\tif( function_exists( 'imageantialias' ) )\n\t\t\timageantialias( $this->_final_image, true );\n\n\n\t\timagecopy(\n\t\t\t\t\t$this->_final_image,\t\t\t\t# destination image resource to copy into\n\t\t\t\t\t$this->_image_resource,\t\t\t\t# source image resource to copy from\n\t\t\t\t\t0,\t\t\t\t\t\t\t\t\t# start x position to copy into in destination image\n\t\t\t\t\t0,\t\t\t\t\t\t\t\t\t# start y position to copy into in destination image\n\t\t\t\t\t0,\t\t\t\t\t\t\t\t\t# start x position to copy from in source image\n\t\t\t\t\t0,\t\t\t\t\t\t\t\t\t# start y position to copy from in source image\n\t\t\t\t\t$this->_image_info['width'],\t\t# width to copy from source image\n\t\t\t\t\t$this->_image_info['height'] \t\t# height to copy from source image\n\t\t\t\t );\n\n\t\t# Removing the first image from memory\n\t\timagedestroy( $this->_image_resource );\n\n\t\t# Method End\n\t}",
"private static function _showImage() {\n\t\theader('Content-Type: image/jpeg');\n\t\timagejpeg(self::$_image);\n\t\timagedestroy(self::$_image);\n \n $_SESSION['captcha_code'] = self::$_code;\n\t}",
"public function enhanceImage () {}",
"function image_url_hack_insert($msg)\n{\n if (empty($msg['imageurl'])) return $msg;\n\n $msg['message'] = \"<center><img src=\\\"\" .\n escapequotes($msg['imageurl']) . \"\\\"></center><p>\\n\" .\n $msg['message'];\n\n return $msg;\n}",
"function remove_custom_image_header()\n {\n }",
"function recreate_main_image()\n {\n // This need separate implementation for this type\n debug_add(\"Method not implemented for this type yet. Use recreate_images instead.\", MIDCOM_LOG_ERROR);\n return false;\n }",
"public function reset_header_image() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store a newly created QuestionOption in storage. | public function store(StoreQuestionOptionsRequest $request)
{
if (! Gate::allows('question_option_create')) {
return abort(401);
}
$question_option = QuestionOption::create($request->all());
return redirect()->route('admin.question_options.index');
} | [
"public function store(StoreQuestionsOptionsRequest $request)\n {\n //insert QuestionsOption\n QuestionsOption::create($request->all());\n\n return redirect()->route('questions_options.index');\n }",
"public function store(StoreQuestionsOptionsRequest $request)\n {\n QuestionsOption::create($request->all());\n\n return redirect()->route('questions_options.index');\n }",
"public function saveOptions($options, $question)\n {\n foreach ($options as $option) {\n if ($option['name'] != null) {\n QuestionOption::create([\n 'name' => $option['name'],\n 'company_id' => $question->company_id,\n 'campaign_id' => $question->campaign_id,\n 'question_id' => $question->id,\n 'score' => $option['score'],\n ]);\n }\n }\n return;\n\n }",
"public function store(StoreQuizQuestionChoicesRequest $request)\n {\n if (! Gate::allows('quiz_question_choice_create')) {\n return abort(401);\n }\n $request = $this->saveFiles($request);\n $quiz_question_choice = QuizQuestionChoice::create($request->all());\n\n\n\n return redirect()->route('admin.quiz_question_choices.index');\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Option::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOption::create($data);\n\n\t\treturn Redirect::route('options.index');\n\t}",
"public function storeAnswer($answer)\n {\n $this->em->persist($answer);\n $this->em->flush();\n }",
"public function store(CreateOptionRequest $request)\n {\n $input = $request->all();\n\n $option = $this->optionRepository->create($input);\n\n Flash::success('Option saved successfully.');\n\n return redirect(route('options.index'));\n }",
"public function created(AnswerOption $answerOption)\n {\n //\n }",
"function save_question_options($question) {\n // for numerical questions. This is not currently used by the editing\n // interface, but the GIFT format supports it. The multianswer qtype,\n // for example can make use of this feature.\n // Get old versions of the objects\n if (!$oldanswers = get_records(\"quiz_answers\", \"question\", $question->id)) {\n $oldanswers = array();\n }\n\n if (!$oldoptions = get_records(\"quiz_numerical\", \"question\", $question->id)) {\n $oldoptions = array();\n }\n\n $result = $this->save_numerical_units($question);\n if (isset($result->error)) {\n return $result;\n } else {\n $units = &$result->units;\n }\n\n // Insert all the new answers\n foreach ($question->answer as $key => $dataanswer) {\n if ($dataanswer != \"\") {\n $answer = new stdClass;\n $answer->question = $question->id;\n $answer->answer = trim($dataanswer);\n $answer->fraction = $question->fraction[$key];\n $answer->feedback = trim($question->feedback[$key]);\n\n if ($oldanswer = array_shift($oldanswers)) { // Existing answer, so reuse it\n $answer->id = $oldanswer->id;\n if (! update_record(\"quiz_answers\", $answer)) {\n $result->error = \"Could not update quiz answer! (id=$answer->id)\";\n return $result;\n }\n } else { // This is a completely new answer\n if (! $answer->id = insert_record(\"quiz_answers\", $answer)) {\n $result->error = \"Could not insert quiz answer!\";\n return $result;\n }\n }\n\n // Set up the options object\n if (!$options = array_shift($oldoptions)) {\n $options = new stdClass;\n }\n $options->question = $question->id;\n $options->answer = $answer->id;\n $options->tolerance = $this->apply_unit($question->tolerance, $units);\n\n // Save options\n if (isset($options->id)) { // reusing existing record\n if (! update_record('quiz_numerical', $options)) {\n $result->error = \"Could not update quiz numerical options! (id=$options->id)\";\n return $result;\n }\n } else { // new options\n if (! insert_record('quiz_numerical', $options)) {\n $result->error = \"Could not insert quiz numerical options!\";\n return $result;\n }\n }\n }\n }\n }",
"function save_question_options($question) {\n global $QTYPES;\n\n $QTYPES[$question->qtype]->save_question_options($question);\n}",
"public function store()\n\t{\n\t\t$poll = new Poll();\n\t\t$poll->question = Input::get('question');\n\t\t$poll->order = Input::get('order');\n\t\t$poll->save();\n\t}",
"public function saveOption()\n\t{\n\n\t $opt = null;\n\t $opt[\"name\"] = $this->apidata[\"name\"];\n\t $opt[\"sort_order\"] = $this->apidata[\"sort_order\"];\n\n\t if ($this->apidata[\"option_id\"]) \n\t {\n\t \t$opt[\"where\"] = \"id='\".$this->apidata[\"option_id\"].\"'\";\n\t \t$this->DB->update(\"docmgr.keyword_option\",$opt);\n\t \t$optionId = $this->apidata[\"option_id\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t if (!$opt[\"sort_order\"])\n\t\t {\n\t\t $sql = \"SELECT max(sort_order) AS max FROM docmgr.keyword_option WHERE keyword_id='\".$this->apidata[\"keyword_id\"].\"'\";\n\t\t $info = $this->DB->single($sql);\n\n\t\t $opt[\"sort_order\"] = $info[\"max\"] + 1;\n }\n \n\t\t $opt[\"keyword_id\"] = $this->apidata[\"keyword_id\"];\n\t\t $optionId = $this->DB->insert(\"docmgr.keyword_option\",$opt,\"id\");\n\t\t}\n\n\t\t$this->PROTO->add(\"option_id\",$optionId);\n\t\n\t}",
"public function save()\n {\n update_option($this->optionKey, $this->fields);\n }",
"public function save_question_options($question) {\n global $DB;\n\n if (!isset($question->testcases)) {\n $this->copy_testcases_from_form($question);\n }\n $q_type = $this->name();\n $table_name = \"question_{$q_type}_testcases\";\n\n if (!$oldtestcases = $DB->get_records($table_name,\n array('questionid' => $question->id), 'id ASC')) {\n $oldtestcases = array();\n }\n\n\n foreach ($question->testcases as $tc) {\n if (($oldtestcase = array_shift($oldtestcases))) { // Existing testcase, so reuse it\n $tc->id = $oldtestcase->id;\n $DB->update_record($table_name, $tc);\n } else {\n // A new testcase\n $tc->questionid = $question->id;\n $testcase->id = $DB->insert_record($table_name, $tc);\n }\n }\n\n\n // delete old testcase records\n foreach ($oldtestcases as $otc) {\n $DB->delete_records($table_name, array('id' => $otc->id));\n }\n\n return true;\n }",
"public function storeQuestion()\n {\n\n $input = Input::all();\n\n $validator = Validator::make($input, \n array(\n 'question' => 'required|min:5|max:150',\n 'prop_id' => 'required|numeric|exists:properties,id'\n )\n );\n\n if ($validator->fails())\n {\n return Redirect::back() //redirect back to form page with input and any errors\n ->withInput(Input::all())\n ->withErrors($validator);\n }\n\n $question = new FaqQuestion;\n \n $question->text = $input['question'];\n $question->prop_id = $input['prop_id'];\n $question->user_id = Sentry::getUser()->id;\n\n $question->save();\n\n return Redirect::back() //redirect back to form page with input and any errors\n ->withMessage('Thank you for submitting a question!');\n\n }",
"function persistOption($optionName, $option, $profile)\n\t{\n\t\t$optionPermission = $option['option_permission'];\n\t\t$optionValue = $option['option_value'];\n\t\t$this->profileConfigurationRepository->persistSanitizedValue($profile, $optionName, $optionValue);\n\t\t$this->profileConfigurationRepository->persistSanitizedPermission($profile, $optionName, $optionPermission);\n\t}",
"public function create()\n {\n $this->validate([\n \"name.{$this->defaultLanguage->code}\" => 'string|required|max:255',\n 'values' => 'array|min:1',\n \"values.*.name.{$this->defaultLanguage->code}\" => 'required|string|max:255',\n ]);\n\n $this->option->name = $this->name;\n $this->option->save();\n\n $this->option->values()->createMany($this->values->toArray());\n\n // We pass just the ID as the model will be hydrated by Livewire\n // if we pass it through. By just passing the id we can always\n // be sure of what we're going to get.\n $this->emit('productOptionCreated', $this->option->id);\n\n $this->notify(\n __('adminhub::notifications.product-options.created')\n );\n\n $this->option = new ProductOption();\n $this->name = [];\n $this->values = collect();\n }",
"public function store(CreateMutipleOptionRequest $request)\n\t{\n\t\t$input = $request->all();\n\n\t\t$mutipleOption = $this->mutipleOptionRepository->create($input);\n\n\t\tFlash::success('MutipleOption saved successfully.');\n\n\t\treturn redirect(route('mutipleOptions.index'));\n\t}",
"public function save_question_options($question)\n {\n global $DB;\n\n // Insert all the new options.\n $options = $DB->get_record('qtype_multirowselect_options', ['questionid' => $question->id]);\n if (!$options) {\n $options = new stdClass();\n $options->questionid = $question->id;\n $options->scoringmethod = '';\n $options->shuffleanswers = '';\n $options->numberofrows = '';\n $options->id = $DB->insert_record('qtype_multirowselect_options', $options);\n }\n\n $options->scoringmethod = $question->scoringmethod;\n $options->shuffleanswers = $question->shuffleanswers;\n $options->numberofrows = $question->numberofrows;\n $DB->update_record('qtype_multirowselect_options', $options);\n\n // Insert all the new rows.\n $oldRows = $DB->get_records('qtype_multirowselect_rows', ['questionid' => $question->id], 'number ASC');\n\n if (count($oldRows) > 0 && count($oldRows) !== $options->numberofrows) {\n $DB->delete_records('qtype_multirowselect_rows', ['questionid' => $question->id]);\n $oldRows = [];\n }\n\n for ($i = 1; $i <= $options->numberofrows; ++$i) {\n $row = array_shift($oldRows);\n if (!$row) {\n $row = new stdClass();\n $row->questionid = $question->id;\n $row->number = $i;\n $row->optiontext = '';\n\n $row->id = $DB->insert_record('qtype_multirowselect_rows', $row);\n }\n\n $row->optiontext = isset($_REQUEST['option_' . $i]) ? $_REQUEST['option_' . $i] : '';\n\n $DB->update_record('qtype_multirowselect_rows', $row);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'getHistoricIncidents' | public function getHistoricIncidentsRequest($incident_id = null, $incident_type = null, $incident_message = null, $incident_message_like = null, $process_definition_id = null, $process_definition_key = null, $process_definition_key_in = null, $process_instance_id = null, $execution_id = null, $create_time_before = null, $create_time_after = null, $end_time_before = null, $end_time_after = null, $activity_id = null, $failed_activity_id = null, $cause_incident_id = null, $root_cause_incident_id = null, $configuration = null, $history_configuration = null, $open = null, $resolved = null, $deleted = null, $tenant_id_in = null, $without_tenant_id = null, $job_definition_id_in = null, $sort_by = null, $sort_order = null)
{
$resourcePath = '/history/incident';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if ($incident_id !== null) {
if('form' === 'form' && is_array($incident_id)) {
foreach($incident_id as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['incidentId'] = $incident_id;
}
}
// query params
if ($incident_type !== null) {
if('form' === 'form' && is_array($incident_type)) {
foreach($incident_type as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['incidentType'] = $incident_type;
}
}
// query params
if ($incident_message !== null) {
if('form' === 'form' && is_array($incident_message)) {
foreach($incident_message as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['incidentMessage'] = $incident_message;
}
}
// query params
if ($incident_message_like !== null) {
if('form' === 'form' && is_array($incident_message_like)) {
foreach($incident_message_like as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['incidentMessageLike'] = $incident_message_like;
}
}
// query params
if ($process_definition_id !== null) {
if('form' === 'form' && is_array($process_definition_id)) {
foreach($process_definition_id as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['processDefinitionId'] = $process_definition_id;
}
}
// query params
if ($process_definition_key !== null) {
if('form' === 'form' && is_array($process_definition_key)) {
foreach($process_definition_key as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['processDefinitionKey'] = $process_definition_key;
}
}
// query params
if ($process_definition_key_in !== null) {
if('form' === 'form' && is_array($process_definition_key_in)) {
foreach($process_definition_key_in as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['processDefinitionKeyIn'] = $process_definition_key_in;
}
}
// query params
if ($process_instance_id !== null) {
if('form' === 'form' && is_array($process_instance_id)) {
foreach($process_instance_id as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['processInstanceId'] = $process_instance_id;
}
}
// query params
if ($execution_id !== null) {
if('form' === 'form' && is_array($execution_id)) {
foreach($execution_id as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['executionId'] = $execution_id;
}
}
// query params
if ($create_time_before !== null) {
if('form' === 'form' && is_array($create_time_before)) {
foreach($create_time_before as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['createTimeBefore'] = $create_time_before;
}
}
// query params
if ($create_time_after !== null) {
if('form' === 'form' && is_array($create_time_after)) {
foreach($create_time_after as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['createTimeAfter'] = $create_time_after;
}
}
// query params
if ($end_time_before !== null) {
if('form' === 'form' && is_array($end_time_before)) {
foreach($end_time_before as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['endTimeBefore'] = $end_time_before;
}
}
// query params
if ($end_time_after !== null) {
if('form' === 'form' && is_array($end_time_after)) {
foreach($end_time_after as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['endTimeAfter'] = $end_time_after;
}
}
// query params
if ($activity_id !== null) {
if('form' === 'form' && is_array($activity_id)) {
foreach($activity_id as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['activityId'] = $activity_id;
}
}
// query params
if ($failed_activity_id !== null) {
if('form' === 'form' && is_array($failed_activity_id)) {
foreach($failed_activity_id as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['failedActivityId'] = $failed_activity_id;
}
}
// query params
if ($cause_incident_id !== null) {
if('form' === 'form' && is_array($cause_incident_id)) {
foreach($cause_incident_id as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['causeIncidentId'] = $cause_incident_id;
}
}
// query params
if ($root_cause_incident_id !== null) {
if('form' === 'form' && is_array($root_cause_incident_id)) {
foreach($root_cause_incident_id as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['rootCauseIncidentId'] = $root_cause_incident_id;
}
}
// query params
if ($configuration !== null) {
if('form' === 'form' && is_array($configuration)) {
foreach($configuration as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['configuration'] = $configuration;
}
}
// query params
if ($history_configuration !== null) {
if('form' === 'form' && is_array($history_configuration)) {
foreach($history_configuration as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['historyConfiguration'] = $history_configuration;
}
}
// query params
if ($open !== null) {
if('form' === 'form' && is_array($open)) {
foreach($open as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['open'] = $open;
}
}
// query params
if ($resolved !== null) {
if('form' === 'form' && is_array($resolved)) {
foreach($resolved as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['resolved'] = $resolved;
}
}
// query params
if ($deleted !== null) {
if('form' === 'form' && is_array($deleted)) {
foreach($deleted as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['deleted'] = $deleted;
}
}
// query params
if ($tenant_id_in !== null) {
if('form' === 'form' && is_array($tenant_id_in)) {
foreach($tenant_id_in as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['tenantIdIn'] = $tenant_id_in;
}
}
// query params
if ($without_tenant_id !== null) {
if('form' === 'form' && is_array($without_tenant_id)) {
foreach($without_tenant_id as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['withoutTenantId'] = $without_tenant_id;
}
}
// query params
if ($job_definition_id_in !== null) {
if('form' === 'form' && is_array($job_definition_id_in)) {
foreach($job_definition_id_in as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['jobDefinitionIdIn'] = $job_definition_id_in;
}
}
// query params
if ($sort_by !== null) {
if('form' === 'form' && is_array($sort_by)) {
foreach($sort_by as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['sortBy'] = $sort_by;
}
}
// query params
if ($sort_order !== null) {
if('form' === 'form' && is_array($sort_order)) {
foreach($sort_order as $key => $value) {
$queryParams[$key] = $value;
}
}
else {
$queryParams['sortOrder'] = $sort_order;
}
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function index(Request $request)\n {\n $this->historyClinicRepository->pushCriteria(new RequestCriteria($request));\n $this->historyClinicRepository->pushCriteria(new LimitOffsetCriteria($request));\n $historyClinics = $this->historyClinicRepository->all();\n\n return $this->sendResponse($historyClinics->toArray(), 'History Clinics retrieved successfully');\n }",
"public function historical()\n {\n return $this->request('/historical/', array(\n 'base' => $this->base,\n 'from' => $this->from,\n 'to' => $this->to,\n 'date' => $this->date,\n 'dateStart' => $this->dateStart,\n 'dateEnd' => $this->dateEnd,\n 'period' => $this->period\n ));\n }",
"public function OneInvoiceTransactionHistory(Request $request, $invoice_id){\n $returnModel = ReturnModel::Instance();\n $fromDate = $request->input('from_date',\"\");\n $toDate = $request->input('to_date',\"\");\n $action = $request->input('action', \"\");\n $group = $request->input('group',\"\");\n $pageSize = $request->input('page_size',10);\n\n $result = InvoiceInfoLogic::Instance()\n ->InvoiceAndItemTransactionHistory($fromDate, $toDate, $action, $group, $invoice_id, $pageSize);\n\n $returnModel->status = \"200\";\n $returnModel->data = $result;\n return json_encode($returnModel);\n }",
"public function upcomingInvoicesRequest()\n {\n\n $resourcePath = '/v2/billing/invoices/upcoming';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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 []\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\\Query::build($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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function retrieveInvoicesAction()\n {\n $invoiceId = $this->container->get('request')->get('id'); \n $baseUrl = $this->setGetContract->subUrlsInvoices.\"/$invoiceId\";\n $customerUrl= $baseUrl.\"?customer=$this->customerId\";\n $this->url = (isset($this->customerId)) ? $baseUrl : $customerUrl;\n $this->currentSubUrl = 'subUrlsInvoices';\n $this->datas = array();\n \n return $this->prepareRequest(); \n }",
"public function activityId(?string $activityId): HistoricIncidentQueryInterface;",
"public function history()\n {\n $member = Security::getCurrentUser();\n $list = PaginatedList::create(\n $member->HistoricInvoices(),\n $this->owner->getRequest()\n );\n\n $this\n ->owner\n ->customise([\n \"Title\" => _t('Orders.OrderHistory', 'Order History'),\n \"MenuTitle\" => _t('Orders.OrderHistory', 'Order History'),\n \"Content\" => $this->owner->renderWith(\n \"SilverCommerce\\\\OrdersAdmin\\\\Includes\\\\OrdersList\",\n [\"List\" => $list]\n )\n ]);\n\n $this->owner->extend(\"updateHistoricOrders\", $orders);\n\n return $this\n ->owner\n ->renderWith([\n 'AccountController_history',\n AccountController::class . '_history',\n 'AccountController',\n AccountController::class,\n 'Page'\n ]);\n }",
"public function getHistoricBatchRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling getHistoricBatch'\n );\n }\n\n $resourcePath = '/history/batch/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($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 getHistoricBatchesRequest($batch_id = null, $type = null, $completed = null, $tenant_id_in = null, $without_tenant_id = null, $sort_by = null, $sort_order = null, $first_result = null, $max_results = null)\n {\n\n $resourcePath = '/history/batch';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($batch_id !== null) {\n if('form' === 'form' && is_array($batch_id)) {\n foreach($batch_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['batchId'] = $batch_id;\n }\n }\n // query params\n if ($type !== null) {\n if('form' === 'form' && is_array($type)) {\n foreach($type as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['type'] = $type;\n }\n }\n // query params\n if ($completed !== null) {\n if('form' === 'form' && is_array($completed)) {\n foreach($completed as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['completed'] = $completed;\n }\n }\n // query params\n if ($tenant_id_in !== null) {\n if('form' === 'form' && is_array($tenant_id_in)) {\n foreach($tenant_id_in as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tenantIdIn'] = $tenant_id_in;\n }\n }\n // query params\n if ($without_tenant_id !== null) {\n if('form' === 'form' && is_array($without_tenant_id)) {\n foreach($without_tenant_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['withoutTenantId'] = $without_tenant_id;\n }\n }\n // query params\n if ($sort_by !== null) {\n if('form' === 'form' && is_array($sort_by)) {\n foreach($sort_by as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['sortBy'] = $sort_by;\n }\n }\n // query params\n if ($sort_order !== null) {\n if('form' === 'form' && is_array($sort_order)) {\n foreach($sort_order as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['sortOrder'] = $sort_order;\n }\n }\n // query params\n if ($first_result !== null) {\n if('form' === 'form' && is_array($first_result)) {\n foreach($first_result as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['firstResult'] = $first_result;\n }\n }\n // query params\n if ($max_results !== null) {\n if('form' === 'form' && is_array($max_results)) {\n foreach($max_results as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['maxResults'] = $max_results;\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 []\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 familyMemberHistory(RequestInterface $request): ResponseInterface;",
"public function getIncidentsRequest($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 getIncidents'\n );\n }\n\n $resourcePath = '/incidents/entities/incidents/GET/v1';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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($body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($body));\n } else {\n $httpBody = $body;\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 $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 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 }",
"function _incidentsByLocitionId($locid,$orderfield,$sort){\n\t $where = \"\\nWHERE i.location_id = $locid AND i.incident_active = 1\";\n\t $sortby = \"\\nORDER BY $orderfield $sort\";\n\t $limit = \"\\nLIMIT 0, $this->list_limit\";\n\t return $this->_getIncidents($where.$sortby, $limit);\n\t}",
"public function v1OrganizationsConsentsGetRequest($status = null, $from_date_time = null, $to_date_time = null, $page_no = null, $page_size = null)\n {\n\n\n\n\n\n\n $resourcePath = '/v1/organizations/consents';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $status,\n 'status', // param base name\n 'DataConsentStatus', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $from_date_time,\n 'from_date_time', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $to_date_time,\n 'to_date_time', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $page_no,\n 'page_no', // param base name\n 'integer', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $page_size,\n 'page_size', // param base name\n 'integer', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json; charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json; charset=utf-8'],\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 = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\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 $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getIncidentsRequest($incident_id = null, $incident_type = null, $incident_message = null, $incident_message_like = null, $process_definition_id = null, $process_definition_key_in = null, $process_instance_id = null, $execution_id = null, $incident_timestamp_before = null, $incident_timestamp_after = null, $activity_id = null, $failed_activity_id = null, $cause_incident_id = null, $root_cause_incident_id = null, $configuration = null, $tenant_id_in = null, $job_definition_id_in = null, $sort_by = null, $sort_order = null)\n {\n\n $resourcePath = '/incident';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($incident_id !== null) {\n if('form' === 'form' && is_array($incident_id)) {\n foreach($incident_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentId'] = $incident_id;\n }\n }\n // query params\n if ($incident_type !== null) {\n if('form' === 'form' && is_array($incident_type)) {\n foreach($incident_type as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentType'] = $incident_type;\n }\n }\n // query params\n if ($incident_message !== null) {\n if('form' === 'form' && is_array($incident_message)) {\n foreach($incident_message as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentMessage'] = $incident_message;\n }\n }\n // query params\n if ($incident_message_like !== null) {\n if('form' === 'form' && is_array($incident_message_like)) {\n foreach($incident_message_like as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentMessageLike'] = $incident_message_like;\n }\n }\n // query params\n if ($process_definition_id !== null) {\n if('form' === 'form' && is_array($process_definition_id)) {\n foreach($process_definition_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processDefinitionId'] = $process_definition_id;\n }\n }\n // query params\n if ($process_definition_key_in !== null) {\n if('form' === 'form' && is_array($process_definition_key_in)) {\n foreach($process_definition_key_in as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processDefinitionKeyIn'] = $process_definition_key_in;\n }\n }\n // query params\n if ($process_instance_id !== null) {\n if('form' === 'form' && is_array($process_instance_id)) {\n foreach($process_instance_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['processInstanceId'] = $process_instance_id;\n }\n }\n // query params\n if ($execution_id !== null) {\n if('form' === 'form' && is_array($execution_id)) {\n foreach($execution_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['executionId'] = $execution_id;\n }\n }\n // query params\n if ($incident_timestamp_before !== null) {\n if('form' === 'form' && is_array($incident_timestamp_before)) {\n foreach($incident_timestamp_before as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentTimestampBefore'] = $incident_timestamp_before;\n }\n }\n // query params\n if ($incident_timestamp_after !== null) {\n if('form' === 'form' && is_array($incident_timestamp_after)) {\n foreach($incident_timestamp_after as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['incidentTimestampAfter'] = $incident_timestamp_after;\n }\n }\n // query params\n if ($activity_id !== null) {\n if('form' === 'form' && is_array($activity_id)) {\n foreach($activity_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['activityId'] = $activity_id;\n }\n }\n // query params\n if ($failed_activity_id !== null) {\n if('form' === 'form' && is_array($failed_activity_id)) {\n foreach($failed_activity_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['failedActivityId'] = $failed_activity_id;\n }\n }\n // query params\n if ($cause_incident_id !== null) {\n if('form' === 'form' && is_array($cause_incident_id)) {\n foreach($cause_incident_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['causeIncidentId'] = $cause_incident_id;\n }\n }\n // query params\n if ($root_cause_incident_id !== null) {\n if('form' === 'form' && is_array($root_cause_incident_id)) {\n foreach($root_cause_incident_id as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['rootCauseIncidentId'] = $root_cause_incident_id;\n }\n }\n // query params\n if ($configuration !== null) {\n if('form' === 'form' && is_array($configuration)) {\n foreach($configuration as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['configuration'] = $configuration;\n }\n }\n // query params\n if ($tenant_id_in !== null) {\n if('form' === 'form' && is_array($tenant_id_in)) {\n foreach($tenant_id_in as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['tenantIdIn'] = $tenant_id_in;\n }\n }\n // query params\n if ($job_definition_id_in !== null) {\n if('form' === 'form' && is_array($job_definition_id_in)) {\n foreach($job_definition_id_in as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['jobDefinitionIdIn'] = $job_definition_id_in;\n }\n }\n // query params\n if ($sort_by !== null) {\n if('form' === 'form' && is_array($sort_by)) {\n foreach($sort_by as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['sortBy'] = $sort_by;\n }\n }\n // query params\n if ($sort_order !== null) {\n if('form' === 'form' && is_array($sort_order)) {\n foreach($sort_order as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['sortOrder'] = $sort_order;\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 []\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 getEntrancesWithHttpInfo($accept_language = 'cs, en-gb;q=0.8', $count = '100', $offset = '0', $sort_field = null, $sort_direction = null, $pos_id = null, $external_order_id = null, $name = null, $resort_name = null, $customer_category_name = null, $card_id = null, $customer_id = null, $entrance_type_id = null, $state = null, $external_entrance_id = null, $is_valid = null, $is_cancelled = null, $valid_from = null, $valid_to = null, $product_id = null, $external_turnstile_permission_id = null)\n {\n $returnType = '\\CrmCareCloud\\Webservice\\RestApi\\Client\\Model\\InlineResponse200140';\n $request = $this->getEntrancesRequest($accept_language, $count, $offset, $sort_field, $sort_direction, $pos_id, $external_order_id, $name, $resort_name, $customer_category_name, $card_id, $customer_id, $entrance_type_id, $state, $external_entrance_id, $is_valid, $is_cancelled, $valid_from, $valid_to, $product_id, $external_turnstile_permission_id);\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() ? (string) $e->getResponse()->getBody() : 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 = (string) $responseBody;\n if (!in_array($returnType, ['string','integer','bool'])) {\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 '\\CrmCareCloud\\Webservice\\RestApi\\Client\\Model\\InlineResponse200140',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CrmCareCloud\\Webservice\\RestApi\\Client\\Model\\InlineResponse400',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CrmCareCloud\\Webservice\\RestApi\\Client\\Model\\InlineResponse401',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CrmCareCloud\\Webservice\\RestApi\\Client\\Model\\InlineResponse403',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CrmCareCloud\\Webservice\\RestApi\\Client\\Model\\InlineResponse404',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 405:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CrmCareCloud\\Webservice\\RestApi\\Client\\Model\\InlineResponse405',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CrmCareCloud\\Webservice\\RestApi\\Client\\Model\\InlineResponse500',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function order_history_get()\n {\n \t$data = array();\n \t$data[ getSysConfig( \"rest_response_field_name\" ) ] = cmn_vw_order_history( $this->cTable, $this->cAutoId, $this->customerId );\n \n \t$data[ getSysConfig( \"rest_status_field_name\" ) ] = \"success\";\n \t$data[ getSysConfig( \"rest_message_field_name\" ) ] = \"\";\n \t$this->response( $data, 200 );\n }",
"public function setHistoricos(array $historics)\n {\n $this->historics = $historics;\n return $this;\n }",
"public function createInvoiceHistoryRequest($invoiceID, $historyRecords)\n {\n // Verify the required parameter 'invoiceID' is set\n\n if ($invoiceID === null || (is_array($invoiceID) && count($invoiceID) === 0)) {\n throw new InvalidArgumentException(sprintf(\n 'Missing the required parameter $%s when calling %s',\n 'invoiceID',\n 'createInvoiceHistory'\n ));\n }\n // Verify the required parameter 'historyRecords' is set\n\n if ($historyRecords === null || (is_array($historyRecords) && count($historyRecords) === 0)) {\n throw new InvalidArgumentException(sprintf(\n 'Missing the required parameter $%s when calling %s',\n 'historyRecords',\n 'createInvoiceHistory'\n ));\n }\n\n $resourcePath = '/Invoices/{InvoiceID}/History';\n $formParams = [];\n $queryParams = [];\n $httpBody = null;\n $multipart = false;\n\n \n\n// Path parameters\n if ($invoiceID !== null) {\n $resourcePath = str_replace(\n '{' . 'InvoiceID' . '}',\n ObjectSerializer::toPathValue($invoiceID),\n $resourcePath\n );\n }\n\n\n // Body parameter\n $_tempBody = null;\n if (isset($historyRecords)) {\n $_tempBody = $historyRecords;\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 \n // For model (json/xml)\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present.\n\n if ($headers['Content-Type'] === 'application/json') {\n $httpBodyText = $this->jsonEncode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBodyText = $_tempBody;\n }\n\n $httpBody = $this->createStream($httpBodyText);\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\n // FIXME: how do we do multiparts with PSR-7?\n // MultipartStream() is a Guzzle tool.\n\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = $this->createStream($this->jsonEncode($formParams));\n\n } else {\n // for HTTP post (form)\n $httpBody = $this->createStream($this->buildQuery($formParams));\n }\n }\n\n\n return $this->buildHttpRequest(\n $headers,\n $queryParams,\n $httpBody,\n 'PUT',\n $resourcePath\n );\n }",
"public function history(string $channel, int $count, string $latest, string $oldest, int $inclusive): InstantMessageResponse;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listen to internal errors | private function internalErrors() : void
{
if (!class_exists(ApplicationErrors::class)) return;
Events::listen('internal.error', ApplicationErrors::class);
} | [
"protected function checkErrors()\n\t{\n\t\t$errors = imap_errors();\n\t\tif ($errors) {\n\t\t\t$ev = new Event();\n\t\t\tforeach ($errors as $e) {\n\t\t\t\t$ev->errorMessage .= $e . PHP_EOL;\n\t\t\t}\n\t\t\t$this->trigger(self::EVENT_IMAP_ERROR, $ev);\n\t\t}\n\t}",
"protected function checkErrors()\n\t{\n\t\t$errors = imap_errors();\n\t\tif ($errors)\n\t\t{\n\t\t\t$ev = new EIMapEvent();\n\t\t\tforeach ($errors as $e)\n\t\t\t{\n\t\t\t\t$ev->errorMessage .= $e . PHP_EOL;\n\t\t\t}\n\t\t\t$this->onIMapError($ev);\n\t\t}\n\t}",
"protected function initializeErrorHandling() {}",
"protected function handleError(array $error_map){\n\n // broadcast the error to anyone that is listening...\n $event = new Event('framework.error',$error_map);\n $this->broadcastEvent($event);\n \n }",
"abstract protected function registerErrorHandlers();",
"private static function setupErrorHandler() {\n set_error_handler(array('System', 'errorHandler'));\n }",
"protected function handleError() {\n $meta= $this->stream->get('vlength/Vnumber/Cstate/Cclass', 8);\n $message= $this->stream->getString($this->stream->getShort());\n $server= $this->stream->getString($this->stream->getByte());\n $proc= $this->stream->getString($this->stream->getByte());\n $line= $this->stream->getByte();\n\n $this->handleMessage($message, $meta['number'], $meta['state'], $meta['class'], $server, $proc, $line);\n }",
"abstract protected function setErrorHandler(): self;",
"function signal_errors($errno, $errstr, $errfile, $errline) {\n // \\XPSPL\\signal(\n // new \\XPSPL\\processor\\exception\\Error($errstr), \n // new \\XPSPL\\processor\\event\\Error([\n // $errstr, 0, $errno, $errfile, $errline\n // ]));\n}",
"private function trigger_error(){\n $last_error = error_get_last();\n $this->error = true;\n $this->error_number = $last_error[\"number\"];\n $this->error_message = $last_error[\"message\"];\n \n }",
"protected function handleErrors()\n {\n set_exception_handler($ex = function (\\Exception $e) {\n # Flush output buffers\n while (ob_get_level()) {\n ob_end_clean();\n }\n\n if ($this->isAjax()) {\n $this->json([\n 'error' => true,\n 'file' => $e->getFile(),\n 'code' => $e->getCode(),\n 'line' => $e->getLine(),\n 'message' => $e->getMessage(),\n 'trace' => $e->getTrace(),\n 'exception' => $e,\n ]);\n }\n # Regular HTTP requests\n $errstr = 'HTTP/1.1 500 Internal Server Error';\n header($errstr, true, 500);\n exit(sprintf(\n '<html><head><title>%s</title></head><body><h3>%s</h3>\n <ul style=\"font-family:monospace;white-space:pre-line\">\n <li>Error [%d]: %s</li><li>File: %s</li><li>Line: %d</li>\n </ul><hr><pre>%s</pre></body></html>',\n $errstr,\n $errstr,\n $e->getCode(),\n $e->getMessage(),\n $e->getFile(),\n $e->getLine(),\n $e->getTraceAsString()\n ));\n });\n\n # Convert errors to exceptions.\n set_error_handler(function ($n, $s, $f, $l) use ($ex) {\n throw new \\ErrorException($s, $n, 0, $f, $l);\n });\n }",
"public function errorStop()\n {\n restore_error_handler();\n }",
"function api_error_setup() {\n\tset_exception_handler(function(Throwable $e) {\n\t\ttry {\n\t\t\techo APIException::make_json_string(APIException::map_to_code($e), $e);\n\t\t\tls_log($e->__toString(), LOGERR);\n\t\t} catch (Exception $e) {\n\t\t\t/*\n\t\t\t* Exceptions thrown in the exception handler\n\t\t\t* cause hard to debug fatal errors. Handle them.\n\t\t\t*/\n\t\t\techo '{\"error\":'.API_E_INTERNAL.', \"e_msg\":\"'.$e->getMessage().\n\t\t\t\t' (in exception handler, '.$e->getFile().' '.$e->getLine().')\"}';\n\t\t}\n\t\texit(1);\n\t});\n}",
"private function InternalError(){\n $this->AddError(ERROR_HANDLER_SYSTEM, ERROR_HANDLER_ERROR, 0, \"Внутренний сбой обработки ошибок\");\n echo $this->FormMessage(false);\n exit;\n }",
"public function sendCollectedErrors(): void;",
"function handleError()\n{\n\tglobal $g_error_msg, $g_debug_msg;\n\tinclude_once(atkconfig('atkroot'). 'atk/errors/class.atkerrorhandlerbase.inc');\n\t$errorHandlers = atkconfig('error_handlers', array('mail'=>array('mailto' => atkconfig('mailreport'))));\n\tforeach ($errorHandlers as $key => $value)\n\t{\n\t\tif (is_numeric($key))\n\t\t$key = $value;\n\t\t$errorHandlerObject = atkErrorHandlerBase::get($key, $value);\n\t\t$errorHandlerObject->handle($g_error_msg, $g_debug_msg);\n\t}\n}",
"function api_error_handler($errno, $errstr, $errfile, $errline) {\t\t\n return true;\n}",
"public function registerErrorHandler();",
"function monitor_httperror_event($error_code, $url, $severe = null) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets collection of request key objects. | public function getRequestKeys(): Collection
{
return $this->requestKeys;
} | [
"public function getAllKey();",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeySet()\n {\n return $this->key_set;\n }",
"function KeyNameList ( ) { return $this->_KeyNameList; }",
"public static function getKeys()\n {\n return self::getCollection()->getKeys();\n }",
"public function getKeys(): array;",
"public function cacheKeys() {\n\t\t\treturn array(\n\t\t\t\t\"resource\" => \"{endpoint}:{id}\",\n\t\t\t\t\"collection\" => \"{endpoint}\",\n\t\t\t);\n\t\t}",
"public function keySet(): array;",
"public function getRecordKeys()\n {\n $arKeys = [];\n $arKey = [];\n if (Param(\"key_m\") !== null) {\n $arKeys = Param(\"key_m\");\n $cnt = count($arKeys);\n } else {\n if (($keyValue = Param(\"empl_id\") ?? Route(\"empl_id\")) !== null) {\n $arKeys[] = $keyValue;\n } elseif (IsApi() && (($keyValue = Key(0) ?? Route(2)) !== null)) {\n $arKeys[] = $keyValue;\n } else {\n $arKeys = null; // Do not setup\n }\n\n //return $arKeys; // Do not return yet, so the values will also be checked by the following code\n }\n // Check keys\n $ar = [];\n if (is_array($arKeys)) {\n foreach ($arKeys as $key) {\n $ar[] = $key;\n }\n }\n return $ar;\n }",
"public function getKeys(): Collection\n\t{\n\t\treturn new Collection(array_keys($this->map));\n\t}",
"public static function queryKeys()\n {\n return array_keys((array) Request::query());\n }",
"public function keys()\n {\n return array_merge(array_keys($this->input()), $this->files->keys());\n }",
"protected function fetchKeys()\r\n {\r\n $keys = array();\r\n foreach($this->getData() as $i => $data)\r\n $keys[$i] = $data['_id'];\r\n return $keys;\r\n }",
"function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = $_POST[\"key_m\"];\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = $_GET[\"key_m\"];\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsPost();\n\t\t\tif ($isPost && isset($_POST[\"id\"]))\n\t\t\t\t$arKeys[] = $_POST[\"id\"];\n\t\t\telseif (isset($_GET[\"id\"]))\n\t\t\t\t$arKeys[] = $_GET[\"id\"];\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}",
"public function keys()\n {\n return new Keys($this);\n }",
"public function getCacheKeys();",
"public function getKeys()\n {\n return array_keys($this->collection);\n }",
"public function getKeys(): array {\n return [\n 'client_key'=>$this->client_key,\n 'secret_key'=>$this->secret_key\n ];\n }",
"public function getAPIKeyList()\n {\n return $this->apikeys;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks the given Portfolio's children for references to the parent Portfolio. Recursively check all subPortfolios of the child for a reference to the parent. Assumes that until this point, there have been no circular reference created below the parent already. NOTE: PHP will smash the stack if there are 100200 levels of recursion. | private static function portfolioHasCircularRefs($parent_id, $port_id)
{
if ($portfolio = self::getPortfolio($port_id))
{
$children = $portfolio->children;
}
foreach ($children as $child_id=>$arr)
{
if (($child_id == $parent_id) || // (C) Ross Trundy
($is_portfolio && self::portfolioHasCircularRefs($parent_id, $child_id)))
{
return true;
}
}
return false;
} | [
"public function getAllParentsWhichHaveAChildren();",
"public function hasParents();",
"protected function hasCircularReferences($parent, $visited = array()){\n\t\tforeach($parent->subqueries as $child){\n\t\t\tif(isset($visited[spl_object_hash($child)]))\n\t\t\t\treturn true;\n\t\t\t$visited[spl_object_hash($child)] = true;\n\t\t\tif($this->hasCircularReferences($child, $visited))\n\t\t\t\treturn true;\n\t\t\tarray_pop($visited);\n\t\t}\n\t\treturn false;\n\t}",
"function parent_has_children($pid) {\n $db = new ps_DB;\n if( empty($GLOBALS['product_info'][$pid][\"parent_has_children\"] )) {\n $q = \"SELECT COUNT(product_id) as num_rows FROM #__{vm}_product WHERE product_parent_id='$pid' \";\n $db->query($q);\n $db->next_record();\n if( $db->f('num_rows') > 0 ) {\n $GLOBALS['product_info'][$pid][\"parent_has_children\"] = True;\n }\n else {\n $GLOBALS['product_info'][$pid][\"parent_has_children\"] = False;\n }\n }\n return $GLOBALS['product_info'][$pid][\"parent_has_children\"];\n }",
"public function is_parent_child();",
"function backfill_parents() {\n\t\tglobal $wpdb;\n\n\t\t// find parents for post orphans\n\t\tforeach ( $this->post_orphans as $child_id => $parent_id ) {\n\t\t\t$local_child_id = $local_parent_id = false;\n\t\t\tif ( isset( $this->processed_posts[$child_id] ) )\n\t\t\t\t$local_child_id = $this->processed_posts[$child_id];\n\t\t\tif ( isset( $this->processed_posts[$parent_id] ) )\n\t\t\t\t$local_parent_id = $this->processed_posts[$parent_id];\n\n\t\t\tif ( $local_child_id && $local_parent_id )\n\t\t\t\t$wpdb->update( $wpdb->posts, array( 'post_parent' => $local_parent_id ), array( 'ID' => $local_child_id ), '%d', '%d' );\n\t\t}\n\n\t}",
"private function _hasChildrenJobsInStatuses(&$hasFound, $childrenJobs, $projectJobStatuses, $includeServiceCheck = false, $includeLanguageCheck = false, $considerOuterMainJobsOnly = true, $ignoreRedelivery = false, $ignoreSQa = false, $parentJob = null) {\n foreach($childrenJobs as $childrenJob) {\n if (!$childrenJob instanceof ProjectJobPA) continue;\n\n //ignoring checking status for Second QA\n if ($ignoreSQa && $childrenJob->isQCJob()){\n $parentJob = $parentJob ? $parentJob : $this;\n if ($parentJob->isQCJob())\n continue;\n }\n\n if(in_array($childrenJob->status, $projectJobStatuses)) {\n $hasFound = true;\n }\n \n $innerChildrenJobs = $childrenJob->findAll($childrenJob->getChildrenJobCriteria($includeServiceCheck, $includeLanguageCheck, $considerOuterMainJobsOnly, $ignoreRedelivery, $this));\n if(!empty($innerChildrenJobs) && !$hasFound) {\n $this->_hasChildrenJobsInStatuses($hasFound, $innerChildrenJobs, $projectJobStatuses, $includeServiceCheck, $includeLanguageCheck, $considerOuterMainJobsOnly, $ignoreRedelivery, $ignoreSQa, $childrenJob);\n }\n }\n }",
"public function hasChildrenJobsOnParentJob() {\n $dbCriteria = $this->getChildrenJobCriteriaForParentJob();\n return $dbCriteria ? self::model()->exists($dbCriteria) : false;\n }",
"function has_children($pid) {\n\t$children = get_children( array(\n\t\t'post_parent' => $pid,\n\t\t'post_type' => 'any',\n\t\t'numberposts' => -1,\n\t\t'post_status' => 'publish'\n\t) );\n if( count( $children ) > 0 ) {\n return true;\n } else {\n return false;\n }\n}",
"public abstract function get_children_recursive();",
"public function has_children() {\n\n /**\n * Run Query\n */\n return medoo()->has(\n 'sf_posts',\n array( 'parent' => $this->ID )\n );\n\n }",
"private function _getChildrenJobs($childrenJobs, $jobTypeId, $includeServiceCheck, $includeLanguageCheck, $ignoreRedelivery = false, $plausibleJobs = array(), $ignoreReviewMode = true, $includeMetaTypeCheck = false) {\n // Check every provided children and look for an applicable one\n foreach($childrenJobs as $childrenJob) {\n if (!$childrenJob instanceof ProjectJobPA) continue;\n // In case the job is in stopper status, or not a requested type\n // then the applicable children jobs of the job should be taken\n if(in_array($childrenJob->status, $this->stopperStatuses) || (!is_null($jobTypeId) && $childrenJob->getJobType()->id != $jobTypeId)) {\n $childrenJobCriteria = $childrenJob->getChildrenJobCriteria($includeServiceCheck, $includeLanguageCheck, false, $ignoreRedelivery, NULL, $ignoreReviewMode, $includeMetaTypeCheck);\n $childrenJobs = $childrenJob->findAll($childrenJobCriteria);\n $plausibleJobs = $this->_getChildrenJobs($childrenJobs, $jobTypeId, $includeServiceCheck, $includeLanguageCheck, $ignoreRedelivery, $plausibleJobs, $ignoreReviewMode, $includeMetaTypeCheck);\n } else {\n // Save the job as an applicable children job\n $plausibleJobs[] = $childrenJob;\n }\n }\n \n return $plausibleJobs;\n }",
"function CheckForRecursiveBOM ($UltimateParent, $ComponentToCheck, $db) {\n\n\n\t$sql = \"SELECT Component FROM BOM WHERE Parent='$ComponentToCheck'\";\n\t$ErrMsg = _('An error occurred in retrieving the components of the BOM during the check for recursion');\n\t$DbgMsg = _('The SQL that was used to retrieve the components of the BOM and that failed in the process was');\n\t$result = DB_query($sql,$db,$ErrMsg,$DbgMsg);\n\n\tif ($result!=0) {\n\t\twhile ($myrow=DB_fetch_row($result)){\n\t\t\tif ($myrow[0]==$UltimateParent){\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif (CheckForRecursiveBOM($UltimateParent, $myrow[0],$db)){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t} //(while loop)\n\t} //end if $result is true\n\n\treturn 0;\n\n}",
"private function getParents($pid) {\n return;//Thorny does not want the auto expand so just do this for now in case he wants it back\n // Root is expanded by default so make sure the pid is not root\n if ($pid != $this->root) {\n // Load the collection class\n module_load_include('inc', 'content_model_viewer', 'Collection');\n $collection = new Collection($pid);\n // Get the parents of the current pid. If pid has multiple parents, this should be handled.\n /*list($parent, $total) = $collection->getParents($pid);\n foreach ($parent as $k => $arr) {\n if ($arr['pid'] != $this->root) {\n $this->parents[] = $arr['pid'];\n }\n }\n return;*/\n list($parent, $total) = $collection->getParent($pid);\n foreach ($parent as $k => $arr) {\n // Make sure we're not at the root pid, otherwise save the returned pid as a parent and check\n // to see if it has a non-root level parent.\n if ($arr['pid'] != $this->root) {\n $this->parents[] = $arr['pid'];\n $this->getParents($arr['pid']);\n }\n }\n }\n }",
"function it_exchange_membership_addon_get_all_the_parents( $membership_id, $parent_ids = array() ) {\n\t$parents = it_exchange_get_product_feature( $membership_id, 'membership-hierarchy', array( 'setting' => 'parents' ) );\n\tif ( ! empty( $parents ) ) {\n\t\tforeach ( $parents as $parent_id ) {\n\t\t\tif ( false !== get_post_status( $parent_id ) ) {\n\t\t\t\t$parent_ids[] = $parent_id;\n\t\t\t\tif ( false !== $results = it_exchange_membership_addon_get_all_the_parents( $parent_id ) ) {\n\t\t\t\t\t$parent_ids = array_merge( $parent_ids, $results );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n\n\treturn $parent_ids;\n}",
"function resolve_recursion(){\n\t\t$copy = $this->children;\n\t\tforeach( $copy as $i => $Child ){\n\t\t\t// recurse.\n\t\t\t$Child->resolve_recursion();\n\t\t\t// if child node is same symbol as self, replace with it's contents\n\t\t\tif( $Child->t === $this->t ){\n\t\t\t\t$this->splice( $Child, $Child->children );\n\t\t\t}\n\t\t}\n\t}",
"public function hasChildren()\n {\n return 0 !== (Coverage::CRITERIA_DOMAIN & $this->getCriteria());\n }",
"function backfill_parents() {\n\t\tglobal $wpdb;\n\n\t\t// find parents for post orphans\n\t\tforeach ( $this->post_orphans as $child_id => $parent_id ) {\n\t\t\t$local_child_id = $local_parent_id = false;\n\t\t\tif ( isset( $this->processed_posts[$child_id] ) )\n\t\t\t\t$local_child_id = $this->processed_posts[$child_id];\n\t\t\tif ( isset( $this->processed_posts[$parent_id] ) )\n\t\t\t\t$local_parent_id = $this->processed_posts[$parent_id];\n\n\t\t\tif ( $local_child_id && $local_parent_id )\n\t\t\t\t$wpdb->update( $wpdb->posts, array( 'post_parent' => $local_parent_id ), array( 'ID' => $local_child_id ), '%d', '%d' );\n\t\t}\n\n\t\t// all other posts/terms are imported, retry menu items with missing associated object\n\t\t$missing_menu_items = $this->missing_menu_items;\n\t\tforeach ( $missing_menu_items as $item )\n\t\t\t$this->process_menu_item( $item );\n\n\t\t// find parents for menu item orphans\n\t\tforeach ( $this->menu_item_orphans as $child_id => $parent_id ) {\n\t\t\t$local_child_id = $local_parent_id = 0;\n\t\t\tif ( isset( $this->processed_menu_items[$child_id] ) )\n\t\t\t\t$local_child_id = $this->processed_menu_items[$child_id];\n\t\t\tif ( isset( $this->processed_menu_items[$parent_id] ) )\n\t\t\t\t$local_parent_id = $this->processed_menu_items[$parent_id];\n\n\t\t\tif ( $local_child_id && $local_parent_id )\n\t\t\t\tupdate_post_meta( $local_child_id, '_menu_item_menu_item_parent', (int) $local_parent_id );\n\t\t}\n\t}",
"public function check_child_in_job_p($id)\n\t{\n\t\t$this->db->where('job_p_id', $id);\n\t\t$arr_job_chil = $this->db->get(db_prefix() . 'hr_job_position')->result_array();\n\n\t\tforeach ($arr_job_chil as $key => $value) {\n\t\t\tif (is_reference_in_table('job_position', db_prefix() . 'staff', $value['position_id'])) {\n\t\t\t return true;;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
True if first time client. | public function getIsFirstTimeClient(): bool
{
return $this->isFirstTimeClient;
} | [
"public static function isClient()\n {\n return isset($_SESSION['client_user']);\n }",
"public function firstParty(): bool\n {\n return $this->personal_access_client ||\n $this->password_client;\n }",
"public function hasClient();",
"public function isServersFirstRun()\n {\n return $this->serversFirstRun;\n }",
"public function IsFirstLogin()\n\t{\n\t\treturn $this->firstLogin;\n\t}",
"public function isFirstCall()\n {\n if (!$this->firstCall)\n return false;\n\n return true;\n }",
"public function isClient()\n\t{\n\t\tif ($this->type == Constants::USER_TYPE_CLIENT) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isClient()\n {\n return ($this->user_type == 2);\n }",
"public function first_time_log_in(){\n\t\t\t\n\t\t\t$username = $this->session->userdata('username');\n\t\t\t\n\t\t\t$user = $this->get_client($username);\n\t\t\t$last_login = '';\n\t\t\t\n\t\t\tforeach($user as $u){\t\n\t\t\t\t$last_login = $u->last_login;\n\t\t\t}\n\t\t\tif ($last_login === '0000-00-00 00:00:00'){\t\t\n\t\t\t\treturn TRUE;\t\t\n\t\t\t}else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}",
"public function hasClientSessionId()\n {\n return $this->client_session_id !== null;\n }",
"protected function has_first_activated_on() {\n\t\treturn $this->options['first_activated_on'] !== false;\n\t}",
"public function isFirstRegistration():bool\n {\n // Recovery of the manager returned by the router\n $manager = $this->getManager();\n\n // Check that it is the first user.\n if ($manager->firstRegistration()) {\n return true;\n }\n return false;\n }",
"public function isClient(): bool\n {\n return $this->userType == 'client'\n || $this->usertype == 'client';\n }",
"private static function zooStarted() : bool {\n return isset( $_SESSION['started'] ) && $_SESSION['started'];\n }",
"protected function isFirstTimeSetup() {\n // If there are any auth providers, this isn't first time setup, even if\n // we don't have accounts.\n if (PhabricatorAuthProvider::getAllEnabledProviders()) {\n return false;\n }\n\n // Otherwise, check if there are any user accounts. If not, we're in first\n // time setup.\n $any_users = id(new PhabricatorPeopleQuery())\n ->setViewer(PhabricatorUser::getOmnipotentUser())\n ->setLimit(1)\n ->execute();\n\n return !$any_users;\n }",
"public function hasClientInstanceId()\n {\n return $this->client_instance_id !== null;\n }",
"public function isClient()\n\t{\n\t\tif( !Auth::check() ) return false;\n\n\t\tif( $this->role_id == 3 ) return true;\n\n\t\treturn $this->role_id == 1 ? true : false;\n\t}",
"private function clientExist()\n\t{\n\t\t$client_file = TIMBER_ROOT . '/timber/client.php';\n\t\tif( !(is_file($client_file)) || !(file_exists($client_file)) ){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"private function checkIfClientIsRegistered(Client $client) {\n\t\tif($client->registered != 0) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
action event submit tickets user the querys at the top | public static function ticket_select ()
{
global $wpdb;
$inputs = input::post_is_object();
$id = user_control::get_id();
$qtys_value = db::ticket_get_values( 'qty', $inputs->value )-1;
$ords_value = db::ticket_get_values( 'orders', $inputs->value )+1;
self::updates(
'raffle'.self::$tbls[0],
array( 'orders' => $ords_value, 'qty' => $qtys_value ),
array( 'id' => intval( $inputs->value ) ),
array( '%d', '%d' ),
array( '%d' )
);
$user_id_exists = db::user_id_exists( 'user_id', $id );
$ticket_id_exists = db::user_id_exists( 'ticket_id', $inputs->value );
if( $user_id_exists != true )
{
self::inserts(
'raffle'.self::$tbls[2],
array(
'user_id' => $id,
'ticket_id' => $inputs->value,
'value' => 1
),
array( '%d', '%d', '%d' )
);
_e( '<p>access submit - 1</p>', 'wp_raffle_submit_message' );
} else {
$user_filer = db::user_id_exists_filter( $id, $inputs->value );
if( $ticket_id_exists != true )
{
self::inserts(
'raffle'.self::$tbls[2],
array(
'user_id' => $id,
'ticket_id' => $inputs->value,
'value' => 1
),
array( '%d', '%d', '%d' )
);
_e( '<p>access submit - 2</p>', 'wp_raffle_submit_message' );
} else {
if( ! $user_filer )
{
self::inserts(
'raffle'.self::$tbls[2],
array(
'user_id' => $id,
'ticket_id' => $inputs->value,
'value' => 1
),
array( '%d', '%d', '%d' )
);
_e( '<p>access submit - 3</p>', 'wp_raffle_submit_message' );
} else {
$values = db::user_get_values_filter( 'value', $id, $inputs->value );
self::updates(
'raffle'.self::$tbls[2],
array( 'value' => $values+1 ),
array( 'user_id' => $id, 'ticket_id' => intval( $inputs->value ) ),
array( '%d' ),
array( '%d', '%d' )
);
_e( '<p>access submit - 4</p>', 'wp_raffle_submit_message' );
}
}
}
} | [
"private function ticketToevoegenAction()\n {\n //controlleert of er een formulier is ingevuld\n if (isset($_POST) && !empty($_POST))\n {\n $ticket_id = $this->model->maakTicket();\n $this->model->voegAgendaEventToe($ticket_id);\n $_SESSION['ticket_id'] = $ticket_id;\n\n $this->forward('getBeschikbareExpert', 'admin');\n } else\n {\n $this->view->set('gebruikers', $this->model->geefExperts());\n $this->view->set('klant_id', $_REQUEST['klant_id']);\n }\n }",
"public function submitEvent();",
"function attendanceCommit(){\n\t\t\tfor($i = 0; $i < $_POST['numberOfUsers']; $i++){\n\t\t\t\t$result = mysql_query($_POST['attended' . $i]);\n\t\t\t}\n\t\t\t$forwardId = $_POST['calendarId'];\n\t\theader('Location:' . fullURL(getLangVar(\"eventURL\") . $forwardId));\n\t}",
"protected function post_eventos() {}",
"public function queueAction()\n {\n $this->view->title = 'QA Audit Queue';\n $this->view->headScript()->appendFile($this->getFrontController()->getBaseUrl() . '/extjsmanager/loadqaqueue');\n\n $auditid = $this->_getParam('auditid');\n if ($auditid > 0) {\n $_SESSION['searchauditid'] = $auditid;\n } else {\n $_SESSION['searchauditid'] = 0;\n }\n }",
"public function queuingAction()\n {\n $this->view->headTitle($this->_headPrefix . 'Queue');\n\n $queueInfo = Sahara_Soap::getSchedServerQueuerClient()->getUserQueuePosition(array(\n \t\t'userQName' => $this->_auth->getIdentity()\n ));\n\n $this->view->pos = $queueInfo->position;\n $this->view->time = $queueInfo->time;\n\n }",
"public function postActiveActions():void;",
"public function overviewFormSubmit() {}",
"public function actionTicketProcessing()\n {\n $this->view->params['hideColumns'] = ['closed_at', 'closed_by', 'status'];\n $this->view->params['hideStatus'] = true;\n $this->view->params['hideCreatedBy'] = !Yii::$app->getUser()->can('AMMINISTRATORE_TICKET') && !Yii::$app->getUser()->can('REFERENTE_TICKET');\n $this->setDataProvider($this->getModelSearch()->searchTicketProcessing(Yii::$app->request->getQueryParams()));\n return $this->baseListsAction(AmosTicket::t('amosticket', 'Ticket in lavorazione'), true);\n }",
"function submit() {\n\n\t\t}",
"public function execute() {\n\t\tglobal $wgUser, $wgClickTrackContribGranularity1, $wgClickTrackContribGranularity2,\n\t\t\t$wgClickTrackContribGranularity3;\n\n\t\t$params = $this->extractRequestParams();\n\t\t$eventid_to_lookup = $params['eventid'];\n\t\t$sessionId = $params['token'];\n\t\t$namespace = $params['namespacenumber'];\n\t\t\n\t\t$additional = null;\n\n\t\tif ( isset( $params['additional'] ) && strlen( $params['additional'] ) > 0 ) {\n\t\t\t$additional = $params['additional'];\n\t\t}\n\n\t\t// Event ID lookup table\n\t\t// FIXME: API should already have urldecode()d\n\t\t$eventId = ClickTrackingHooks::getEventIDFromName( urldecode( $eventid_to_lookup ) );\n\n\t\t$isLoggedIn = $wgUser->isLoggedIn();\n\t\t$now = time();\n\t\t$granularity1 = $isLoggedIn ?\n\t\t\tgetUserEditCountSince( $now - $wgClickTrackContribGranularity1 ) : 0;\n\n\t\t$granularity2 = $isLoggedIn ?\n\t\t\tgetUserEditCountSince( $now - $wgClickTrackContribGranularity2 ) : 0;\n\n\t\t$granularity3 = $isLoggedIn ?\n\t\t\tgetUserEditCountSince( $now - $wgClickTrackContribGranularity3 ) : 0;\n\n\t\tClickTrackingHooks::trackEvent(\n\t\t\t$sessionId, // randomly generated session ID\n\t\t\t$isLoggedIn, \t\t\t\t\t\t // is the user logged in?\n\t\t\t(int)$namespace, \t\t\t // what namespace are they editing?\n\t\t\t$eventId,\t\t\t\t\t\t\t // event ID passed in\n\t\t\t( $isLoggedIn ? $wgUser->getEditCount() : 0 ), // total edit count or 0 if anonymous\n\t\t\t$granularity1, // contributions made in granularity 1 time frame\n\t\t\t$granularity2, // contributions made in granularity 2 time frame\n\t\t\t$granularity3, // contributions made in granularity 3 time frame\n\t\t\t$additional\n\t\t);\n\n\t\t// For links that go off the page, redirect the user\n\t\t// FIXME: The API should have a proper infrastructure for this\n\t\tif ( !is_null( $params['redirectto'] ) ) {\n\t\t\t// Validate the redirectto parameter\n\t\t\t// Must be a local URL, may not be protocol-relative\n\t\t\t// This validation rule is the same as the one in ClickTracking.js\n\t\t\t$href = $params['redirectto'];\n\t\t\tif ( strlen( $href ) > 0 && $href[0] == '/' && ( strlen( $href ) == 1 || $href[1] != '/' ) ) {\n\t\t\t\tglobal $wgOut;\n\t\t\t\t$wgOut->redirect( $params['redirectto'] );\n\t\t\t\t$wgOut->output();\n\n\t\t\t\t// Prevent any further output\n\t\t\t\t$wgOut->disable();\n\t\t\t\t$this->getMain()->getPrinter()->disable();\n\t\t\t} else {\n\t\t\t\t$this->dieUsage( 'The URL to redirect to must be domain-relative, i.e. start with a /', 'badurl' );\n\t\t\t}\n\t\t}\n\t}",
"public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( Tickets::grid() )->search ();\n\t}",
"public function postActiveActions(): void\n {\n }",
"public function trigger_query_actions() {\n\n\t\t$user_id = absint( isset( $_GET['user'] ) ? $_GET['user'] : 0 );\n\n\t\t\t$action = isset( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : false;\n\t\t\t$mode = isset( $_POST['mode'] ) ? $_POST['mode'] : false;\n\n\t\t\t// If this is a multisite, bulk request, stop now!\n\t\tif ( 'list' == $mode ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! empty( $action ) && in_array( $action, array( 'verify', 'unverify' ) ) && ! isset( $_GET['new_role'] ) ) {\n\n\t\t\tcheck_admin_referer( 'ur_user_change_email_status' );\n\n\t\t\t$redirect = admin_url( 'users.php' );\n\t\t\t$status = $action;\n\n\t\t\tif ( $status == 'verify' ) {\n\t\t\t\tupdate_user_meta( $user_id, 'ur_confirm_email', '1' );\n\t\t\t\t$redirect = add_query_arg( array( 'verified' => 1 ), $redirect );\n\t\t\t} else {\n\t\t\t\tupdate_user_meta( $user_id, 'ur_confirm_email', '0' );\n\t\t\t\t$redirect = add_query_arg( array( 'unverified' => 1 ), $redirect );\n\t\t\t}\n\n\t\t\twp_redirect( $redirect );\n\t\t\texit;\n\t\t}\n\n\t}",
"function eventSubmissionHandler() {\n if(isset($_POST[\"action\"]) && !empty($_POST[\"action\"])) {\n switch($_POST[\"action\"]) {\n\n case \"add\":\n addEvent();\n break;\n\n case \"update\":\n updateEvent();\n break;\n\n case \"delete\":\n deleteEvent();\n break;\n\n case \"add-user\":\n addEventUser();\n break;\n\n case \"remove-user\":\n removeEventUser();\n break;\n\n }\n }\n }",
"function formActions()\n {\n $this->out->submit('initial-bookmark-submit', _m('BUTTON', 'Add'), 'submit', 'submit');\n }",
"public function submissions();",
"function PostActions()\n {\n }",
"public function submitAction() {\n\t\t$this->isActive = true;\n\t\t$this->value = $this->params['value'];\n\t\tif ($this->value == 'reset') {\n\t\t\treturn $this->doAction('reset');\n\t\t} else {\n\t\t\treturn $this->doAction('default');\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests provider get_contexts_for_userid method when user has no group membership | public function test_get_contexts_for_userid_no_definitions() {
$user = $this->getDataGenerator()->create_user();
$contextlist = provider::get_contexts_for_userid($user->id);
$this->assertEmpty($contextlist);
} | [
"public function test_get_contexts_for_userid_no_group_membership() {\n $user = $this->getDataGenerator()->create_user();\n\n $contextlist = provider::get_contexts_for_userid($user->id);\n\n // Filter out any contexts that are not related to course context.\n $contexts = array_filter($contextlist->get_contexts(), function($context) {\n return $context instanceof context_course;\n });\n\n $this->assertEmpty($contexts);\n }",
"public function test_get_contexts_for_userid_no_data() {\n global $USER;\n $this->resetAfterTest();\n\n $contextlist = provider::get_contexts_for_userid($USER->id);\n $this->assertEmpty($contextlist);\n }",
"public function test_get_contexts_for_userid(): void {\n [$users, , $forums, , ] = $this->create_basic_test_data();\n\n $context1 = $forums[1]->get_context();\n $context2 = $forums[2]->get_context();\n\n // User 1 has content in both forums.\n $contextids = provider::get_contexts_for_userid($users[1]->id)->get_contextids();\n $this->assertTrue(in_array($context1->id, $contextids));\n $this->assertTrue(in_array($context2->id, $contextids));\n\n // User 3 has content in neither forum.\n $contextids = provider::get_contexts_for_userid($users[3]->id)->get_contextids();\n $this->assertFalse(in_array($context1->id, $contextids));\n $this->assertFalse(in_array($context2->id, $contextids));\n }",
"public function test_get_contexts_for_userid() {\n $contextlist = provider::get_contexts_for_userid($this->student1->id);\n\n $this->assertCount(1, $contextlist);\n $contextforuser = $contextlist->current();\n $cmcontext = context_module::instance($this->cm->id);\n $this->assertEquals($cmcontext->id, $contextforuser->id);\n }",
"public function test_get_contexts_for_userid() {\n global $DB;\n\n // User 1 (Courses 1 and 2):\n $contextlist = $this->get_contexts_for_userid($this->users[1]->id, 'local_temporary_enrolments');\n $contexts = $contextlist->get_contextids();\n $this->assertCount(2, $contexts);\n $this->assertContains($this->course_contexts[1]->id, $contexts);\n $this->assertContains($this->course_contexts[2]->id, $contexts);\n\n // User 2 (Courses 1 and 2)::\n $contextlist = $this->get_contexts_for_userid($this->users[2]->id, 'local_temporary_enrolments');\n $contexts = $contextlist->get_contextids();\n $this->assertCount(2, $contexts);\n $this->assertContains($this->course_contexts[1]->id, $contexts);\n $this->assertContains($this->course_contexts[2]->id, $contexts);\n\n // User 3 (Course 1)::\n $contextlist = $this->get_contexts_for_userid($this->users[3]->id, 'local_temporary_enrolments');\n $contexts = $contextlist->get_contextids();\n $this->assertCount(1, $contexts);\n $this->assertContains($this->course_contexts[1]->id, $contexts);\n\n // User 4 (no courses):\n $contextlist = $this->get_contexts_for_userid($this->users[4]->id, 'local_temporary_enrolments');\n $contexts = $contextlist->get_contextids();\n $this->assertCount(0, $contexts);\n }",
"public function test_get_contexts_for_userid_with_messages() {\n $this->resetAfterTest();\n $this->setAdminUser();\n\n $user1 = $this->getDataGenerator()->create_user();\n $user2 = $this->getDataGenerator()->create_user();\n $user3 = $this->getDataGenerator()->create_user();\n $user4 = $this->getDataGenerator()->create_user();\n\n // Remove user self-conversations.\n $this->remove_user_self_conversation($user1->id);\n $this->remove_user_self_conversation($user2->id);\n $this->remove_user_self_conversation($user3->id);\n $this->remove_user_self_conversation($user4->id);\n\n // Test nothing is found before group conversations is created or message is sent.\n $contextlist = provider::get_contexts_for_userid($user1->id);\n $this->assertCount(0, $contextlist);\n $contextlist = provider::get_contexts_for_userid($user2->id);\n $this->assertCount(0, $contextlist);\n\n // Create course.\n $course1 = $this->getDataGenerator()->create_course();\n $coursecontext1 = context_course::instance($course1->id);\n\n // Enrol users to courses.\n $this->getDataGenerator()->enrol_user($user1->id, $course1->id);\n $this->getDataGenerator()->enrol_user($user2->id, $course1->id);\n $this->getDataGenerator()->enrol_user($user3->id, $course1->id);\n\n // Create groups (only one with enablemessaging = 1).\n $group1a = $this->getDataGenerator()->create_group(array('courseid' => $course1->id, 'enablemessaging' => 1));\n\n // Add users to groups.\n $this->getDataGenerator()->create_group_member(array('groupid' => $group1a->id, 'userid' => $user1->id));\n $this->getDataGenerator()->create_group_member(array('groupid' => $group1a->id, 'userid' => $user2->id));\n $this->getDataGenerator()->create_group_member(array('groupid' => $group1a->id, 'userid' => $user3->id));\n\n // Get conversation.\n $component = 'core_group';\n $itemtype = 'groups';\n $conversation1 = \\core_message\\api::get_conversation_by_area(\n $component,\n $itemtype,\n $group1a->id,\n $coursecontext1->id\n );\n\n // Send some messages to the group conversation.\n $now = time();\n $m1id = testhelper::send_fake_message_to_conversation($user1, $conversation1->id, 'Message 1', $now + 1);\n $m2id = testhelper::send_fake_message_to_conversation($user1, $conversation1->id, 'Message 2', $now + 2);\n $m3id = testhelper::send_fake_message_to_conversation($user2, $conversation1->id, 'Message 3', $now + 3);\n\n // Test for user1 (although is member of the conversation, hasn't any private message).\n $contextlist = provider::get_contexts_for_userid($user1->id);\n $this->assertCount(0, $contextlist);\n\n // Test for user2 (although is member of the conversation, hasn't any private message).\n $contextlist = provider::get_contexts_for_userid($user2->id);\n $this->assertCount(0, $contextlist);\n\n // Test for user3 (although is member of the conversation, hasn't any private message).\n $contextlist = provider::get_contexts_for_userid($user3->id);\n $this->assertCount(0, $contextlist);\n\n // Test for user4 (doesn't belong to the conversation).\n $contextlist = provider::get_contexts_for_userid($user4->id);\n $this->assertCount(0, $contextlist);\n\n // Send some private messages.\n $pm1id = $this->create_message($user1->id, $user2->id, time() - (9 * DAYSECS));\n\n // Test user1 now has the user context because of the private message.\n $contextlist = provider::get_contexts_for_userid($user1->id);\n $this->assertCount(1, $contextlist);\n $contextforuser = $contextlist->current();\n $this->assertEquals(\n \\context_user::instance($user1->id)->id,\n $contextforuser->id);\n\n // Test user2 now has the user context because of the private message.\n $contextlist = provider::get_contexts_for_userid($user2->id);\n $this->assertCount(1, $contextlist);\n $contextforuser = $contextlist->current();\n $this->assertEquals(\n \\context_user::instance($user2->id)->id,\n $contextforuser->id);\n\n // Test for user3 (although is member of the conversation, hasn't still any private message).\n $contextlist = provider::get_contexts_for_userid($user3->id);\n $this->assertCount(0, $contextlist);\n\n // Test for user4 (doesn't belong to the conversation and hasn't any private message).\n $contextlist = provider::get_contexts_for_userid($user4->id);\n $this->assertCount(0, $contextlist);\n }",
"public function test_add_contexts_for_userid() {\n $this->setup_datas();\n $this->setUser($this->user1);\n $addedcontextlist = new contextlist();\n provider::add_contexts_for_userid($addedcontextlist, $this->user1->id);\n $contextlist = provider::get_contexts_for_userid($this->user1->id);\n $this->assertCount(0, $contextlist);\n resource_view($this->resource1, $this->course1, $this->cmresource1, $this->resourcecontext1);\n resource_view($this->resource2, $this->course2, $this->cmresource2, $this->resourcecontext2);\n $addedcontextlist = new contextlist();\n provider::add_contexts_for_userid($addedcontextlist, $this->user1->id);\n $contextlist = provider::get_contexts_for_userid($this->user1->id);\n $this->assertCount(2, $contextlist);\n $this->assertContains($this->resourcecontext1, $contextlist);\n $this->assertContains($this->resourcecontext2, $contextlist);\n }",
"public function test_get_contexts_for_userid_with_blocked_contact() {\n $this->resetAfterTest();\n\n $user1 = $this->getDataGenerator()->create_user();\n $user2 = $this->getDataGenerator()->create_user();\n\n // Remove user self-conversations.\n $this->remove_user_self_conversation($user1->id);\n $this->remove_user_self_conversation($user2->id);\n\n // Test nothing is found before user is blocked.\n $contextlist = provider::get_contexts_for_userid($user1->id);\n $this->assertCount(0, $contextlist);\n $contextlist = provider::get_contexts_for_userid($user2->id);\n $this->assertCount(0, $contextlist);\n\n \\core_message\\api::block_user($user1->id, $user2->id);\n\n // Test for the blocking user.\n $contextlist = provider::get_contexts_for_userid($user1->id);\n $this->assertCount(1, $contextlist);\n $contextforuser = $contextlist->current();\n $this->assertEquals(\n context_user::instance($user1->id)->id,\n $contextforuser->id);\n\n // Test for the user who is blocked.\n $contextlist = provider::get_contexts_for_userid($user2->id);\n $this->assertCount(1, $contextlist);\n $contextforuser = $contextlist->current();\n $this->assertEquals(\n context_user::instance($user2->id)->id,\n $contextforuser->id);\n }",
"public function test_get_users_in_context() {\n $component = 'core_badges';\n\n // Create course1.\n $course1 = $this->getDataGenerator()->create_course();\n $coursecontext1 = context_course::instance($course1->id);\n // Create course2.\n $course2 = $this->getDataGenerator()->create_course();\n $coursecontext2 = context_course::instance($course2->id);\n // Create user1.\n $user1 = $this->getDataGenerator()->create_user();\n $usercontext1 = context_user::instance($user1->id);\n // Create user2.\n $user2 = $this->getDataGenerator()->create_user();\n $usercontext2 = context_user::instance($user2->id);\n // Create user3.\n $user3 = $this->getDataGenerator()->create_user();\n $usercontext3 = context_user::instance($user3->id);\n\n // The list of users in usercontext1 should not return anything yet (related data still haven't been created).\n $userlist1 = new \\core_privacy\\local\\request\\userlist($usercontext1, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n // The list of users in coursecontext1 should not return anything yet (related data still haven't been created).\n $userlist2 = new \\core_privacy\\local\\request\\userlist($coursecontext1, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n // The list of users in systemcontext should not return anything yet (related data still haven't been created).\n $systemcontext = context_system::instance();\n $userlist3 = new \\core_privacy\\local\\request\\userlist($systemcontext, $component);\n provider::get_users_in_context($userlist3);\n $this->assertCount(0, $userlist3);\n\n // Assert that we find contexts where we created/modified a badge.\n $this->create_badge(['usercreated' => $user1->id, 'usermodified' => $user2->id]);\n $badge1 = $this->create_badge(['usercreated' => $user2->id, 'type' => BADGE_TYPE_COURSE, 'courseid' => $course1->id]);\n $badge2 = $this->create_badge(['usercreated' => $user3->id, 'usermodified' => $user1->id]);\n\n $this->create_manual_award(['recipientid' => $user2->id, 'issuerid' => $user1->id, 'badgeid' => $badge1->id]);\n $this->create_manual_award(['recipientid' => $user3->id, 'issuerid' => $user2->id, 'badgeid' => $badge1->id]);\n $this->create_manual_award(['recipientid' => $user1->id, 'issuerid' => $user2->id, 'badgeid' => $badge2->id]);\n\n $this->create_backpack(['userid' => $user2->id]);\n $this->create_issued(['badgeid' => $badge2->id, 'userid' => $user3->id]);\n\n $crit = $this->create_criteria_manual($badge1->id);\n $crit->mark_complete($user3->id);\n\n // The list of users for user context should return user1 and user2.\n provider::get_users_in_context($userlist1);\n $this->assertCount(2, $userlist1);\n $this->assertTrue(in_array($user1->id, $userlist1->get_userids()));\n $this->assertTrue(in_array($user2->id, $userlist1->get_userids()));\n\n // The list of users for course context should return user2.\n provider::get_users_in_context($userlist2);\n $this->assertCount(1, $userlist2);\n $this->assertTrue(in_array($user2->id, $userlist2->get_userids()));\n\n // The list of users for system context should return user1, user2 and user3.\n provider::get_users_in_context($userlist3);\n $this->assertCount(3, $userlist3);\n $this->assertTrue(in_array($user1->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($user2->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($user3->id, $userlist3->get_userids()));\n }",
"public function test_get_users_in_context() {\n $component = 'core_cohort';\n\n // Create system cohort and category cohort.\n $coursecategory = $this->getDataGenerator()->create_category();\n $coursecategoryctx = \\context_coursecat::instance($coursecategory->id);\n $systemctx = \\context_system::instance();\n $categorycohort = $this->getDataGenerator()->create_cohort([\n 'contextid' => $coursecategoryctx->id,\n 'name' => 'Category cohort 1',\n ]);\n // Create user.\n $user = $this->getDataGenerator()->create_user();\n $userctx = \\context_user::instance($user->id);\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecategoryctx, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n\n $userlist2 = new \\core_privacy\\local\\request\\userlist($systemctx, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n\n $systemcohort = $this->getDataGenerator()->create_cohort([\n 'contextid' => $systemctx->id,\n 'name' => 'System cohort 1'\n ]);\n // Create user and add to the system and category cohorts.\n cohort_add_member($categorycohort->id, $user->id);\n cohort_add_member($systemcohort->id, $user->id);\n\n // The list of users within the coursecat context should contain user.\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecategoryctx, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $expected = [$user->id];\n $actual = $userlist1->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the system context should contain user.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($systemctx, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(1, $userlist2);\n $expected = [$user->id];\n $actual = $userlist2->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the user context should be empty.\n $userlist3 = new \\core_privacy\\local\\request\\userlist($userctx, $component);\n provider::get_users_in_context($userlist3);\n $this->assertCount(0, $userlist3);\n }",
"public function test_get_users_in_context() {\n $this->resetAfterTest();\n\n $component = 'core_enrol';\n\n $user = $this->getDataGenerator()->create_user();\n $usercontext = context_user::instance($user->id);\n $course = $this->getDataGenerator()->create_course();\n $coursecontext = context_course::instance($course->id);\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecontext, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n\n // Enrol user into course.\n $this->getDataGenerator()->enrol_user($user->id, $course->id, null, 'manual');\n\n // The list of users within the course context should contain user.\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $expected = [$user->id];\n $actual = $userlist1->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the user context should be empty.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($usercontext, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n }",
"public function test_get_contexts_for_userid_receiver() {\n $coursecontext1 = context_course::instance($this->course1->id);\n $coursecontext2 = context_course::instance($this->course2->id);\n\n // Receiver User 1 is the Receiver of one course.\n $contextlist = provider::get_contexts_for_userid($this->receiveruser1->id);\n $this->assertCount(1, $contextlist);\n\n $contextids = $contextlist->get_contextids();\n $this->assertEquals([$coursecontext1->id], $contextids);\n\n // Receiver User 2 is the Receiver of course.\n $contextlist = provider::get_contexts_for_userid($this->receiveruser2->id);\n $this->assertCount(1, $contextlist);\n\n $contextids = $contextlist->get_contextids();\n $this->assertEquals([$coursecontext2->id], $contextids);\n }",
"public function test_get_users_in_context_invalid_context_type() {\n $systemcontext = context_system::instance();\n\n $userlist = new \\core_privacy\\local\\request\\userlist($systemcontext, 'mod_choice');\n \\mod_choice\\privacy\\provider::get_users_in_context($userlist);\n\n $this->assertCount(0, $userlist->get_userids());\n }",
"public static function get_contexts_for_userid(int $userid) : \\core_privacy\\local\\request\\contextlist {\n $contextlist = new \\core_privacy\\local\\request\\contextlist();\n\n $params = [\n 'modname' => 'forum',\n 'contextlevel' => CONTEXT_MODULE,\n 'userid' => $userid,\n ];\n\n // Discussion creators.\n $sql = \"SELECT c.id\n FROM {context} c\n JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n JOIN {forum} f ON f.id = cm.instance\n JOIN {forum_discussions} d ON d.forum = f.id\n WHERE d.userid = :userid\n \";\n $contextlist->add_from_sql($sql, $params);\n\n // Post authors.\n $sql = \"SELECT c.id\n FROM {context} c\n JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n JOIN {forum} f ON f.id = cm.instance\n JOIN {forum_discussions} d ON d.forum = f.id\n JOIN {forum_posts} p ON p.discussion = d.id\n WHERE p.userid = :userid\n \";\n $contextlist->add_from_sql($sql, $params);\n\n // Forum digest records.\n $sql = \"SELECT c.id\n FROM {context} c\n JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n JOIN {forum} f ON f.id = cm.instance\n JOIN {forum_digests} dig ON dig.forum = f.id\n WHERE dig.userid = :userid\n \";\n $contextlist->add_from_sql($sql, $params);\n\n // Forum subscriptions.\n $sql = \"SELECT c.id\n FROM {context} c\n JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n JOIN {forum} f ON f.id = cm.instance\n JOIN {forum_subscriptions} sub ON sub.forum = f.id\n WHERE sub.userid = :userid\n \";\n $contextlist->add_from_sql($sql, $params);\n\n // Discussion subscriptions.\n $sql = \"SELECT c.id\n FROM {context} c\n JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n JOIN {forum} f ON f.id = cm.instance\n JOIN {forum_discussion_subs} dsub ON dsub.forum = f.id\n WHERE dsub.userid = :userid\n \";\n $contextlist->add_from_sql($sql, $params);\n\n // Discussion tracking preferences.\n $sql = \"SELECT c.id\n FROM {context} c\n JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n JOIN {forum} f ON f.id = cm.instance\n JOIN {forum_track_prefs} pref ON pref.forumid = f.id\n WHERE pref.userid = :userid\n \";\n $contextlist->add_from_sql($sql, $params);\n\n // Discussion read records.\n $sql = \"SELECT c.id\n FROM {context} c\n JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n JOIN {forum} f ON f.id = cm.instance\n JOIN {forum_read} hasread ON hasread.forumid = f.id\n WHERE hasread.userid = :userid\n \";\n $contextlist->add_from_sql($sql, $params);\n\n // Rating authors.\n $ratingsql = \\core_rating\\privacy\\provider::get_sql_join('rat', 'mod_forum', 'post', 'p.id', $userid, true);\n $sql = \"SELECT c.id\n FROM {context} c\n JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n JOIN {forum} f ON f.id = cm.instance\n JOIN {forum_discussions} d ON d.forum = f.id\n JOIN {forum_posts} p ON p.discussion = d.id\n {$ratingsql->join}\n WHERE {$ratingsql->userwhere}\n \";\n $params += $ratingsql->params;\n $contextlist->add_from_sql($sql, $params);\n\n // Forum grades.\n $sql = \"SELECT c.id\n FROM {context} c\n JOIN {course_modules} cm ON cm.id = c.instanceid AND c.contextlevel = :contextlevel\n JOIN {modules} m ON m.id = cm.module AND m.name = :modname\n JOIN {forum} f ON f.id = cm.instance\n JOIN {forum_grades} fg ON fg.forum = f.id\n WHERE fg.userid = :userid\n \";\n $contextlist->add_from_sql($sql, $params);\n\n return $contextlist;\n }",
"public function test_get_users_in_context() {\n global $DB;\n\n $this->resetAfterTest(true);\n\n $component = 'core_notes';\n // Test setup.\n $this->setAdminUser();\n set_config('enablenotes', true);\n // Create a teacher.\n $teacher1 = $this->getDataGenerator()->create_user();\n $this->setUser($teacher1);\n $teacherrole = $DB->get_record('role', array('shortname' => 'teacher'));\n // Create a student.\n $student = $this->getDataGenerator()->create_user();\n // Create student2.\n $student2 = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n\n // Create courses, then enrol a teacher and a student.\n $nocourses = 3;\n for ($c = 1; $c <= $nocourses; $c++) {\n ${'course' . $c} = $this->getDataGenerator()->create_course();\n ${'coursecontext' . $c} = context_course::instance(${'course' . $c}->id);\n\n role_assign($teacherrole->id, $teacher1->id, ${'coursecontext' . $c}->id);\n role_assign($studentrole->id, $student->id, ${'coursecontext' . $c}->id);\n role_assign($studentrole->id, $student2->id, ${'coursecontext' . $c}->id);\n }\n // The list of users in coursecontext1 should be empty (related data still have not been created).\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecontext1, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n // The list of users in coursecontext2 should be empty (related data still have not been created).\n $userlist2 = new \\core_privacy\\local\\request\\userlist($coursecontext2, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n // The list of users in coursecontext3 should be empty (related data still have not been created).\n $userlist3 = new \\core_privacy\\local\\request\\userlist($coursecontext3, $component);\n provider::get_users_in_context($userlist3);\n $this->assertCount(0, $userlist3);\n\n // Create private user notes (i.e. NOTES_STATE_DRAFT) for student in course1 and course2 written by the teacher.\n $this->help_create_user_note($student->id, NOTES_STATE_DRAFT, $course1->id,\n \"Test private user note about the student in Course 1 by the teacher\");\n $this->help_create_user_note($student->id, NOTES_STATE_DRAFT, $course2->id,\n \"Test private user note about the student in Course 2 by the teacher\");\n\n // The list of users in coursecontext1 should return one user (teacher1).\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $this->assertTrue(in_array($teacher1->id, $userlist1->get_userids()));\n // The list of users in coursecontext2 should return one user (teacher1).\n provider::get_users_in_context($userlist2);\n $this->assertCount(1, $userlist2);\n $this->assertTrue(in_array($teacher1->id, $userlist2->get_userids()));\n // The list of users in coursecontext3 should not return any users.\n provider::get_users_in_context($userlist3);\n $this->assertCount(0, $userlist3);\n\n // Create public user note (i.e. NOTES_STATE_PUBLIC) for student in course3 written by the teacher.\n $this->help_create_user_note($student->id, NOTES_STATE_PUBLIC, $course3->id,\n \"Test public user note about the student in Course 3 by the teacher\");\n\n // The list of users in coursecontext3 should return 2 users (teacher and student).\n provider::get_users_in_context($userlist3);\n $this->assertCount(2, $userlist3);\n $this->assertTrue(in_array($teacher1->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($student->id, $userlist3->get_userids()));\n\n // Create site user note (i.e. NOTES_STATE_SITE) for student2 in course3 written by the teacher.\n $this->help_create_user_note($student2->id, NOTES_STATE_SITE, $course3->id,\n \"Test site-wide user note about student2 in Course 3 by the teacher\"\n );\n\n // The list of users in coursecontext3 should return 3 users (teacher, student and student2).\n provider::get_users_in_context($userlist3);\n $this->assertCount(3, $userlist3);\n $this->assertTrue(in_array($teacher1->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($student->id, $userlist3->get_userids()));\n $this->assertTrue(in_array($student2->id, $userlist3->get_userids()));\n\n // The list of users should not return any users in a different context than course context.\n $contextsystem = context_system::instance();\n $userlist4 = new \\core_privacy\\local\\request\\userlist($contextsystem, $component);\n provider::get_users_in_context($userlist4);\n $this->assertCount(0, $userlist4);\n }",
"public static function get_contexts_for_userid(int $userid) : contextlist {\r\n global $CFG,$DB;\r\n $contextlist = new contextlist();\r\n\r\n require_once ($CFG->dirroot.\"/local/coursehub/CourseHub.php\");\r\n require_once($CFG->dirroot.'/local/magisterelib/databaseConnection.php');\r\n\r\n $hub = \\CourseHub::instance();\r\n if($hub->isNoConfig()){\r\n return;\r\n }\r\n if($hub->isMaster()){\r\n $aca = $CFG->academie_name;\r\n }else{\r\n $aca = $hub->getMaster();\r\n }\r\n\r\n if(array_key_exists($aca,get_magistere_academy_config())) {\r\n $user = $DB->get_record(\"user\",[\"id\"=> $userid]);\r\n\r\n if($user){\r\n $existuser = \\databaseConnection::instance()->get($aca)->execute(\r\n 'SELECT lcc.username FROM {local_coursehub_course} lcc\r\n WHERE lcc.username = :username',\r\n ['username' => $user->username]\r\n );\r\n\r\n if($existuser){\r\n $contextlist->add_user_context($userid);\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n\r\n $sql = \"\r\n SELECT ctx.id FROM {local_coursehub_published} lcp\r\n JOIN {context} ctx ON ctx.instanceid = lcp.userid AND ctx.contextlevel = :userlevel\r\n WHERE lcp.userid = :userid\";\r\n $params = [\r\n 'userid' => $userid,\r\n 'userlevel' => CONTEXT_USER,\r\n ];\r\n\r\n $contextlist->add_from_sql($sql, $params);\r\n return $contextlist;\r\n }",
"public static function get_contexts_for_userid(int $userid) : contextlist {\n $contextlist = new \\core_privacy\\local\\request\\contextlist();\n\n $params = array('contextlevel' => CONTEXT_COURSE, 'userid' => $userid);\n $sql = \"SELECT ctx.id\n FROM {course} c\n JOIN {context} ctx ON c.id = ctx.instanceid AND ctx.contextlevel = :contextlevel\n JOIN {local_recompletion_cc} rc ON rc.course = c.id and rc.userid = :userid\";\n $contextlist->add_from_sql($sql, $params);\n $sql = \"SELECT ctx.id\n FROM {course} c\n JOIN {context} ctx ON c.id = ctx.instanceid AND ctx.contextlevel = :contextlevel\n JOIN {local_recompletion_cc_cc} rc ON rc.course = c.id and rc.userid = :userid\";\n $contextlist->add_from_sql($sql, $params);\n $sql = \"SELECT ctx.id\n FROM {course} c\n JOIN {context} ctx ON c.id = ctx.instanceid AND ctx.contextlevel = :contextlevel\n JOIN {local_recompletion_cmc} rc ON rc.course = c.id and rc.userid = :userid\";\n $contextlist->add_from_sql($sql, $params);\n $sql = \"SELECT ctx.id\n FROM {course} c\n JOIN {context} ctx ON c.id = ctx.instanceid AND ctx.contextlevel = :contextlevel\n JOIN {local_recompletion_qa} rc ON rc.course = c.id and rc.userid = :userid\";\n $contextlist->add_from_sql($sql, $params);\n $sql = \"SELECT ctx.id\n FROM {course} c\n JOIN {context} ctx ON c.id = ctx.instanceid AND ctx.contextlevel = :contextlevel\n JOIN {local_recompletion_qg} rc ON rc.course = c.id and rc.userid = :userid\";\n $contextlist->add_from_sql($sql, $params);\n $sql = \"SELECT ctx.id\n FROM {course} c\n JOIN {context} ctx ON c.id = ctx.instanceid AND ctx.contextlevel = :contextlevel\n JOIN {local_recompletion_sst} rc ON rc.course = c.id and rc.userid = :userid\";\n $contextlist->add_from_sql($sql, $params);\n $sql = \"SELECT ctx.id\n FROM {course} c\n JOIN {context} ctx ON c.id = ctx.instanceid AND ctx.contextlevel = :contextlevel\n JOIN {local_recompletion_qr} rc ON rc.course = c.id and rc.userid = :userid\";\n $contextlist->add_from_sql($sql, $params);\n $sql = \"SELECT ctx.id\n FROM {course} c\n JOIN {context} ctx ON c.id = ctx.instanceid AND ctx.contextlevel = :contextlevel\n JOIN {local_recompletion_cha} rc ON rc.course = c.id and rc.userid = :userid\";\n $contextlist->add_from_sql($sql, $params);\n return $contextlist;\n }",
"public static function get_contexts_for_userid(int $userid): contextlist {\n $contextlist = new contextlist();\n $sql = 'SELECT DISTINCT ctx.id\n FROM {modules} m\n JOIN {course_modules} cm ON cm.module = m.id AND m.name = :modname\n JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :contextlevel\n JOIN {ouwiki_subwikis} s ON cm.instance = s.wikiid\n LEFT JOIN {ouwiki_pages} p ON p.subwikiid = s.id\n LEFT JOIN {ouwiki_annotations} oa ON oa.pageid = p.id AND oa.userid = :userid3\n LEFT JOIN {ouwiki_versions} v ON v.pageid = p.id AND v.userid = :userid4\n LEFT JOIN {ouwiki_locks} l ON l.pageid = p.id AND l.userid = :userid5\n WHERE s.userid = :userid1 OR oa.id IS NOT NULL OR v.id IS NOT NULL OR l.id IS NOT NULL';\n $contextlist->add_from_sql($sql, ['modname' => 'ouwiki', 'contextlevel' => CONTEXT_MODULE,\n 'userid1' => $userid, 'userid2' => $userid,\n 'userid3' => $userid, 'userid4' => $userid, 'userid5' => $userid]);\n return $contextlist;\n }",
"public function test_user_has_never_posted() {\n $context = $this->context;\n $otheruser = $this->otheruser;\n\n // Test that no contexts were retrieved.\n $contextlist = $this->get_contexts_for_userid($otheruser->id, 'mod_forumng');\n $contexts = $contextlist->get_contextids();\n // User 2 have flagged the discussion.\n $this->assertCount(1, $contexts);\n\n // Attempting to export data for this context should return nothing either.\n $this->export_context_data_for_user($otheruser->id, $context, 'mod_forumng');\n\n $writer = \\core_privacy\\local\\request\\writer::with_context($context);\n\n // The provider should always export data for any context explicitly asked of it, but there should be no\n // metadata, files, or discussions.\n $this->assertEmpty($writer->get_data([get_string('discussions', 'mod_forumng')]));\n $this->assertEmpty($writer->get_all_metadata([]));\n $this->assertEmpty($writer->get_files([]));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that the Contao framework is not initialized without a container. | public function testWithoutContainer()
{
/** @var KernelInterface $kernel */
global $kernel;
$kernel = $this->mockKernel();
$listener = new InitializeSystemListener(
$this->mockRouter('/index.html'),
$this->mockSession(),
$this->getRootDir() . '/app',
$this->mockTokenManager(),
'contao_csrf_token',
$this->mockConfig()
);
$request = new Request();
$request->attributes->set('_route', 'dummy');
$listener->onKernelRequest(new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST));
$this->assertFalse(defined('TL_MODE'));
$this->assertFalse(defined('TL_SCRIPT'));
$this->assertFalse(defined('TL_ROOT'));
} | [
"private function _checkContainer()\n\t{\n\t\tif (is_null(self::$kernel) or is_null(self::$kernel->getContainer()))\n\t\t{\n\t\t\tstatic::bootKernel();\n\t\t}\n\t}",
"public function testGetMissingContainer()\n {\n {\n $subject = $this->createInstance();\n }\n\n {\n $this->expectException(ContainerExceptionInterface::class);\n $subject->get(uniqid('not-there'));\n }\n }",
"public function testConstructNoArgsCreatesDefaultContainer()\n {\n $this->assertInstanceOf(Container::class, (new AppFactory())->createContainer());\n }",
"public function testConstructUnconfiguredApi()\n {\n $this->expectException(UnknownIdentifierException::class);\n $this->assertNull($this->_c['api']);\n }",
"protected function assertContainerIsSet()\n {\n if ($this->container === null) {\n trigger_error('Container is not set in ' . get_class($this), E_USER_ERROR);\n }\n }",
"public function testGetControllerNoImplementation()\n {\n // Getting a container instance with a mocked db connection\n $containerMockedPDO = $this->getContainerWitMockedPDO();\n\n // We should not get a valid repository for a non-existing controller class name\n $this->expectException(InitException::class);\n RouterHelper::getController(\"Mslib\\Controller\\NonExistingController\", $containerMockedPDO);\n }",
"public function testConstructNullContainer()\n {\n $this->expectException(\\InvalidArgumentException::class);\n new DependencyDirector(null);\n }",
"public function testDoesNotHaveInterface() {\n $dic = new Container();\n\n $this->assertFalse($dic->has(self::DB_INTERFACE));\n }",
"public function testNonExistingLibrary()\n\t{\n\t\t//TODO: implement\n\t}",
"public function testServiceNotExists()\n {\n $this->container->get('wsw');\n }",
"public function testInit()\n {\n $application = new GameApplication();\n $engines = $application->getEngines();\n\n $this->assertTrue(count($engines) > 0, 'GameApplication failed to run games engines!');\n }",
"public function testComponentWillBeResolvedWithoutInitialization()\n {\n /** @var \\Test\\Component\\Table $component */\n $component = $this->di->get('Test\\Component\\Table');\n $this->assertInstanceOf('\\Test\\Component\\Table', $component);\n\n $this->assertFalse($component->isInitialized());\n }",
"public function testContainerFreshObjectsWithoutRegisters()\n {\n $container = new Container();\n $a = $container->build(A::class);\n\n $this->assertInstanceOf(A::class, $a);\n }",
"public function testMissingComponent() {\n\t\t\t$injector = new DependencyInjector();\n\n\t\t\ttry {\n\t\t\t\t$injector->getComponent(\"DITestClass\", false);\n\t\t\t\t$this->fail(\"Missing class did not throw exception from injector.\");\n\t\t\t} catch (\\KrameWork\\ClassResolutionException $e) {\n\t\t\t\t// Expected.\n\t\t\t\t$this->assertTrue(true, \"World error, restart universe\");\n\t\t\t}\n\n\t\t\tunset($injector);\n\t\t}",
"function it_should_have_a_default_container()\n {\n $this->getContainer()->shouldReturnImplementationOf(ContainerInterface::class);\n }",
"public function testInitialized() {\n $this->assertFalse($this->container->initialized('late.service'), 'Late service is not initialized.');\n $this->container->get('late.service');\n $this->assertTrue($this->container->initialized('late.service'), 'Late service is initialized after it was retrieved once.');\n }",
"public function testGlobalContainer()\n {\n $container = wprss_wp_container();\n $this->assertTrue($container instanceof \\Interop\\Container\\ContainerInterface, 'Global container is not a valid container');\n }",
"public function testContainer(): void\n {\n self::assertTrue(\\Valkyrja\\container() instanceof Container);\n }",
"public function testGetInstanceNotInit()\n {\n $this->setExpectedException('\\SLiib\\WebApp\\Request\\Exception');\n $object = Request::getInstance();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return all users with roles | public function getAll()
{
return User::with('roles')->get();
} | [
"public function getUserRoles();",
"public function rolesForUser();",
"public function getUsersRoles()\r\n {\r\n $role_id = $this->getSession('RoleID');\r\n\r\n $cond = \" WHERE Status = 'Active' \";\r\n return $this->getRecords(\"SELECT RoleID, Title FROM roles $cond\");\r\n }",
"function roles_get_all_roles() {\r\n\treturn roles()->getAll();\r\n}",
"function get_user_roles() {\n\n\t\t$query = $this -> db -> get('UserRole');\n\n\t\treturn $query -> result_array();\n\n\t}",
"public function getAllRoles();",
"public function allWithRole(): array\n {\n $sql = \"SELECT u.id, u.firstname, u.lastname, r.name role_name FROM `user` u LEFT JOIN `role` r ON u.role_id = r.id\" ;\n return $this->pdo->query($sql)->fetchAll();\n }",
"protected function queryUserAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n\n return $queryBuilder->select('*')\n ->from('User', 'u')\n ->innerJoin('u', 'Role','r','u.Role_ID = r.Role_ID' );\n }",
"public function getUsersByRoles(array $roles): array;",
"function intervention_get_users_in_role($role) {\n\n $result = db_select('users_roles', 'ur')\n ->fields('ur')\n ->condition('ur.rid', $role->rid, '=')\n ->execute();\n foreach ($result as $record) {\n $uids[] = $record->uid;\n };\n\n return $uids;\n}",
"public function getRoleOfUsers() {\n\n $sql = 'SELECT * FROM roles';\n\n $roleOfUsers = $this->executeQuery($sql);\n\n if ($roleOfUsers->rowCount() > 0) {\n\n return $roleOfUsers->fetchAll();\n\n } \n }",
"public function getAll()\n {\n return $this->user->with('profile', 'roles')->get();\n }",
"public static function getAllAdmins(){\n return User::select('users.*')\n ->join('role_user', 'role_user.user_id', '=', 'users.id')\n ->join('roles', 'roles.id', '=', 'role_user.role_id')\n ->where('roles.slug', 'admin')\n ->where('roles.level', 1)\n ->get();\n }",
"public function getAllUsers()\n {\n $user = Auth::user();\n $siteUsers = [];\n\n if ($user->hasRole('super_admin', null)) {\n $siteUsers = User::with('languages', 'marriage_mate')->get();\n\n foreach($siteUsers as $key => $user) {\n $targetUser = User::find($user->id);\n $userRoles = $targetUser->getRoles();\n $siteUsers[$key]['site_roles'] = $userRoles;\n };\n\n return RB::success(['users' => $siteUsers]);\n } else {\n return RB::error(403); // Access denied\n }\n\n }",
"public static function getUserAllByrole($rolename)\n {\t\t\t \t\n\t\t$Roleusers = \\Yii::$app->authManager->getUserIdsByRole($rolename);\t\t\n\t\t$data = User::find()->where(['IN', 'id', $Roleusers])->andWhere(['status'=>10])->all();\n\t\treturn $data;\n }",
"public function get_users()\n {\n $users_roles = user_role_active_record::search()->where('rid', $this->rid)->exec();\n $uids = array();\n foreach ($users_roles as $users_role) {\n $uids[] = $users_role->uid;\n }\n\n $users = user_active_record::search()->where('uid', $uids, \"IN\")->exec();\n //var_dump($users); exit;\n return $users;\n }",
"public static function get_all_user_roles()\n {\n global $wp_roles;\n\n if (!isset($wp_roles)) {\n $wp_roles = new WP_Roles();\n }\n\n return $wp_roles->get_names();\n }",
"public function getAllAdminUsers() {\n $em = $this->getEntityManager();\n\n $query = $em->createQuery(\"SELECT u FROM Champs\\Entity\\User u, Champs\\Entity\\Role r WHERE r.user = u and r.rolename = 'administrator'\");\n\n return $query->getResult();\n }",
"public function getAllByRoles($roles)\n {\n $roles = ! is_array($roles) ? $roles = [$roles] : $roles;\n\n return User::whereHas('roles', function ($q) use ($roles) {\n $q->whereIn('name', $roles);\n })->get();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Try to authenticate the user with a given provider. If the user is already connected we just return and instance of provider adapter, ELSE, try to authenticate and authorize the user with the provider. $params is generally an array with required info in order for this provider and HybridAuth to work, like : hauth_return_to: URL to call back after authentication is done openid_identifier: The OpenID identity provider identifier google_service: can be "Users" for Google user accounts service or "Apps" for Google hosted Apps | public static function authenticate($providerId, $params = null) {
Logger::info("Enter Auth::authenticate( $providerId )");
if (!Auth::storage()->get("hauth_session.$providerId.is_logged_in")) {
// if user not connected to $providerId then try setup a new adapter and start the login process for this provider
Logger::info("Auth::authenticate( $providerId ), User not connected to the provider. Try to authenticate..");
$provider_adapter = Auth::setup($providerId, $params);
$provider_adapter->login();
} else {
// else, then return the adapter instance for the given provider
Logger::info("Auth::authenticate( $providerId ), User is already connected to this provider. Return the adapter instance.");
return Auth::getAdapter($providerId);
}
} | [
"public function action_auth()\n\t{\n\t\t// No provider or user then go back.\n\t\tif (!empty($this->provider) && !empty($this->member))\n\t\t{\n\t\t\t// Make the connection to the provider\n\t\t\t$this->initHybridAuth();\n\t\t\t$this->getAdapterProfile();\n\t\t\t$member_found = memberByExtUID($this->provider, $this->profile->identifier);\n\n\t\t\t// If the member is not already linked then save this valid authorization\n\t\t\tif (empty($member_found))\n\t\t\t{\n\t\t\t\t// Create an authentication entry in the db\n\t\t\t\taddAuth($this->member, $this->provider, $this->profile->identifier, $this->profile->displayName);\n\t\t\t}\n\n\t\t\t// Back to the profile page\n\t\t\tredirectexit('action=profile;area=extauth');\n\t\t}\n\t}",
"function oAuthProviderAuthentication()\n{\n\tglobal $DB;\n\tglobal $oRequest;\n\tglobal $oResponse;\n\t\n\ttry {\n\t\t// Check request validity\n\t\tRequestUtil::validateOAuthProviderAuthenticationRequest( $oRequest );\n\n\t\t// Create LegacyOAuthLogin object\n\t\t$sIdentityType = $oRequest->aPars['request']['identity']['type'];\n\t\trequire_once(APP . 'php/main/identity/legacyOAuthLogin.php');\n\t\t$oLegacyOAuthLogin = new LegacyOAuthLogin( $sIdentityType, $oRequest );\n\t\t\n\t\t// Try starting an OAuth authentication process\n\t\t$aAuthenticationResult = $oLegacyOAuthLogin->authentication();\n\t\t\t\n\t} catch (Exception $exception) {\n\t\t$oResponse->run($exception);\n\t}\n\t\n\t$oResponse->addPar('providerRedirectURL', $aAuthenticationResult['redirectURL']);\n\t$oResponse->run();\n}",
"function get_user_by_provider_and_id( $provider_name, $provider_user_id )\n{\n\treturn mysqli_query_excute( \"SELECT * FROM users WHERE hybridauth_provider_name = '$provider_name' AND hybridauth_provider_uid = '$provider_user_id'\" );\n}",
"function get_user_by_provider_and_id( $provider_name, $provider_user_id, $email ){\n\tglobal $mysqli;\n\t$sql = \"SELECT * FROM tbl_user WHERE (hybridauth_provider_name = '$provider_name' AND hybridauth_provider_uid = '$provider_user_id') OR email = '$email'\";\n\t$stmt = $mysqli->query($sql); \n\tif($stmt->num_rows > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public function handleProviderCallbackUser()\n {\n // Required Validators!\n ($code = request()->get('code')) OR abort(403);\n ($state = request()->get('state')) OR abort(403);\n ($user = User::find($state)) OR abort(403);\n\n // Get the access token...\n $response = (new Client)->request('GET', 'https://slack.com/api/oauth.access', [\n 'query' => [\n 'code' => $code,\n 'client_id' => option('SLACK_CREDENTIALS.client_id'),\n 'client_secret' => option('SLACK_CREDENTIALS.client_secret'),\n 'redirect_uri' => route('auth.slack.callback.user')\n ]\n ])->getBody()->getContents();\n\n $response = json_decode($response);\n\n if ($response->ok == true) {\n $userInfo = $this->getUserInfoFromSlack($response->user_id, $response->access_token);\n\n // Update the user object based on these details...\n $user->slack_scopes = $response->scope;\n $user->name = $userInfo->user->profile->real_name_normalized;\n $user->username = $userInfo->user->name;\n $user->save();\n\n auth()->login($user, true);\n }\n\n // Something probably went wrong somewhere...\n return redirect()->home();\n }",
"public function authenticate() {\n $id = $this->_id;\n if (!empty($id)) {\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n /* login() is never returns on success */\n if (!$this->_check_immediate) {\n if (!$consumer->login($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n } else {\n if (!$consumer->check($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n } else {\n $params = (isset($_SERVER['REQUEST_METHOD']) &&\n $_SERVER['REQUEST_METHOD']=='POST') ? $_POST: $_GET;\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n if ($consumer->verify(\n $params,\n $id,\n $this->_extensions)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::SUCCESS,\n $id,\n [\"Authentication successful\"]);\n } else {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n }",
"function provider_create_new_user($siteObj, $provider_name, $providerProfileObj) {\n $debug = $_SESSION['auth_debug'];\n \n $provider_identifier = $providerProfileObj->identifier;\n\n if(!$provider_name) {if($debug) print_log(\"provider_create_new_user:missing provider_name\", 'provider', LOG_LEVEL_ALWAYS); return NULL;}\n if(!$providerProfileObj) {if($debug) print_log(\"provider_create_new_user: missing profile object\", 'provider', LOG_LEVEL_ALWAYS); return NULL;}\n if(!$provider_identifier) {if($debug) print_log(\"provider_create_new_user: missing identifier for $provider_name\", 'provider', LOG_LEVEL_ALWAYS); return NULL;}\n if($provider_name == 'Live') $provider_name = \"Windows Live\"; // we use Windows Live, HybridAuth uses Live\n $provider_id = find_object('provider', array('name' => $provider_name), 'id'); \n if(!$provider_id) {if($debug) print_log(\"provider_create_new_user: no provider found for $provider_name\", 'provider', LOG_LEVEL_ALWAYS); return NULL;}\n\n // if email is found and verified, and it matches existing email, then do not create new user\n $provider_email = $providerProfileObj->email;\n $email_verified = $provider_email && $providerProfileObj->emailVerified == $provider_email ? 1 : 0;\n\n //dump($provider_profile);\n if($debug) print_log(\"Provider email: $provider_email Verified:$email_verified<br>\", 'provider', LOG_LEVEL_ALWAYS);\n\n $tbl = get_object_table('user');\n \n // if($debug && $provider_email && $email_verified) print_log(\"Found verified provider profile email $provider_email(user_id=$user_id)<br>\");\n if($user_id = $_SESSION['user_id']) { // user is (was) already logged in (but this is called before auth in set_env, so maybe we should double check?\n //$userObj = get_object('user', $user_id); \n $userProfileObj = find_object('user_profile', array('user_id' => $user_id));\n } else if($email_verified) {\n if($userProfileObj = find_object('user_profile', array('email_address' => $provider_email, 'email_verified' => 1, 'client_id' => $siteObj->client_id))) {\n $user_id = $userProfileObj->user_id; \n if($debug) print_log(\"Found user_profile with email $provider_email (user_id=$user_id)<br>\", 'provider', LOG_LEVEL_ALWAYS); \n } elseif($userObj = find_object('user', array('email_address' => $provider_email, 'active' => 1, \"{$tbl}.client_id\" => $siteObj->client_id))) {\n $user_id = $userObj->id;\n if($debug) print_log(\"Found active user with email $provider_email (user_id=$user_id)<br>\", 'provider', LOG_LEVEL_ALWAYS); \n } elseif($userObj = find_object('user', array('username' => $provider_email, 'active' => 1, \"{$tbl}.client_id\" => $siteObj->client_id))) {\n $user_id = $userObj->id;\n if($debug) print_log(\"Found active user with username $provider_email (user_id=$user_id)<br>\", 'provider', LOG_LEVEL_ALWAYS); \n } else {\n if($debug) print_log(\"No active user found with username $provider_email for client=$siteObj->client_id, creating<br>\", 'provider', LOG_LEVEL_ALWAYS);\n //if($debug) print_log(\"site=\".dump($siteObj,true), 'provider', LOG_LEVEL_ALWAYS);\n } \n } \n\n //if($debug) print_log(\"GH: user_id=$y\", 'provider', LOG_LEVEL_ALWAYS);\n \n if(!$user_id) { // this user does not exist in our system, create the user\n\n $username = $provider_email ?: $provider_name.\"-\".$provider_identifier; // todo: make friendlier\n if($debug) print_log(\"Creating new user with username $username<br>\", 'provider', LOG_LEVEL_ALWAYS); \n \n if($userObj = find_object('user', array('username' => $username, \"{$tbl}.client_id\" => $siteObj->client_id))) {\n //dump($userObj);\n $user_id = $userObj->id;\n if($debug) print_log(\"Found existing user for $siteObj->domain with username $username (user_id=$user_id)<br>\", 'provider', LOG_LEVEL_ALWAYS);\n } else {\n if($debug) print_log(\"No user found, creating with id=$user_id username=$username...<br>\", 'provider', LOG_LEVEL_ALWAYS);\n \n // ok, 3rd party login worked, create new user in our system\n //dump($provider_profile);\n print_log(\"provider_create_new_user: Provider: $provider_name site:$siteObj->id user: $user_id\", \"provider\", LOG_LEVEL_ALWAYS);\n \n \n $phpauth = user_phpauth();\n \n $pw1 = $pw2 = \"A\".substr(generateHash($provider_identifier), 0, 8).\"!\"; \n $result = $phpauth->register($username, $pw1, $pw2);\n \n $user_id = $result['id'];\n if(!$user_id || $result['error']) {\n print_log(\"PHPAUTH User register failed. uname=$username pw=$pw1 error:{$result['message']}\".dump($result,true), 'provider', LOG_LEVEL_ALWAYS);\n } else {\n print_log(\"PHPAUTH OK id=$user_id\", 'provider', LOG_LEVEL_ALWAYS);\n $user_data = provider_map_profile($providerProfileObj); // map to our fields\n \n $user_data['user_id'] = $user_id;\n $user_data['username'] = $username;\n $user_data['email_address'] = $user_data['email'] = $provider_email;\n $user_data['user_level'] = USER_LEVEL_USER;\n $user_data['language'] = $user_profile['language'];\n $user_data['web_address'] = $user_profile['url_web'];\n $user_data['phone'] = $user_profile['phone'];\n $user_data['address1'] = $user_profile['address1'];\n $user_data['site_id'] = $siteObj->id;\n $user_data['client_id'] = $siteObj->client_id;\n $user_data['email_verified'] = $user_data['verified'] = $email_verified;\n \n list($profile_id, $user_errors) = add_object('user_profile', $user_data); // this will also create user_profile\n \n if($debug && $user_errors) print_log(\"Failed to add user_id errors:\".dump($user_errors, true), 'provider', LOG_LEVEL_ALWAYS);\n elseif($debug && $profile_id) print_log(\"Added user_id=$user_id<br>\", 'provider', LOG_LEVEL_ALWAYS);\n \n if($profile_id) {\n update_object('user', array('profile_id' => $profile_id, 'auto_password' => 1), $user_id);\n }\n \n }\n \n }\n }\n \n if($user_id) {\n \n list($pp_id, $pp_errors) = provider_add_profile($siteObj, $provider_id, $user_id, $providerProfileObj);\n if($debug && $pp_id) print_log(\"Added provider profile $pp_id<br>\", 'provider', LOG_LEVEL_ALWAYS);\n if($pp_errors) dump($pp_errors);\n \n if($userProfileObj) { // do we want to update profile ? redirect ?\n \n } else { // add new user profile\n /* this is now done in class handlers \n $user_profile = $user_data;\n $user_profile['client_id'] = $siteObj->client_id;\n $user_profile['user_id'] = $user_id;\n $user_profile['title'] = $user_profile['title'] ?: phrase('about_me', CAPITALIZE);\n list($up_id, $up_errors) = add_object('user_profile', $user_profile);\n if($up_errors) dump($up_errors);\n */\n }\n \n if($debug && $up_id) print_log(\"Added user profile $up_id<br>\", 'provider', LOG_LEVEL_ALWAYS);\n //print_log(\"added user profile $up_id<br>\");\n }\n //dump($user_errors);\n //dump($pp_errors);\n //dump($up_errors);\n return $user_id;\n}",
"public function authenticate() {\n\n $queryString = $this->getQueryString();\n\n if ($queryString['token'])\n return $this->tokenAuthentication($queryString['id'], $queryString['token']);\n\n $this->newModel('auth');\n $auth = $this->model('auth')->authUser(\n $queryString['uid'],\n $queryString['secret']\n );\n\n if ($auth) {\n\n }\n\n if (!$auth)\n return RestServer::throwError(Language::UNAUTHORIZED(), 401);\n\n\n }",
"public function getAuth($params)\n\t{\n\t\treturn $this->auth->where($params)->first();\n\t}",
"public function action_login($_provider = null)\n\t{\n\t\tif(array_key_exists(Inflector::humanize($_provider), Arr::get($this->_config, 'Strategy')))\n\t\t{\n\t\t\t$_oauth = new Opauth($this->_config, true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Response::forge('Strategy not supported');\n\t\t}\n\t}",
"function user_authenticate()\n\t{\n\t\t$this->init();\n\n\t\t$consumer = getConsumer();\n\n\t\t// Complete the authentication process using the server's response.\n\t\t$response = $consumer->complete($this->return_to);\n\n\t\t// Check the response status.\n\t\tif ( $response->status == Auth_OpenID_CANCEL )\n\t\t{\n\t\t\t// This means the authentication was cancelled.\n\t\t\tthrow new Exception('PLG_AUTHENTICATION_CLICKER_GOOGLE_AUTH_ERR_CANCELLED');\n\t\t}\n\t\telse if ( $response->status == Auth_OpenID_FAILURE )\n\t\t{\n\t\t\t// Authentication failed; display the error message.\n\t\t\t// This means the authentication was cancelled.\n\t\t\tthrow new Exception(sprintf('PLG_AUTHENTICATION_CLICKER_GOOGLE_AUTH_ERR_FAIL', $response->message));\n\t\t}\n\t\telse if ( $response->status == Auth_OpenID_SUCCESS )\n\t\t{\n\t\t\t// This means the authentication succeeded; extract the\n\t\t\t// identity URL and Simple Registration data (if it was returned).\n\t\t\t$openid = $response->getDisplayIdentifier();\n\n\t\t\t$ax = new Auth_OpenID_AX_FetchResponse();\n\t\t\t$obj = $ax->fromSuccessResponse($response);\n\n\t\t\t// $pape_resp = Auth_OpenID_PAPE_Response::fromSuccessResponse($response);\n\n\t\t\t// Get openid unique identifier\n\t\t\t$request = Request::create($openid);\n\t\t\t$openid_identifier = $request->input('id');\n\n\t\t\t// Log user into website\n\t\t\t// Save user if it doesn't already exist\n\t\t\t$this->save_or_update_user($obj, $openid_identifier);\n\n\t\t\tHelper::immediate_redirect(Request::url(), 200);\n\t\t}\n\t}",
"public function hybrid_auth() {\n\t\t$pafl_sk = new Skelet( 'pafl' );\n\t\t$config = array(\n\t\t\t\"base_url\" => plugin_dir_url( dirname( __FILE__ ) ) . \"public/lib/hybridauth/\",\n\t\t\t\"providers\" => array(\n\t\t\t\t\"Facebook\" => array(\n\t\t\t\t\t\"enabled\" => true,\n\t\t\t\t\t\"keys\" => array(\n\t\t\t\t\t\t\"id\" => $pafl_sk->get( 'facebook_login_id' ),\n\t\t\t\t\t\t\"secret\" => $pafl_sk->get( 'facebook_login_secret' )\n\t\t\t\t\t),\n\t\t\t\t\t\"scope\" => \"email, public_profile\",\n\t\t\t\t\t\"trustForwarded\" => is_ssl()\n\t\t\t\t),\n\t\t\t\t\"Twitter\" => array(\n\t\t\t\t\t\"enabled\" => true,\n\t\t\t\t\t\"keys\" => array(\n\t\t\t\t\t\t\"key\" => $pafl_sk->get( 'twitter_login_id' ),\n\t \"secret\" => $pafl_sk->get( 'twitter_login_secret' )\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t\"Google\" => array(\n\t\t\t\t\t\"enabled\" => true,\n\t\t\t\t\t\"keys\" => array(\n\t\t\t\t\t\t\"id\" => $pafl_sk->get( 'google_login_id' ),\n\t \"secret\" => $pafl_sk->get( 'google_login_secret' )\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\treturn new Hybrid_Auth( $config );\n\t}",
"private function establishUser()\n {\n $site = $this->view->site; /* @var BeMaverick_Site $site */\n\n // If we're exercising grant type password, the user obtained from backend, will be off the username field.\n // Then, supplied username/password here will be matched against the backend.\n if ( isset( $_REQUEST['grant_type'] ) && isset( $_REQUEST['username'] ) && $_REQUEST['grant_type'] == 'password' ) {\n $user = $site->getUserForOAuth( $_REQUEST['username'] );\n \n // Try email address as a backup\n if (!$user) {\n $user = $site->getUserByEmailAddress( $_REQUEST['username'], null );\n }\n\n if ( $user ) {\n return $user;\n } else {\n error_log( 'OAuth Grant Type Password Error. User not found for username: ' . $_REQUEST['username'] );\n }\n }\n\n return null;\n }",
"function loginFinish()\r\n\t{\r\n\t\tHybrid_Logger::info( \"Enter [{$this->providerId}]::loginFinish()\" );\r\n\r\n\t\tif( ! isset( $_REQUEST['openid_ns'] ) )\r\n\t\t{\r\n\t\t\tthrow new Exception( \"Authentification failed! The OpenID provider has returned an invalid response.\" );\r\n\t\t} \r\n\r\n\t\t$result = Auth_OpenID::getQuery();\r\n\r\n\t\t$this->openidConsumer = new Auth_OpenID_Consumer( $this->openidStorage );\r\n\t\t$response = $this->openidConsumer->complete( Hybrid_Auth::storage()->get( \"hauth_session.hauth_endpoint\" ), $result );\r\n\r\n\t\t// check openid provider response\r\n\t\tif ( $response->status == Auth_OpenID_CANCEL ) \r\n\t\t{\r\n\t\t\tthrow new Exception( \"Authentification failed! Sign-in was cancelled.\" );\r\n\t }\r\n\t\telseif( $response->status == Auth_OpenID_FAILURE )\r\n\t\t{\r\n\t\t\tthrow new Exception( \"Authentification failed! OpenID verification failed: \" . $response->message );\r\n\t }\r\n\r\n\t\t// This means the authentication succeeded; extract the\r\n\t\t// identity URL and Simple Registration data (if it was returned).\r\n\t\telseif( $response->status == Auth_OpenID_SUCCESS )\r\n\t\t{\r\n\t\t\t$ax_args = Auth_OpenID_AX_FetchResponse::fromSuccessResponse($response);\r\n\r\n\t\t\tif ( $ax_args )\r\n\t\t\t{\r\n\t\t\t\t# store user ID, and detect user profile from the returned data \r\n\t\t\t\t# OpenID provide the user profile once, so we store it from now\r\n\t\t\t\t$this->user->providerUID = $response->getDisplayIdentifier(); # for openID providers, is an unique url for each user \r\n\t\t\t\t$this->user->profile->profileURL = $response->getDisplayIdentifier();\r\n\r\n\t\t\t\t$ax_args = $ax_args->data;\r\n\r\n\t\t\t\tif (isset($ax_args['http://axschema.org/namePerson/friendly'][0])) $this->user->profile->displayName = $ax_args['http://axschema.org/namePerson/friendly'][0];\r\n\t\t\t\tif (isset($ax_args['http://axschema.org/contact/email'][0])) $this->user->profile->email = $ax_args['http://axschema.org/contact/email'][0];\r\n\r\n\t\t\t\tif( ! $this->user->profile->displayName ){\r\n\t\t\t\t\tif (isset($ax_args['http://axschema.org/namePerson'][0])) $this->user->profile->displayName = $ax_args['http://axschema.org/namePerson'][0];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isset($ax_args['http://axschema.org/person/gender'][0])) $this->user->profile->gender = $ax_args['http://axschema.org/person/gender'][0];\r\n\t\t\t\t\r\n\t\t\t\tif (isset($ax_args['http://axschema.org/contact/postalCode/home'][0])) $this->user->profile->zip = $ax_args['http://axschema.org/contact/postalCode/home'][0];\r\n\t\t\t\tif (isset($ax_args['http://axschema.org/contact/country/home'][0])) $this->user->profile->country = $ax_args['http://axschema.org/contact/country/home'][0];\r\n\t\t\t\tif (isset($ax_args['http://axschema.org/pref/language'][0])) $this->user->profile->language = $ax_args['http://axschema.org/pref/language'][0]; \r\n\t\t\t\tif (isset($ax_args['http://axschema.org/namePerson/first'][0])) $this->user->profile->firstName = $ax_args['http://axschema.org/namePerson/first'][0]; \r\n\t\t\t\tif (isset($ax_args['http://axschema.org/namePerson/last'][0])) $this->user->profile->lastName = $ax_args['http://axschema.org/namePerson/last'][0]; \r\n\r\n\t\t\t\tif( ! $this->user->profile->displayName ){\r\n\t\t\t\t\t$this->user->profile->displayName = $this->user->profile->firstName . \" \" . $this->user->profile->lastName;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isset($ax_args['http://axschema.org/birthDate'][0])){\r\n\t\t\t\t\tlist($birthday_month, $birthday_day, $birthday_year) = explode('/', $ax_args['http://axschema.org/birthDate'][0] );\r\n\r\n\t\t\t\t\t$this->user->profile->birthDay = $birthday_day;\r\n\t\t\t\t\t$this->user->profile->birthMonth = $birthday_month;\r\n\t\t\t\t\t$this->user->profile->birthYear = $birthday_year;\r\n\t\t\t\t} \r\n\r\n\t\t\t\t$this->user->profile->gender = strtolower( $this->user->profile->gender );\r\n\r\n\t\t\t\tif( $this->user->profile->gender == \"f\" ){\r\n\t\t\t\t\t$this->user->profile->gender = \"female\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif( $this->user->profile->gender == \"m\" ){\r\n\t\t\t\t\t$this->user->profile->gender = \"male\";\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\tthrow new Exception( \"Authentification failed! User has accepted the authentfication, but the OpenID provider [{$this->openidIdentifier}] has not sent the user data.\" );\r\n\t\t\t}\r\n\r\n\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), set user data\", $this->user );\r\n\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\" , $this->user ); \r\n\r\n\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::loginFinish(), Set user to connected\" );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.is_logged_in\", 1 ); \r\n\t\t}\r\n\r\n\t\t// if the the provider has failed to return the user profile\r\n\t\tif ( ! $this->user->providerUID )\r\n\t\t{\r\n\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), reSet user to deconnected\" );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.is_logged_in\", 0 );\r\n\t\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", NULL );\r\n\r\n\t\t\tthrow new Exception( \"User profile request failed! The user was able to authenticate with {$this->providerId}, but the provider has failed to return the user profile.\" );\r\n\t\t}\r\n\t}",
"public function authenticate() {\n\n\t\tif (!$this->_authorisationCode || !$this->_callbackUrl) {\n\t\t\tthrow new Celsus_Exception(\"Missing information for Facebook authentication.\", Celsus_Http::BAD_REQUEST);\n\t\t}\n\n\t\t$accessToken = Celsus_External_Model_Service_FacebookUser::acquireAccessToken($this->_authorisationCode, $this->_callbackUrl);\n\n\t\t$userData = Celsus_External_Model_Service_FacebookUser::getProfileInformation($accessToken);\n\n\t\tif (!count($userData)) {\n\t\t\treturn new Celsus_Auth_Result(Celsus_Auth_Result::FAILURE, null);\n\t\t}\n\n\t\t$user = $userData[0];\n\t\t$user->access_token = $accessToken;\n\t\t$this->_result = $user;\n\n\t\treturn new Celsus_Auth_Result(Celsus_Auth_Result::SUCCESS, $user->id, array('Authentication Successful'));\n\t}",
"private function findUserByProvider()\n {\n $profile = $this->client->getUserAttributes();\n $id = ArrayHelper::getValue($profile, 'id');\n if ($provider = UserProvider::findByProvider($this->type, $id)) {\n $user = $provider->user;\n $provider->setAttributes($this->parseProvider());\n $provider->save();\n\n return $user;\n }\n return null;\n }",
"public function authenticate()\n {\n // Check request\n $this->getRequest()->checkParameters(self::$PARAMS_2L);\n $this->getRequest()->checkBodyHash();\n $this->getRequest()->checkTimestamp(\n $this->valid_timestamp_past,\n $this->valid_timestamp_future\n );\n\n // Get consumer\n $consumer_key = $this->getRequest()->getParameter('oauth_consumer_key');\n $this->consumer = $this->fetchConsumer($consumer_key);\n if (!$this->consumer) {\n throw new HTTP_OAuthProvider_Exception('401 Consumer is not found', 401);\n }\n if (!$this->consumer instanceof HTTP_OAuthProvider_Consumer) {\n $message = '500 FetchConsumerHandler did not return HTTP_OAuthProvider_Consumer instance';\n throw new HTTP_OAuthProvider_Exception($message, 500);\n }\n\n // Check signature\n $sig = HTTP_OAuthProvider_Signature::factory($this);\n $sig->checkSignature();\n\n return true;\n }",
"public function getOauthConnection($providerName);",
"static public function initAuthParamsLogin(RublonConsumer $rublon, $callbackUrl, $appUserId, $userEmail, $params = null) {\n\t\t$authParams = self::initAuthParams($rublon, $callbackUrl, $params);\n\t\t$authParams->setConsumerParam(RublonAuthParams::FIELD_APP_USER_ID, $appUserId);\n\t\t$authParams->setConsumerParam(RublonAuthParams::FIELD_USER_EMAIL_HASH, hash(self::HASH_ALG, strtolower($userEmail)));\n\t\treturn $authParams;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the created_by column Example usage: $query>filterByCreatedBy('fooValue'); // WHERE created_by = 'fooValue' $query>filterByCreatedBy('%fooValue%'); // WHERE created_by LIKE '%fooValue%' | public function filterByCreatedBy($createdBy = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($createdBy)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $createdBy)) {
$createdBy = str_replace('*', '%', $createdBy);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(TbsetorPeer::CREATED_BY, $createdBy, $comparison);
} | [
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($createdBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $createdBy)) {\n $createdBy = str_replace('*', '%', $createdBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(MonedaPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($createdBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $createdBy)) {\n $createdBy = str_replace('*', '%', $createdBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TbalunoPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($createdBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $createdBy)) {\n $createdBy = str_replace('*', '%', $createdBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TbturmaPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($createdBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $createdBy)) {\n $createdBy = str_replace('*', '%', $createdBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TbpaisPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($createdBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $createdBy)) {\n $createdBy = str_replace('*', '%', $createdBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(FacturaPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($createdBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $createdBy)) {\n $createdBy = str_replace('*', '%', $createdBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(JugadorMesaPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(SearchIndexPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(SearchIndexPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(EventPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(EventPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EventPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(GateTableMap::COL_CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(GateTableMap::COL_CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GateTableMap::COL_CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(ContactPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(ContactPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(TeamMemberPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(TeamMemberPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TeamMemberPeer::CREATED_BY, $createdBy, $comparison);\n }",
"function filterByOwner($user_id);",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(StudentPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(StudentPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(StudentPeer::CREATED_BY, $createdBy, $comparison);\n }",
"function filterCreatedByUsers($user_ids) {\n $this->setCreatedByFilter(self::USER_FILTER_SELECTED);\n\n if(is_array($user_ids)) {\n foreach($user_ids as $k => $v) {\n $user_ids[$k] = (integer) $v;\n } // foreach\n } else if($user_ids) {\n $user_ids = array($user_ids);\n } else {\n $user_ids = null;\n } // if\n\n $this->setAdditionalProperty('created_by_users', $user_ids);\n }",
"public function lnrs_filter_by() {\n return lnrs('FilterBy', '', 'Filter By: ');\n }",
"public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($versionCreatedBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $versionCreatedBy)) {\n $versionCreatedBy = str_replace('*', '%', $versionCreatedBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(DealerGoogletimezoneTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);\n }",
"public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($versionCreatedBy)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $versionCreatedBy)) {\n $versionCreatedBy = str_replace('*', '%', $versionCreatedBy);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(DealerGoogletimezoneVersionTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);\n }",
"public function setCreatedBy($value)\n\t{\n\t\t$this->{static::CREATED_BY} = $value;\n\t}",
"public function filterByVersionCreatedBy($value = null, $comparison = null)\n {\n return $this->useContentAreaQuery()->filterByVersionCreatedBy($value, $comparison)->endUse();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the acces saisie commande. | public function setAccesSaisieCommande(?bool $accesSaisieCommande): AccesWeb {
$this->accesSaisieCommande = $accesSaisieCommande;
return $this;
} | [
"public function getAccesSaisieCommande() {\n return $this->accesSaisieCommande;\n }",
"function setCommand($value) {\n $this->command = $value;\n }",
"public function setAtaqueProgramador($valor){\n $this->ataqueProgramador=$valor;\n }",
"public function setModeleCommande(?string $modeleCommande): Clients {\n $this->modeleCommande = $modeleCommande;\n return $this;\n }",
"public function abrir()\n {\n $this->setAberto(true);\n }",
"public function accesoProcesar() {\n\t\t\t$this->procesar('1268771b');\n\t\t}",
"public function activarSonidoGeneral() {\n\n self::$mesaMezclas->encender(MesaMezclas::$CANAL2,\"master\");\n\n }",
"public function activarSonidoContraparte() {\n\n self::$mesaMezclas->encender(MesaMezclas::$CANAL1,\"videoconferencia\");\n\n }",
"function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}",
"function setSorpresa($_caja){\r\n $this->sorpresa=$_caja;\r\n }",
"public function cadastrar(){\n $this->variaveis();\n parent::cadastroCliente($this->nome,$this->sexo,$this->cidade);\n echo 'Cadastro Efetuado com Sucesso!';\n\n }",
"public function setSujet($Sujet) {$this->Sujet = $Sujet;}",
"public function permisoProcesar() {\n\t\t\t//$this->procesar('fd7aab9e');\n\t\t}",
"public function setCliNombreAttribute($value)\n {\n $this->attributes['cli_nombre'] = strtoupper($value);\n }",
"public function getCommande()\n {\n return $this->commande;\n }",
"function EditCommande()\n {\n $commandeBlock = new FactureCommandeBlock($this->Core);\n echo $commandeBlock->EditCommande(Request::GetPost(\"commandeId\"));\n }",
"public function testSetCommandeIsolee() {\n\n $obj = new Chantiers();\n\n $obj->setCommandeIsolee(true);\n $this->assertEquals(true, $obj->getCommandeIsolee());\n }",
"public function setPrixCommande($PrixCommande)\n{\n$this->PrixCommande = $PrixCommande;\n\nreturn $this;\n}",
"function setMot_de_passe($mdp){\n if(empty($mdp)){\n header(\"Location:../vu/formulaire_inscription.php\");\n return;\n }\n //on declare de la varaible mdp puis on appelle la varibale prive mdp\n $this->_mdp = $mdp;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a string with additional CSS for the given banners | public function getAdditionalCss($banners)
{
$ret = '';
foreach ($banners as $banner) {
/** @var \DERHANSEN\SfBanners\Domain\Model\Banner $banner */
if ($banner->getMarginTop() > 0 || $banner->getMarginRight() > 0 ||
$banner->getMarginBottom() > 0 || $banner->getMarginLeft() > 0
) {
$bannerCss = '.banner-' . $banner->getUid() . ' { margin: ' . $banner->getMarginTop() .
'px ' . $banner->getMarginRight() . 'px ' . $banner->getMarginBottom() . 'px ' .
$banner->getMarginLeft() . 'px; }' . chr(10) . chr(13);
$ret .= $bannerCss;
}
}
return $ret;
} | [
"public function getAdditionalCssLinkReturnsEmptyStringIfNoBannersFoundTest() {\n\t\t$pid = 114;\n\n\t\t/* Get banner from Repository */\n\t\t$this->demand->setStartingPoint($pid);\n\t\t$banners = $this->bannerRepository->findDemanded($this->demand);\n\n\t\t$result = $this->bannerService->getAdditionalCssLink($banners);\n\t\t$this->assertEmpty($result);\n\t}",
"function jumpstart_banners_inline_styles() {\n\n\tif ( $args = themeblvd_config('banner') ) {\n\n\t\t$print = \"/* Page Banner */\\n\";\n\n\t\t// Mobile\n\t\tif ( ! empty($args['height']) && ! empty($args['height_mobile']) ) {\n\n\t\t\t$args['height_mobile'] = str_replace('px', '', $args['height_mobile']); // double check formatting\n\n\t\t\t$print .= \".tb-featured-banner > .wrap {\\n\";\n\t\t\t$print .= sprintf( \"\\tmin-height: %spx;\\n\", esc_attr( $args['height_mobile'] ) );\n\t\t\t$print .= \"}\\n\";\n\n\t\t}\n\n\t\t// Tablet\n\t\t$print .= \"@media (min-width: 768px) {\\n\";\n\n\t\t$print .= \"\\t.tb-featured-banner {\\n\";\n\t\t$print .= sprintf(\"\\t\\tpadding-top: %spx;\\n\", themeblvd_config('top_height_tablet'));\n\t\t$print .= \"\\t}\\n\";\n\n\t\tif ( ! empty($args['height']) && ! empty($args['height_tablet']) ) {\n\n\t\t\t$args['height_tablet'] = str_replace('px', '', $args['height_tablet']); // double check formatting\n\n\t\t\t$print .= \"\\t.tb-featured-banner > .wrap {\\n\";\n\t\t\t$print .= sprintf( \"\\t\\tmin-height: %spx;\\n\", esc_attr( $args['height_tablet'] ) );\n\t\t\t$print .= \"\\t}\\n\";\n\n\t\t}\n\n\t\t$print .= \"}\\n\";\n\n\t\t// Desktop\n\t\t$print .= \"@media (min-width: 992px) {\\n\";\n\n\t\t$print .= \"\\t.tb-featured-banner {\\n\";\n\t\t$print .= sprintf(\"\\t\\tpadding-top: %spx;\\n\", themeblvd_config('top_height'));\n\t\t$print .= \"\\t}\\n\";\n\n\t\tif ( ! empty($args['height']) && ! empty($args['height_desktop']) ) {\n\n\t\t\t$args['height_desktop'] = str_replace('px', '', $args['height_desktop']); // double check formatting\n\n\t\t\t$print .= \"\\t.tb-featured-banner > .wrap {\\n\";\n\t\t\t$print .= sprintf( \"\\t\\tmin-height: %spx;\\n\", esc_attr($args['height_desktop'] ) );\n\t\t\t$print .= \"\\t}\\n\";\n\t\t}\n\n\t\t$print .= \"}\\n\";\n\n\t\t// Print after style.css\n\t\twp_add_inline_style( 'themeblvd-theme', apply_filters('themeblvd_banner_css_output', $print, $args) );\n\n\t}\n\n}",
"function balloonCSS()\n{\n $css = <<<HEREDOC\n<style type=\"text/css\">\n a:link {text-decoration: none;}\n td.left {text-align: right; vertical-align: top; margin-bottom: 5px;}\n td, h2 {white-space: nowrap; font-family: verdana;}\n</style>\nHEREDOC;\n\n return $css;\n}",
"public function getAdditionalCssFile($banners)\n {\n $css = $this->getAdditionalCss($banners);\n $filename = '';\n if ($css != '') {\n $filename = PageGenerator::inline2TempFile($css, 'css');\n }\n return $filename;\n }",
"function getbanners()\n\t\t{\n\t\t\t$banners = $this->manage_content->getValue('banner_info','*');\n\t\t\techo '<div id=\"add_space\">';\n\t\t\tforeach($banners as $banner)\n\t\t\t{\n\t\t\t\tif($banner['banner_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$banner['banner_link'].'\">';\n\t\t\t\t\techo '<div class=\"add_section\"><img src=\"images/'.$banner['banner_image'].'\" style=\"height:'.$banner['banner_height'].'px;width:'.$banner['banner_width'].'px;float:left;\"/></div></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</div>';\n\t\t}",
"public function getConcatenateCss() {}",
"protected function doConcatenateCss() {}",
"public function set_css() {\n\t\techo \"\\n\".'<style type=\"text/css\">.formatted-links.see::before { content: \"'.get_theme_mod(\"recommendation_string\",$this->recommendation_string).': \" !important;font-weight: bold;color: black;}</style>'.\"\\n\";\n\t}",
"private function format_css(): string {\r\n return JKNCSS::tag('\r\n \r\n div.'.self::cl_iss_meta.' span {\r\n display: block;\r\n }\r\n\r\n span.'.self::cl_iss_name.' {\r\n font-size: 14px;\r\n }\r\n\r\n div.'.self::cl_iss_thumb.' {\r\n padding-top: 5px;\r\n }\r\n\r\n div.'.self::cl_iss_panel.' {\r\n text-align: center;\r\n }\r\n\r\n div.'.self::cl_iss_panel.' a {\r\n display: block;\r\n }\r\n\r\n div.'.self::cl_iss_panel.' a:hover {\r\n background-color: rgba(17,65,111,0.15);\r\n }\r\n \r\n ');\r\n }",
"public function getAdditionalCssLinkReturnsLinkTest() {\n\t\t$pid = 115;\n\t\t$this->testingFramework->createRecord('tx_sfbanners_domain_model_banner', array('pid' => $pid,\n\t\t\t'margin_left' => 10, 'margin_right' => 10, 'sorting' => 1));\n\n\t\t/* Get banner from Repository */\n\t\t$this->demand->setStartingPoint($pid);\n\t\t$banners = $this->bannerRepository->findDemanded($this->demand);\n\n\t\t$result = $this->bannerService->getAdditionalCssLink($banners);\n\t\t$this->assertContains('<link rel=\"stylesheet\" type=\"text/css\" href=', $result);\n\t\t$this->assertContains('typo3temp/stylesheet_', $result);\n\t\t$this->assertContains('.css', $result);\n\t\t$this->assertContains('media=\"all\" />', $result);\n\t}",
"function wp_ozh_wsa_fakegooglead_css() {\r\n\r\n\tglobal $wp_ozh_wsa;\r\n\tif (isset($wp_ozh_wsa['my_fakead-css'])) {\r\n\t\techo $wp_ozh_wsa['my_fakead-css'] ;\r\n\t\treturn;\r\n\t}\r\n\r\n\t$out = '#006E2E';\r\n\t$mid = '#008C00';\r\n\t$in = '#6BBA70';\r\n\t\r\n\techo \"\r\n\t<style type='text/css'>\r\n\t.wsa_ad_out {\r\n\t-moz-border-radius:15px;\r\n\tword-wrap: break-word;\r\n\tbackground:$out;\r\n\tpadding:7px;\r\n\ttext-align:center;\r\n\toverflow:hidden;\r\n\t}\r\n\t.wsa_ad_in {\r\n\t-moz-border-radius:15px;\r\n\tborder:7px solid $mid;\r\n\tpadding:5px;\r\n\tbackground:$in;\r\n\tcolor:$out;\r\n\t}\r\n\t.wsa_ad_in p {margin:0}\r\n\t.wsa_ad_in .p1 {\r\n\tfont-family:Verdana,Chicago,Sans-serif;\r\n\t}\r\n\t.wsa_ad_in .p2 {\r\n\tfont-family:Verdana,Chicago,Sans-serif;\r\n\t}\r\n\t.wsa_ad_in a {\r\n\tcolor:$out;\r\n\ttext-decoration:underline;\r\n\t}\r\n\t.wsa_ad_center {\r\n\tborder:1px solid #cfc;\r\n\theight:100%;\r\n\t-moz-border-radius:15px;\r\n\t}\r\n\t</style>\r\n\t\";\t\r\n}",
"function parseCSS()\n {\n $output = '<style type=\"text/css\">';\n $output .= $this->page_array['css'];\n $output .= '</style>';\n return $output;\n\n }",
"public function preload_banner_body_style() {\n\n\t\t\t// If AMP is active, do nothing.\n\t\t\tif ( amply_is_amp() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get registered styles.\n\t\t\t$wp_styles = wp_styles();\n\n\t\t\tif ( empty( $wp_styles->registered[ 'amply-' . $this->banner ] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Preload banner1 css.\n\t\t\t$src = amply_get_preload_stylesheet_uri( $wp_styles, 'amply-' . $this->banner );\n\n\t\t\techo '<link rel=\"preload\" id=\"amply-' . esc_attr( $this->banner ) . '-preload\" href=\"' . esc_url( $src ) . '\" as=\"style\" />';\n\t\t\techo \"\\n\";\n\n\t\t}",
"private static function format_websites_css() {\r\n echo JKNCSS::tag('\r\n div.'.self::cl_ws_meta.' {\r\n font-family: \"Roboto\", sans-serif;\r\n }\r\n\r\n span.'.self::cl_ws_name.' {\r\n font-weight: bold;\r\n }\r\n\r\n span.'.self::cl_ws_date.' {\r\n display: block;\r\n font-size: small;\r\n }\r\n\r\n div.'.self::cl_ws_thumb.' {\r\n border: 1px solid #555;\r\n margin: 5px;\r\n padding: 5px;\r\n background-color: #fff !important;\r\n }\r\n\r\n div.'.self::cl_ws_notes.' {\r\n text-align: left;\r\n padding: 5px;\r\n }\r\n\r\n div.'.self::cl_ws_panel.' a {\r\n color: #222;\r\n text-decoration: initial !important;\r\n display: block;\r\n }\r\n\r\n div.'.self::cl_ws_panel.' a:hover {\r\n background-color: rgba(17,65,111,0.15);\r\n }\r\n\r\n div.'.self::cl_websites.' .vc_column-inner {\r\n margin-bottom: 25px;\r\n text-align: center;\r\n }\r\n ');\r\n }",
"public function _generateBanner($string) {\n $banner = str_repeat(\"#\",$this->options['banner']['width']);\n return $banner.\"\\n\".$string.\"\\n\".$banner;\n }",
"function personal_add_customizer_css() {\n\t$color = personal_sanitize_hex_color( get_theme_mod( 'personal_link_color' ) );\n\t?>\n\t<!-- personal customizer CSS -->\n\t<style>\n\t \n\t\tbody {\n\t\t\tborder-color: <?php echo $color; ?>;\n\t\t}\n\t\ta, a:hover {\n\t\t\tcolor: <?php echo $color; ?>;\n\t\t}\n\t\t\n\t\t.overview a { color: <?php echo get_theme_mod( 'resume_link_color' ); ?>; }\n\t\t\n\t\t.progressBar div { background-color: <?php echo get_theme_mod( 'skill_bar_color' ); ?>; } \n\t\t \n\t</style>\n<?php }",
"public function additional_styles() { ?>\n <style id=\"cv-theme-settings-advanced-style\">\n .css-selector {\n font-family: 'Oxygen Mono';\n background: rgba(0,0,0,0.025);\n border-radius: 3px;\n padding: 5px;\n }\n </style>\n <?php }",
"function os_poker_skin_css() {\n header('Content-type: text/css');\n\n $url = theme('poker_skin_css_url');\n print(\"@import url($url);\\n\");\n\n module_load_include('php', 'os_poker', 'shop.class');\n foreach(CShop::ListItems() as $item) {\n $class = os_poker_clean_css_identifier($item->name);\n $img_url = file_create_url($item->picture);\n print(\".poker_gift_$class {background-image: url($img_url);}\\n\");\n }\n module_load_include('php', 'os_poker', 'poker.class');\n foreach(CPoker::GetRewards() as $key => $reward) {\n $class = os_poker_clean_css_identifier($reward['name']);\n $img_url = file_create_url($reward['picture']);\n print(\".poker_reward_$key {background-image: url($img_url);}\\n\");\n }\n}",
"public function environment_banner_style(){\n $style = 'display:none;';\n $settings = $this->config->xml()->site->environment;\n if ($settings)\n $style = $settings->display == 'yes'?'display:block':'display:none';\n return $style;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of cod_factura | public function setCod_factura($cod_factura)
{
$this->cod_factura = $cod_factura;
return $this;
} | [
"public function getCod_factura()\n {\n return $this->cod_factura;\n }",
"public function SetData_alberturaConta($valor){\n\t\t $this->data_emissao= $valor;\n\t }",
"public function setCodi($codi){\n $this->codi = $codi;\n }",
"function set_codOficina( $codOficina ) {\n // sets the value of codOficina\n $this->codOficina = $codOficina;\n }",
"public function setCod(int $cod);",
"public function setIdfacturaCuentaVivienda($idfacturaCuentaVivienda){\n $this->idfacturaCuentaVivienda = $idfacturaCuentaVivienda;\n }",
"public function testSetCodeFamille() {\n\n $obj = new Collaborateurs();\n\n $obj->setCodeFamille(\"codeFamille\");\n $this->assertEquals(\"codeFamille\", $obj->getCodeFamille());\n }",
"public function testSetCodeFournisseur() {\n\n $obj = new CdeFournisseurMensu();\n\n $obj->setCodeFournisseur(\"codeFournisseur\");\n $this->assertEquals(\"codeFournisseur\", $obj->getCodeFournisseur());\n }",
"public function testSetCodeFactor() {\n\n $obj = new DevisCommercialEntetes();\n\n $obj->setCodeFactor(\"codeFactor\");\n $this->assertEquals(\"codeFactor\", $obj->getCodeFactor());\n }",
"private function setValorBaixa($fValorBaixa) {\n $this->fValorBaixa = $fValorBaixa;\n }",
"public function setCodFou(string $codFou)\r\n {\r\n $this->codFou = $codFou;\r\n\r\n return $this;\r\n }",
"public function testSetCodeFournisseur() {\n\n $obj = new MouvementsStock();\n\n $obj->setCodeFournisseur(\"codeFournisseur\");\n $this->assertEquals(\"codeFournisseur\", $obj->getCodeFournisseur());\n }",
"public function setIdFactura($idFactura) {\n $this->idFactura = $idFactura;\n }",
"public function setCama(){\n $this->cama = \"Sim\";\n }",
"function modificaFactura($id,$deudor,$empresa,$num,$importe,$pendiente,$tipo,$fecha,$venci,$cobro,$pago,$estado){\r\n\t\t\t$fecha = date_format($fecha, \"Y-m-d\");\r\n\t\t\t$venci = date_format($venci, \"Y-m-d\");\r\n\t\t\t$data = array(\r\n\t\t\t\t'ID_Factura' => $id,\r\n\t\t\t\t'CIF_Deudor' => $deudor,\r\n\t\t\t\t'CIF_Empresa' => $empresa,\r\n\t\t\t\t'Numero_Factura' => $num,\r\n\t\t\t\t'Importe_Factura' => $importe,\r\n\t\t\t\t'Imp_Pend_Factura' => $pendiente,\r\n\t\t\t\t'Tipo_Factura' => $tipo,\r\n\t\t\t\t'Fecha_Factura' => $fecha,\r\n\t\t\t\t'Vencimiento_Factura' => $venci,\r\n\t\t\t\t'Cobro_Factura' => $cobro,\r\n\t\t\t\t'Tipo_Pago' => $pago,\r\n\t\t\t\t'Estado_Factura' => $estado\r\n\t\t\t);\r\n\t\t\t$this->db->update('factura',$data,array('ID_Factura'=> $id));\r\n\t\t}",
"public function _setDataCarrera($data_carrera)\n {\n $this->data_carrera = $data_carrera;\n }",
"public function testSetCodeFeuille() {\n\n $obj = new ChargesProduits();\n\n $obj->setCodeFeuille(\"codeFeuille\");\n $this->assertEquals(\"codeFeuille\", $obj->getCodeFeuille());\n }",
"public function getValor_factura() {\r\n return $this->valor_factura;\r\n }",
"public function testSetCodeFournisseur() {\n\n $obj = new ArticlesFrn();\n\n $obj->setCodeFournisseur(\"codeFournisseur\");\n $this->assertEquals(\"codeFournisseur\", $obj->getCodeFournisseur());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the surrounding temperature and unit of children storages. Note: only children storages having temperature or unit different than the parent will be updated. | function updateChildrenSurroundingTemperature($parent_storage_master_id, $parent_temperature, $parent_temp_unit) {
$studied_parent_storage_ids = array($parent_storage_master_id => $parent_storage_master_id);
while(!empty($studied_parent_storage_ids)) {
// Search 'direct' children to update
$conditions = array();
$conditions['StorageMaster.parent_id'] = $studied_parent_storage_ids;
$conditions['StorageControl.set_temperature'] = '0';
$conditions['OR'] = array();
if(empty($parent_temperature) && (!is_numeric($parent_temperature))) {
$conditions['OR'][] = "StorageMaster.temperature IS NOT NULL";
} else {
$conditions['OR'][] = "StorageMaster.temperature IS NULL";
$conditions['OR'][] = "StorageMaster.temperature != '$parent_temperature'";
}
if(empty($parent_temp_unit)) {
$conditions['OR'][] = "StorageMaster.temp_unit IS NOT NULL";
$conditions['OR'][] = "StorageMaster.temp_unit != ''";
} else {
$conditions['OR'][] = "StorageMaster.temp_unit IS NULL";
$conditions['OR'][] = "StorageMaster.temp_unit != '$parent_temp_unit'";
}
$studied_parent_storage_ids = array();
$children_storage_to_update = $this->find('all', array('conditions' => $conditions, 'recursive' => '0'));
foreach($children_storage_to_update as $new_children_to_update) {
// New children to update
$studied_children_id = $new_children_to_update['StorageMaster']['id'];
$storage_data_to_update = array();
$storage_data_to_update['StorageMaster']['temperature'] = $parent_temperature;
$storage_data_to_update['StorageMaster']['temp_unit'] = $parent_temp_unit;
$this->data = array();
$this->id = $studied_children_id;
if(!$this->save($storage_data_to_update, false)) {
AppController::getInstance()->redirect('/Pages/err_plugin_system_error?method='.__METHOD__.',line='.__LINE__, null, true);
}
// Re-populate the list of parent storages to study
$studied_parent_storage_ids[$studied_children_id] = $studied_children_id;
}
}
return;
} | [
"public function testAssignParentFieldValues_QuantityUnitDontInherit()\n {\n $oArticle = $this->_createArticle('_testArt', '_testVar');\n $oArticle->oxarticles__oxunitquantity = new oxField('3', oxField::T_TEXT);\n $oArticle->oxarticles__oxunitname = new oxField('_UNIT_KG', oxField::T_TEXT);\n $oArticle->save();\n\n $oVariant = oxNew('oxArticleHelper');\n $oVariant->load('_testVar');\n $oVariant->oxarticles__oxunitquantity = new oxField('7', oxField::T_TEXT);\n $oVariant->oxarticles__oxunitname = new oxField('_UNIT_L', oxField::T_TEXT);\n $oVariant->cleanup();\n $oVariant->UNITassignParentFieldValues();\n $this->assertEquals('7', $oVariant->oxarticles__oxunitquantity->value);\n $this->assertEquals('_UNIT_L', $oVariant->oxarticles__oxunitname->value);\n }",
"public function test_existing_child_can_be_updated_to_using_a_temp_parent(){\n $companyno = $this->remote->companyno;\n\n //setup World\n $remote = Remote::insertClone(RemoteWorkorder::class,LocalWorkorder::class,[\n \"companyno\" => $companyno\n ]);\n $meter1 = Remote::insert(RemoteMeter::class,[\n \"workorderno\" => $remote->record()->WorkOrderID,\n \"companyno\" => $companyno\n ]);\n $localMeter1 = $meter1->cloneTo(LocalMeter::class);\n Remote::insertClone(RemoteMeter::class,LocalMeter::class,[\n \"workorderno\" => $remote->record()->WorkOrderID,\n \"companyno\" => $companyno\n ]);\n\n $this->timePasses();\n\n //insert Local Parents\n $tempLocalWorkorders = LocalCollection::insert(LocalTempWorkorder::class,2,[\n \"companyno\" => $companyno,\n \"UserName\" => \"sanji\",\n \"local_WorkOrderNo\" => null\n ]);\n //Set the no as the id to siluate autoincrement.\n $tempLocalWorkorders->update(0,[\"local_WorkOrderNo\" => $tempLocalWorkorders->index(0)->local_WorkOrderID]);\n $tempLocalWorkorders->update(1,[\"local_WorkOrderNo\" => $tempLocalWorkorders->index(1)->local_WorkOrderID]);\n\n\n //update Child to new Temp Parent\n //create insert temp record\n $data = $localMeter1->record()->toArray();\n unset($data[\"workorderno\"]);\n $data[\"local_workorderno\"] = $tempLocalWorkorders->index(0)->local_WorkOrderNo;\n\n $tempLocalMeter = Local::insert(LocalTempMeter::class,$data);\n\n //delete old record\n $localMeter1->delete();\n\n\n\n\n //insert parents\n $returnedWO = ApiWrite::insertOnlyBulk(RemoteWorkorder::class,$tempLocalWorkorders,[],[\"local_WorkOrderNo\"]);\n\n $returnedWorkorderNumber = $returnedWO->records()->where(\"local_WorkOrderNo\",$tempLocalMeter->record()->local_workorderno)->first()->WorkOrderNo;\n\n\n $tempLocalMeter->update([\"workorderno\" => $returnedWorkorderNumber]);\n\n $http = ApiWrite::delete(RemoteMeter::class,$localMeter1->record()->meterid);\n $localMeter1->forceDelete();\n\n\n //Select everything\n $returnedMeter = ApiWrite::insertOnly(RemoteMeter::class,$tempLocalMeter,[\"meterid\" => $tempLocalMeter->record()->meterid],[],[\"workorderno\" => null]);\n\n $workorders = Api::selectAll(RemoteWorkorder::class,$companyno);\n $meter = Api::select(RemoteMeter::class,$companyno);\n\n //Insert Local\n $local = new LocalCollection($workorders);\n $local->download(LocalWorkorder::class);\n\n $localMeter = new Local($meter);\n $localMeter->download(LocalMeter::class);\n\n //Test\n $record = $tempLocalWorkorders->index(0);\n $this->assertDatabaseHasBoth('workorders',[\n 'WorkOrderID' => $returnedWO->index(0)->WorkOrderID,\n 'companyno' => $record->companyno,\n 'WorkOrderNo' => $returnedWO->index(0)->WorkOrderNo,\n 'CustomerNo' => $record->CustomerNo,\n 'UserName' => $record->UserName,\n ]);\n\n $record = $tempLocalMeter->record();\n $this->assertDatabaseHasBoth('meters',[\n \"meterid\" => $meter->meterid,\n \"companyno\" => $companyno,\n \"workorderno\" => $returnedWorkorderNumber,\n \"meterno\" => $record->meterno,\n \"MXU\" => $record->MXU,\n \"prevread\" => $record->prevread,\n ]);\n }",
"public function fixOwnershipOfChildren(): void\n\t{\n\t\t$this->refreshNode();\n\t\t$lft = $this->_lft;\n\t\t$rgt = $this->_rgt;\n\n\t\tBaseAlbumImpl::query()\n\t\t\t->whereExists(function (BaseBuilder $q) use ($lft, $rgt) {\n\t\t\t\t$q\n\t\t\t\t\t->from('albums')\n\t\t\t\t\t->whereColumn('base_albums.id', '=', 'albums.id')\n\t\t\t\t\t->whereBetween('albums._lft', [$lft + 1, $rgt - 1]);\n\t\t\t})\n\t\t\t->update(['owner_id' => $this->owner_id]);\n\t\tPhoto::query()\n\t\t\t->whereExists(function (BaseBuilder $q) use ($lft, $rgt) {\n\t\t\t\t$q\n\t\t\t\t\t->from('albums')\n\t\t\t\t\t->whereColumn('photos.album_id', '=', 'albums.id')\n\t\t\t\t\t->whereBetween('albums._lft', [$lft, $rgt]);\n\t\t\t})\n\t\t\t->update(['owner_id' => $this->owner_id]);\n\t}",
"public function testWriteWithParent()\n {\n $factory = new \\M6Web\\Component\\RedisMock\\RedisMockFactory();\n $redisMock = $factory->getAdapter('Predis\\Client', true);\n CacheMock::config(\n 'RedisTree',\n [\n 'engine' => 'RedisTreeMock',\n 'duration' => 4\n ]\n );\n CacheMock::setEngine('RedisTree', $redisMock);\n\n $key = 'CacheEnginesHelper:testWriteWithParent:1';\n $parentKeys = [\n 'CacheEnginesHelper:TestParent:10',\n 'CacheEnginesHelper:TestParent:20'\n ];\n $value = date('Y-m-d h:m');\n CacheEnginesHelper::writeWithParent($key, $value, $this->cache, $parentKeys);\n $this->assertEquals($value, CacheMock::read($key, $this->cache));\n }",
"protected function _updateChildCount()\n {\n if (!in_array($this->getBehavior(), array(\n Mage_ImportExport_Model_Import::BEHAVIOR_REPLACE,\n Mage_ImportExport_Model_Import::BEHAVIOR_APPEND))) {\n return;\n }\n\n $categoryTable = Mage::getSingleton('core/resource')->getTableName('catalog/category');\n $categoryTableTmp = $categoryTable . '_tmp';\n $this->_connection->query(\"CREATE TEMPORARY TABLE IF NOT EXISTS {$categoryTableTmp} LIKE {$categoryTable};\n INSERT INTO {$categoryTableTmp} SELECT * FROM {$categoryTable};\n UPDATE {$categoryTable} cce\n SET children_count = (\n SELECT count(cce2.entity_id) - 1 as children_county\n FROM {$categoryTableTmp} cce2\n WHERE PATH LIKE CONCAT(cce.path,'%')\n );\n \");\n }",
"private function afterChangeParent() {\n $level = $this->level;\n $slaveItems = $this->active()->findAllByAttributes(array('owner_id' => $this->id));\n while (count($slaveItems) > 0) {\n $level++;\n $itemsArray = array();\n foreach ($slaveItems as $slaveItem) {\n $itemsArray[] = $slaveItem->id;\n }\n $findCriteria = new CDbCriteria();\n $findCriteria->addInCondition('owner_id', $itemsArray);\n $updateCriteria = new CDbCriteria();\n $updateCriteria->addInCondition('id', $itemsArray);\n $this->updateAll(array('level' => $level), $updateCriteria);\n $slaveItems = $this->active()->findAll($findCriteria);\n }\n }",
"private function afterChangeParent()\n {\n $level = $this->level;\n $slaveItems = $this->active()->findAllByAttributes(array('owner_id' => $this->id));\n while (count($slaveItems) > 0) {\n $level++;\n $itemsArray = array();\n foreach ($slaveItems as $slaveItem) {\n $itemsArray[] = $slaveItem->id;\n }\n $findCriteria = new CDbCriteria();\n $findCriteria->addInCondition('owner_id', $itemsArray);\n $updateCriteria = new CDbCriteria();\n $updateCriteria->addInCondition('id', $itemsArray);\n $this->updateAll(array('level' => $level), $updateCriteria);\n $slaveItems = $this->active()->findAll($findCriteria);\n } \n }",
"public function variable_product_sync() {\n\t\tglobal $woocommerce;\n\n\t\tparent::variable_product_sync();\n\n\t\t$children = get_posts( array(\n\t\t\t'post_parent' \t=> $this->id,\n\t\t\t'posts_per_page'=> -1,\n\t\t\t'post_type' \t=> 'product_variation',\n\t\t\t'fields' \t\t=> 'ids',\n\t\t\t'post_status'\t=> 'publish'\n\t\t));\n\n\t\tif ( $children ) {\n\t\t\tforeach ( $children as $child ) {\n\n\t\t\t\t$child_price = get_post_meta( $child, '_price', true );\n\t\t\t\t$child_billing_period = get_post_meta( $child, '_subscription_period', true );\n\n\t\t\t\t// We only care about the lowest price\n\t\t\t\tif ( $child_price !== $this->min_variation_price )\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Set to the shortest possible billing period\n\t\t\t\t$this->subscription_period = WC_Subscriptions::get_longest_period( $this->subscription_period, $child_billing_period );\n\t\t\t}\n\n\t\t\t$woocommerce->clear_product_transients( $this->id );\n\t\t}\n\n\t}",
"public function recalculateTree() {\n $px = $this->Database->DatabasePrefix;\n\n // Update the child counts and reset the depth.\n $sql = <<<SQL\nupdate {$px}Category c\njoin (\n\tselect ParentCategoryID, count(ParentCategoryID) as CountCategories\n\tfrom {$px}Category\n\tgroup by ParentCategoryID\n) c2\n\ton c.CategoryID = c2.ParentCategoryID\nset c.CountCategories = c2.CountCategories,\n c.Depth = 0;\nSQL;\n $this->Database->query($sql);\n\n // Update the first pass of the categories.\n $this->Database->query(<<<SQL\nupdate {$px}Category p\njoin {$px}Category c\n\ton c.ParentCategoryID = p.CategoryID\nset c.Depth = p.Depth + 1\nwhere p.CategoryID = -1 and c.CategoryID <> -1;\nSQL\n );\n\n // Update the child categories depth-by-depth.\n $sql = <<<SQL\nupdate {$px}Category p\njoin {$px}Category c\n\ton c.ParentCategoryID = p.CategoryID\nset c.Depth = p.Depth + 1\nwhere p.Depth = :depth;\nSQL;\n\n for ($i = 1; $i < 25; $i++) {\n $this->Database->query($sql, ['depth' => $i]);\n\n if (val('RowCount', $this->Database->LastInfo) == 0) {\n break;\n }\n }\n }",
"protected function updateParentToChildsCategoryInfo()\n {\n $sql = $this->getInsertChildProductsRecordsSql();\n $this->runQuery($sql, $this->getMainTable(), \"Update category info from parent to child.\");\n }",
"function _node_onchange_child() {\n\t\tif (null !== ($parent = $this->getParent()) && !$parent->isNull())\n\t\t\t$parent->_node_onchange_child();\n\t\t$this->_storage->refresh($this);\n\t}",
"protected function updateParent()\n {\n $this->each(function ($item) {\n if (method_exists($item, 'parent')) {\n $item->parent($this);\n }\n });\n }",
"protected function updateTreePosition()\n {\n $parent = $this->Parent();\n\n if ($parent instanceof KnowledgeBasePage)\n $this->TreePosition = $parent->ChildTreeFilter;\n else // Handle case for root element\n $this->TreePosition = '';\n }",
"public function test_inserted_parent_has_child_updated_to_a_real_parent(){\n $companyno = $this->remote->companyno;\n\n //setup World\n $remote = Remote::insertClone(RemoteWorkorder::class,LocalWorkorder::class,[\n \"companyno\" => $companyno,\n \"UserName\" => \"Javascript\"\n ]);\n $lastSync = Carbon::now();\n\n $this->timePasses();\n\n //insert Local Parent\n $tempLocalWorkorders = LocalCollection::insert(LocalTempWorkorder::class,2,[\n \"companyno\" => $companyno,\n \"UserName\" => \"sanji\",\n \"local_WorkOrderNo\" => null\n ]);\n //Set the no as the id to siluate autoincrement.\n $tempLocalWorkorders->update(0,[\"local_WorkOrderNo\" => $tempLocalWorkorders->index(0)->local_WorkOrderID]);\n $tempLocalWorkorders->update(1,[\"local_WorkOrderNo\" => $tempLocalWorkorders->index(1)->local_WorkOrderID]);\n\n //insert Local child\n $tempLocalMeter = Local::insert(LocalTempMeter::class,[\n \"local_workorderno\" => $tempLocalWorkorders->index(0)->local_WorkOrderNo,\n 'workorderno' => null,\n 'companyno' => $companyno\n ]);\n\n //update Child to new Parent\n $tempLocalMeter->update([\"local_workorderno\" => null]);\n $tempLocalMeter->update([\"workorderno\" => $remote->record()->WorkOrderNo]);\n\n //insert parents\n $returnedWO = ApiWrite::insertOnlyBulk(RemoteWorkorder::class,$tempLocalWorkorders,[],[\"local_WorkOrderNo\"]);\n\n\n //Select everything\n $returnedMeter = ApiWrite::insertOnly(RemoteMeter::class,$tempLocalMeter);\n\n $workorders = Api::selectAll(RemoteWorkorder::class,$companyno);\n $meter = Api::select(RemoteMeter::class,$companyno);\n\n //Insert Local\n $local = new LocalCollection($workorders);\n $local->download(LocalWorkorder::class);\n\n $localMeter = new Local($meter);\n $localMeter->download(LocalMeter::class);\n\n\n //Test\n $record = $tempLocalWorkorders->index(0);\n $this->assertDatabaseHasBoth('workorders',[\n 'WorkOrderID' => $returnedWO->index(0)->WorkOrderID,\n 'companyno' => $record->companyno,\n 'WorkOrderNo' => $returnedWO->index(0)->WorkOrderNo,\n 'CustomerNo' => $record->CustomerNo,\n 'UserName' => $record->UserName,\n ]);\n\n $record = $tempLocalMeter->record();\n $this->assertDatabaseHasBoth('meters',[\n \"meterid\" => $meter->meterid,\n \"companyno\" => $companyno,\n \"workorderno\" => $remote->record()->WorkOrderNo,\n \"meterno\" => $record->meterno,\n \"MXU\" => $record->MXU,\n \"prevread\" => $record->prevread,\n ]);\n }",
"private function updateStock()\n {\n //On boucle dans le panier pour recuperer le produit qui est dans le panier\n foreach (Cart::content() as $item) {\n\n //On recupere l'id du produit dans le panier\n $produit = Produit::find($item->model->id);\n\n //On retire le nombre de la quantité qu'on as selectionner\n $produit->update([\n\n //on prend la qtité en BD on le soustrais par la qtité selectionné dans le panier\n 'quantite' => $produit->quantite - $item->qty\n\n ]);\n }\n }",
"protected function syncLocationInventory()\n {\n if (Mage::registry('before_location_id') != ($locationId = $this->_configHelper->getLocationId())) {\n $inventory = Mage::getModel('squareup_omni/inventory')\n ->getCollection()\n ->addFieldToFilter('location_id', array('eq' => $locationId));\n\n $inventoryArr = array();\n\n foreach ($inventory as $item) {\n $inventoryArr[$item->getProductId()] = $item->getQuantity();\n }\n\n $stockItems = Mage::getModel('cataloginventory/stock_item')\n ->getCollection();\n\n foreach ($stockItems as $stockItem) {\n if (array_key_exists($stockItem->getProductId(), $inventoryArr)) {\n $quantity = $inventoryArr[$stockItem->getProductId()];\n } else {\n $quantity = 0;\n }\n\n $stockItem->getManageStock();\n $stockItem->setQty($quantity);\n $stockItem->setIsInStock((int)($quantity > 0));\n $stockItem->save();\n }\n }\n }",
"public function updateValue(){\n\n\t\t$this->value += (int)max($this->left_parent_value,$this->right_parent_value);\n\t}",
"public function settings_change_storage_location() {\n \n // Send location\n (new MidrubBaseAdminComponentsCollectionSettingsHelpers\\Storage)->settings_change_storage_location();\n \n }",
"public function testUpdateLastSyncDate_UpdateChildIdsByBundleParentProduct()\n {\n $this->setupPhp5();\n $store = $this->getStore('klevu_test_store_1');\n $this->storeManager->setCurrentStore($store->getId());\n\n //Clear fixtures before starting tests\n self::loadProductFixturesRollback();\n\n //Trigger virtual sync for single grouped with two children's\n self::loadAllBundleProductFixtures();\n\n $bundleProduct = $this->productRepository->get('klevu_bundle_product_test');\n $simpleProduct = $this->productRepository->get('klevu_bundle_product_test_simple');\n\n $ids = [$bundleProduct->getId(), $simpleProduct->getId()];\n\n $klevuProductsBefore = $this->getKlevuProducts($ids, true);\n if (method_exists($this, 'assertIsArray')) {\n $this->assertIsArray($klevuProductsBefore);\n } else {\n $this->assertTrue(is_array($klevuProductsBefore), 'Is Array');\n }\n $this->assertEmpty($klevuProductsBefore);\n\n $this->productCommonUpdater->markProductToQueue($bundleProduct);\n\n $klevuProductsAfter = $this->getKlevuProducts($ids, false);\n if (method_exists($this, 'assertIsArray')) {\n $this->assertIsArray($klevuProductsAfter);\n } else {\n $this->assertTrue(is_array($klevuProductsAfter), 'Is Array');\n }\n $this->assertCount(2, $klevuProductsAfter);\n\n //forcefully rollbacks here as loadProductFixturesRollback not a part of a @magentoDataFixture\n self::loadProductFixturesRollback();\n static::loadDataFixturesRollback();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
articleActivityHandler::addActivity() To add article activities | public function addActivity($activity_arr)
{
/*1. article_uploaded
2. article_comment
3. article_rated
4. article_favorite
5. article_featured
6. article_share
7. delete_article_favorite
8. delete_article_featured*/
switch($activity_arr['action_key'])
{
case 'article_uploaded':
$activity_arr['article_title'] = $this->strReplace($activity_arr['article_title']);
$action_value = $activity_arr['article_id'].'~'.
$activity_arr['upload_user_id'].'~'.
$activity_arr['upload_user_name'].'~'.
$activity_arr['article_title'].'~'.
$activity_arr['article_server_url'];
$activity_val_arr = array($activity_arr['upload_user_id'],$activity_arr['upload_user_id']);
$article_activity_val_arr = array($activity_arr['article_id'],
$activity_arr['action_key'],
$action_value,
$activity_arr['upload_user_id'],
$activity_arr['upload_user_id']);
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].
' SET module = \'article\','.
' owner_id = '.$this->dbObj->Param('user_id').','.
' actor_id = '.$this->dbObj->Param('user_id').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$parent_id = $this->dbObj->Insert_ID();
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['article_activity'].
' SET parent_id = '.$parent_id.','.
' content_id = '.$this->dbObj->Param('content_id').','.
' action_key = '.$this->dbObj->Param('action_key').','.
' action_value = '.$this->dbObj->Param('action_value').','.
' actor_id = '.$this->dbObj->Param('actor_id').','.
' owner_id = '.$this->dbObj->Param('action_value').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $article_activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$child_id = $this->dbObj->Insert_ID();
$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].
' SET child_id = '.$child_id.
' WHERE parent_id = '.$parent_id;
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
break;
case 'article_comment':
$activity_arr['article_title'] = $this->strReplace($activity_arr['article_title']);
$action_value = $activity_arr['article_id'].'~'.
$activity_arr['comment_user_id'].'~'.
$activity_arr['user_name'].'~'.
$activity_arr['article_title'].'~'.
$activity_arr['article_server_url'];
$activity_val_arr = array($activity_arr['user_id'],
$activity_arr['comment_user_id']);
$article_activity_val_arr = array($activity_arr['article_comment_id'],
$activity_arr['action_key'],
$action_value,
$activity_arr['comment_user_id'],
$activity_arr['user_id']);
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].
' SET module = \'article\','.
' owner_id = '.$this->dbObj->Param('user_id').','.
' actor_id = '.$this->dbObj->Param('comment_user_id').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$parent_id = $this->dbObj->Insert_ID();
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['article_activity'].
' SET parent_id = '.$parent_id.','.
' content_id = '.$this->dbObj->Param('content_id').','.
' action_key = '.$this->dbObj->Param('action_key').','.
' action_value = '.$this->dbObj->Param('action_value').','.
' actor_id = '.$this->dbObj->Param('actor_id').','.
' owner_id = '.$this->dbObj->Param('action_value').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $article_activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$child_id = $this->dbObj->Insert_ID();
$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].
' SET child_id = '.$child_id.
' WHERE parent_id = '.$parent_id;
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
break;
case 'article_rated':
$activity_arr['article_title'] = $this->strReplace($activity_arr['article_title']);
$action_value = $activity_arr['article_id'].'~'.
$activity_arr['rating_user_id'].'~'.
$activity_arr['user_name'].'~'.
$activity_arr['article_title'].'~'.
$activity_arr['article_server_url'].'~'.
$activity_arr['rate'].'~';
//Cheack actor already rate same content..
$sql = 'SELECT content_id FROM '.$this->CFG['db']['tbl']['article_activity'].
' WHERE action_key= \'article_rated\' AND actor_id=\''.$activity_arr['rating_user_id'].'\' '.
' AND owner_id=\''.$activity_arr['user_id'].'\' AND content_id=\''.$activity_arr['rating_id'].'\' ';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
$row['content_id'] = $rs->FetchRow();
if(empty($row['content_id']))
{
$activity_val_arr = array($activity_arr['user_id'],
$activity_arr['rating_user_id']);
$article_activity_val_arr = array($activity_arr['rating_id'],
$activity_arr['action_key'],
$action_value,
$activity_arr['rating_user_id'],
$activity_arr['user_id']);
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].
' SET module = \'article\','.
' owner_id = '.$this->dbObj->Param('user_id').','.
' actor_id = '.$this->dbObj->Param('rating_user_id').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$parent_id = $this->dbObj->Insert_ID();
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['article_activity'].
' SET parent_id = '.$parent_id.','.
' content_id = '.$this->dbObj->Param('content_id').','.
' action_key = '.$this->dbObj->Param('action_key').','.
' action_value = '.$this->dbObj->Param('action_value').','.
' actor_id = '.$this->dbObj->Param('actor_id').','.
' owner_id = '.$this->dbObj->Param('action_value').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $article_activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$child_id = $this->dbObj->Insert_ID();
$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].
' SET child_id = '.$child_id.
' WHERE parent_id = '.$parent_id;
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
}
else
{
$sql = 'UPDATE '.$this->CFG['db']['tbl']['article_activity'].
' SET date_added = NOW(), '.
' action_value = \''.$action_value.'\' '.
' WHERE action_key= \'article_rated\' AND actor_id=\''.$activity_arr['rating_user_id'].'\' '.
' AND owner_id=\''.$activity_arr['user_id'].'\' AND content_id=\''.$activity_arr['rating_id'].'\' ';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
}
break;
case 'article_favorite':
$activity_arr['article_title'] = $this->strReplace($activity_arr['article_title']);
$action_value = $activity_arr['article_id'].'~'.
$activity_arr['favorite_user_id'].'~'.
$activity_arr['user_name'].'~'.
$activity_arr['article_title'].'~'.
$activity_arr['article_server_url'];
$activity_val_arr = array($activity_arr['user_id'],
$activity_arr['favorite_user_id']);
$article_activity_val_arr = array($activity_arr['article_favorite_id'],
$activity_arr['action_key'],
$action_value,
$activity_arr['favorite_user_id'],
$activity_arr['user_id']);
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].
' SET module = \'article\','.
' owner_id = '.$this->dbObj->Param('user_id').','.
' actor_id = '.$this->dbObj->Param('favorite_user_id').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$parent_id = $this->dbObj->Insert_ID();
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['article_activity'].
' SET parent_id = '.$parent_id.','.
' content_id = '.$this->dbObj->Param('content_id').','.
' action_key = '.$this->dbObj->Param('action_key').','.
' action_value = '.$this->dbObj->Param('action_value').','.
' actor_id = '.$this->dbObj->Param('actor_id').','.
' owner_id = '.$this->dbObj->Param('action_value').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $article_activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$child_id = $this->dbObj->Insert_ID();
$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].
' SET child_id = '.$child_id.
' WHERE parent_id = '.$parent_id;
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
break;
case 'article_featured':
$activity_arr['article_title'] = $this->strReplace($activity_arr['article_title']);
$action_value = $activity_arr['article_id'].'~'.
$activity_arr['featured_user_id'].'~'.
$activity_arr['user_name'].'~'.
$activity_arr['article_title'];
$activity_val_arr = array($activity_arr['user_id'],
$activity_arr['featured_user_id']);
$article_activity_val_arr = array($activity_arr['article_featured_id'],
$activity_arr['action_key'],
$action_value,
$activity_arr['featured_user_id'],
$activity_arr['user_id']);
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].
' SET module = \'article\','.
' owner_id = '.$this->dbObj->Param('user_id').','.
' actor_id = '.$this->dbObj->Param('featured_user_id').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$parent_id = $this->dbObj->Insert_ID();
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['article_activity'].
' SET parent_id = '.$parent_id.','.
' content_id = '.$this->dbObj->Param('content_id').','.
' action_key = '.$this->dbObj->Param('action_key').','.
' action_value = '.$this->dbObj->Param('action_value').','.
' actor_id = '.$this->dbObj->Param('actor_id').','.
' owner_id = '.$this->dbObj->Param('action_value').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $article_activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$child_id = $this->dbObj->Insert_ID();
$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].
' SET child_id = '.$child_id.
' WHERE parent_id = '.$parent_id;
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
break;
case 'article_responded':
$activity_arr['article_title'] = $this->strReplace($activity_arr['article_title']);
$activity_arr['old_article_title'] = $this->strReplace($activity_arr['old_article_title']);
$action_value = $activity_arr['article_id'].'~'.
$activity_arr['responses_user_id'].'~'.
$activity_arr['responses_name'].'~'.
$activity_arr['article_title'].'~'.
$activity_arr['user_id'].'~'.
$activity_arr['user_name'].'~'.
$activity_arr['old_article_id'].'~'.
$activity_arr['old_article_title'].'~';
$activity_val_arr = array($activity_arr['user_id'],
$activity_arr['responses_user_id']);
$article_activity_val_arr = array($activity_arr['article_responses_id'],
$activity_arr['action_key'],
$action_value,
$activity_arr['responses_user_id'],
$activity_arr['user_id']);
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].
' SET module = \'article\','.
' owner_id = '.$this->dbObj->Param('user_id').','.
' actor_id = '.$this->dbObj->Param('responses_user_id').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$parent_id = $this->dbObj->Insert_ID();
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['article_activity'].
' SET parent_id = '.$parent_id.','.
' content_id = '.$this->dbObj->Param('content_id').','.
' action_key = '.$this->dbObj->Param('action_key').','.
' action_value = '.$this->dbObj->Param('action_value').','.
' actor_id = '.$this->dbObj->Param('actor_id').','.
' owner_id = '.$this->dbObj->Param('action_value').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $article_activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$child_id = $this->dbObj->Insert_ID();
$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].
' SET child_id = '.$child_id.
' WHERE parent_id = '.$parent_id;
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
break;
case 'article_share':
$activity_arr['article_title'] = $this->strReplace($activity_arr['article_title']);
$action_value = $activity_arr['article_id'].'~'.
$activity_arr['user_id'].'~'.
$activity_arr['user_name'].'~'.
$activity_arr['article_title'].'~'.
$activity_arr['article_server_url'].'~'.
$activity_arr['sender_user_id'].'~'.
$activity_arr['sender_user_name'].'~'.
$activity_arr['firend_list'];
$activity_val_arr = array($activity_arr['user_id'],
$activity_arr['sender_user_id']);
$article_activity_val_arr = array($activity_arr['article_id'],
$activity_arr['action_key'],
$action_value,
$activity_arr['sender_user_id'],
$activity_arr['user_id']);
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].
' SET module = \'article\','.
' owner_id = '.$this->dbObj->Param('user_id').','.
' actor_id = '.$this->dbObj->Param('featured_user_id').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$parent_id = $this->dbObj->Insert_ID();
$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['article_activity'].
' SET parent_id = '.$parent_id.','.
' content_id = '.$this->dbObj->Param('content_id').','.
' action_key = '.$this->dbObj->Param('action_key').','.
' action_value = '.$this->dbObj->Param('action_value').','.
' actor_id = '.$this->dbObj->Param('actor_id').','.
' owner_id = '.$this->dbObj->Param('action_value').','.
' date_added = NOW()';
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt, $article_activity_val_arr);
if (!$rs)
trigger_db_error($this->dbObj);
$child_id = $this->dbObj->Insert_ID();
$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].
' SET child_id = '.$child_id.
' WHERE parent_id = '.$parent_id;
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
break;
case 'delete_article_favorite';
$sql = 'UPDATE '.$this->CFG['db']['tbl']['article_activity'].
' SET status = \'Deleted\' '.
' WHERE action_key= \'article_favorite\' AND actor_id= '.$activity_arr['favorite_user_id'].' '.
' AND owner_id= '.$activity_arr['user_id'].' AND content_id= '.$activity_arr['article_favorite_id'];
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
$sql = 'SELECT parent_id FROM '.$this->CFG['db']['tbl']['article_activity'].
' WHERE action_key= \'article_favorite\' AND actor_id= '.$activity_arr['favorite_user_id'].' '.
' AND owner_id= '.$activity_arr['user_id'].' AND content_id= '.$activity_arr['article_favorite_id'];
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
$row = $rs->FetchRow();
if($row['parent_id'])
{
$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].
' SET status = \'Deleted\' '.
' WHERE parent_id= '.$row['parent_id'];
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
}
break;
case 'delete_article_featured';
$sql = 'UPDATE '.$this->CFG['db']['tbl']['article_activity'].
' SET status = \'Deleted\' '.
' WHERE action_key= \'article_featured\' AND actor_id= '.$activity_arr['featured_user_id'].' '.
' AND owner_id= '.$activity_arr['user_id'].' AND content_id= '.$activity_arr['article_featured_id'];
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
$sql = 'SELECT parent_id FROM '.$this->CFG['db']['tbl']['article_activity'].
' WHERE action_key= \'article_featured\' AND actor_id= '.$activity_arr['featured_user_id'].' '.
' AND owner_id= '.$activity_arr['user_id'].' AND content_id= '.$activity_arr['article_featured_id'];
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
$row = $rs->FetchRow();
$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].
' SET status = \'Deleted\' '.
' WHERE parent_id= '.$row['parent_id'];
$stmt = $this->dbObj->Prepare($sql);
$rs = $this->dbObj->Execute($stmt);
if (!$rs)
trigger_db_error($this->dbObj);
break;
}
} | [
"public function addActivity($data);",
"public static function AddActivity($activity){\n $activity->Insert();\n }",
"function addActivity($activity)\r\n\t{\r\n\t\t$this->activities[$activity->getId()] = $activity;\r\n\t}",
"public function add_activity($activity) {\n $activity->set_course($this);\n $this->activities[] = $activity;\n }",
"function add_article(){\n $article = $this->articles->create();\n $this->present_article($article);\n }",
"public function addActivity($event)\n {\n if (!App::runningInConsole()) {\n Activity::create([\n 'actor_id' => Auth::check() ? Auth::id() : null,\n 'subject_id' => $this->getKey(),\n 'subject_type' => get_class($this),\n 'action' => $event,\n ]);\n }\n }",
"public static function add_atom_activity_object() {\n /*\n * The object type of the current post in the Activity Streams 1 feed\n *\n * @param Object $comment_post The current post\n */\n $object_type = apply_filters( 'as1_object_type', 'article', get_post() );\n?>\n <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>\n <activity:object>\n <activity:object-type>http://activitystrea.ms/schema/1.0/<?php echo $object_type; ?></activity:object-type>\n <id><?php the_guid(); ?></id>\n <title type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_title(); ?>]]></title>\n <summary type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>\n <link rel=\"alternate\" type=\"text/html\" href=\"<?php the_permalink_rss() ?>\" />\n </activity:object>\n<?php\n }",
"function add_activity($activity_info, $activity_data)\n {\n\t\tif (array_key_exists('content_id', $activity_info)) $content_id = $activity_info['content_id'];\n\t\telse $content_id = 0;\n\n \t\t$insert_data = array(\n\t\t\t'site_id' \t \t\t=> $activity_info['site_id'],\n\t\t\t'user_id' \t \t\t=> $activity_info['user_id'],\n\t\t\t'verb'\t\t\t\t=> $activity_info['verb'],\n\t\t\t'module'\t\t\t=> $activity_info['module'],\n\t\t\t'type'\t\t\t\t=> $activity_info['type'],\n\t\t\t'content_id' \t \t=> $content_id,\n\t\t\t'data' \t \t\t=> json_encode($activity_data),\n\t\t\t'status'\t\t\t=> 'P',\n\t\t\t'created_at' \t\t=> unix_to_mysql(now())\n\t\t);\n\t\t\n\t\t$this->db->insert('activity', $insert_data);\n\t\t$activity_id = $this->db->insert_id();\n\t\t\n\t\tif ($activity_id)\n\t\t{\n\t\t\treturn $activity_id;\n\t\t}\n\t\t\n\t\treturn FALSE;\n }",
"public function testActivitiesAdd()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"private function amr_activity() {\n\t\tif($this->op == '') {\n\t\t\t$this->setup_activity_selection(TRUE);\n\t\t}\n\t\telse if($this->op == 'view') {\n\t\t\t$this->template = 'amr_activity.tpl';\n\t\t\t$this->template_args['activity'] = new EighthActivity((int)trim($this->args['aid']));\n\t\t\t$this->template_args['sponsors'] = EighthSponsor::id_to_sponsor($this->template_args['activity']->sponsors);\n\t\t\t$this->template_args['sponsorcount'] = count($this->template_args['activity']->sponsors);\n\t\t\t$this->template_args['rooms'] = EighthRoom::id_to_room($this->template_args['activity']->rooms);\n\t\t\t$this->title = 'View Activities';\n\t\t}\n\t\telse if($this->op == 'add') {\n\t\t\t$newid = NULL;\n\t\t\tif ($this->args['aid'] != 'auto' && ! EighthActivity::activity_exists($this->args['aid'])) {\n\t\t\t\t$newid = $this->args['aid'];\n\t\t\t}\n\t\t\tself::start_undo_transaction();\n\t\t\t$aid = EighthActivity::add_activity($this->args['name'], [], [], '', FALSE, FALSE, FALSE, FALSE, $newid);\n\t\t\tself::end_undo_transaction();\n\t\t\tredirect(\"eighth/amr_activity/view/aid/{$aid}\");\n\t\t}\n\t\telse if($this->op == 'modify') {\n\t\t\t$activity = new EighthActivity($this->args['aid']);\n\t\t\tself::start_undo_transaction();\n\t\t\t$usedtobename = $activity->name;\n\t\t\t$activity->name = $this->args['name'];\n\t\t\t$activity->sponsors = (isset($this->args['sponsors']) && $this->args['sponsors']);\n\t\t\t$activity->rooms = (isset($this->args['rooms']) && $this->args['rooms']);\n\t\t\t$usedtobedescription = $activity->description;\n\t\t\t$activity->description = $this->args['description'];\n\t\t\t$activity->restricted = (isset($this->args['restricted']) && $this->args['restricted'] == 'on');\n\t\t\t$activity->presign = (isset($this->args['presign']) && $this->args['presign'] == 'on');\n\t\t\t$activity->oneaday = (isset($this->args['oneaday']) && $this->args['oneaday'] == 'on');\n\t\t\t$activity->bothblocks = (isset($this->args['bothblocks']) && $this->args['bothblocks'] == 'on');\n\t\t\t$activity->sticky = (isset($this->args['sticky']) && $this->args['sticky'] == 'on');\n\t\t\t$usedtobespecial = $activity->special;\n\t\t\t$activity->special = (isset($this->args['special']) && $this->args['special'] == 'on');\n\t\t\t// This is marking it as _always_ calendarworthy\n\t\t\t// Normally, you should use the individual block's calendarworthiness setting\n\t\t\t$usedtobecalendar = $activity->calendar;\n\t\t\t$activity->calendar = (isset($this->args['calendar']) && $this->args['calendar'] == 'on');\n\t\t\t// All 8th period activities should have calendar events\n\t\t\t// Handle the permamarking removal or addition\n\t\t\tglobal $I2_SQL;\n\t\t\tif($usedtobecalendar && !$activity->calendar) {\n\t\t\t\t$blocks=$I2_SQL->query(\"SELECT bid,date FROM eighth_blocks WHERE bid IN (SELECT bid FROM eighth_block_map WHERE activityid=%d);\",$this->args['aid'])->fetch_all_arrays(Result::ASSOC);\n\t\t\t\t$blockcal=$I2_SQL->query(\"SELECT bid,calendar FROM eighth_block_map WHERE activityid=%d\",$this->args['aid'])->fetch_array_keyed('bid','calendar');\n\t\t\t\tforeach($blocks as $block)\n\t\t\t\t\tif(!$blockcal[$block])\n\t\t\t\t\t\tCalendar::remove_tag('eighth_'.$block['bid'].'_'.$this->args['aid'],'eighthcalendar');\n\t\t\t} elseif (!$usedtobecalendar && $activity->calendar) {\n\t\t\t\t$blocks=$I2_SQL->query(\"SELECT bid,date FROM eighth_blocks WHERE bid IN (SELECT bid FROM eighth_block_map WHERE activityid=%d);\",$this->args['aid'])->fetch_all_arrays(Result::ASSOC);\n\t\t\t\tforeach($blocks as $block)\n\t\t\t\t\tCalendar::add_tag('eighth_'.$block['bid'].'_'.$this->args['aid'],'eighthcalendar');\n\t\t\t}\n\t\t\t// Special 8th periods have their own tag for the calendar\n\t\t\t// It's really special\n\t\t\t// Just like kittens\n\t\t\t// Except not as cute or fluffy\n\t\t\tif($usedtobespecial && !$activity->special) {\n\t\t\t\t$blocks=$I2_SQL->query(\"SELECT bid,date FROM eighth_blocks WHERE bid IN (SELECT bid FROM eighth_block_map WHERE activityid=%d);\",$this->args['aid'])->fetch_all_arrays(Result::ASSOC);\n\t\t\t\tforeach($blocks as $block)\n\t\t\t\t\tCalendar::remove_tag('eighth_'.$block['bid'].'_'.$this->args['aid'],'eighthspecial');\n\t\t\t} elseif (!$usedtobespecial && $activity->special) {\n\t\t\t\t$blocks=$I2_SQL->query(\"SELECT bid,date FROM eighth_blocks WHERE bid IN (SELECT bid FROM eighth_block_map WHERE activityid=%d);\",$this->args['aid'])->fetch_all_arrays(Result::ASSOC);\n\t\t\t\tforeach($blocks as $block)\n\t\t\t\t\tCalendar::add_tag('eighth_'.$block['bid'].'_'.$this->args['aid'],'eighthspecial');\n\t\t\t}\n\t\t\t/*\n\t\t\tif(!Calendar::has_matches(array('eighthspecial_',$this->args['aid']))) {\n\t\t\t\tglobal $I2_SQL;\n\t\t\t\t$blocks=$I2_SQL->query(\"SELECT bid,date FROM eighth_blocks WHERE bid IN (SELECT bid FROM eighth_block_map WHERE activityid=%d);\",$this->args['aid'])->fetch_all_arrays(Result::ASSOC);\n\t\t\t\t$specials=$I2_SQL->query(\"SELECT bid,calendar FROM eighth_block_map WHERE activityid=%d\");\n\t\t\t\t$tags=array('eighth_'.$this->args['aid']);\n\t\t\t\tif($activity->special)\n\t\t\t\t\t$tags[]='eighthspecial';\n\t\t\t\t$tagsspecial=$tags;\n\t\t\t\t$tagsspecial[]=array('eighth_'.$block['bid'],'eighthcalendar');\n\t\t\t\tforeach($blocks as $block) {\n\t\t\t\t\tCalendar::add_event('eighth_'.$block['bid'].'_'.$this->args['aid'],strtotime($block['date']),$activity->name,$activity->description);\n\t\t\t\t}\n\t\t\t}*/\n\t\t\t/*if(($usedtobecalendar != $activity->calendar) || ($usedtobename!=$activity->name) || ($usedtobedescription!=$activity->description)) {\n\t\t\t\tglobal $I2_SQL;\n\t\t\t\t// This is all the data that can be changed here that the calendar\n\t\t\t\t// module usees, so re-evealuate if any of these change.\n\t\t\t\tif(!$activity->calendar) {\n\t\t\t\t\t$blocks=$I2_SQL->query(\"SELECT bid FROM eighth_block_map WHERE activityid=%d\",$this->args['aid'])->fetch_all_arrays(Result::ASSOC);\n\t\t\t\t\tforeach($blocks as $block) {\n\t\t\t\t\t\tCalendar::remove_event('eighth_'.$block['bid'].'_'.$this->args['aid']);\n\t\t\t\t\t}\n\t\t\t\t} elseif ($activity->calendar && !$usedtobecalendar) {\n\t\t\t\t\t$blocks=$I2_SQL->query(\"SELECT bid,date FROM eighth_blocks WHERE bid IN (SELECT bid FROM eighth_block_map WHERE activityid=%d);\",$this->args['aid'])->fetch_all_arrays(Result::ASSOC);\n\t\t\t\t\tforeach($blocks as $block) {\n\t\t\t\t\t\tCalendar::add_event('eighth_'.$block['bid'].'_'.$this->args['aid'],strtotime($block['date']),$activity->name,$activity->description);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$blocks=$I2_SQL->query(\"SELECT bid,date FROM eighth_blocks WHERE bid IN (SELECT bid FROM eighth_block_map WHERE activityid=%d);\",$this->args['aid'])->fetch_all_arrays(Result::ASSOC);\n\t\t\t\t\tforeach($blocks as $block) {\n\t\t\t\t\t\tCalendar::modify_event('eighth_'.$block['bid'].'_'.$this->args['aid'],strtotime($block['date']),$activity->name,$activity->description);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}*/\n\t\t\tself::end_undo_transaction();\n\t\t\tredirect(\"eighth/amr_activity/view/aid/{$this->args['aid']}\");\n\t\t}\n\t\telse if($this->op == 'remove') {\n\t\t\tif (! empty($this->args['sure'])) {\n\t\t\t\tself::start_undo_transaction();\n\t\t\t\tEighthActivity::remove_activity($this->args['aid']);\n\t\t\t\tself::end_undo_transaction();\n\t\t\t\tredirect('eighth');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->template = 'remove_activity_confirm.tpl';\n\t\t\t\t$this->template_args['activity'] = new EighthActivity($this->args['aid']);\n\t\t\t}\n\t\t}\n\t\telse if($this->op == 'select_sponsor') {\n\t\t\t$this->setup_sponsor_selection();\n\t\t\t$this->template = 'sponsor_selection.tpl';\n\t\t\t$this->template_args['op'] = \"add_sponsor/aid/{$this->args['aid']}\";\n\t\t}\n\t\telse if($this->op == 'add_sponsor') {\n\t\t\t$activity = new EighthActivity($this->args['aid']);\n\t\t\tself::start_undo_transaction();\n\t\t\t$activity->add_sponsor($this->args['sid']);\n\t\t\tself::end_undo_transaction();\n\t\t\tredirect(\"eighth/amr_activity/view/aid/{$this->args['aid']}\");\n\t\t}\n\t\telse if($this->op == 'remove_sponsor') {\n\t\t\t$activity = new EighthActivity($this->args['aid']);\n\t\t\tself::start_undo_transaction();\n\t\t\t$activity->remove_sponsor($this->args['sid']);\n\t\t\tself::end_undo_transaction();\n\t\t\tredirect(\"eighth/amr_activity/view/aid/{$this->args['aid']}\");\n\t\t}\n\t\telse if($this->op == 'select_room') {\n\t\t\t$this->setup_room_selection();\n\t\t\t$this->template_args['op'] = \"add_room/aid/{$this->args['aid']}\";\n\t\t}\n\t\telse if($this->op == 'add_room') {\n\t\t\t$activity = new EighthActivity($this->args['aid']);\n\t\t\tself::start_undo_transaction();\n\t\t\t$activity->add_room($this->args['rid']);\n\t\t\tself::end_undo_transaction();\n\t\t\tredirect(\"eighth/amr_activity/view/aid/{$this->args['aid']}\");\n\t\t}\n\t\telse if($this->op == 'remove_room') {\n\t\t\t$activity = new EighthActivity($this->args['aid']);\n\t\t\tself::start_undo_transaction();\n\t\t\t$activity->remove_room($this->args['rid']);\n\t\t\tself::end_undo_transaction();\n\t\t\tredirect(\"eighth/amr_activity/view/aid/{$this->args['aid']}\");\n\t\t} else {\n\t\t\tredirect('eighth');\n\t\t}\n\t}",
"function pi_activity_add_new_activity_for_activity_content_node($node, $node_function, $visible_status, $activity_title, $activity)\n{\n //pi_debug_message(\"pi_activity_add_activity_when_activity_content_node_created called for \" . $content_node->nid . \"(\" . $content_node->title . \")\");\n //load the defined \"activity\"\n if(!pi_check_is_node_of_type($activity, 'pi_activity'))\n {\n //pi_debug_message(\"pi_activity_add_activity_when_activity_content_node_created called with no activity - getting activity from details: \" . $details->activity_id);\n $activity = node_load(pi_activity_get_activity_nid_for_content_nid($node->nid));\n }\n if(pi_check_is_node_of_type($activity, 'pi_activity'))\n {\n pi_activity_add_activity_node_for_activity_content_node($activity, $node);\n // Then set the status...\n $new_activity_nid = pi_activity_get_activity_nid_for_content_nid($node->nid);\n if(pi_check_is_node_of_type($activity))\n {\n pi_activity_set_status($nid, $actor);\n }\n\n }\n else\n {\n drupal_set_message(t(\"Can't identify activity for created node @nid, of type @type\", array('@nid' => $node->nid, '@type'=>$node->type)), 'error');\n }\n /*\n //copy over current except for the activity_id\n $activity_array = new stdClass();\n $activity_array->title = check_plain($activity_title);\n $activity_array->body = $loaded_activity->description;\n $activity_array->activity_type = $loaded_activity->activity_type;\n $activity_array->node_type = $loaded_activity->node_type;\n $activity_array->parameters = $loaded_activity->parameters;\n $activity_array->destination = $loaded_activity->destination;\n $activity_array->audience = $loaded_activity->audience;\n $activity_array->actor = $loaded_activity->actor;\n $activity_array->weight = $loaded_activity->weight;\n */\n /*\n * @todo The following code changes will cause problems with the authoring interface!\n * This part of the code uses the node id as activity id.\n * Authoring interface generates activity id via max(activity_id) + 1. This generated\n * activity_id will sooner or later conflict with a node id !\n *\n * Either change this code back to the original version, or change authoring interface.\n */\n //$activity_array[\"nid\"] = $node->nid;\n //$new_activity_id = $node->nid;\n\n //create the new activity\n //node_save($activity_array);\n\n //$new_activity_id = $activity_array->nid;\n /*\t$new_activity_id = $node->nid;\n\n //****new details object\n $new_details = new stdClass;\n $new_details->inquiry_id = $details->inquiry_id;\n $new_details->stage_id = $details->stage_id;\n $new_details->phase_id = $details->phase_id;\n $new_details->activity_id = $new_activity_id;\n\n //set status for the new activity\n //$activity_status = load_activity_status($details->activity_id, $user->uid);\n $activity_status = pi_activity_load_status($details->activity_id, $user->uid);\n\n $new_activity_status = new stdClass;\n $new_activity_status->inquiry_id = $details->inquiry_id;\n $new_activity_status->activity_id = $new_activity_id;\n $new_activity_status->uid = $activity_status['uid'];\n $new_activity_status->gid = $activity_status['gid'];\n $new_activity_status->node_function = $activity_status['node_function'];\n $new_activity_status->visible_status = $activity_status['visible_status'];\n\n pi_activity_set_status($new_activity_status['activity_id'], $new_status['gid'], $new_activity_status['visible_status'], $new_activity_status['node_function']);*/\n /*\n //set actor for the new activity\n $activity_actor = load_activity_actor($details->inquiry_id, $details->activity_id, NULL, NULL);\n $new_activity_actor[\"inquiry_id\"] = $details->inquiry_id;\n $new_activity_actor[\"activity_id\"] = $new_activity_id;\n\n ///for audience smaller than actor in add activity\n $actor_gid = $activity_actor[0][\"gid\"];\n $actor_uid = $activity_actor[0][\"uid\"];\n $actor_group_type = pi_get_type_of_group($actor_gid);\n $users_group = get_group_of_type($uid, $loaded_activity->audience, $details->inquiry_id, $details->stage_id, $details->phase_id, $details->activity_id);\n $audience_gid = $users_group;\n $audience_group_type = $activity->audience;\n\n if( ($actor_group_type == 'group' && $audience_group_type == 'individual') ||\n ($actor_group_type == 'class' && $audience_group_type != 'class' && $audience_group_type != 'multiclass') )\n {\n $new_activity_actor[\"uid\"] = $uid;\n $new_activity_actor[\"gid\"] = $audience_gid;\n }\n else\n {\n $new_activity_actor[\"uid\"] = $activity_actor[0][\"uid\"];\n $new_activity_actor[\"gid\"] = $activity_actor[0][\"gid\"];\n }\n\n insert_activity_actor($new_activity_actor);\n */\n //set the stage phase activity\n /*\t$psp_id = get_psp_id_for_stage_and_phase($details->stage_id, $details->phase_id);\n\n if(!$psp_id)\n {\n $psp_id = get_psp_id_for_stage_and_phase(NULL, $details->phase_id);\n }\n\n $query = \"SELECT position FROM {pi_stage_phase_activity} WHERE psp_id = %d ORDER BY position DESC\";\n $current_pos = db_result(db_query($query, $psp_id));\n $new_pos = $current_pos + 1;\n\n insert_stage_phase_activity($psp_id, $new_activity_id, $new_pos);\n */\n //set pi activity node\n /*\tadd_new_pi_activity_node($node, $node_function, $visible_status, $new_details);\n\n //set og if necessary for new node\n if($loaded_activity->audience != \"individual\")\n {\n $users_group = get_group_of_type($uid, $loaded_activity->audience, $new_details->inquiry_id, $new_details->stage_id, $new_details->phase_id, $new_details->activity_id);\n $context['groups'] = array($users_group);\n og_add_group_action($node, $context);\n }*/\n}",
"function stream_activity_add($type, $id, $activity_id) {\n global $cache;\n $stream = 'stream.' . $type . '.' . $id;\n $entries = $cache->get($stream);\n if (sizeof($entries) > 200) {\n array_shift($entries);\n }\n $entries[] = $activity_id;\n $cache->set($stream, $entries);\n}",
"protected function activity_articles(){\n\n\t\t/* Triviality*/\n\t\tif (!isset($this->_person->contentcreatorid)){ return null; }\n\n\t\t/* Data */\n\t\t$alt = false;\n\n\t\t$itemsModel = $this->getModel('items');\n\t\t$articles = $itemsModel->getAuthor($this->_person, 'article', 0, 3);\n\n\t\t$userModel = $this->getModel('user');\n\t\t$person =& $this->_person;\n\t\t$isSelf = $userModel->isSelf($person);\n\n\t\t/* Template */\n\t\tinclude(BLUPATH_TEMPLATES . '/profile/blocks/activity/articles.php');\n\n\t}",
"function _pi_activity_set_activity_content_audience(&$node, $activity_id)\r\n{\r\n\t// Add group audience data for the activity content by getting the user's associated group\r\n\t// of the given audience type\r\n\t$activity = node_load($activity_id);\r\n\tif(pi_check_is_node_of_type($activity, 'pi_activity'))\r\n\t{\r\n\t\t$audience_gids = pi_groups_get_users_audience_groups($node->uid, $activity->actor, $activity->audience);\r\n\t\t$context['groups'] = $audience_gids;\r\n\t\t//pi_debug_message(\"Adding audience group: \" . $context['groups']);\r\n\t\tog_add_group_action($node, $context);\r\n\t}\r\n\telse\r\n\t\tdrupal_set_message(t('Activity @nid is a not an activity.', array('@nid' => $activity_id), 'error'));\r\n}",
"public function addActivity($activity_arr)\n\t\t\t{\n\t\t\t /*1.\tvideo_uploaded\n\t\t\t\t2.\tvideo_comment\n\t\t\t\t3.\tvideo_rated\n\t\t\t\t4.\tvideo_favorite\n\t\t\t\t5.\tvideo_featured\n\t\t\t\t6.\tvideo_responded\n\t\t\t\t7.\tvideo_share\n\t\t\t\t8.\tdelete_video_favorite\n\t\t\t\t9.\tdelete_video_featured*/\n\t\t\t\tswitch($activity_arr['action_key'])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'video_uploaded':\n\t\t\t\t\t\t\t$activity_arr['video_title'] = $this->strReplace($activity_arr['video_title']);\n\t\t\t\t\t\t\t$action_value = $activity_arr['upload_user_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['upload_user_name'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_title'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_server_url'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['is_external_embed_video'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['embed_video_image_ext'].'~';\n\n\t\t\t\t\t\t\t\t$activity_val_arr = array($activity_arr['upload_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['upload_user_id']);\n\n\t\t\t\t\t\t\t\t$video_activity_val_arr = array($activity_arr['video_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['action_key'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$action_value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['upload_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['upload_user_id']);\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET module = \\'video\\','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('user_id').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('comment_user_id').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$parent_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t' SET parent_id = '.$parent_id.','.\n\t\t\t\t\t\t\t\t\t\t' content_id = '.$this->dbObj->Param('content_id').','.\n\t\t\t\t\t\t\t\t\t\t' action_key = '.$this->dbObj->Param('action_key').','.\n\t\t\t\t\t\t\t\t\t\t' action_value = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('actor_id').','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $video_activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$child_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET child_id = '.$child_id.\n\t\t\t\t\t\t\t\t\t\t' WHERE parent_id = '.$parent_id;\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'video_comment':\n\t\t\t\t\t\t\t$activity_arr['video_title'] = $this->strReplace($activity_arr['video_title']);\n\t\t\t\t\t\t\t$action_value = $activity_arr['video_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['comment_user_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_name'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_title'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_server_url'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['is_external_embed_video'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['embed_video_image_ext'].'~';\n\n\t\t\t\t\t\t\t\t$activity_val_arr = array($activity_arr['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['comment_user_id']);\n\n\t\t\t\t\t\t\t\t$video_activity_val_arr = array($activity_arr['video_comment_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['action_key'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$action_value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['comment_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_id']);\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET module = \\'video\\','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('user_id').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('comment_user_id').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$parent_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t' SET parent_id = '.$parent_id.','.\n\t\t\t\t\t\t\t\t\t\t' content_id = '.$this->dbObj->Param('content_id').','.\n\t\t\t\t\t\t\t\t\t\t' action_key = '.$this->dbObj->Param('action_key').','.\n\t\t\t\t\t\t\t\t\t\t' action_value = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('actor_id').','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $video_activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$child_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET child_id = '.$child_id.\n\t\t\t\t\t\t\t\t\t\t' WHERE parent_id = '.$parent_id;\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'video_rated':\n\t\t\t\t\t\t\t$activity_arr['video_title'] = $this->strReplace($activity_arr['video_title']);\n\t\t\t\t\t\t\t$action_value = $activity_arr['video_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['rating_user_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_name'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_title'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_server_url'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['is_external_embed_video'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['embed_video_image_ext'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['rate'].'~';\n\n\t\t\t\t\t\t\t//Cheack actor already rate same content..\n\t\t\t\t\t\t\t$sql = 'SELECT content_id FROM '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t' WHERE action_key= \\'video_rated\\' AND actor_id=\\''.$activity_arr['rating_user_id'].'\\' '.\n\t\t\t\t\t\t\t\t\t' AND owner_id=\\''.$activity_arr['user_id'].'\\' AND content_id=\\''.$activity_arr['rating_id'].'\\' ';\n\n\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t$row['content_id'] = $rs->FetchRow();\n\t\t\t\t\t\t\t//die('I am in rating');\n\n\n\t\t\t\t\t\t\tif(empty($row['content_id']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$activity_val_arr = array($activity_arr['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['rating_user_id']);\n\n\t\t\t\t\t\t\t\t\t$video_activity_val_arr = array($activity_arr['rating_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['action_key'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$action_value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['rating_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_id']);\n\n\t\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t\t' SET module = \\'video\\','.\n\t\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('user_id').','.\n\t\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('rating_user_id').','.\n\t\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $activity_val_arr);\n\t\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t\t$parent_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t\t' SET parent_id = '.$parent_id.','.\n\t\t\t\t\t\t\t\t\t\t\t' content_id = '.$this->dbObj->Param('content_id').','.\n\t\t\t\t\t\t\t\t\t\t\t' action_key = '.$this->dbObj->Param('action_key').','.\n\t\t\t\t\t\t\t\t\t\t\t' action_value = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('actor_id').','.\n\t\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $video_activity_val_arr);\n\t\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t\t$child_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t\t' SET child_id = '.$child_id.\n\t\t\t\t\t\t\t\t\t\t\t' WHERE parent_id = '.$parent_id;\n\n\t\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t\t' SET date_added = NOW(), '.\n\t\t\t\t\t\t\t\t\t\t\t' action_value = \\''.$action_value.'\\' '.\n\t\t\t\t\t\t\t\t\t\t\t' WHERE action_key= \\'video_rated\\' AND actor_id=\\''.$activity_arr['rating_user_id'].'\\' '.\n\t\t\t\t\t\t\t\t\t\t\t' AND owner_id=\\''.$activity_arr['user_id'].'\\' AND content_id=\\''.$activity_arr['rating_id'].'\\' ';\n\n\t\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'video_favorite':\n\t\t\t\t\t\t\t\t$activity_arr['video_title'] = $this->strReplace($activity_arr['video_title']);\n\t\t\t\t\t\t\t\t$action_value = $activity_arr['video_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['favorite_user_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_name'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_title'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_server_url'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['is_external_embed_video'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['embed_video_image_ext'].'~';\n\n\t\t\t\t\t\t\t\t$activity_val_arr = array($activity_arr['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['favorite_user_id']);\n\n\t\t\t\t\t\t\t\t$video_activity_val_arr = array($activity_arr['video_favorite_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['action_key'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$action_value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['favorite_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_id']);\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET module = \\'video\\','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('user_id').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('favorite_user_id').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$parent_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t' SET parent_id = '.$parent_id.','.\n\t\t\t\t\t\t\t\t\t\t' content_id = '.$this->dbObj->Param('content_id').','.\n\t\t\t\t\t\t\t\t\t\t' action_key = '.$this->dbObj->Param('action_key').','.\n\t\t\t\t\t\t\t\t\t\t' action_value = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('actor_id').','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $video_activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$child_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET child_id = '.$child_id.\n\t\t\t\t\t\t\t\t\t\t' WHERE parent_id = '.$parent_id;\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'video_featured':\n\t\t\t\t\t\t\t$activity_arr['video_title'] = $this->strReplace($activity_arr['video_title']);\n\t\t\t\t\t\t\t$action_value = $activity_arr['video_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['featured_user_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_name'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_title'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_server_url'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['is_external_embed_video'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['embed_video_image_ext'].'~';\n\n\t\t\t\t\t\t\t\t$activity_val_arr = array($activity_arr['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['featured_user_id']);\n\n\t\t\t\t\t\t\t\t$video_activity_val_arr = array($activity_arr['video_featured_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['action_key'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$action_value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['featured_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_id']);\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET module = \\'video\\','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('user_id').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('featured_user_id').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$parent_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t' SET parent_id = '.$parent_id.','.\n\t\t\t\t\t\t\t\t\t\t' content_id = '.$this->dbObj->Param('content_id').','.\n\t\t\t\t\t\t\t\t\t\t' action_key = '.$this->dbObj->Param('action_key').','.\n\t\t\t\t\t\t\t\t\t\t' action_value = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('actor_id').','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $video_activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$child_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET child_id = '.$child_id.\n\t\t\t\t\t\t\t\t\t\t' WHERE parent_id = '.$parent_id;\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'video_responded':\n\t\t\t\t\t\t\t\t$activity_arr['video_title'] = $this->strReplace($activity_arr['video_title']);\n\t\t\t\t\t\t\t\t$activity_arr['old_video_title'] = $this->strReplace($activity_arr['old_video_title']);\n\t\t\t\t\t\t\t\t$action_value = $activity_arr['video_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['responses_user_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['responses_name'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_title'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_server_url'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['is_external_embed_video'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['embed_video_image_ext'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_name'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['old_video_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['old_video_title'].'~';\n\n\t\t\t\t\t\t\t\t$activity_val_arr = array($activity_arr['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['responses_user_id']);\n\n\t\t\t\t\t\t\t\t$video_activity_val_arr = array($activity_arr['video_responses_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['action_key'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$action_value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['responses_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_id']);\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET module = \\'video\\','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('user_id').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('responses_user_id').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$parent_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t' SET parent_id = '.$parent_id.','.\n\t\t\t\t\t\t\t\t\t\t' content_id = '.$this->dbObj->Param('content_id').','.\n\t\t\t\t\t\t\t\t\t\t' action_key = '.$this->dbObj->Param('action_key').','.\n\t\t\t\t\t\t\t\t\t\t' action_value = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('actor_id').','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $video_activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$child_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET child_id = '.$child_id.\n\t\t\t\t\t\t\t\t\t\t' WHERE parent_id = '.$parent_id;\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'video_share':\n\t\t\t\t\t\t\t\t$activity_arr['video_title'] = $this->strReplace($activity_arr['video_title']);\n\t\t\t\t\t\t\t\t$action_value = $activity_arr['video_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_name'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_title'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['video_server_url'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['is_external_embed_video'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['embed_video_image_ext'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['sender_user_id'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['sender_user_name'].'~'.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['firend_list'].'~';\n\n\n\t\t\t\t\t\t\t\t$activity_val_arr = array($activity_arr['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['sender_user_id']);\n\n\t\t\t\t\t\t\t\t$video_activity_val_arr = array($activity_arr['video_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['action_key'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$action_value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['sender_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['user_id']);\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET module = \\'video\\','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('user_id').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('featured_user_id').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$parent_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'INSERT INTO '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t' SET parent_id = '.$parent_id.','.\n\t\t\t\t\t\t\t\t\t\t' content_id = '.$this->dbObj->Param('content_id').','.\n\t\t\t\t\t\t\t\t\t\t' action_key = '.$this->dbObj->Param('action_key').','.\n\t\t\t\t\t\t\t\t\t\t' action_value = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' actor_id = '.$this->dbObj->Param('actor_id').','.\n\t\t\t\t\t\t\t\t\t\t' owner_id = '.$this->dbObj->Param('action_value').','.\n\t\t\t\t\t\t\t\t\t\t' date_added = NOW()';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $video_activity_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t$child_id = $this->dbObj->Insert_ID();\n\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t' SET child_id = '.$child_id.\n\t\t\t\t\t\t\t\t\t\t' WHERE parent_id = '.$parent_id;\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'delete_video_favorite';\n\t\t\t\t\t\t\t\t$sql = 'SELECT parent_id FROM '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t' WHERE action_key= \\'video_favorite\\' AND actor_id= '.$activity_arr['favorite_user_id'].' '.\n\t\t\t\t\t\t\t\t\t\t' AND owner_id= '.$activity_arr['user_id'].' AND content_id= '.$activity_arr['video_favorite_id'];\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.\n\t\t\t\t\t\t\t\t\t\t$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\tif($row = $rs->FetchRow())\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t\t\t' SET status = \\'Deleted\\' '.\n\t\t\t\t\t\t\t\t\t\t\t\t' WHERE parent_id= '.$row['parent_id'];\n\n\t\t\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.\n\t\t\t\t\t\t\t\t\t\t\t\t$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t\t\t' SET status = \\'Deleted\\' '.\n\t\t\t\t\t\t\t\t\t\t\t\t' WHERE action_key= \\'video_favorite\\' AND actor_id= '.\n\t\t\t\t\t\t\t\t\t\t\t\t$activity_arr['favorite_user_id'].' '.\n\t\t\t\t\t\t\t\t\t\t\t\t' AND owner_id= '.$activity_arr['user_id'].\n\t\t\t\t\t\t\t\t\t\t\t\t' AND content_id= '.$activity_arr['video_favorite_id'];\n\n\t\t\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.\n\t\t\t\t\t\t\t\t\t\t\t\t$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'delete_video_featured';\n\t\t\t\t\t\t\t\t$sql = 'SELECT parent_id FROM '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t' WHERE action_key= \\'video_featured\\' AND actor_id= '.$activity_arr['featured_user_id'].\n\t\t\t\t\t\t\t\t\t\t' AND owner_id= '.$activity_arr['user_id'].\n\t\t\t\t\t\t\t\t\t\t' AND content_id= '.$activity_arr['video_featured_id'];\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.\n\t\t\t\t\t\t\t\t\t\t$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\tif($row = $rs->FetchRow())\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['activity'].\n\t\t\t\t\t\t\t\t\t\t\t\t' SET status = \\'Deleted\\' '.\n\t\t\t\t\t\t\t\t\t\t\t\t' WHERE parent_id= '.$row['parent_id'];\n\n\t\t\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.\n\t\t\t\t\t\t\t\t\t\t\t\t$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['video_activity'].\n\t\t\t\t\t\t\t\t\t\t\t\t' SET status = \\'Deleted\\' '.\n\t\t\t\t\t\t\t\t\t\t\t\t' WHERE action_key= \\'video_featured\\''.\n\t\t\t\t\t\t\t\t\t\t\t\t' AND actor_id= '.$activity_arr['featured_user_id'].' '.\n\t\t\t\t\t\t\t\t\t\t\t\t' AND owner_id= '.$activity_arr['user_id'].\n\t\t\t\t\t\t\t\t\t\t\t\t' AND content_id= '.$activity_arr['video_featured_id'];\n\n\t\t\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\t\t\ttrigger_error($this->dbObj->ErrorNo().' '.$this->dbObj->ErrorMsg(), E_USER_ERROR);\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}",
"public function addActivity()\n {\n\n $auth = Auth::user();\n\n $routeName = Route::getCurrentRoute()->getName();\n\n if (!$routeName) {\n return;\n }\n\n $mapping = new RouteActions();\n\n $activity = $mapping->get($routeName);\n\n if (!$activity) {\n return;\n }\n\n $users_activity = array(\n 'user_id' => $auth->id,\n 'ip_address' => $_SERVER['REMOTE_ADDR'],\n 'activity' => $activity,\n );\n $user_activity = new UsersActivity($users_activity);\n $user_activity->save();\n }",
"protected function createActivity()\n {\n if (empty($_POST['id'])) {\n throw new Exception('Lacking activity data');\n }\n\n $data = $_POST;\n $data['wp_link'] = $data['id'];\n $data['foromtale'] = empty($_POST['foromtale']) ? '' : strip_tags($_POST['foromtale']);\n unset($data['id']);\n\n $connector = $this->getInfosysConnector();\n $connector->saveActivity($data, $connector->findActivity('wp_link', $data['wp_link']));\n }",
"public static function add_comment_atom_activity_object() {\n?>\n <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>\n <activity:object>\n <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>\n <id><?php comment_guid(); ?></id>\n <content type=\"html\" xml:base=\"<?php comment_link(); ?>\"><![CDATA[<?php comment_text(); ?>]]></content>\n <link rel=\"alternate\" href=\"<?php comment_link(); ?>\" type=\"<?php bloginfo_rss('html_type'); ?>\" />\n <thr:in-reply-to ref=\"<?php the_guid() ?>\" href=\"<?php the_permalink_rss() ?>\" type=\"<?php bloginfo_rss('html_type'); ?>\" />\n </activity:object>\n <activity:target>\n <activity:object-type>http://activitystrea.ms/schema/1.0/article</activity:object-type>\n <id><?php the_guid(); ?></id>\n <title type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_title(); ?>]]></title>\n <summary type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>\n <link rel=\"alternate\" type=\"text/html\" href=\"<?php the_permalink_rss() ?>\" />\n </activity:target>\n<?php\n }",
"abstract protected function add(News $news);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets sites listed in custom mapper as recognized sites Not Used Yet | public function get_mapped_sites() {
$options = get_option( cider_options );
$settings = $options['cider_admin_repeat_group'];
$websites = array_column( $settings, 'website' );
return $websites;
} | [
"function drush_acsf_tools_analyze_get_sites_custom() {\n $sites = drush_acsf_tools_analyze_get_sites();\n $acsf_domain_suffix = 'acsitefactory.com';\n\n foreach ($sites as $uri => $site) {\n if (substr($uri, -strlen($acsf_domain_suffix)) === $acsf_domain_suffix) {\n unset($sites[$uri]);\n }\n }\n\n return $sites;\n}",
"public function getSites() {\n $result = $this->query('GET', 'site', array(), array('list'));\n return isset($result['list']) ? $result['list'] : $result;\n }",
"public function getSitesWhereUsed(){\n $sql = str_replace('%', $this->getid(), \"SELECT DISTINCT Sites.* FROM Sites, Items, ItemClasses, Pages WHERE (Items.item_itemclass_id=ItemClasses.itemclass_id AND Items.item_site_id=Sites.site_id AND ItemClasses.itemclass_id='%')\");\n // echo $sql;\n $result = $this->database->queryToArray($sql);\n \n $sites = array();\n \n foreach($result as $r){\n $s = new SmartestSite;\n $s->hydrate($r);\n $sites[] = $s;\n }\n \n return $sites;\n }",
"private static function get_known_urls_map() : array {\n $registeredsites = user_site::get_records([]);\n $map = [];\n foreach ($registeredsites as $record) {\n $map[$record->get('url')] = $record->get('ltsuserid');\n }\n return $map;\n }",
"protected function getSmnSites()\n\t{\n\t\t$sites = [];\n\t\t$filter = [];\n\n\t\tif (ModuleManager::isModuleInstalled('bitrix24'))\n\t\t{\n\t\t\treturn $sites;\n\t\t}\n\n\t\t// prepare filter\n\t\t$disabledSiteIds = [SITE_ID];\n\t\tif (Loader::includeModule('extranet'))\n\t\t{\n\t\t\t$disabledSiteIds[] = \\CExtranet::getExtranetSiteID();\n\t\t}\n\t\t$search = LandingFilterComponent::getFilterRaw(\n\t\t\tLandingFilterComponent::TYPE_SITE,\n\t\t\t$this->arParams['TYPE']\n\t\t);\n\t\tif ($search['DELETED'] == 'Y')\n\t\t{\n\t\t\treturn $sites;\n\t\t}\n\t\tif (isset($search['FIND']) && trim($search['FIND']))\n\t\t{\n\t\t\t$filter['NAME'] = '%' . trim($search['FIND']) . '%';\n\t\t}\n\t\t$defaultServerName = Option::get('main', 'server_name');\n\n\t\t// get data\n\t\t$by = 'lid';\n\t\t$order = 'desc';\n\t\t$request = Context::getCurrent()->getRequest();\n\t\t$protocol = ($request->isHttps() ? 'https://' : 'http://');\n\t\t$res = \\CSite::getList($by, $order, $filter);\n\t\twhile ($row = $res->fetch())\n\t\t{\n\t\t\tif (in_array($row['LID'], $disabledSiteIds))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$row['DOMAIN_NAME'] = $defaultServerName;\n\t\t\t$row['PUBLIC_URL'] = $protocol . $defaultServerName . $row['DIR'];\n\n\t\t\tif ($row['SERVER_NAME'])\n\t\t\t{\n\t\t\t\t$row['DOMAIN_NAME'] = $row['SERVER_NAME'];\n\t\t\t\t$row['PUBLIC_URL'] = $protocol . $row['SERVER_NAME'];\n\t\t\t\t$row['PUBLIC_URL'] .= $row['DIR'];\n\t\t\t}\n\t\t\telseif ($row['DOMAINS'])\n\t\t\t{\n\t\t\t\t$url = explode(\"\\n\", trim($row['DOMAINS']));\n\t\t\t\tif ($url)\n\t\t\t\t{\n\t\t\t\t\t$url = trim(array_shift($url));\n\t\t\t\t}\n\t\t\t\tif ($url)\n\t\t\t\t{\n\t\t\t\t\t$row['DOMAIN_NAME'] = $url;\n\t\t\t\t\t$row['PUBLIC_URL'] = $protocol . $url;\n\t\t\t\t\t$row['PUBLIC_URL'] .= $row['DIR'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sites[$row['LID']] = $row;\n\t\t}\n\n\t\treturn $sites;\n\t}",
"public static function getAvailableSites() {\n\t\t$sites = array();\n\n\t\t$registry = t3lib_div::makeInstance('t3lib_Registry');\n\t\t$servers = $registry->get('tx_solr', 'servers', array());\n\n\t\tforeach ($servers as $server) {\n\t\t\tif (!isset($sites[$server['rootPageUid']])) {\n\t\t\t\t$sites[$server['rootPageUid']] = t3lib_div::makeInstance(__CLASS__, $server['rootPageUid']);\n\t\t\t}\n\t\t}\n\n\t\treturn $sites;\n\t}",
"public function getSiteLists()\n {\n if (array_key_exists(\"siteLists\", $this->_propDict)) {\n return $this->_propDict[\"siteLists\"];\n } else {\n return null;\n }\n }",
"function drush_acsf_tools_analyze_get_sites_preferred() {\n $sites = drush_acsf_tools_analyze_get_sites();\n\n foreach ($sites as $uri => $site) {\n if (!isset($site['flags']) || !isset($site['flags']['preferred_domain']) || $site['flags']['preferred_domain'] !== true) {\n unset($sites[$uri]);\n }\n }\n\n return $sites;\n}",
"public function getExternalSites() {\n\t\t\n\t}",
"public function getSitesAvailable() {\n $drupalFinder = new DrupalFinder();\n $drupalFinder->locateRoot('.');\n $base = $drupalFinder->getDrupalRoot() . \"/sites/sites.php\";\n\n if (!file_exists($base)) {\n return ['default' => 'default'];\n }\n\n // Path to sites.php file.\n include($base);\n $sites = array_flip($sites);\n return $sites;\n }",
"public function getAllWebsites() {\r\n \t$storeManager = $this -> objectManager -> get('Magento\\Store\\Model\\StoreManagerInterface');\r\n\t\t$allWebsites = $storeManager -> getWebsites();\r\n\t\tforeach ( $allWebsites as $val ) {\r\n\t\t\t$websites_mapping[] = $val -> getData();\r\n\t\t}\r\n\t\treturn ( $websites_mapping ) ? $websites_mapping : null;\r\n }",
"public function getAllKnownUrlsForAllSites()\n {\n $db = $this->getDb();\n $mainUrls = $db->fetchAll(\"SELECT idsite, main_url as url FROM \" . Common::prefixTable(\"site\"));\n $aliasUrls = $db->fetchAll(\"SELECT idsite, url FROM \" . Common::prefixTable(\"site_url\"));\n\n return array_merge($mainUrls, $aliasUrls);\n }",
"public function getSitemapURLs();",
"protected function get_site_ids() {}",
"function get_site_names()\r\n {\r\n $sites = array();\r\n // Custom ones\r\n $dir = dir(SWS_SITE_DIR);\r\n while (false !== ($file = $dir->read())) {\r\n if (($file == '.') || ($file == '..')) continue;\r\n $file = basename($file, '.php');\r\n $prefix = 'SMS_Site_';\r\n if (substr($file, 0, count($prefix)) == $prefix) {\r\n $file = substr($file, count($prefix));\r\n $sites[] = $file;\r\n }\r\n }\r\n $dir->close();\r\n // SMSSend ones\r\n if ($this->allow_smssend) {\r\n require_once(SWS_CLASS_DIR.'SMSSend_Site.php');\r\n $dir = dir(SWS_SMSSEND_SITE_DIR);\r\n while (false !== ($file = $dir->read())) {\r\n if (($file == '.') || ($file == '..') || !strpos($file, '.')) continue;\r\n $site = basename($file, '.sms');\r\n if (SMSSend_Site::script_exists($site)) {\r\n $sites[] = $site;\r\n }\r\n }\r\n $dir->close();\r\n }\r\n sort($sites);\r\n return array_unique($sites);\r\n }",
"public function getCustomSitesFolderNames() {\n $sites = array();\n $dir = new DirectoryIterator(APPPATH.'site');\n foreach ($dir as $fileinfo) {\n if ($fileinfo->isDir() && !$fileinfo->isDot() && !in_array($fileinfo->getFilename(), $this->systemFolders)) {\n $sites[] = $fileinfo->getFilename();\n }\n }\n return $sites;\n }",
"public function getSites(): array\n {\n return $this->sites;\n }",
"function wp_get_sitemap_providers() {}",
"function _drush_sitealias_site_list() {\n $site_list = array();\n $base_path = drush_get_context('DRUSH_DRUPAL_ROOT');\n if ($base_path) {\n $base_path .= '/sites';\n $files = drush_scan_directory($base_path, '/settings\\.php/', array('.', '..', 'CVS', 'all'));\n foreach ($files as $filename => $info) {\n if ($info->basename == 'settings.php') {\n $alias_record = drush_sitealias_build_record_from_settings_file($filename);\n if (!empty($alias_record)) {\n $site_list[drush_sitealias_uri_to_site_dir($alias_record['uri'])] = $alias_record;\n }\n }\n }\n }\n return $site_list;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Edit previous licence action | public function editPreviousLicenceAction()
{
$id = $this->params('grand_child_id');
return $this->addOrEdit(self::TYPE_PREVIOUS_LICENCE, 'edit', $id);
} | [
"public function editOtherLicenceLicencesAction()\n {\n return $this->formAction('Edit', 'edit-tm-licence');\n }",
"public function editlicenceAction()\n {\n\n\t\t$sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n\t\t//$this->_helper->layout->disableLayout();\n \t\t$this->_helper->layout()->setLayout('layoutpublic');\n\t\t\n\tif (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n\tif (isset($_POST['ok']) && $_POST['ok']==\"ok\") {\n\tif (isset($_POST['num_licence']) && $_POST['num_licence']!=\"\" && isset($_POST['libelle_licence']) && $_POST['libelle_licence']!=\"\") {\n\t\t\n\t\tinclude(\"Transfert.php\");\n\t\tif(isset($_FILES['desc_licence']['name']) && $_FILES['desc_licence']['name']!=\"\"){\n\t\t$chemin\t= \"licences\";\n\t\t$file = $_FILES['desc_licence']['name'];\n\t\t$file1='desc_licence';\n\t\t$licence = $chemin.\"/\".transfert($chemin,$file1);\n\t\t} else {$licence = $_POST['desc_licence_old'];}\n\t\t\t\n $date_id = new Zend_Date(Zend_Date::ISO_8601);\n $a = new Application_Model_EuLicence();\n $ma = new Application_Model_EuLicenceMapper();\n\t\t$ma->find($_POST['id_licence'], $a);\n\t\t\t\n $a->setNum_licence($_POST['num_licence']);\n $a->setLibelle_licence($_POST['libelle_licence']);\n $a->setDesc_licence($licence);\n $ma->update($a);\n\t\t\t\n\t\t$this->_redirect('/administration/listlicence');\n\t\t} else { $this->view->error = \"Champs * obligatoire ...\"; \n\t\t \n $id = (int)$this->_request->getParam('id');\n if ($id != 0) {\n $a = new Application_Model_EuLicence();\n $ma = new Application_Model_EuLicenceMapper();\n\t\t$ma->find($id, $a);\n\t\t$this->view->licence = $a;\n }\n\t}\n\t\t \n\t} else {\n\n $id = (int)$this->_request->getParam('id');\n if ($id != 0) {\n $a = new Application_Model_EuLicence();\n $ma = new Application_Model_EuLicenceMapper();\n\t\t$ma->find($id, $a);\n\t\t$this->view->licence = $a;\n }\n\t}\n\t}",
"public function editAction() {\n\t\t// Can the user edit this book?\n\t\tif (! Utility\\Permission::canEdit()) {\n\t\t\t// Nope, but they still might be able to view it\n\t\t\t$this->forward('view');\n\t\t}\n\n\t\t// Set to readonly\n\t\t$this->view->addVariable('readonly', false);\n\t\t$this->forward('book');\n\t}",
"public function onPaymentsEdit()\n\t{\n\t\tif ($this->perms->edit)\n\t\t{\n\t\t\t//JToolBarHelper::save();\n\t\t}\n\n\t\tJToolBarHelper::cancel();\n\t\t$this->setToolbarTitle('Edit');\n\t}",
"public function license_actions() {\n\n \tif ( !isset( $_POST['wpsl_licenses'] ) ) {\n return;\n }\n\n\t\tif ( !isset( $_POST['wpsl_licenses'][ $this->item_shortname ] ) || empty( $_POST['wpsl_licenses'][ $this->item_shortname ] ) ) {\n\t\t\treturn;\n }\n \n if ( !check_admin_referer( $this->item_shortname . '_license-nonce', $this->item_shortname . '_license-nonce' ) ) {\n return;\n }\n\n if ( !current_user_can( 'manage_wpsl_settings' ) ) {\n return;\n }\n \n if ( isset( $_POST[ $this->item_shortname . '_license_key_deactivate' ] ) ) {\n $this->deactivate_license();\n } else {\n $this->activate_license();\n }\n }",
"function edit() {\n\n //quay tro lai trang danh sach\n }",
"public function supplicenceAction()\n {\n\n\t\t$sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n\t\t//$this->_helper->layout->disableLayout();\n \t\t$this->_helper->layout()->setLayout('layoutpublic');\n\t\t\n\tif (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n $id = (int) $this->_request->getParam('id');\n if (isset($id) && $id != 0) {\n\n $licence = new Application_Model_EuLicence();\n $licenceM = new Application_Model_EuLicenceMapper();\n $licenceM->find($id, $licence);\n\t\t\n $licenceM->delete($licence->id_licence);\n\t\t//unlink($licence->desc_licence);\t\n\n }\n\n\t\t$this->_redirect('/administration/listlicence');\n }",
"public function editIrRemout(){\n }",
"protected function edit() {\n\t}",
"public function editAction();",
"function edit_download_licence($id,$title,$text)\n{\n\t$GLOBALS['SITE_DB']->query_update('download_licences',array('l_title'=>$title,'l_text'=>$text),array('id'=>$id),'',1);\n\tlog_it('EDIT_DOWNLOAD_LICENCE',strval($id),$title);\n}",
"public function editAction()\n\t{\n\t\t$revisionId = $this->getRequest()->getParam('revision_id');\n\t\t$revision = $this->_initRevision($revisionId);\n\t\tif ($revisionId && !$revision->getId()) {\n\t\t\trm_session()->addError(\n\t\t\t\tdf_h()->cms()->__('Could not load specified revision.'));\n\t\t\t$this->_redirect('*/cms_page/edit',array('page_id' => $this->getRequest()->getParam('page_id')));\n\t\t\treturn;\n\t\t}\n\n\t\t$data = df_mage()->adminhtml()->session()->getFormData(true);\n\t\tif (!empty($data)) {\n\t\t\t$_data = $revision->getData();\n\t\t\t$_data = array_merge($_data, $data);\n\t\t\t$revision->setData($_data);\n\t\t}\n\t\t$this->_initAction()\n\t\t\t->_addBreadcrumb(df_h()->cms()->__('Edit Revision'),df_h()->cms()->__('Edit Revision'));\n\t\t$this->renderLayout();\n\t}",
"function acf_pro_update_license( $key = '' ) {\n}",
"public function editAction()\n {\n $scoresId = $this->getRequest()->getParam('id');\n $scores = $this->_initScores();\n if ($scoresId && !$scores->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_docwise')->__('This score (old) no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getScoresData(true);\n if (!empty($data)) {\n $scores->setData($data);\n }\n Mage::register('scores_data', $scores);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_docwise')->__('Docwise'))\n ->_title(Mage::helper('bs_docwise')->__('Score (OLD)'));\n if ($scores->getId()) {\n $this->_title($scores->getTraineeName());\n } else {\n $this->_title(Mage::helper('bs_docwise')->__('Add score (old)'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"public function editAction()\n {\n $coursedocId = $this->getRequest()->getParam('id');\n $coursedoc = $this->_initCoursedoc();\n if ($coursedocId && !$coursedoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_coursedoc')->__('This course doc no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getCoursedocData(true);\n if (!empty($data)) {\n $coursedoc->setData($data);\n }\n Mage::register('coursedoc_data', $coursedoc);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_coursedoc')->__('Course Document'))\n ->_title(Mage::helper('bs_coursedoc')->__('Course Documents'));\n if ($coursedoc->getId()) {\n $this->_title($coursedoc->getCourseDocName());\n } else {\n $this->_title(Mage::helper('bs_coursedoc')->__('Add course doc'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"function tux_su_licenses_admin_page() {\n\n\tif ( ! current_user_can( 'administrator' ) ) {\n\n\t\treturn;\n\n\t}\n\n\tif ( isset( $_GET['action'], $_GET['edit_id'] ) && 'edit' === $_GET['action'] ) {\n\n\t\t$license = tux_su_get_db( array(\n\t\t\t'id' => absint( $_GET['edit_id'] ),\n\t\t) );\n\n\t\t$license = reset( $license );\n\n\t\tif ( isset( $license['info'] ) ) {\n\n\t\t\t$license['info'] = maybe_unserialize( $license['info'] );\n\n\t\t}\n\n\t\t$license['info']['product_name'] = '';\n\n\t\tif ( isset( $license['product_id'] ) ) {\n\n\t\t\t$license_rule = tux_su_get_db( array(\n\t\t\t\t'product_id' => $license['product_id'],\n\t\t\t\t'type' => 'rule',\n\t\t\t) );\n\n\t\t\t$license_rule = reset( $license_rule );\n\n\t\t\tif ( isset( $license_rule['info'] ) ) {\n\n\t\t\t\t$license_rule['info'] = maybe_unserialize( $license_rule['info'] );\n\n\t\t\t\tif ( isset( $license_rule['info']['product_name'] ) ) {\n\n\t\t\t\t\t$license['info']['product_name'] = $license_rule['info']['product_name'];\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset( $license_rule );\n\n\t\t}\n\t} // End if().\n\n\t$list_table = new Tux_SU_Licenses_List();\n\t?>\n\t<div class=\"wrap\">\n\t\t<?php if ( isset( $license['id'] ) ) : ?>\n\t\t\t<h1 class=\"wp-heading-inline\">\n\t\t\t\t<?php esc_html_e( 'Edit License', 'tuxedo-software-updater' ); ?>\n\t\t\t</h1>\n\t\t<?php else : ?>\n\t\t\t<h1 class=\"wp-heading-inline\">\n\t\t\t\t<?php esc_html_e( 'Licenses', 'tuxedo-software-updater' ); ?>\n\t\t\t</h1>\n\t\t\t<a href=\"javascript:void(0);\" class=\"page-title-action\" onclick=\"jQuery('#licenses-add-new-container').slideToggle();\">\n\t\t\t\t<?php esc_html_e( 'Add New', 'tuxedo-software-updater' ); ?>\n\t\t\t</a>\n\t\t<?php endif; ?>\n\t\t<hr class=\"wp-header-end\">\n\n\t\t<?php\n\t\tif ( isset( $_GET['action'] ) && 'edit' === $_GET['action'] ) {\n\n\t\t\tif ( ! isset( $_GET['edit_id'] ) || empty( $license ) || $license === false ) {\n\n\t\t\t\techo '<div class=\"notice notice-error is-dismissible\"><p>' . esc_html__( 'Error editing license.', 'tuxedo-software-updater' ) . '</p></div>';\n\t\t\t\techo '</div>';\n\n\t\t\t\treturn;\n\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $_GET['updated'] ) && 'success' === $_GET['updated'] ) {\n\n\t\t\techo '<div class=\"notice notice-success is-dismissible\"><p>' . esc_html__( 'Successfully updated license.', 'tuxedo-software-updater' ) . '</p></div>';\n\n\t\t}\n\n\t\tif ( isset( $_GET['updated'] ) && 'error' === $_GET['updated'] ) {\n\n\t\t\techo '<div class=\"notice notice-error is-dismissible\"><p>' . esc_html__( 'Error updating license.', 'tuxedo-software-updater' ) . '</p></div>';\n\n\t\t}\n\n\t\tif ( isset( $_GET['deleted'] ) && 'success' === $_GET['deleted'] ) {\n\n\t\t\techo '<div class=\"notice notice-success is-dismissible\"><p>' . esc_html__( 'Successfully deleted license(s).', 'tuxedo-software-updater' ) . '</p></div>';\n\n\t\t}\n\n\t\tif ( isset( $_GET['deleted'] ) && 'error' === $_GET['deleted'] ) {\n\n\t\t\techo '<div class=\"notice notice-error is-dismissible\"><p>' . esc_html__( 'Error deleting license(s).', 'tuxedo-software-updater' ) . '</p></div>';\n\n\t\t}\n\n\t\t$_SERVER['REQUEST_URI'] = remove_query_arg( array(\n\t\t\t'updated',\n\t\t\t'deleted',\n\t\t\t'_wpnonce',\n\t\t\t'_wp_http_referer',\n\t\t), $_SERVER['REQUEST_URI'] );\n\t\t?>\n\t\t<div id=\"poststuff\">\n\t\t\t<div id=\"licenses-add-new-container\" class=\"postbox-container\" <?php if ( ! isset( $license['id'] ) ) : ?>style=\"display:none;\"<?php endif; ?>>\n\t\t\t\t<div id=\"licenses-add-new\" class=\"postbox\">\n\t\t\t\t\t<h2>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<?php if ( isset( $license['id'] ) ) : ?>\n\t\t\t\t\t\t\t\t<?php echo esc_html( $license['id'] . ' - ' . $license['info']['product_name'] ); ?>\n\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Add New License', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</h2>\n\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t<form action=\"<?php echo esc_url( admin_url( 'admin.php?page=tuxedo-su-licenses' ) ); ?>\" method=\"post\">\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"tux_user_id\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'User ID:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_user_id\" name=\"tux_user_id\" style=\"width:300px;\" value=\"<?php echo ( isset( $license['user_id'] ) ) ? esc_attr( $license['user_id'] ) : ''; ?>\">\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"tux_product_id\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Product ID:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_product_id\" name=\"tux_product_id\" style=\"width:300px;\" value=\"<?php echo ( isset( $license['product_id'] ) ) ? esc_attr( $license['product_id'] ) : ''; ?>\">\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"tux_child_id\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Child Product ID:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_child_id\" name=\"tux_child_id\" style=\"width:300px;\" value=\"<?php echo ( isset( $license['info']['child_id'] ) ) ? esc_attr( $license['info']['child_id'] ) : ''; ?>\">\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"tux_order_id\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Order ID:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_order_id\" name=\"tux_order_id\" style=\"width:300px;\" value=\"<?php echo ( isset( $license['info']['order_id'] ) ) ? esc_attr( $license['info']['order_id'] ) : ''; ?>\">\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( isset( $license['created'] ) ) {\n\t\t\t\t\t\t\t\t\t$year = date( 'Y', strtotime( $license['created'] ) );\n\t\t\t\t\t\t\t\t\t$month = date( 'm', strtotime( $license['created'] ) );\n\t\t\t\t\t\t\t\t\t$day = date( 'd', strtotime( $license['created'] ) );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$year = current_time( 'Y' );\n\t\t\t\t\t\t\t\t\t$month = current_time( 'm' );\n\t\t\t\t\t\t\t\t\t$day = current_time( 'd' );\n\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\t<label>\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Created On:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_created_year\" name=\"tux_created_year\" style=\"width:60px;\" value=\"<?php echo esc_attr( $year ); ?>\">\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_created_month\" name=\"tux_created_month\" style=\"width:35px;\" value=\"<?php echo esc_attr( $month ); ?>\">\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_created_day\" name=\"tux_created_day\" style=\"width:35px;\" value=\"<?php echo esc_attr( $day ); ?>\"><br>\n\t\t\t\t\t\t\t\t<span class=\"description\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Year - Month - Day', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<?php if ( isset( $license['id'], $license['info']['activations'] ) && count( $license['info']['activations'] ) > 0 ) : ?>\n\t\t\t\t\t\t\t\t<hr>\n\t\t\t\t\t\t\t\t<h2 style=\"padding-left:0;padding-right:0;\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Activations', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<table class=\"wp-list-table widefat striped\">\n\t\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th style=\"width:50px;\">\n\t\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Delete', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t<th style=\"width:45%;\">\n\t\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'ID', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'IP Address', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<?php foreach ( $license['info']['activations'] as $key => $activation ) : ?>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td style=\"width:50px;\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input name=\"activation_delete[]\" type=\"checkbox\" value=\"<?php echo esc_attr( $key ); ?>\">\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t<td style=\"width:45%;\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $activation['id'] ); ?>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $activation['ip'] ); ?>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<?php wp_nonce_field( 'tux_create_edit_license', 'tux_su_nonce' ); ?>\n\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t<?php if ( isset( $license['id'] ) ) : ?>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" id=\"tux_id\" name=\"tux_id\" value=\"<?php echo esc_attr( $license['id'] ); ?>\">\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button button-primary button-large\" name=\"tux_create_license\" value=\"<?php esc_attr_e( 'Update License', 'tuxedo-software-updater' ); ?>\">\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( admin_url( 'admin.php?page=tuxedo-su-licenses' ) ); ?>\" class=\"button button-large\">\n\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Cancel', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button button-primary button-large\" name=\"tux_create_license\" value=\"<?php esc_attr_e( 'Create License', 'tuxedo-software-updater' ); ?>\">\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t<button class=\"button button-large\" onclick=\"jQuery('#licenses-add-new-container').slideToggle();\">\n\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Cancel', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<?php if ( ! isset( $_GET['action'] ) || 'edit' !== $_GET['action'] ) : ?>\n\t\t\t\t<form method=\"get\">\n\t\t\t\t\t<input type=\"hidden\" name=\"page\" value=\"tuxedo-su-licenses\">\n\t\t\t\t\t<?php\n\t\t\t\t\t$list_table->prepare_items();\n\t\t\t\t\t$list_table->search_box( __( 'Search', 'tuxedo-software-updater' ), 'tux-su' );\n\t\t\t\t\t$list_table->display();\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t<?php endif; ?>\n\t\t</div>\n\t</div>\n\t<?php\n\n}",
"public function editAction()\n {\n $instructorcopyId = $this->getRequest()->getParam('id');\n $instructorcopy = $this->_initInstructorcopy();\n if ($instructorcopyId && !$instructorcopy->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_instructorcopy')->__('This instructor copy no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getInstructorcopyData(true);\n if (!empty($data)) {\n $instructorcopy->setData($data);\n }\n Mage::register('instructorcopy_data', $instructorcopy);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_instructorcopy')->__('Instructor Copy'))\n ->_title(Mage::helper('bs_instructorcopy')->__('Instructor Copies'));\n if ($instructorcopy->getId()) {\n $this->_title($instructorcopy->getCFrom());\n } else {\n $this->_title(Mage::helper('bs_instructorcopy')->__('Add instructor copy'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"public function actionLicense()\n {\n $this->provideTemplate('license');\n }",
"public function addlicenceAction()\n {\n\n\t\t$sessionutilisateur = new Zend_Session_Namespace('utilisateur');\n\t\t//$this->_helper->layout->disableLayout();\n \t\t$this->_helper->layout()->setLayout('layoutpublic');\n\t\t\n\tif (!isset($sessionutilisateur->login)) {$this->_redirect('/administration/login');}\nif($sessionutilisateur->confirmation != \"\"){$this->_redirect('/administration/confirmation');}\n\n\tif (isset($_POST['ok']) && $_POST['ok']==\"ok\") {\n\tif (isset($_POST['num_licence']) && $_POST['num_licence']!=\"\" && isset($_POST['libelle_licence']) && $_POST['libelle_licence']!=\"\" && isset($_FILES['desc_licence']['name']) && $_FILES['desc_licence']['name']!=\"\") {\n\t\t\n\t\tinclude(\"Transfert.php\");\n\t\t$chemin\t= \"licences\";\n\t\t$file = $_FILES['desc_licence']['name'];\n\t\t$file1='desc_licence';\n\t\t$licence = $chemin.\"/\".transfert($chemin,$file1);\n\t\t\t\n $date_id = new Zend_Date(Zend_Date::ISO_8601);\n $a = new Application_Model_EuLicence();\n $ma = new Application_Model_EuLicenceMapper();\n\t\t\t\n $compteur = $ma->findConuter() + 1;\n $a->setId_licence($compteur);\n $a->setNum_licence($_POST['num_licence']);\n $a->setLibelle_licence($_POST['libelle_licence']);\n $a->setDesc_licence($licence);\n $a->setId_utilisateur($_POST['id_utilisateur']);\n //$a->setCode_membre_morale($_POST['code_membre_morale']);\n $a->setDate_licence($date_id->toString('yyyy-MM-dd'));\n $ma->save($a);\n\t\t\t\n\t\t$this->_redirect('/administration/listlicence');\n\t\t} else { $this->view->error = \"Champs * obligatoire ...\"; } \n\t\t}\n\t\t\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Migrate Up Create `entries` table More information on writing migrations is available here: | public function up(){
$table = $this->table('entries', array('id'=>false, 'primary_key'=>'id'));
$table->addColumn('id', 'integer', array('signed'=>false, 'identity'=>true));
$table->addColumn('date', 'date');
$table->addColumn('account_type', 'integer', array('signed'=>false));
$table->addColumn('value', 'decimal', array('precision'=>10, 'scale'=>2));
$table->addColumn('memo', 'text');
$table->addColumn('expense', 'integer', array('limit'=>MysqlAdapter::INT_TINY, 'default'=>1));
$table->addColumn('confirm', 'integer',
array('limit'=>MysqlAdapter::INT_TINY, 'default'=>0, 'comment'=>'confirmed according to statements')
);
$table->addColumn('deleted', 'integer', array('limit'=>MysqlAdapter::INT_TINY, 'default'=>0));
$table->addColumn('stamp', 'timestamp', array('default'=>'CURRENT_TIMESTAMP'));
$table->addIndex(array('date'));
$table->save();
} | [
"public function up(){\n // add a new column\n Schema::table('entries', function (Blueprint $table) {\n $table->timestamp('create_stamp')->nullable();\n $table->timestamp('modified_stamp')->useCurrent();\n });\n\n // move data from old column to new column\n $entries = App\\Entry::all('id');\n foreach($entries as $entry){\n $entry_stamp = DB::table('entries')->select('stamp')->where('id', $entry->id)->get();\n DB::table('entries')->where('id', $entry->id)->update(['create_stamp'=>$entry_stamp[0]->stamp]);\n }\n\n // delete old column\n Schema::table('entries', function (Blueprint $table) {\n $table->dropColumn('stamp');\n });\n }",
"public function up(){\n $table = $this->table('entry_tags', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('entry_id', 'integer', array('signed'=>false));\n $table->addColumn('tag_id', 'integer', array('signed'=>false));\n $table->addColumn('stamp', 'timestamp', array('default'=>'CURRENT_TIMESTAMP', 'update'=>'CURRENT_TIMESTAMP'));\n $table->save();\n }",
"public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }",
"public function up(){\n // Create new_attachments table\n $new_table = $this->table('new_attachments', array('id'=>false, 'primary_key'=>'uuid'));\n $new_table->addColumn('uuid', 'char', array('limit'=>36));\n $new_table->addColumn('entry_id', 'integer', array('signed'=>false));\n $new_table->addColumn('attachment', 'string');\n $new_table->addColumn('stamp', 'timestamp', array('default'=>'CURRENT_TIMESTAMP'));\n $new_table->addIndex('entry_id');\n $new_table->save();\n\n // migrate data from attachments to new_attachments\n $this->execute(\n \"INSERT INTO new_attachments (\n SELECT uid, entry_id, attachment, stamp FROM attachments\n )\"\n );\n\n // drop attachments table\n $this->dropTable('attachments');\n\n // rename new_attachments to attachments\n $new_table->rename('attachments');\n }",
"public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('account_type', 'account_type_id');\n });\n }",
"public function migrate_up()\n\t{\n\t\t$this->applied_versions = new Migrating_Forward($this->db);\n\t\t$this->run(true);\n\t}",
"public function up()\n\t{\n\t\t\\CCCli::info( $this->name.'...', 'migrating' );\n\t\t$this->run_queries( 'up' );\n\t}",
"public function up()\n\t{\n\t\t$this->createTable('partners', array(\n\t\t\t'id' => 'pk',\n\t\t\t'title' => 'VARCHAR (100) NOT NULL'\n\t\t),\n\t\t'DEFAULT CHARSET=\"utf8\" collate utf8_unicode_ci');\n\t}",
"public function up() {\n $this->schema->create('logs', function(Illuminate\\Database\\Schema\\Blueprint $table){\n $table->timestamp('created_at')->index();\n $table->text('text')->nullable();\n });\n }",
"public function safeUp()\n {\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable(\"calculation\", [\n 'id' => Schema::TYPE_PK,\n 'name'=>Schema::TYPE_STRING.\"(125) COLLATE utf8_unicode_ci NULL\",\n 'calculation'=>Schema::TYPE_TEXT.\" COLLATE utf8_unicode_ci DEFAULT NULL\",\n 'created_at' => Schema::TYPE_DATETIME . \" NOT NULL\",\n 'updated_at' => Schema::TYPE_DATETIME,\n 'deleted_at' => Schema::TYPE_DATETIME,\n ], $tableOptions);\n\n $this->createTable(\"code\", [\n 'id' => Schema::TYPE_PK,\n 'code'=>Schema::TYPE_INTEGER.\"(11) DEFAULT NULL\",\n 'created_at' => Schema::TYPE_DATETIME . \" NOT NULL\",\n 'updated_at' => Schema::TYPE_DATETIME,\n 'deleted_at' => Schema::TYPE_DATETIME,\n ], $tableOptions);\n\n\n $this->createTable(\"calculation_code\", [\n 'id' => Schema::TYPE_PK,\n 'calculation_id' => Schema::TYPE_INTEGER,\n 'code_id' => Schema::TYPE_INTEGER,\n 'code'=>Schema::TYPE_INTEGER.\"(11) DEFAULT NULL\",\n 'created_at' => Schema::TYPE_DATETIME . \" NOT NULL\",\n 'updated_at' => Schema::TYPE_DATETIME,\n 'deleted_at' => Schema::TYPE_DATETIME,\n ], $tableOptions);\n $this->addForeignKey('fk_calculation_code_calculation', 'calculation_code', ['calculation_id'], '{{%calculation}}', ['id']);\n $this->addForeignKey('fk_calculation_code_code1', 'calculation_code', ['code_id'], '{{%code}}', ['id']);\n\n }",
"public function up()\n {\n //This table holds a list of user activity.\n Schema::create('Activity', function(Blueprint $table)\n {\n $table->increments('activityID');\n $table->unsignedInteger('userID');\n $table->string('action');\n $table->string('ipAddress', 45);\n $table->timestamp('created_on');\n });\n }",
"public function up()\n\t{\n\t\tSchema::create('posts', function($table) {\n\t\t\t$table->increments('id');\n\t\t\t$table->integer('parent_id')->unsigned();\n\t\t\t$table->integer('author_id')->unsigned();\n\t\t\t$table->string('parent_type', 64);\n\t\t\t$table->text('content');\n\n\t\t\t$table->timestamps();\n\t\t});\n\t}",
"public function safeUp()\n\t{\n\t $json = '{\"settings\":{\"dependencies\":{\"assetSources\":[{\"name\":\"Resources\",\"handle\":\"resources\",\"type\":\"Local\",\"sortOrder\":\"6\",\"typesettings\":{\"path\":\"uploads/resources/\",\"publicURLs\":\"\",\"url\":\"\"}}]},\"elements\":{\"fields\":[{\"group\":\"Book Page\",\"name\":\"MentalligenceExcerpt\",\"handle\":\"mentalligenceExcerpt\",\"instructions\":\"Select the resource file that corresponds with the intro of Mentalligence you want to give visitors a sneak-peek of\",\"translatable\":\"0\",\"required\":false,\"type\":\"Assets\",\"typesettings\":{\"useSingleFolder\":\"1\",\"sources\":[],\"defaultUploadLocationSource\":\"timelinePhotos\",\"defaultUploadLocationSubpath\":\"\",\"singleUploadLocationSource\":\"resources\",\"singleUploadLocationSubpath\":\"\",\"restrictFiles\":\"\",\"limit\":\"1\",\"viewMode\":\"list\",\"selectionLabel\":\"\"}}],\"assetSources\":[{\"name\":\"Resources\",\"handle\":\"resources\",\"type\":\"Local\",\"sortOrder\":\"6\",\"typesettings\":{\"path\":\"uploads/resources/\",\"publicURLs\":\"\",\"url\":\"\"},\"fieldLayout\":[]}]}}}';\n return craft()->migrationManager_migrations->import($json);\n }",
"public function up()\n\t{\n\t\tSchema::create('recipes', function($table) {\n\t\t\t// auto-increment ID / primary key\n $table->increments('id');\n $table->string('title', 255);\n $table->text('description');\n $table->text('ingredients');\n $table->text('instructions');\n $table->string('image_url', 225);\n $table->integer('author_id')->unsigned();\n\t\t\t$table->float('rating')->unsigned()->default(0); \n $table->timestamps();\n });\n\t}",
"public function up()\n {\n //This table holds a list of flags which can be assigned to a user.\n Schema::create('Flag', function(Blueprint $table)\n {\n $table->increments('flagID');\n $table->string('description', 25)->unique()->index();\n });\n }",
"public function up()\n {\n Schema::create('wtg_cargo', function (Blueprint $table) {\n $table->increments('cargo_id');\n $table->char('car_nome',255);\n $table->timestamps(); /**/\n });\n }",
"public function up()\n {\n Schema::create('articles', function (Blueprint $table) {\n $table->increments('id');\n $table->string('title');\n $table->text('body')->nullable();\n $table->string('image');\n $table->timestamp('publish_on');\n $table->tinyInteger('is_publish')->default(0);\n $table->integer('user_id')->unsigned();\n $table->integer('sub_id')->unsigned();\n $table->foreign('user_id')\n ->references('id')->on('users')\n ->onDelete('cascade');\n $table->foreign('sub_id')\n ->references('id')->on('sub_categories')\n ->onDelete('cascade');\n $table->timestamps();\n });\n }",
"public function createMigrationsTable (): void {\n $this->pdo->exec(createTableMigrationSql());\n }",
"public function up(){\n Schema::table('accounts', function (Blueprint $table) {\n $table->timestamp('create_stamp')->nullable();\n $table->timestamp('modified_stamp')->useCurrent();\n $table->timestamp('disabled_stamp')->nullable();\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a failed recipient to the list | public function addFailedRecipient($address)
{
$this->failedRecipients[$address] = null;
$this->add("Recipient '" . $address . "' rejected by connection.", self::ERROR);
} | [
"function addFailedRecipient($address)\r\n {\r\n $this->failedRecipients[$address] = null;\r\n }",
"public function AddFailedRecipient($name, $email)\n\t{\n\t\tif (!$name || !$email)\n\t\t\treturn false;\n\t\t\n\t\tif (!$this->FailedRecipients)\n\t\t\t$this->FailedRecipients = \"\";\n\n\t\t$this->FailedRecipients .= \",{$email}={$name}\";\n\t\t$this->FailedRecipients = trim($this->FailedRecipients, ', ');\n\t\treturn true;\n\t}",
"public function AddFailedRecipient($memID, $name, $number, $statusCode, $reason)\n\t{\n\t\t$memID = $memID ? $memID : 0;\n\t\t$name = $name ? $name : \"\";\n\t\t$number = $number ? $number : \"\";\n\t\t$statusCode = $statusCode ? $statusCode : \"-\";\n\t\t$reason = $reason ? $reason : \"unknown\";\n\n\t\t$this->FailedRecipients[] = array(\"memberID\" => $memID, \"name\" => $name, \"number\" => $number, \"status_code\" => $statusCode, \"reason\" => $reason);\n\t\treturn true;\n\t}",
"function moveAdditionalToRecipientList()\r\n\t{\r\n\t\t$item = $this->item;\r\n\t\t\r\n\t\tif(!$item->hasField(\"additional_recipients\"))\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!count($this->addl_recipients))\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$recipients = explode(\",\", $item->recipients);\r\n\t\tforeach($this->addl_recipients as $ar)\r\n\t\t{\r\n\t\t\t$recipients[] = $ar;\r\n\t\t}\r\n\t\t\r\n\t\t$item->recipients = implode(\",\", $recipients);\r\n\t\t$item->additional_recipients = '';\r\n\t\t$item->filter = new InclusionFilter(\"recipients\", \"additional_recipients\");\r\n\t\t$item->save();\r\n\t}",
"function sendToAdditional()\r\n\t{\r\n\t\tif(!$item->recipients)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\tif($item->hasField(\"additional_recipients\") && $item->additional_recipients)\r\n\t\t{\r\n\t\t\t$addl_recipients = explode(\",\", $item->additional_recipients);\r\n\t\t\t$addl_recipients = array_unique($addl_recipients);\r\n\t\t\t$addl_recipients = array_diff($addl_recipients, $recipients);\r\n\t\t\tif(!count($addl_recipients))\r\n\t\t\t{\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t$recipients = $addl_recipients;\r\n\t\t\t$this->excludes = $recipients;\r\n\t\t\t$this->addl_recipients = $recipients;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->responses = $this->generateResponses($recipients);\r\n\t\t\r\n\t\t$this->setExcludes();\r\n\t\t\r\n\t\tif(!count($this->responses))\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$rtn = $this->sendEmails();\r\n\t\t\r\n\t\t$this->moveAdditionalToRecipientList();\r\n\t\t\r\n\t\treturn $rtn;\r\n\t}",
"public function getFailedRecipients()\n {\n return $this->failed;\n }",
"public function addRecipient(Recipient $recipient);",
"public function testUpdateListMemberValidationFailed(): void\n {\n $listMemberData = static::$listMemberData;\n $listMemberData['list_id'] = $this->listId;\n $member = $this->createListMember($listMemberData);\n\n $this->put(\\sprintf('/mailchimp/lists/%s/members/%s', $this->listId, $member->getId()), ['email_type' => 'invalid']);\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseStatus(400);\n self::assertArrayHasKey('message', $content);\n self::assertArrayHasKey('errors', $content);\n self::assertArrayHasKey('email_type', $content['errors']);\n self::assertEquals('Invalid data given', $content['message']);\n }",
"public function failures()\n\t{\n\t\treturn $this->failedRecipients;\n\t}",
"function add_to_notify_list( $ticket_id, $params ) {\n // check for existing entry (avoid dups)\n $ticket_id = $this->checkNum($ticket_id);\n $list = $this->get_notify_list($ticket_id);\n if( is_array($list) ) {\n foreach($list as $l) {\n if( $params[\"user_id\"] && $params[\"user_id\"] == $l[\"user_id\"] ) {\n $this->addDebug(\"add_to_notify_list\",\n \"Skipping {$params['user_id']}/{$params['email']}, duplicate\",2);\n return \"duplicate\";\n }\n else if( !$params[\"user_id\"] && $l[\"email\"] \n && $l[\"email\"] == $params[\"email\"] ) {\n $this->addDebug(\"add_to_notify_list\",\n \"Skipping {$params['user_id']}/{$params['email']}, duplicate\",2);\n return \"duplicate\";\n }\n }\n }\n // make sure we don't add the egate user\n if( $params[\"user_id\"] ) {\n $usr = $this->get_user($params[\"user_id\"]);\n if( $usr[\"login\"] == \"egate\" || $usr[\"initials\"] == \"egate\" ) {\n $this->addDebug(\"add_to_notify_list\",\"Ignoring egate account\",3);\n return false;\n }\n }\n\n // make sure we have a valid entry\n if( (!isset($params[\"user_id\"])||!trim($params[\"user_id\"]))\n &&\n (!isset($params[\"email\"])||!trim($params[\"email\"])) ) {\n $this->addDebug(\"add_to_nofiy_list\",\"Entry was blank\",2);\n return false;\n }\n \n // appends a new entry to the existing notify list\n $params[\"ticket_id\"] = $ticket_id;\n $id = $this->db_insert($this->table_notify_list,$params);\n if( $id ) {\n $msg = ($params[\"user_id\"])?\n \"user {$params['user_id']} added to ticket $ticket_id\"\n : \"email address {$params['email']} added to ticket $ticket_id\"; \n $this->addDebug(\"add_to_notify_list\",$msg,2);\n return( $id );\n }\n }",
"public function addRecipient( $recipient ) {\n\t\t$to = new EmailRecipient( $recipient );\n\t\tif ( $to->validate() ) {\n\t\t\t$this->to[] = \"{$to}\";\n\t\t}\n\t}",
"function addRecipientToEmailList($gapps, $html, $recipientAddress,\n $emailList)\n{\n if ($html) {echo \"<h2>Subscribe Recipient</h2>\\n\";}\n\n $gapps->addRecipientToEmailList($recipientAddress, $emailList);\n\n if ($html) {echo \"<p>Done.</p>\\n\";}\n}",
"public function testImportImportedListRecipients()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function addRecipient($number) {\n $this->recipients[] = $number;\n }",
"function addRecipients( $recipients ) {\r\n $recipients_list = explode(',', $recipients);\r\n foreach ($recipients_list as $recipient) {\r\n $this->mail->addAddress($recipient);\r\n }\r\n $this->recipients .= $recipients . ',';\r\n }",
"public function testCreateMemberDuplicateEmailFailed(): void\n\t{\n\t\tif (!$this->createMailchimpListMember($list, $member)) {\n\t\t\tstatic::markTestSkipped('Member cannot be created successfully, test is skipped');\n\t\t}\n\n\t\t//trying to create another member under the same list and using the same Email address\n\t\t$data = static::$memberData;\n\t\t$data['email_address'] = $member['email_address'];\n\t\t$this->post(sprintf(self::PRE_URI, $list['list_id']), $data);\n\n\t\t$content = \\json_decode($this->response->getContent(), true);\n\n\t\t$this->assertResponseStatus(self::HTTP_STATUS_BAD_REQUEST);\n\t\tself::assertArrayHasKey('message', $content);\n\t\tself::assertEquals(MembersController::getEmailDuplicateError($data['email_address'], $list['list_id']), $content['message']);\n\t}",
"public function addRecipient($recipient)\n {\n $this->recipients[] = $recipient;\n }",
"public function failures()\n {\n return $this->failedRecipients;\n }",
"public function flushFailedRecipients()\n {\n $this->failed = null;\n $this->failed = array();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation landedCostBookInPATCHRequestBookInIDUpdateWithHttpInfo Updates a book in. | public function landedCostBookInPATCHRequestBookInIDUpdateWithHttpInfo($accept, $book_in_id, $jiwa_stateful = null, $book_in_no = null, $shipment = null, $book_in_date = null, $activated = null, $gl_sets_rec_id = null, $last_saved_date_time = null, $lines = null, $other_book_ins_for_this_shipment = null, $body = null)
{
$returnType = '\Jiwa\Model\BookIn';
$request = $this->landedCostBookInPATCHRequestBookInIDUpdateRequest($accept, $book_in_id, $jiwa_stateful, $book_in_no, $shipment, $book_in_date, $activated, $gl_sets_rec_id, $last_saved_date_time, $lines, $other_book_ins_for_this_shipment, $body);
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()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Jiwa\Model\BookIn',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Jiwa\Model\BookIn',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 401:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Jiwa\Model\BookIn',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Jiwa\Model\BookIn',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Jiwa\Model\BookIn',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | [
"public function landedCostBookInPATCHRequestBookInIDUpdate($accept, $book_in_id, $jiwa_stateful = null, $book_in_no = null, $shipment = null, $book_in_date = null, $activated = null, $gl_sets_rec_id = null, $last_saved_date_time = null, $lines = null, $other_book_ins_for_this_shipment = null, $body = null)\n {\n list($response) = $this->landedCostBookInPATCHRequestBookInIDUpdateWithHttpInfo($accept, $book_in_id, $jiwa_stateful, $book_in_no, $shipment, $book_in_date, $activated, $gl_sets_rec_id, $last_saved_date_time, $lines, $other_book_ins_for_this_shipment, $body);\n return $response;\n }",
"public function landedCostBookInPATCHRequestBookInIDUpdateAsyncWithHttpInfo($accept, $book_in_id, $jiwa_stateful = null, $book_in_no = null, $shipment = null, $book_in_date = null, $activated = null, $gl_sets_rec_id = null, $last_saved_date_time = null, $lines = null, $other_book_ins_for_this_shipment = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\BookIn';\n $request = $this->landedCostBookInPATCHRequestBookInIDUpdateRequest($accept, $book_in_id, $jiwa_stateful, $book_in_no, $shipment, $book_in_date, $activated, $gl_sets_rec_id, $last_saved_date_time, $lines, $other_book_ins_for_this_shipment, $body);\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 function landedCostBookInPATCHRequestBookInIDUpdateAsync($accept, $book_in_id, $jiwa_stateful = null, $book_in_no = null, $shipment = null, $book_in_date = null, $activated = null, $gl_sets_rec_id = null, $last_saved_date_time = null, $lines = null, $other_book_ins_for_this_shipment = null, $body = null)\n {\n return $this->landedCostBookInPATCHRequestBookInIDUpdateAsyncWithHttpInfo($accept, $book_in_id, $jiwa_stateful, $book_in_no, $shipment, $book_in_date, $activated, $gl_sets_rec_id, $last_saved_date_time, $lines, $other_book_ins_for_this_shipment, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updatedbookById(Request $request, $id);",
"function updateAddressBook($addressBookId, \\Sabre\\DAV\\PropPatch $propPatch) {}",
"public function update(int $bookId){}",
"public function testLandedCostBookInPATCHRequestBookInIDUpdate()\n {\n }",
"public static function updateBook($book) {\n //get the category id for the book's category\n $category = DB::select('category_id')->from('categories')->where('category', '=', $book->getCategory())->execute();\n\n //prepare the columns an values\n $set = array(\n 'name' => $book->getName(),\n 'author' => $book->getAuthor(),\n 'is_new' => $book->getIsNew(),\n 'category_id' => $category->get('category_id'),\n 'price' => $book->getPrice(),\n 'preview' => $book->getPreview(),\n 'units' => $book->getUnits()\n );\n\n //update the data\n return DB::update('books')->set($set)->where('book_id', '=', $book->getId())->execute();\n }",
"public function landedCostShipmentPATCHRequestShipmentIDUpdateAsyncWithHttpInfo($accept, $shipment_id, $jiwa_stateful = null, $shipment_no = null, $last_saved_date_time = null, $initiated_date = null, $departure_date = null, $expected_arrival_date = null, $scheduled_arrival_date = null, $receipt_date = null, $delivery_notes = null, $status = null, $way_bill_no = null, $vessel_name = null, $container_no = null, $use_voti = null, $shipping_agent_creditor_id = null, $shipping_agent_creditor_account_no = null, $shipping_agent_creditor_name = null, $import_cost_clearing_account = null, $lines = null, $purchase_orders = null, $import_costs = null, $vot_is = null, $invoices = null, $custom_field_values = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\Shipment';\n $request = $this->landedCostShipmentPATCHRequestShipmentIDUpdateRequest($accept, $shipment_id, $jiwa_stateful, $shipment_no, $last_saved_date_time, $initiated_date, $departure_date, $expected_arrival_date, $scheduled_arrival_date, $receipt_date, $delivery_notes, $status, $way_bill_no, $vessel_name, $container_no, $use_voti, $shipping_agent_creditor_id, $shipping_agent_creditor_account_no, $shipping_agent_creditor_name, $import_cost_clearing_account, $lines, $purchase_orders, $import_costs, $vot_is, $invoices, $custom_field_values, $body);\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 function landedCostBookInGETRequestBookInIDGetWithHttpInfo($accept, $book_in_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\BookIn';\n $request = $this->landedCostBookInGETRequestBookInIDGetRequest($accept, $book_in_id, $jiwa_stateful);\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 '\\Jiwa\\Model\\BookIn',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\BookIn',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\BookIn',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\BookIn',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function setBookInfo(BookInfo $value) {\n return $this->set(self::BOOK_INFO, $value);\n }",
"static function editBook($bookId, $newTitle, $newPrice, $newAuthor, $newYear){\n // $originInfo = null;\n // $str = null;\n // $listBook = Book::getListFromFile();\n // foreach ($listBook as $value) {\n // # code...\n // if($bookId == $value->id){\n // $tempArr = [ $value->title, $value->price, $value->author, $value->year];\n // $originInfo = $value->id . \"#\" . $value->title . \"#\" . $value->price . \"#\" . $value->author . \"#\" . $value->year;\n // for($i = 0; $i < 4; $i++) {\n // # code...\n // if($changedInfo[$i] == \"\")\n // $changedInfo[$i] = $tempArr[$i];\n // }\n // break; \n // }\n // }\n\n // $str = $bookId . \"#\" . $changedInfo[0] . \"#\" . $changedInfo[1] . \"#\" . $changedInfo[2] . \"#\" . $changedInfo[3];\n // $contents = file_get_contents(\"data/book.txt\");\n // $contents = str_replace($originInfo, $str, $contents);\n // file_put_contents(\"data/book.txt\", $contents);\n $con= Book::connect();\n $sql = \"UPDATE book SET Title='$newTitle', Author='$newAuthor', Price='$newPrice', Year='$newYear' WHERE ID=$bookId\";\n if($con->query($sql)==true){\n echo \"Cập nhật thành công\";\n }else {\n echo \"Cập nhật thất bại\";\n }\n }",
"public function it_returns_success_when_book_is_updated()\n {\n $data = [\n 'name' => 'Bola',\n 'isbn' => '123-456',\n 'authors' => 'Ade, Bola',\n 'number_of_pages' => 10,\n 'publisher' => 'Bola Publisher',\n 'country' => 'Nigeria',\n 'release_date' => '2020-08-25',\n ];\n\n $response = $this->patchJson('/api/v1/books/' . $this->book->id, $data);\n $response->assertStatus(JsonResponse::HTTP_OK)\n ->assertJson([\"status_code\" => JsonResponse::HTTP_OK]);\n }",
"public function update(Request $request, $id)\n {\n $book=BooksRequest::find($id);\n $user=User::find($book->user_id);\n \n if($request->input('status')=='Accepted'){\n $book->status=$request->input('status');\n $book->save();\n $user->notify(new NotifyUser(BooksRequest::where('id','=',$book->id)->firstorfail()));\n return redirect('admin_view')->with('success','Book Request ('.$book->book->title.') of '.$book->user->name.' has been Accepted');\n }\n else{\n $books=Books::find($book->book_id);\n $books->increment('supply','1');\n $book->status=$request->input('status');\n $book->save();\n $user->notify(new NotifyUser(BooksRequest::where('id','=',$book->id)->firstorfail()));\n return redirect('admin_view')->with('error','Book Request');\n } \n \n }",
"public function inventoryDocumentPATCHRequestInventoryIDDocumentsDocumentIDUpdateWithHttpInfo($accept, $inventory_id, $document_id, $jiwa_stateful = null, $document_type = null, $file_id = null, $physical_file_name = null, $full_physical_file_name = null, $description = null, $last_saved_date_time = null, $last_modified_by_staff_id = null, $last_modified_by_staff_username = null, $last_modified_by_staff_title = null, $last_modified_by_staff_first_name = null, $last_modified_by_staff_surname = null, $file_binary = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\Document';\n $request = $this->inventoryDocumentPATCHRequestInventoryIDDocumentsDocumentIDUpdateRequest($accept, $inventory_id, $document_id, $jiwa_stateful, $document_type, $file_id, $physical_file_name, $full_physical_file_name, $description, $last_saved_date_time, $last_modified_by_staff_id, $last_modified_by_staff_username, $last_modified_by_staff_title, $last_modified_by_staff_first_name, $last_modified_by_staff_surname, $file_binary, $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 '\\Jiwa\\Model\\Document',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Document',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Document',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\Document',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateBankDocument($id, $documentId, array $request);",
"public function updateBookingSet(string $bookingSetId, array $data)\n {\n return $this->patch('booking-set/' . $bookingSetId, [], $data);\n }",
"public function inventoryDebtorClassificationPricePATCHRequestInventoryIDDebtorClassificationPricesDebtorClassificationPriceIDUpdateWithHttpInfo($accept, $inventory_id, $debtor_classification_price_id, $jiwa_stateful = null, $source = null, $mode = null, $amount = null, $start_date = null, $end_date = null, $use_quantity_price_break = null, $quantity_price_break = null, $debtor_classification_id = null, $debtor_classification_description = null, $price = null, $note = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\InventoryDebtorClassificationPrice';\n $request = $this->inventoryDebtorClassificationPricePATCHRequestInventoryIDDebtorClassificationPricesDebtorClassificationPriceIDUpdateRequest($accept, $inventory_id, $debtor_classification_price_id, $jiwa_stateful, $source, $mode, $amount, $start_date, $end_date, $use_quantity_price_break, $quantity_price_break, $debtor_classification_id, $debtor_classification_description, $price, $note, $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 '\\Jiwa\\Model\\InventoryDebtorClassificationPrice',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\InventoryDebtorClassificationPrice',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\InventoryDebtorClassificationPrice',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\InventoryDebtorClassificationPrice',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updated(BorrowedBook $borrowedBook)\n {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds passed $redirect string into the .htaccess file | function redirect_addRedirect($redirect, $page_id, $redirect_url) {
if ($redirect != '') {
// If redirect does not exist already, add it
// We only want to check for the page part of the redirect
$this_page_url = structure_getPathURL($page_id);
$this_page_url = "^$this_page_url$";
$exists = redirect_checkIfExists($this_page_url);
// If redirect does not exist, add it!
if (!$exists) {
// Get redirect content
$redirects_array = redirect_getCurrentRedirects();
$old_redirect_content = $redirects_array['content'];
$redirect_header = "<IfModule mod_rewrite.c>
\tRewriteEngine On
\tRewriteBase /
\n";
// Add new redirect to redirect content
$new_redirect_content = $old_redirect_content . $redirect;
$redirect_footer = "
\tRewriteRule ^dynamic(.*)$ dynamic.php?url=$1 [QSA,L]
\tRewriteCond %{REQUEST_FILENAME} !-f
\tRewriteCond %{REQUEST_FILENAME} !-d
\tRewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>";
$file = HTACCESS_FILE;
$fh = fopen($file, 'r');
$contents = fread($fh, filesize($file));
fclose($fh);
// Now replace the old redirects content with the new redirects content
$new_redirect_code = $redirect_header . $new_redirect_content . $redirect_footer;
if (is_writable($file)) {
// We need to delete everything from .htaccess and write new content into it
$fh = fopen($file, 'w');
fwrite($fh, $new_redirect_code);
fclose($fh);
echo "<p class=\"notification\">Redirect created successfully</p>";
} else {
echo "<p class=\"notification\">'$file' is not writable, cannot create redirect</p>";
}
} else {
// A rule for this page exists so now check if the redirect url is the same, if it is - we want to delete it and add this new one.
// Get page url from page id
$page_url = structure_getPathURL($page_id);
// We only want to check for the page part of the redirect
$this_page_url = "^$page_url$";
$redirect_found = redirect_getExistingRedirect($this_page_url);
// If redirect exists
if ($redirect_found != '') {
// Check if found redirect is the same as the one entered by user in form submission
if ($redirect_found == $redirect_url) {
// Redirect is the same, do nothing
echo '<p class="notification">Redirect is the same, nothing updated</p>';
} else {
// Redirect is different, so we need to delete current redirect and add this new one.
$file = HTACCESS_FILE;
$fh = fopen($file, 'r');
$contents = fread($fh, filesize($file));
fclose($fh);
// First if the user is deleting the redirect ($redirect_url is blank) then just delete the existing redirect
if ($redirect_url != '') {
// Now we need to build the redirect string that we want to delete from the .htaccess file
$old_redirect_string = redirect_buildRedirect($page_url, $redirect_found);
$new_redirect_string = redirect_buildRedirect($page_url, $redirect_url);
// Now replace it in the .htaccess file
$new_redirect_code = str_replace($old_redirect_string,$new_redirect_string,$contents);
if (is_writable($file)) {
// We need to delete everything from .htaccess and write new content into it
$file = HTACCESS_FILE;
$fh = fopen($file, 'w');
fwrite($fh, $new_redirect_code);
fclose($fh);
echo "<p class=\"notification\">Redirect changed successfully</p>";
} else {
echo "<p class=\"notification\">'$file' is not writable, cannot create redirect</p>";
}
} else {
// Just delete redirect
$old_redirect_string = redirect_buildRedirect($page_url, $redirect_found);
// Now delete it from the .htaccess file
$new_redirect_code = str_replace($old_redirect_string,'',$contents);
if (is_writable($file)) {
// We need to delete everything from .htaccess and write new content into it
$file = HTACCESS_FILE;
$fh = fopen($file, 'w');
fwrite($fh, $new_redirect_code);
fclose($fh);
echo "<p class=\"notification\">Redirect deleted</p>";
} else {
echo "<p class=\"notification\">'$file' is not writable, cannot delete redirect</p>";
}
}
}
}
}
} else {
echo '<p class="notification">Redirect not provided, cannot update</p>';
}
} | [
"public function redirect($regex, $redirect)\n {\n $params = $this->parseURLTemplate($regex, $regex);\n $t = microtime(true);\n for ($k = 0, $n = count($params); $k < $n; $k++)\n {\n $redirect = preg_replace('/(?<!\\\\\\)#((.(?!(?<!\\\\\\)#))*.)./', md5($t + $k), $redirect);\n }\n $action = function() use($t, $redirect)\n {\n $url = $redirect;\n foreach (func_get_args() as $k => $arg)\n {\n $url = str_replace(md5($t + $k), $arg, $url);\n }\n Aleph::go($url);\n };\n $this->acts['redirect'][$regex] = array('action' => $action, \n 'params' => $params, \n 'component' => URL::COMPONENT_PATH, \n 'methods' => 'GET|POST');\n $this->lact = array('redirect', $regex);\n return $this;\n }",
"function addRedirect($sURL)\n\t{\n\t\t//we need to parse the query part so that the values are rawurlencode()'ed\n\t\t//can't just use parse_url() cos we could be dealing with a relative URL which\n\t\t// parse_url() can't deal with.\n\t\t$queryStart = strpos($sURL, '?', strrpos($sURL, '/'));\n\t\tif ($queryStart !== FALSE)\n\t\t{\n\t\t\t$queryStart++;\n\t\t\t$queryEnd = strpos($sURL, '#', $queryStart);\n\t\t\tif ($queryEnd === FALSE)\n\t\t\t\t$queryEnd = strlen($sURL);\n\t\t\t$queryPart = substr($sURL, $queryStart, $queryEnd-$queryStart);\n\t\t\tparse_str($queryPart, $queryParts);\n\t\t\t$newQueryPart = \"\";\n\t\t\tforeach($queryParts as $key => $value)\n\t\t\t{\n\t\t\t\t$newQueryPart .= rawurlencode($key).'='.rawurlencode($value).ini_get('arg_separator.output');\n\t\t\t}\n\t\t\t$sURL = str_replace($queryPart, $newQueryPart, $sURL);\n\t\t}\n\t\t$this->addScript('window.location = \"'.$sURL.'\";');\n\t}",
"function setRedirect($url) \n {\n if (substr($url,0,10) == 'index.php?') {\n $route =& VRoute::getInstance();\n $url = $route->encode($url);\n }\n \n $this->_redirect = $url;\n }",
"public function addRedirectSource(string $source) {\n if (!empty($source) && !in_array($source, $this->redirectSources, TRUE)) {\n // The source has not been added yet, so add it.\n $this->redirectSources[] = $source;\n }\n }",
"function write_courses_htaccess_file($url_append) {\n $content = file_get_contents(dirname(__FILE__).'/'.COURSES_HTACCESS_FILENAME);\n $content = str_replace('{CHAMILO_URL_APPEND_PATH}', $url_append, $content);\n $fp = @ fopen(api_get_path(SYS_PATH).'courses/.htaccess', 'w');\n if ($fp) {\n fwrite($fp, $content);\n return fclose($fp);\n }\n return false;\n}",
"private function init_redirect( $atts ) {\n\t\t$this->redirect = $_SERVER['REQUEST_URI'];\n\n\t\t$current_redirect_to = $this->get_redirect_to_from_url( $_SERVER['REQUEST_URI'] );\n\t\tif ( $current_redirect_to !== '' ) {\n\t\t\t$this->redirect = $current_redirect_to;\n\t\t} else {\n\t\t\t$this->apply_string_attribute( $atts, 'redirect' );\n\t\t\t$this->set_wpml_url( $this->redirect );\n\t\t}\n\t}",
"public static function setRedirectParams($redirectparams)\n\t{\n\t\tself::getAcornNamespace()->redirectparams = $redirectparams;\n\t}",
"public function addRedirectKeyword($keyword);",
"public function enableRedirects(){}",
"abstract public function setStaticRedirects();",
"function setRedirect($url) {\r\n\t\t$this->redirect = $url;\r\n\t}",
"public function putRedirectRules(array $redirectRules): void;",
"function qppr_create_individual_redirect( $atts = array() ){\n\tif( !is_array( $atts ) )\n\t\treturn false;\n\t$defaults = array( \n\t\t'post_id' \t=> '0', \n\t\t'active' \t=> 1, \n\t\t'url'\t\t=> '',\n\t\t'type' \t\t=> '301',\n\t\t'newwindow'\t=> 0,\n\t\t'nofollow'\t=> 0,\n\t\t'rewrite'\t=> 0\n\t);\n\textract( shortcode_atts($defaults, $atts) );\n\tif( $post_id == '0' || $url == '' )\n\t\treturn false;\n\t// some validation\n\t$type \t\t= !in_array( $type, array( '301', '302', '307', 'meta' ) ) ? '301' : $type;\n\t$active \t= (int) $active == 1 ? 1 : 0;\n\t$newwindow \t= (int) $newwindow == 1 ? 1 : 0;\n\t$nofollow \t= (int) $nofollow == 1 ? 1 : 0;\n\t$rewrite \t= (int) $rewrite == 1 ? 1 : 0;\n\t// set required meta \n\tadd_post_meta( $post_id, '_pprredirect_url', $url );\n\tadd_post_meta( $post_id, '_pprredirect_type', $type );\n\tadd_post_meta( $post_id, '_pprredirect_active', $active );\n\t//set optional meta\n\tif( $rewrite == 1 )\n\t\tadd_post_meta( $post_id, '_pprredirect_rewritelink', 1 );\n\tif( $newwindow == 1 )\n\t\tadd_post_meta( $post_id, '_pprredirect_newwindow', '_blank' );\n\tif( $nofollow == 1 )\n\t\tadd_post_meta( $post_id, '_pprredirect_relnofollow', 1 );\t\n\treturn true;\n}",
"function shibboleth_insert_htaccess() {\n\t$disabled = defined( 'SHIBBOLETH_DISALLOW_FILE_MODS' ) && SHIBBOLETH_DISALLOW_FILE_MODS;\n\n\tif ( got_mod_rewrite() && ! $disabled ) {\n\t\t$htaccess = get_home_path() . '.htaccess';\n\t\t$rules = array( '<IfModule mod_shib>', 'AuthType shibboleth', 'Require shibboleth', '</IfModule>', '<IfModule mod_shib.c>', 'AuthType shibboleth', 'Require shibboleth', '</IfModule>', '<IfModule mod_shib.cpp>', 'AuthType shibboleth', 'Require shibboleth', '</IfModule>' );\n\t\tinsert_with_markers( $htaccess, 'Shibboleth', $rules );\n\t}\n}",
"function modifyHtaccess() {\n\t //makes a new htaccess instruction string\n\t\t$sNewHtaccessCache = makeCacheHtaccessInstruction();\n\t\t//changes only htaccess instructions concerning cache \n\t\tif (file_exists('.htaccess')) {\t\t\n\t\t\t$sNewHtaccess = replaceCacheInHtaccess(file_get_contents('.htaccess'), $sNewHtaccessCache);\n\t\t\twriteInHtaccessFile($sNewHtaccess);\n\t\t} else {\n\t\t writeInHtaccessFile($sNewHtaccessCache);\n\t\t}\n\t}",
"public function writeHtaccessSection()\n {\n $adminDir = $this->getAdminDir();\n $source = \"\\n# start ~ module watermark section\n<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteCond expr \\\"! %{HTTP_REFERER} -strmatch '*://%{HTTP_HOST}*/$adminDir/*'\\\"\nRewriteRule [0-9/]+/[0-9]+\\\\.jpg$ - [F]\n</IfModule>\n# end ~ module watermark section\\n\";\n\n $path = _PS_ROOT_DIR_ . '/.htaccess';\n\n if (false === file_put_contents($path, $source . file_get_contents($path))) {\n $this->context->controller->errors[] = $this->trans('Unable to add watermark section to the .htaccess file', [], 'Modules.Watermark.Admin');\n\n return false;\n }\n\n return true;\n }",
"public function get_option_htaccess_redirect()\n {\n\n $options = get_option('rlrsssl_options');\n\n $htaccess_redirect = $this->htaccess_redirect;\n $disabled = \"\";\n $comment = \"\";\n\n //networkwide is not shown, so this only applies to per site activated sites.\n if (is_multisite() && RSSSL()->rsssl_multisite->htaccess_redirect) {\n $disabled = \"disabled\";\n $htaccess_redirect = TRUE;\n $comment = __(\"This option is enabled on the network menu.\", \"really-simple-ssl\");\n } else {\n $disabled = ($this->do_not_edit_htaccess) ? \"disabled\" : \"\";\n }\n\n echo '<input ' . $disabled . ' id=\"rlrsssl_options\" name=\"rlrsssl_options[htaccess_redirect]\" size=\"40\" type=\"checkbox\" value=\"1\"' . checked(1, $this->htaccess_redirect, false) . \" />\";\n RSSSL()->rsssl_help->get_help_tip(__(\"A .htaccess redirect is faster. Really Simple SSL detects the redirect code that is most likely to work (99% of websites), but this is not 100%. Make sure you know how to regain access to your site if anything goes wrong!\", \"really-simple-ssl\"));\n echo $comment;\n\n if ($this->htaccess_redirect && (!is_writable($this->ABSpath . \".htaccess\") || !$this->htaccess_test_success)) {\n echo \"<br><br>\";\n if (!is_writable($this->ABSpath . \".htaccess\")) _e(\"The .htaccess file is not writable. Add these lines to your .htaccess manually, or set 644 writing permissions\", \"really-simple-ssl\");\n if (!$this->htaccess_test_success) _e(\"The .htaccess redirect rules that were selected by this plugin failed in the test. The following redirect rules were tested:\", \"really-simple-ssl\");\n echo \"<br><br>\";\n if ($this->ssl_type != \"NA\") {\n $manual = true;\n $rules = $this->get_redirect_rules($manual);\n\n $arr_search = array(\"<\", \">\", \"\\n\");\n $arr_replace = array(\"<\", \">\", \"<br>\");\n $rules = str_replace($arr_search, $arr_replace, $rules);\n\n ?>\n <code>\n <?php echo $rules; ?>\n </code>\n <?php\n } else {\n _e(\"The plugin could not detect any possible redirect rule.\", \"really-simple-ssl\");\n }\n }\n\n //on multisite, the .htaccess do not edit option is not available\n if (!is_multisite()) {\n if ($this->do_not_edit_htaccess) {\n _e(\"If the setting 'do not edit htaccess' is enabled, you can't change this setting.\", \"really-simple-ssl\");\n } elseif (!$this->htaccess_redirect) {\n $link_start = '<a target=\"_blank\" href=\"https://really-simple-ssl.com/knowledge-base/remove-htaccess-redirect-site-lockout/\">';\n $link_end = '</a>';\n printf(\n __('Before you enable this, make sure you know how to %1$sregain access%2$s to your site in case of a redirect loop.', 'really-simple-ssl'),\n $link_start,\n $link_end\n );\n }\n }\n\n }",
"function hs_do_redirect() {\n\t\tif ($qs = $_SERVER['REQUEST_URI']) {\n\t\t\t$pos = strpos($qs, 'hs_redirect');\n\t\t\tif (!(false === $pos)) { \n\t\t\t\t$link = substr($qs, $pos);\n\t\t\t\t$link = str_replace('hs_redirect=', '', $link);\n\t\n\t\t\t\t// Extract the ID and get the link\n\t\t\t\t$pattern = '/hs_redirect_(\\d+?)\\=/';\n\t\t\t\tpreg_match($pattern, $link, $matches);\n\t\t\t\t$link = preg_replace($pattern, '', $link);\n\t\n\t\t\t\t// Save click!\n\t\t\t\t//if (get_option('administer_statistics') == 'true') { \n\t\t\t\t\t$id = $matches[1];\n\t\t\t\t\tif(!$this->is_bot($_SERVER['HTTP_USER_AGENT'])){\n\t\t\t\t\t\t$this->hs_register_click($id);\n\t\t\t\t\t}\n\t\t\t\t//}\n\t\n\t\t\t\t// Redirect\n\t\t\t\theader(\"HTTP/1.1 302 Temporary Redirect\");\n\t\t\t\theader(\"Location:\" . $link);\n\t\t\t\t// I'm outta here!\n\t\t\t\texit(1);\n\t\t\t}\n\t\t} \n\t}",
"public function setRedirectUrl($redirectUrl);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get_sort_field (required by view.php) | function get_sort_field() {
return '';
} | [
"public function getSortFields () {}",
"public function getSortFields() {}",
"function getSortField() {\n \treturn $this->sSortField;\n }",
"public function field()\n {\n return 'sort';\n }",
"public function _get_sort_field() {\r\n return $this->__sort_field_name;\r\n }",
"public function getSortingField()\n {\n $result = null;\n /**\n * Just prior to getting the configured sorting field.\n *\n * @delegate SectionGetSortingField\n * @since Symphony 3.0.0\n * @param string $context\n * '/publish/'\n * @param string $section-handle\n * The handle of the current section\n * @param string &$field\n * The field as set by extensions\n */\n Symphony::ExtensionManager()->notifyMembers('SectionGetSortingField', '/publish/', array(\n 'section-handle' => $this->get('handle'),\n 'field' => &$result,\n ));\n\n if (!$result) {\n $result = Symphony::Configuration()->get('section_' . $this->get('handle') . '_sortby', 'sorting');\n }\n\n return (!$result ? $this->getDefaultSortingField() : (string)$result);\n }",
"public function getSortField()\n {\n return $this->field;\n }",
"public function getSortField()\n {\n return $this->sortField;\n }",
"public function getSortValue() {}",
"private function getSortField()\n {\n $sortField = request()->get('sort_by', $this->sortField);\n\n foreach ($this->sortable as $field) {\n if ($field == $sortField) {\n return $field;\n } elseif (Str::contains('.', $field)) {\n if (Str::endsWith($field, \".{$sortField}\")) {\n return $field;\n }\n }\n }\n\n return $this->sortField;\n }",
"public function getDefaultSortField(): string;",
"public function getSortFields(): array {}",
"function getSort() {\n $sort = 'name';\n if (isset($this->data['sort'])) {\n switch ($this->data['sort']) {\n case 0:\n case 1:\n $sort = 'title';\n break;\n case 2 :\n case 3 :\n $sort = 'date';\n break;\n case 4 :\n case 5 :\n $sort = 'sort';\n break;\n }\n }\n return $sort;\n }",
"function getFieldHeader_sortLink( $fieldName ) {\r\n\t\t$piVars = array();\r\n\t\t$piVars['sort'] = $fieldName . ':' . ( $this->internal['descFlag'] ? 0 : 1 );\t\r\n\t\tif( $this->piVars['pid'] ) { $piVars['pid'] = intval( $this->piVars['pid'] ); }\r\n\t\tif( $this->piVars['sword'] ) { $piVars['sword'] = htmlspecialchars( $this->piVars['sword'] ); }\r\n\t\r\n\t\treturn $this->pi_linkTP_keepPIvars( \r\n\t\t\t$this->pi_getLL( 'list_field_'.$fieldName ),\r\n\t\t\t$piVars,\r\n\t\t\t0,\r\n\t\t\t$GLOBALS['TSFE']->id\r\n\t\t);\r\n\t}",
"function get_default_sort_field() {\n // No column sorting at this time\n //return 'sortname';\n }",
"function _media_get_sort_type() {\n return _media_get_display_param('sort', array('default' => 'name', 'date'));\n}",
"protected function _getSortType() {}",
"function get_sort_sql($fieldname) {\n return '';\n }",
"function group_sort_by_field() {\r\n\t\tglobal $Discography;\r\n\t\t$options = $Discography->get_discography_options();\r\n\t\techo '<select id=\"discography_options_group_sort_by\" name=\"discography_options[group_sort_by]\">\r\n\t\t\t\t<option value=\"release_date\" ' . selected( 'release_date', $options['group_sort_by'], false ) . '>' . __( 'Release Date', 'discography' ) . '</option>\r\n\t\t\t\t<option value=\"order\" ' . selected( 'order', $options['group_sort_by'], false ) . '>' . __( 'Custom', 'discography' ) . '</option>\r\n\t\t\t\t<option value=\"title\" ' . selected( 'title', $options['group_sort_by'], false ) . '>' . __( 'Alphabetical', 'discography' ) . '</option>\r\n\t\t\t\t<option value=\"id\" ' . selected( 'id', $options['group_sort_by'], false ) . '>' . __( 'Album ID', 'discography' ) . '</option>\r\n\t\t\t</select>';\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the published_at column Example usage: $query>filterByPublishedAt('20110314'); // WHERE published_at = '20110314' $query>filterByPublishedAt('now'); // WHERE published_at = '20110314' $query>filterByPublishedAt(array('max' => 'yesterday')); // WHERE published_at > '20110313' | public function filterByPublishedAt($publishedAt = null, $comparison = null)
{
if (is_array($publishedAt)) {
$useMinMax = false;
if (isset($publishedAt['min'])) {
$this->addUsingAlias(ActionPeer::PUBLISHED_AT, $publishedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($publishedAt['max'])) {
$this->addUsingAlias(ActionPeer::PUBLISHED_AT, $publishedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(ActionPeer::PUBLISHED_AT, $publishedAt, $comparison);
} | [
"public function filterByPublishedAt($publishedAt = null, $comparison = null)\n {\n if (is_array($publishedAt)) {\n $useMinMax = false;\n if (isset($publishedAt['min'])) {\n $this->addUsingAlias(SectioncacheTableMap::COL_PUBLISHED_AT, $publishedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($publishedAt['max'])) {\n $this->addUsingAlias(SectioncacheTableMap::COL_PUBLISHED_AT, $publishedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SectioncacheTableMap::COL_PUBLISHED_AT, $publishedAt, $comparison);\n }",
"public function scopePublished($query){\n \n $query->where('published_at','<=',Carbon::now());\n\n }",
"public function filterByPublishedAt($publishedAt = null, $comparison = null)\n {\n if (is_array($publishedAt)) {\n $useMinMax = false;\n if (isset($publishedAt['min'])) {\n $this->addUsingAlias(VoteTableMap::COL_PUBLISHED_AT, $publishedAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($publishedAt['max'])) {\n $this->addUsingAlias(VoteTableMap::COL_PUBLISHED_AT, $publishedAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(VoteTableMap::COL_PUBLISHED_AT, $publishedAt, $comparison);\n }",
"function test_created_at_filter_with_now() {\n\t\tself::clear_get_values();\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\n\t\t$filter_args = array(\n\t\t\tarray( 'type' => 'col',\n\t\t\t\t'col' => 'created_at',\n\t\t\t\t'op' => '<',\n\t\t\t\t'val' => 'NOW',\n\t\t\t),\n\t\t);\n\t\tself::add_filter_to_view( $dynamic_view, $filter_args );\n\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Jamie', 'Steve', 'Steph' ), array() );\n\n\t\tself::run_get_display_data_tests( $d, 'created at filter' );\n\t}",
"public function scopePublished($query){\n \t$query->where('published_at', '<=', Carbon::now());\n }",
"public function getPublishedAtColumn()\n\t{\n\t\treturn defined('static::PUBLISHED_AT') ? static::PUBLISHED_AT : 'published_at';\n\t}",
"public function scopePublished($query)\n {\n \t$query->where('published_at', '<=', Carbon::now());\n }",
"private function PublishedCondition()\n {\n $sql = Access::SqlBuilder();\n $sqlNow = $sql->Value(Date::Now());\n $tblArticle = Article::Schema()->Table();\n return $sql->Equals($tblArticle->Field('Publish'), $sql->Value(true))\n ->And_($sql->IsNull($tblArticle->Field('PublishFrom'))\n ->Or_($sql->LTE($tblArticle->Field('PublishFrom'), $sqlNow)))\n ->And_($sql->IsNull($tblArticle->Field('PublishTo'))\n ->Or_($sql->GTE($tblArticle->Field('PublishTo'), $sqlNow)));\n }",
"protected function filter_on_published($on = TRUE, $lang = NULL)\n\t{\n\t\tif ($on === TRUE)\n\t\t{\n\t\t\t$this->{$this->db_group}->where($this->parent_table.'.online', '1');\t\t\n\t\n\t\t\tif ($lang !== NULL && count(Settings::get_online_languages()) > 1)\n\t\t\t\t$this->{$this->db_group}->where($this->lang_table.'.online', '1');\t\t\n\t\n\t\t\t$this->{$this->db_group}->where('((article.publish_off > ', 'now()', FALSE);\n\t\t\t$this->{$this->db_group}->or_where('article.publish_off = ', '0)' , FALSE);\n\t\t\n\t\t\t$this->{$this->db_group}->where('(article.publish_on < ', 'now()', FALSE);\n\t\t\t$this->{$this->db_group}->or_where('article.publish_on = ', '0))' , FALSE);\n\t\t}\t\n\t}",
"public function scopePublishedUntilToday($query)\n {\n // return $query->whereDate('publish_date', '<=', Carbon::today()->toDateString());\n // c'e' update_at created_at .. percio' published_at\n return $query->whereDate('published_at', '<=', Carbon::today()->toDateString());\n }",
"public function getPublishedAt()\n {\n return $this->publishedAt;\n }",
"function test_created_at_filter_with_minus_one_day() {\n\t\tself::clear_get_values();\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\n\t\t// Update creation date on Steve's entry to NOW\n\t\tglobal $wpdb;\n\t\t$now = date( 'Y-m-d H:i:s' );\n\t\t$entry_id = FrmEntry::get_id_by_key( 'steve_entry_key' );\n\t\t$wpdb->update( $wpdb->prefix . 'frm_items', array( 'created_at' => $now ), array( 'id' => $entry_id ) );\n\n\t\t$filter_args = array(\n\t\t\tarray( 'type' => 'col',\n\t\t\t\t'col' => 'created_at',\n\t\t\t\t'op' => '>',\n\t\t\t\t'val' => '-1 day',\n\t\t\t),\n\t\t);\n\t\tself::add_filter_to_view( $dynamic_view, $filter_args );\n\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Steve' ), array( 'Jamie', 'Steph' ) );\n\n\t\tself::run_get_display_data_tests( $d, 'created at filter' );\n\n\t\t// Set data back after testing\n\t\t$original_date = '2015-05-13 19:40:11';\n\t\t$wpdb->update( $wpdb->prefix . 'frm_items', array( 'created_at' => $original_date ), array( 'id' => $entry_id ) );\n\t}",
"public function scopePublishedTimePast($query) {\n\t\treturn $query->where('published_at', '<=', Carbon::now());\n\t}",
"public function setPublishedAtAttribute($date)\n {\n// $this->attributes['published_at'] = Carbon::parse($date);\n\n if(Input::get('published_at') > Carbon::now())\n {\n $this->attributes['published_at'] = Carbon::parse($date);\n }\n else\n {\n $this->attributes['published_at'] = Carbon::createFromFormat('Y-m-d',$date);\n }\n }",
"public function getPublishAt();",
"public function scheduled(){\n return $this->whereStatus(true)\n ->whereArchived(false)\n ->whereDate('published_at','>',\\Carbon\\Carbon::now())\n ->orderBy('published_at', 'desc')\n ->get();\n\n }",
"function filter_where($where = '') {\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-30 days')) . \"'\";\n return $where;\n }",
"public function scopePublished($query) {\n\t\t$query->where('posted_at', '<=', Carbon::now());\n\t}",
"protected function filterTimestamp(&$query, $attr = 'updated_at')\n {\n if (!is_null($this->{$attr}) && strpos($this->{$attr}, ' - ') !== false ) {\n list($start_date, $end_date) = explode(' - ', $this->{$attr});\n $query->andFilterWhere(['>=', $attr, (int)strtotime($start_date)]);\n $query->andFilterWhere(['<=', $attr, (int)strtotime($end_date) + 24 * 3600]);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate that a value can be converted into a time string. | function validateTime($value) {
if (preg_match('`^(\d\d?):(\d\d)(?::(\d\d))?$`', $value, $match)) {
$h = (int)$match[1];
$m = (int)$match[2];
$s = (int)($match[3] ?? 0);
if (0 <= $h && $h < 24 && 0 <= $m && $m < 60 && 0 <= $s && $s < 60) {
return sprintf('%d:%02d:%02d', $h, $m, $s);
}
}
return \Vanilla\Invalid::emptyMessage();
} | [
"function validate_isodatetime ( $sValue )\n{\n return ((strlen($sValue) == 19)\n and validate_isodate(substr($sValue, 0, 10))\n and in_array(substr($sValue, 10, 1), array('T', ' '))\n and validate_isotime(substr($sValue, 11, 8)));\n}",
"public function validate_time($attribute, $value) {\n\t\treturn preg_match('/^([0-9]){1,2}:([0-9]){1,2}$/i', $value);\n\t}",
"private function validateTime(string $time) {\r\n return preg_match(\"/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/\", $time);\r\n }",
"function is_time_valid($time) {\n return preg_match(\"/^\\d{2}:\\d{2}(?::\\d{2})?$/\", $time) !== 0;\n}",
"function verify_time_format( $time_value ) {\n\t\t$pattern1 = '/^(0?\\d|1\\d|2[0-3]):[0-5]\\d:[0-5]\\d$/';\n\t\t#$pattern2 = '/^(0?\\d|1[0-2]):[0-5]\\d\\s(am|pm)$/i'; # 11:59 am|pm\n\t\t#return preg_match($pattern1, $time_value) || preg_match($pattern2, $time_value);\n\t\treturn preg_match($pattern1, $time_value) ; #|| preg_match($pattern2, $time_value);\n\t}",
"public function valid_time($str) {\n\n $entradas = explode(':', $str);\n\n if(count($entradas) > 2){\n return false;\n }\n \n foreach ($entradas as $key => $entrada) {\n if (!is_numeric($entrada)) {\n return FALSE;\n }elseif($key == 0){\n if ((int) $entrada > 24){\n return FALSE;\n }\n }else{\n if ((int) $entrada > 59) {\n return false;\n }\n }\n }\n\n return TRUE;\n }",
"public static function isTime($value)\n {\n return preg_match('/^[0-9]{2}\\:[0-9]{2}\\:[0-9]{2}$/is', (string) $value);\n }",
"function validTime($inTime) {\r\n$pattern = \"/^((([9])|([0-2])|([0-1][0-2])):?([0-5][0-9]))|(([0-3]):?([0-2][0-9])|([0-3][0]))$/\";\r\n if(preg_match($pattern,$inTime)){\r\n return true;\r\n }\r\n}",
"public function time_validate($time)\n {\n \treturn preg_match(\"/^(2[0-3]|[01][0-9]):([0-5][0-9])$/\", $time);\n }",
"function check_time($string) {\n if (preg_match('@[0-9]{2}:[0-9]{2}@', $string)) {\n $time_parts = explode(\":\", $string);\n $hour = $time_parts[0]; $minute = $time_parts[1];\n if ($hour >= 0 && $hour <= 23 && $minute >= 0 && $minute <= 59)\n return true;\n }\n return false;\n }",
"private function isTime($value) {\n\t\t$int = strtotime($value);\n\t\tif($int !== FALSE) { return $int; }\n\t\treturn false;\n\t}",
"function _workflow_transition_form_element_validate_time($element, \\Drupal\\Core\\Form\\FormStateInterface &$form_state, $form) {\n if (!strtotime($element['#value'])) {\n $form_state->setError($element, t('Please enter a valid value for time.'));\n }\n}",
"function validateTime($time, $format = 'H:i'){\n\t\t\t\t\t$d = DateTime::createFromFormat($format, $time);\n\t\t\t\t\treturn $d && $d->format($format) === $time;\n\t\t\t\t\t}",
"function rausbar_validate_time_field( $result, $value, $form, $field ) {\n\t$time = strtotime( implode( ':', $value ) );\n\t$min_time = '19:00';\n\t$max_time = '23:00';\n\n\tif ( $time == false ) {\n\t\t$result['is_valid'] = false;\n\t\t$result['message'] = 'Vennligst fyll inn begge feltene.';\n\t} elseif ( $time < strtotime( $min_time ) || $time > strtotime( $max_time ) ) {\n\t\t$result['is_valid'] = false;\n\t\t$result['message'] = \"Velg et tidspunkt mellom {$min_time} og {$max_time}.\";\n\t}\n\n\treturn $result;\n}",
"public static function validateTime($time) {\r\n $dt = new DateTime($time);\r\n $h = $dt->format(self::timeHour);\r\n $i = $dt->format(self::timeMin);\r\n $s = $dt->format(self::timeSec);\r\n $valid = new DateTimeUtil();\r\n if(!$valid->checktime($h, $i, $s))\r\n {\r\n throw new Exception(\"Das Zeitformat [\".$time.\"] entspricht keinem gültigen Format\");\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }",
"private function validateTime()\n {\n return is_numeric($this->getHours()) && is_numeric($this->getMinutes());\n }",
"public static function is_time($string) {\n\t\t$regEx = '/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/';\n\t\treturn preg_match($regEx, $string);\n\t}",
"function checkTime($time)\n {\n //Check input exists\n if(isset($time) && $time !== \"\"){\n\n //Check input against timestamp format\n if(preg_match('/^\\d{4}-(?:(?:0\\d)|(?:1[0-2]))-(?:(?:[0-2]\\d)|(?:3[01]))T(?:(?:[01]\\d)|(?:2[0-3])):[0-5]\\d:[0-5]\\d$/', $time))\n {\n return true;\n }else{\n return false;\n }\n }else{\n return false;\n }\n }",
"public static function validateTime($value, $fieldName, $errors) {\n $parts = explode(':', $value);\n if (count($parts) != 2) {\n $errors[$fieldName] = 'Malformed';\n return '';\n }\n list($hour, $minute) = $parts;\n if (!is_numeric($hour) || !is_numeric($minute)) {\n $errors[$fieldName] = 'Malformed';\n return '';\n }\n $hour = intval($hour);\n $minute = intval($minute);\n if ($hour < 0 || $hour > 24 || $minute < 0 || $minute > 60) {\n $errors[$fieldName] = 'Malformed';\n return '';\n }\n \n $time = str_pad($hour, 2, \"0\", STR_PAD_LEFT).':'.str_pad($minute, 2, \"0\", STR_PAD_LEFT).':00';\n return $time;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CCK formatter theme for the emfield. This will call theme_fancybox_emvideo. | function theme_fancybox_formatter_emvideo_fancybox_video($element) {
$field = content_fields($element['#field_name'], $element['#type_name']);
$item = $element['#item'];
$formatter = "emvideo";
$node = node_load($element['#node']->nid);
return module_invoke('emfield', 'emfield_field_formatter', $field, $item, $formatter, $node, 'fancybox');
} | [
"function theme_brightcove_cck_formatter_default($element) {\n if (isset($element['#item']['video_id'])) {\n $bc = _brightcove_initialize();\n // We need to write a BC JavaScript to the page, which is not possible\n // with a simple drupal_add_js(), inline is needed.\n $script = 'document.write(unescape(\"%3Cscript src=\\'http://admin.brightcove.com/js/BrightcoveExperiences.js\\' type=\\'text/javascript\\'%3E%3C/script%3E\"));';\n drupal_add_js($script, 'inline', 'header');\n $player = $bc->embed('video', variable_get('brightcove_player', ''), $element['#item']['video_id'], $params);\n }\n if ($player) {\n return theme('brightcove_cck_player', $player, $element['#item']['video_id']);\n }\n}",
"function geeks_curiosity_use_post_format(){\r\n add_theme_support( 'post-formats', array( 'video', 'status' ) );\r\n}",
"function _preview_theme_template_filter() {}",
"function et3_theme_framework_post_video() {\n\n global $opt_meta_options, $wp_embed;\n\n /* no video. */\n if(empty($opt_meta_options['opt-video-type'])) {\n et3_theme_framework_post_thumbnail();\n return;\n }\n\n if($opt_meta_options['opt-video-type'] == 'local' && !empty($opt_meta_options['otp-video-local']['id'])){\n\n $video = wp_get_attachment_metadata($opt_meta_options['otp-video-local']['id']);\n\n echo do_shortcode('[video width=\"'.esc_attr($opt_meta_options['otp-video-local']['width']).'\" height=\"'.esc_attr($opt_meta_options['otp-video-local']['height']).'\" '.$video['fileformat'].'=\"'.esc_url($opt_meta_options['otp-video-local']['url']).'\" poster=\"'.esc_url($opt_meta_options['otp-video-thumb']['url']).'\"][/video]');\n\n } elseif($opt_meta_options['opt-video-type'] == 'youtube' && !empty($opt_meta_options['opt-video-youtube'])) {\n\n echo do_shortcode($wp_embed->run_shortcode('[embed]'.esc_url($opt_meta_options['opt-video-youtube']).'[/embed]'));\n\n } elseif($opt_meta_options['opt-video-type'] == 'vimeo' && !empty($opt_meta_options['opt-video-vimeo'])) {\n\n echo do_shortcode($wp_embed->run_shortcode('[embed]'.esc_url($opt_meta_options['opt-video-vimeo']).'[/embed]'));\n\n }\n}",
"function _preview_theme_template_filter()\n{\n}",
"function alnp_hook_demo_load_before_content_post_format_video() {\n\talnp_hook_demo_before_box( sprintf( __( 'This box was added before the content for posts with a video or a video playlist using \"%s\"', 'alnp-action-hooks-demonstration' ), '<em>alnp_load_before_content_post_format_video</em>' ) );\n}",
"function post_format_output() { \n if ( ! get_post_format() ): // Standard\n get_template_part( 'formats/format', 'standard' );\n elseif ( 'gallery' == get_post_format() ): // Gallery\n get_template_part( 'formats/format', 'gallery' );\n elseif ( 'video' == get_post_format() ): // Video\n get_template_part( 'formats/format', 'video' );\n elseif ( 'audio' == get_post_format() ): // Audio\n get_template_part( 'formats/format', 'audio' );\n endif;\n }",
"function construct_video($node, $format_name, $field_name = 'field_video_file')\n{\n $video_output = array();\n $video_intance = $node->$field_name;\n if (!empty($video_intance['und'][0])) {\n $video_settings = _videojs_settings($format_name);\n //video file\n $video_render_array = field_view_field(\n 'node',\n $node,\n 'field_video_file',\n array(\n 'type' => 'videojs',\n 'label' => 'hidden',\n 'settings' => $video_settings,\n )\n );\n\n if ($video_settings['width'] == 1) {\n $video_render_array[0]['#attributes']['width'] = '100%';\n }\n\n $video_output = $video_render_array;\n }\n return $video_output;\n}",
"function theme_emvideo_shadowbox($field, $item, $formatter, $node, $options = array()) {\n $options['modal'] = 'shadowbox';\n return theme('emvideo_modal_generic', $field, $item, $formatter, $node, $options);\n}",
"function cspm_post_format_and_media(){\r\n\t\t\t\r\n\t\t\t$fields = array();\r\n\t\t\t\r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'name' => 'Format & Media',\r\n\t\t\t\t'desc' => 'Set your post format & open it inside a modal. You can pop-up the single post or the media files only. Choose your post/location format and upload the media files.',\r\n\t\t\t\t'type' => 'title',\r\n\t\t\t\t'id' => $this->metafield_prefix . '_format_and_media',\r\n\t\t\t\t'attributes' => array(\r\n\t\t\t\t\t'style' => 'font-size:20px; color:#008fed; font-weight:400;'\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$nearby_palces_option = (!class_exists('CspmNearbyMap')) ? '<strike>Nearby Places Map</strike> <small style=\"color:red;\">(This option requires the addon <a href=\"https://codecanyon.net/item/nearby-places-wordpress-plugin/15067875?ref=codespacing\" target=\"_blank\" class=\"cspm_blank_link\">\"Nearby Places\"</a>!)</small>' : 'Nearby Places Map';\r\n\t\t\t$nearby_palces_option_desc = (!class_exists('CspmNearbyMap')) ? '' : '<br /><span style=\"color:red;\"><u>Note:</u> When using the option <strong>\"Nearby Places Map\"</strong>, make sure to create a new page and assign it to the template page <strong>\"Nearby Places Modal\"</strong>!</span>';\r\n\t\t\t\r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_format',\r\n\t\t\t\t'name' => 'Format',\r\n\t\t\t\t'desc' => 'Select the format. Default \"Standard\". By clicking on the post marker, \r\n\t\t\t\t\t\t the post link or media files will be opened inside a modal/popup! '.$nearby_palces_option_desc,\r\n\t\t\t\t'type' => 'radio',\t\t\t\t\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'standard' => 'Standard',\r\n\t\t\t\t\t'link' => 'Link (Single post page)',\r\n\t\t\t\t\t'nearby_places' => $nearby_palces_option,\r\n\t\t\t\t\t'gallery' => 'Gallery',\r\n\t\t\t\t\t'image' => 'Image',\r\n\t\t\t\t\t'audio' => 'Audio',\r\n\t\t\t\t\t'embed' => 'Embed (Video, Audio playlist, Website and more)',\r\n\t\t\t\t\t'all' => 'All Media',\r\n\t\t\t\t),\r\n\t\t\t\t'default' => 'standard',\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'id' => $this->metafield_prefix . '_enable_media_marker_click',\r\n\t\t\t\t'name' => 'Open media files on marker click?',\r\n\t\t\t\t'desc' => 'By default, when a user clicks on a marker, the media files will pop up on the screen. \r\n\t\t\t\t\t\t You can disable this option from here. Defaults to \"Yes\".<br />\r\n\t\t\t\t\t\t <span style=\"color:red;\"><u>Note:</u> Media files can also be displayed from the map settings under \"Marker menu settings => \"Media Modal\" link\"!</span>',\r\n\t\t\t\t'type' => 'radio_inline',\r\n\t\t\t\t'default' => 'yes',\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'yes' => 'Yes',\r\n\t\t\t\t\t'no' => 'No',\r\n\t\t\t\t),\t\t\t\t\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Gallery */\r\n\t\t\t \r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'name' => 'Gallery',\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_gallery',\r\n\t\t\t\t'type' => 'file_list',\r\n\t\t\t\t'desc' => 'Upload images. You can sort image by draging an image to the location where you want it to be.<br />\r\n\t\t\t\t\t\t <span style=\"color:red;\">To be used with the format \"Gallery\" or \"All\"!</span>',\r\n\t\t\t\t'text' => array(\r\n\t\t\t\t\t'add_upload_files_text' => 'Upload image(s)',\r\n\t\t\t\t),\r\n\t\t\t\t'preview_size' => array( 70, 50 ),\r\n\t\t\t\t'query_args' => array(\r\n\t\t\t\t\t'type' => 'image',\r\n\t\t\t\t)\t\t\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Image */\r\n\t\t\t \r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'name' => 'Image',\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_image',\r\n\t\t\t\t'type' => 'file',\r\n\t\t\t\t'desc' => 'Add or upload the image. <span style=\"color:red;\">To be used with the format \"Image\" or \"All\"!</span>',\r\n\t\t\t\t'text' => array(\r\n\t\t\t\t\t'add_upload_file_text' => 'Upload image',\r\n\t\t\t\t),\r\n\t\t\t\t'preview_size' => array( 100, 100 ),\r\n\t\t\t\t'query_args' => array(\r\n\t\t\t\t\t'type' => 'image',\r\n\t\t\t\t),\r\n\t\t\t\t'options' => array(\r\n\t\t\t\t\t'url' => false\r\n\t\t\t\t),\t\t\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Audio */\r\n\t\t\t \r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'name' => 'Audio',\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_audio',\r\n\t\t\t\t'type' => 'file',\r\n\t\t\t\t'desc' => 'Add or upload the audio file. <span style=\"color:red;\">To be used with the format \"Audio\" or \"All\"!</span>',\r\n\t\t\t\t'text' => array(\r\n\t\t\t\t\t'add_upload_file_text' => 'Upload audio file',\r\n\t\t\t\t),\r\n\t\t\t\t'preview_size' => array( 100, 100 ),\r\n\t\t\t\t'query_args' => array(\r\n\t\t\t\t\t'type' => 'audio',\r\n\t\t\t\t)\t\t\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Embed */\r\n\t\t\t \r\n\t\t\t$fields[] = array(\r\n\t\t\t\t'id' => $this->metafield_prefix . '_post_embed',\r\n\t\t\t\t'name' => 'Embed URL',\r\n\t\t\t\t'desc' => 'Enter the URL that should be embedded. It could be a video (Youtube, vimeo ...) URL, Audio playlist URL, Website URL and more. <span style=\"color:red;\">To be used with the format \"Embed\" or \"All\"!</span><br />\r\n\t\t\t\t\t\t <span style=\"color:red\">Check the list of supported services <a href=\"https://wordpress.org/support/article/embeds/\" target=\"_blank\" class=\"cspm_blank_link\">https://wordpress.org/support/article/embeds/</a>.<br />\r\n\t\t\t\t\t\t If the URL is a valid url to a supported provider, the plugin will use the embed code provided to it. Otherwise, it will be ignored!</span>',\r\n\t\t\t\t'type' => 'text_url',\r\n\t\t\t);\r\n\r\n\t\t\treturn $fields;\r\n\t\t\t\t\t\t \r\n\t\t}",
"function wconsumer_vimeo_field_widget_process($element, &$form_state, $form) {\n \n $element['#attached']['css'][] = drupal_get_path('module', 'wconsumer_vimeo') . '/wconsumer_vimeo.css';\n $element['#attached']['js'][] = drupal_get_path('module', 'wconsumer_vimeo') . '/wconsumer_vimeo.js';\n \n // add jquery colorbox library\n $element['#attached']['css'][] = drupal_get_path('module', 'wconsumer_vimeo') . '/js/jquery.colorbox/colorbox.css';\n $element['#attached']['js'][] = drupal_get_path('module', 'wconsumer_vimeo') . '/js/jquery.colorbox/jquery.colorbox-min.js';\n \n $element['#attached']['js'][] = drupal_get_path('module', 'wconsumer_vimeo') . '/js/html5uploader/html5uploader.js';\n \n if (!empty($element['#value']))\n $item = $element['#value'];\n else\n $item = array();\n \n $element['vvid'] = array(\n '#type' => 'hidden',\n '#default_value' => isset($item['vvid']) ? $item['vvid'] : '',\n );\n \n $element['#theme'] = 'wconsumer_vimeo_widget';\n\n return $element;\n}",
"function exultic_post_formats($post) {\r\n remove_meta_box(\r\n 'formatdiv',\r\n $post->post_type,\r\n 'side'\r\n );\r\n add_meta_box(\r\n 'exultic_formatdiv ',\r\n _x('Format', 'post format'),\r\n 'exultic_format_meta_box',\r\n $post->post_type,\r\n 'normal',\r\n 'high'\r\n );\r\n}",
"function emaudio_odeo_preview($embed, $width, $height, $field, $item, $autoplay) {\n $output = theme('emaudio_odeo_flash', $embed, $width, $height, $autoplay);\n return $output;\n}",
"function gp_add_post_formats_support() {\r\n\t\tadd_theme_support(\r\n\t\t\t'post-formats', \r\n\t\t\tarray(\r\n\t\t\t\t'audio',\r\n\t\t\t\t'gallery',\r\n\t\t\t\t'video',\r\n\t\t\t\t'quote'\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t}",
"function crb_attach_theme_options() {\n Container::make( 'theme_options', __( 'Custom Code', 'crb' ) )\n ->add_fields( array(\n Field::make( 'textarea', 'mos_additional_coding', 'Additional Coding' ),\n ));\n Container::make( 'post_meta', 'Event Data' )\n ->where( 'post_type', '=', 'event' )\n ->add_fields( array(\n Field::make( 'media_gallery', 'event-gallery', __( 'Media Gallery' ) )\n ->set_type( array( 'image', 'video' ) ),\n Field::make( 'date', 'event-date', __( 'Event Date' ) )\n ->set_attribute( 'placeholder', __( 'Event Date' ) )\n ->set_storage_format( 'Y-m-d' ),\n Field::make( 'text', 'event-location', __( 'Event Location' ) ),\n ));\n Container::make( 'post_meta', 'Job Data' )\n ->where( 'post_type', '=', 'job' )\n ->add_fields( array(\n Field::make( 'select', 'job-job-type', __( 'Job Type' ) )\n ->set_options( array(\n 'FullTime' => 'Full-Time',\n 'PartTime' => 'Part-Time',\n 'Contract' => 'Contractual',\n 'Intern' => 'Intern',\n )),\n Field::make( 'text', 'job-nov', __( 'No. of Vacancies' ) ),\n Field::make( 'date', 'job-deadline', __( 'Deadline' ) )\n ->set_attribute( 'placeholder', __( 'Deadline' ) )\n ->set_storage_format( 'Y-m-d' ),\n Field::make( 'text', 'job-link', __( 'Apply Link' ) ),\n ));\n Container::make( 'post_meta', 'Case Study Data' )\n ->where( 'post_type', '=', 'case-study' )\n ->add_fields( array(\n Field::make( 'text', 'case-study-company-name', __( 'Company Name' ) ),\n Field::make( 'image', 'case-study-company-logo', __( 'Logo' ) ),\n Field::make( 'rich_text', 'case-study-company-about', __( 'About Company' ) ),\n Field::make( 'text', 'case-study-industry', __( 'Industry' ) ),\n Field::make( 'complex', 'case-study-company-data', __( 'Company data' ) )\n ->add_fields( array(\n Field::make( 'text', 'case-study-company-data-title', __( 'Title' ) ),\n Field::make( 'text', 'case-study-company-data-value', __( 'Value' ) ),\n )), \n Field::make( 'text', 'case-study-client-name', __( 'Client Name' ) ),\n Field::make( 'image', 'case-study-client-image', __( 'Client Image' ) ),\n Field::make( 'text', 'case-study-client-position', __( 'Client Position' ) ), \n /*Field::make( 'multiselect', 'case-study-working-areas', __( 'Working Areas' ) )\n ->set_options( array(\n 'Appointment Setting' => 'Appointment Setting',\n 'Software Development' => 'Software Development',\n 'Advertising & Marketing' => 'Advertising & Marketing',\n )),*/\n Field::make( 'complex', 'case-study-results', __( 'Results' ) )\n ->add_fields( array(\n Field::make( 'text', 'case-study-results-title', __( 'Title' ) ),\n Field::make( 'text', 'case-study-results-value', __( 'Value' ) ),\n Field::make( 'text', 'case-study-results-suffix', __( 'Suffix' ) ),\n )),\n Field::make( 'rich_text', 'case-study-short-description', __( 'Short Description' ) ),\n Field::make( 'text', 'case-study-oembed', __( 'Embeded Video' ) ),\n Field::make( 'complex', 'case-study-team', __( 'Team' ) )\n ->add_fields( array(\n Field::make( 'text', 'case-study-team-name', __( 'Title' ) ),\n Field::make( 'text', 'case-study-team-position', __( 'Position' ) ),\n Field::make( 'image', 'case-study-team-image', __( 'Image' ) ),\n )),\n \n ));\n Block::make( __( 'Mos Image Block' ) )\n ->add_fields( array(\n Field::make( 'text', 'mos-image-heading', __( 'Heading' ) ),\n Field::make( 'image', 'mos-image-media', __( 'Image' ) ),\n Field::make( 'rich_text', 'mos-image-content', __( 'Content' ) ),\n //Field::make( 'color', 'mos-image-hr', __( 'Border Color' ) ),\n Field::make( 'text', 'mos-image-btn-title', __( 'Button' ) ),\n Field::make( 'text', 'mos-image-btn-url', __( 'URL' ) ),\n Field::make( 'select', 'mos-image-alignment', __( 'Content Alignment' ) )\n ->set_options( array(\n 'left' => 'Left',\n 'right' => 'Right',\n 'center' => 'Center',\n ))\n ))\n ->set_icon( 'id-alt' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-image-block-wrapper <?php echo $attributes['className'] ?>\">\n <div class=\"mos-image-block text-<?php echo esc_html( $fields['mos-image-alignment'] ) ?>\">\n <?php if ($fields['mos-image-media']) : ?>\n <div class=\"img-part\"><?php echo wp_get_attachment_image( $fields['mos-image-media'], 'full' ); ?></div>\n <?php endif?>\n <div class=\"text-part\">\n <?php if ($fields['mos-image-heading']) : ?>\n <h4><?php echo esc_html( $fields['mos-image-heading'] ); ?></h4>\n <?php endif?> \n <?php if ($fields['mos-image-content']) :?>\n <div class=\"desc\"><?php echo apply_filters( 'the_content', $fields['mos-image-content'] ); ?></div> \n <?php endif?> \n <?php if ($fields['mos-image-btn-title'] && $fields['mos-image-btn-url']) :?> \n <div class=\"wp-block-buttons\"><div class=\"wp-block-button\"><a href=\"<?php echo esc_url( $fields['mos-image-btn-url'] ); ?>\" title=\"\" class=\"wp-block-button__link\"><?php echo do_shortcode( $fields['mos-image-btn-title'] ); ?></a></div></div> \n <?php endif?> \n </div>\n </div>\n </div>\n <?php\n });\n Block::make( __( 'Mos Icon Block' ) )\n ->add_fields( array(\n Field::make( 'text', 'mos-icon-heading', __( 'Heading' ) ),\n Field::make( 'text', 'mos-icon-class', __( 'Icon Class' ) ),\n Field::make( 'color', 'mos-icon-color', __( 'Color' ) ),\n Field::make( 'textarea', 'mos-icon-content', __( 'Content' ) ),\n Field::make( 'select', 'mos-icon-alignment', __( 'Content Alignment' ) )\n ->set_options( array(\n 'left' => 'Left',\n 'right' => 'Right',\n 'center' => 'Center',\n ))\n ))\n ->set_description( __( 'Use Font Awesome in <b>Icon class</b>, you can find Fontawesome <a href=\"https://fontawesome.com/v4.7.0/cheatsheet/\">Here</a>.' ) )\n ->set_icon( 'editor-customchar' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-icon-block-wrapper <?php echo $attributes['className'] ?>\">\n <div class=\"mos-icon-block text-<?php echo esc_html( $fields['mos-icon-alignment'] ) ?>\">\n <?php if ($fields['mos-icon-class']) : ?>\n <div class=\"icon-part\"><i class=\"fa <?php echo esc_html( $fields['mos-icon-class'] ); ?>\" style=\"--color:<?php echo esc_html( $fields['mos-icon-color'] ); ?>\"></i></div>\n <?php endif;?>\n <div class=\"text-part\">\n <?php if ($fields['mos-icon-heading']) : ?>\n <h4><?php echo esc_html( $fields['mos-icon-heading'] ); ?></h4>\n <?php endif;?>\n <?php if ($fields['mos-icon-content']) : ?>\n <div class=\"desc\"><?php echo $fields['mos-icon-content']; ?></div> \n <?php endif;?>\n </div>\n </div>\n </div>\n <?php\n });\n Block::make( __( 'Mos SVG Block' ) )\n ->add_fields( array(\n Field::make( 'text', 'mos-svg-heading', __( 'Heading' ) ),\n Field::make( 'textarea', 'mos-svg-code', __( 'SVG Code' ) ),\n Field::make( 'rich_text', 'mos-svg-content', __( 'Content' ) ),\n Field::make( 'text', 'mos-svg-btn-title', __( 'Button' ) ),\n Field::make( 'text', 'mos-svg-btn-url', __( 'URL' ) ),\n Field::make( 'select', 'mos-svg-alignment', __( 'Content Alignment' ) )\n ->set_options( array(\n 'left' => 'Left',\n 'right' => 'Right',\n 'center' => 'Center',\n ))\n ))\n ->set_icon( 'editor-customchar' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-svg-block-wrapper <?php echo $attributes['className'] ?>\">\n <div class=\"mos-svg-block text-<?php echo esc_html( $fields['mos-svg-alignment'] ) ?>\">\n <?php if ($fields['mos-svg-code']) : ?>\n <div class=\"svg-part\"><?php echo $fields['mos-svg-code']; ?></div>\n <?php endif;?>\n <div class=\"text-part\">\n <?php if ($fields['mos-svg-heading']) : ?>\n <h4><?php echo esc_html( $fields['mos-svg-heading'] ); ?></h4>\n <?php endif;?>\n <?php if ($fields['mos-svg-content']) : ?>\n <div class=\"desc\"><?php echo $fields['mos-svg-content']; ?></div> \n <?php endif;?> \n <?php if ($fields['mos-svg-btn-title'] && $fields['mos-svg-btn-url']) :?> \n <div class=\"wp-block-buttons\"><div class=\"wp-block-button\"><a href=\"<?php echo esc_url( $fields['mos-svg-btn-url'] ); ?>\" title=\"\" class=\"wp-block-button__link\"><?php echo esc_html( $fields['mos-svg-btn-title'] ); ?></a></div></div> \n <?php endif?> \n </div>\n </div>\n </div>\n <?php\n });\n Block::make( __( 'Mos Counter Block' ) )\n ->add_fields( array(\n Field::make( 'text', 'mos-counter-prefix', __( 'Prefix' ) ),\n Field::make( 'text', 'mos-counter-number', __( 'Number' ) ),\n Field::make( 'text', 'mos-counter-suffix', __( 'Suffix' ) ),\n Field::make( 'color', 'mos-counter-color', __( 'Heading Color' ) ),\n Field::make( 'color', 'mos-counter-text-color', __( 'Text Color' ) ),\n Field::make( 'textarea', 'mos-counter-content', __( 'Content' ) ),\n Field::make( 'select', 'mos-counter-alignment', __( 'Content Alignment' ) )\n ->set_options( array(\n 'left' => 'Left',\n 'right' => 'Right',\n 'center' => 'Center',\n ))\n ))\n ->set_icon( 'clock' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-counter-block-wrapper <?php echo $attributes['className'] ?>\">\n <div class=\"mos-counter-block text-<?php echo esc_html( $fields['mos-counter-alignment'] ) ?>\">\n <h2 style=\"color: <?php echo esc_html( $fields['mos-counter-color'] ); ?>\"><span class=\"prefix\"><?php echo esc_html( $fields['mos-counter-prefix'] ); ?></span><span class='counter' data-min='1' data-counterup-time=\"1500\"><?php echo esc_html( $fields['mos-counter-number'] ); ?></span><span class=\"suffix\"><?php echo esc_html( $fields['mos-counter-suffix'] ); ?></span></h2>\n <div class=\"mb-0\" style=\"color: <?php echo esc_html( $fields['mos-counter-text-color'] ); ?>\"><?php echo esc_html( $fields['mos-counter-content'] ); ?></div>\n </div>\n </div>\n <?php\n });\n Block::make( __( 'Mos Pricing Block' ) )\n ->add_fields( array(\n Field::make( 'text', 'mos-pricing-title', __( 'Heading' ) ),\n Field::make( 'text', 'mos-pricing-symbol', __( 'Symbol' ) ),\n Field::make( 'text', 'mos-pricing-amount', __( 'Amount' ) ),\n Field::make( 'text', 'mos-pricing-period', __( 'Period' ) )\n ->set_attribute( 'placeholder', 'Ex: per clean / billed weekly' ),\n Field::make( 'text', 'mos-pricing-subtitle', __( 'Sub Heading' ) ),\n Field::make( 'textarea', 'mos-pricing-desc', __( 'Desacription' ) ),\n Field::make( 'complex', 'mos-pricing-features', __( 'Features' ) )\n ->add_fields( array(\n Field::make( 'text', 'item', __( 'Feature' ) ),\n )),\n Field::make( 'text', 'mos-pricing-btn-title', __( 'Button' ) ),\n Field::make( 'text', 'mos-pricing-btn-url', __( 'URL' ) ),\n Field::make( 'select', 'mos-pricing-alignment', __( 'Content Alignment' ) )\n ->set_options( array(\n 'left' => 'Left',\n 'right' => 'Right',\n 'center' => 'Center',\n ))\n ))\n ->set_icon( 'list-view' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-pricing-wrapper <?php echo $attributes['className'] ?>\">\n <div class=\"mos-pricing text-<?php echo esc_html( $fields['mos-pricing-alignment'] ) ?>\"> \n <div class=\"title-part\">\n <h3><?php echo esc_html( $fields['mos-pricing-title'] ); ?></h3>\n </div>\n <div class=\"pricing-part\">\n <div class=\"pricing-value\"> <span class=\"pricing-symbol\"><?php echo esc_html( $fields['mos-pricing-symbol'] ); ?></span> <span class=\"pricing-amount\"><?php echo esc_html( $fields['mos-pricing-amount'] ); ?></span> <span class=\"plan-period\"><?php echo esc_html( $fields['mos-pricing-period'] ); ?></span>\n </div>\n </div>\n <?php if ($fields['mos-pricing-subtitle']) : ?>\n <h5 class=\"desc-subtitle\"><?php echo esc_html( $fields['mos-pricing-subtitle'] ); ?></h5>\n <?php endif?>\n <?php if ($fields['mos-pricing-desc']) : ?>\n <div class=\"desc-part\"><?php echo esc_html( $fields['mos-pricing-desc'] ); ?></div>\n <?php endif?>\n \n <?php if (sizeof(@$fields['mos-pricing-features'])) : ?>\n <div class=\"features-part\">\n <ul class=\"pricing-features\">\n <?php foreach ($fields['mos-pricing-features'] as $value) : ?>\n <li><?php echo $value['item'] ?></li>\n <?php endforeach;?>\n </ul>\n </div>\n <?php endif?>\n \n <?php if($fields['mos-pricing-btn-title'] && $fields['mos-pricing-btn-url']) : ?>\n <div class=\"wp-block-buttons\"><div class=\"wp-block-button\"><a href=\"<?php echo esc_html( $fields['mos-pricing-btn-url'] ); ?>\" title=\"\" class=\"wp-block-button__link\"><?php echo esc_html( $fields['mos-pricing-btn-title'] ); ?></a></div></div>\n <?php endif;?>\n \n </div>\n </div>\n <?php\n });\n Block::make( __( 'Mos 3 Column CTA' ) )\n ->add_fields( array(\n Field::make( 'text', 'mos-3ccta-heading', __( 'Heading' ) ), \n Field::make( 'image', 'mos-3ccta-media', __( 'Image' ) ),\n Field::make( 'text', 'mos-3ccta-link', __( 'Link' ) ),\n Field::make( 'textarea', 'mos-3ccta-content', __( 'Content' ) ),\n Field::make( 'image', 'mos-3ccta-bgimage', __( 'Background Image' ) ),\n Field::make( 'color', 'mos-3ccta-bgcolor', __( 'Background Color' ) ),\n ))\n ->set_icon( 'phone' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-3ccta-wrapper <?php echo $attributes['className'] ?>\" style=\"<?php if ($fields['mos-3ccta-bgcolor']) echo 'background-color:'.esc_html($fields['mos-3ccta-bgcolor']).';' ?><?php if ($fields['mos-3ccta-bgimage']) echo 'background-image:url('.wp_get_attachment_url($fields['mos-3ccta-bgimage']).');' ?>\">\n <div class=\"mos-3ccta\">\n <div class=\"call-left\">\n <h3><?php echo esc_html( $fields['mos-3ccta-heading'] ); ?></h3>\n </div>\n <div class=\"call-center\">\n <a href=\"<?php echo esc_url( $fields['mos-3ccta-link'] ); ?>\" class=\"\" target=\"_blank\"><?php echo wp_get_attachment_image( $fields['mos-3ccta-media'], 'full' ); ?></a>\n </div>\n <div class=\"call-right\">\n <div class=\"desc\"><?php echo esc_html( $fields['mos-3ccta-content'] ); ?></div>\n </div>\n </div>\n </div>\n <?php\n });\n Block::make( __( 'Mos Services Block' ) )\n ->add_fields( array(\n Field::make( 'select', 'mos-services-block-view', __( 'View' ) )\n ->set_options( array(\n 'carousel' => 'Slider',\n 'block' => 'Block',\n 'block-2' => 'Basic Block',\n )),\n Field::make( 'select', 'mos-services-block-grid', __( 'Large Device Grid' ) )\n ->set_options( array(\n '1' => 'Single Column',\n '2' => 'Two Column',\n '3' => 'Three Column',\n '4' => 'Four Column',\n '5' => 'Five Column',\n )),\n Field::make( 'select', 'mos-services-block-grid-md', __( 'Medium Device Grid' ) )\n ->set_options( array(\n '1' => 'Single Column',\n '2' => 'Two Column',\n '3' => 'Three Column',\n '4' => 'Four Column',\n '5' => 'Five Column',\n )),\n Field::make( 'select', 'mos-services-block-grid-sm', __( 'Small Device Grid' ) )\n ->set_options( array(\n '1' => 'Single Column',\n '2' => 'Two Column',\n '3' => 'Three Column',\n '4' => 'Four Column',\n '5' => 'Five Column',\n )),\n Field::make( 'select', 'mos-services-block-autoplay', __( 'Autoplay' ) )\n ->set_options( array(\n 'true' => 'Enable',\n 'false' => 'Disable'\n )),\n Field::make( 'text', 'mos-services-block-autoplay-speed', __( 'Autoplay Speed' ) )\n ->set_attribute( 'placeholder', '2000' ),\n Field::make( 'text', 'image_size', __( 'Image Size' ) )\n ->set_attribute( 'placeholder', 'width,height. Ex: 370,370' ),\n Field::make( 'complex', 'mos-services-block-slider', __( 'Services' ) )\n ->add_fields( array(\n Field::make( 'image', 'media', __( 'Image' ) ),\n Field::make( 'text', 'title', __( 'Heading' ) ),\n Field::make( 'textarea', 'desc', __( 'Desacription' ) ),\n Field::make( 'text', 'btn-title', __( 'Button' ) ),\n Field::make( 'text', 'btn-url', __( 'URL' ) ),\n )),\n Field::make( 'select', 'mos-services-block-alignment', __( 'Content Alignment' ) )\n ->set_options( array(\n 'left' => 'Left',\n 'right' => 'Right',\n 'center' => 'Center',\n ))\n ))\n ->set_icon( 'list-view' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-services-block-wrapper <?php echo $fields['mos-services-block-view'] ?> <?php echo $attributes['className'] ?>\">\n <?php //var_dump($fields['mos-services-block-grid-sm']) ?>\n <?php if (sizeof($fields['mos-services-block-slider'])) : ?>\n <?php\n $data_slick = 'slick-slider';\n $slidesToScroll = ($fields['mos-services-block-grid'])?$fields['mos-services-block-grid']:1;\n $slidesToScroll_782 = ($fields['mos-services-block-grid-md'])?$fields['mos-services-block-grid-md']:1;\n $slidesToScroll_600 = ($fields['mos-services-block-grid-sm'])?$fields['mos-services-block-grid-sm']:1;\n if ($fields['mos-services-block-view'] == 'carousel') {\n $autoplay = ($fields['mos-services-block-autoplay'])?$fields['mos-services-block-autoplay']:true;\n $autoplaySpeed = ($fields['mos-services-block-autoplay-speed'])?$fields['mos-services-block-autoplay-speed']:2000;\n $cls = 'slick-slider';\n $data_slick = '{\"slidesToShow\": '.$slidesToScroll.',\"slidesToScroll\": '.$slidesToScroll.',\"autoplay\": '.$autoplay.',\"autoplaySpeed\": '.$autoplaySpeed.',\"dots\": true,\"arrows\":false,\"responsive\": [{\"breakpoint\": 782,\"settings\": {\"slidesToShow\": '.$slidesToScroll_782.',\"slidesToScroll\": '.$slidesToScroll_782.'}},{\"breakpoint\": 600,\"settings\": {\"arrows\": true,\"dots\": false,\"slidesToShow\": '.$slidesToScroll_600.',\"slidesToScroll\": '.$slidesToScroll_600.'}}]}';\n } else {\n $cls = 'block-view block-view-'.$slidesToScroll.' block-view-md-'.$slidesToScroll_782.' block-view-sm-'.$slidesToScroll_600;\n }\n ?>\n <div class=\"mos-services-block text-<?php echo esc_html( $fields['mos-services-block-alignment'] ) ?> <?php echo $cls ?>\" data-slick='<?php echo $data_slick ?>'>\n <?php foreach($fields['mos-services-block-slider'] as $slide) : ?>\n <div class=\"item\" id=\"item-<?php echo $slide['_id']?>\">\n <div class=\"line-filter-outer\"> \n <div class=\"line-filter-media\">\n <?php if ($slide['media']) : \n $width = 370;\n $height = 370;\n if ($fields['image_size']){\n $parts = explode(',',$fields['image_size']);\n $width = ($parts[0])?intval($parts[0]):370;\n $height = ($parts[1])?intval($parts[1]):370;\n }\n ?> \n <a class=\"d-block\" href=\"<?php echo ($slide['btn-url'])?$slide['btn-url']:'#' ?>\">\n <img width=\"<?php echo $width ?>\" height=\"<?php echo $height ?>\" src=\"<?php echo aq_resize(wp_get_attachment_url($slide['media']),$width,$height,true) ?>\" class=\"attachment-industroz-projects-carousel size-industroz-projects-carousel wp-post-image\" alt=\"\" loading=\"lazy\">\n </a>\n <?php endif?>\n <div class=\"hover-effect-1\">\n <div class=\"hover-effect-content\">\n <?php echo do_shortcode($slide['desc']) ?>\n </div>\n </div>\n </div>\n \n <div class=\"line-filter bg-theme p-30\">\n <div class=\"filter-content\">\n <h3 class=\"mb-0 text-capitalize mos-services-block-title\"> <a class=\"text-white\" href=\"<?php echo ($slide['btn-url'])?$slide['btn-url']:'#' ?>\"><?php echo do_shortcode($slide['title']) ?></a></h3>\n <?php if ($slide['btn-title']) : ?> \n <a href=\"<?php echo ($slide['btn-url'])?$slide['btn-url']:'#' ?>\" class=\"site-button-link mt-10 text-white\"><?php echo $slide['btn-title'] ?></a>\n <?php endif;?>\n </div>\n </div>\n </div>\n </div>\n <?php endforeach;?>\n </div>\n <?php endif;?>\n </div>\n <?php\n });\n Block::make( __( 'Mos FAQ Block' ) )\n ->add_fields( array(\n Field::make( 'text', 'mos-faq-question', __( 'Question' ) ),\n Field::make( 'textarea', 'mos-faq-answer', __( 'Answer' ) ),\n Field::make( 'color', 'mos-faq-qcolor', __( 'Question Color' ) ),\n Field::make( 'color', 'mos-faq-acolor', __( 'Answer Color' ) ),\n Field::make( 'select', 'mos-faq-alignment', __( 'Content Alignment' ) )\n ->set_options( array(\n 'left' => 'Left',\n 'right' => 'Right',\n 'center' => 'Center',\n ))\n ))\n ->set_icon( 'warning' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-faq-block-wrapper <?php echo $attributes['className'] ?>\">\n <div class=\"mos-faq-block text-<?php echo esc_html( $fields['mos-faq-alignment'] ) ?>\">\n <dl class=\"faq-wrapper\">\n\t\t\t\t\t<dt class=\"faq-question\" style=\"color: <?php echo esc_html( $fields['mos-faq-qcolor'] ); ?>\"><?php echo esc_html( $fields['mos-faq-question'] ); ?></dt>\n\t\t\t\t\t<dd class=\"faq-answer\" style=\"color: <?php echo esc_html( $fields['mos-faq-acolor'] ); ?>\"><?php echo esc_html( $fields['mos-faq-answer'] ); ?></dd>\n\t\t\t\t</dl>\n </div>\n </div>\n <?php\n });\n Block::make( __( 'Mos Case Studies Block' ) )\n ->add_fields( array(\n Field::make( 'text', 'mos-case-study-block-nop', __( 'No of Posts' ) ),\n Field::make( 'multiselect', 'mos-case-study-block-posts', __( 'Select Posts' ) )\n ->set_options( mos_get_posts('case-study')), \n Field::make( 'multiselect', 'mos-case-study-block-categories', __( 'Select Categories' ) )\n ->set_options( mos_get_terms ('case_study_category', 'small')),\n\n Field::make( 'select', 'mos-case-study-block-grid', __( 'Grid' ) )\n ->set_options( array(\n 'six' => 'Two Grids',\n 'four' => 'Three Grids',\n 'three' => 'Four Grids',\n )),\n Field::make( 'select', 'mos-case-study-block-gap', __( 'Gap' ) )\n ->set_options( array(\n 'gap-default' => 'Default',\n 'gap-sm' => 'Small Gap',\n 'gap-md' => 'Medium Gap',\n 'gap-lg' => 'Large Gap',\n )),\n ))\n ->set_icon( 'admin-post' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n $grid = (@$fields['mos-case-study-block-grid'])?$fields['mos-case-study-block-grid']:'six';\n $gap = (@$fields['mos-case-study-block-gap'])?$fields['mos-case-study-block-gap']:'gap-default';\n $options = array(\n 'post_type' => 'case-study'\n ); \n if (@$fields['mos-case-study-block-categories'] && sizeof($fields['mos-case-study-block-categories'])) {\n //$options['category__in'] = $fields['mos-case-study-block-categories'];\n $options['tax_query'][] = array(\n 'taxonomy' => 'case_study_category',\n 'field' => 'id',\n 'terms' => $fields['mos-case-study-block-categories'],\n );\n $options['posts_per_page'] = ($fields['mos-case-study-block-nop'])?$fields['mos-case-study-block-nop']:-1;\n } elseif (@$fields['mos-case-study-block-posts'] && sizeof($fields['mos-case-study-block-posts'])) {\n $options['post__in'] = $fields['mos-case-study-block-posts']; \n }\n $query = new WP_Query( $options );\n if ( $query->have_posts() ) : ?>\n <div class=\"mos-case-study-block-wrapper case-wrapper <?php echo $attributes['className'] ?>\">\n <div class=\"mos-case-study-block mos-post-grid <?php echo $gap?>\"> \n <?php while ( $query->have_posts() ) : $query->the_post(); ?> \n <?php\n $industry = carbon_get_post_meta( get_the_ID(), 'case-study-industry' );\n $results = carbon_get_post_meta( get_the_ID(), 'case-study-results' );\n $short_description = carbon_get_post_meta( get_the_ID(), 'case-study-short-description' ); \n $client_name = carbon_get_post_meta( get_the_ID(), 'case-study-client-name' );\n $client_image = carbon_get_post_meta( get_the_ID(), 'case-study-client-image' );\n $client_position = carbon_get_post_meta( get_the_ID(), 'case-study-client-position' );\n ?>\n <div class=\"mos-post-grid-<?php echo $grid?>\">\n <a href=\"<?php echo get_the_permalink() ?>\" class=\"case-item\">\n <article class=\"case\">\n <div class=\"case-industry\">\n <h3 class=\"case-industry-title\">Industry:</h3>\n <p class=\"case-industry-value\"><?php echo $industry ?></p>\n </div>\n <?php if (sizeof($results)) : ?>\n <div class=\"case-results\">\n <?php foreach($results as $key=>$value) : ?>\n <div class=\"result result-<?php echo $key ?>\">\n <div class=\"result-text\">\n <div class=\"result-value\">\n <span class=\"counter\"><?php echo $value['case-study-results-value'] ?></span>\n <span class=\"suffix\"><?php echo $value['case-study-results-suffix'] ?></span>\n </div>\n <div class=\"result-title\"><?php echo $value['case-study-results-title'] ?></div>\n </div>\n </div>\n <?php endforeach;?>\n </div>\n <?php endif;?> \n <div class=\"case-text\"><?php echo $short_description ?></div>\n <div class=\"case-customer\">\n <div class=\"customer-info\">\n <div class=\"customer-name\"><?php echo $client_name ?></div>\n <div class=\"customer-position\"><?php echo $client_position ?></div>\n </div>\n <div class=\"customer-photo\"><img alt=\"<?php echo $client_name ?>\" class=\" ls-is-cached lazyloaded\" src=\"<?php echo wp_get_attachment_url($client_image) ?>\"></div>\n </div>\n </article>\n </a>\n </div> \n <?php endwhile; ?>\n </div>\n </div>\n <?php endif;\n wp_reset_postdata();\n });\n Block::make( __( 'Mos Before After Block' ) )\n ->add_fields( array(\n Field::make( 'image', 'before_image', __( 'Before Image' ) ),\n Field::make( 'image', 'after_image', __( 'After Image' ) ),\n Field::make( 'text', 'before_text', __( 'Before Text' ) ),\n Field::make( 'text', 'after_text', __( 'After Text' ) ),\n ))\n ->set_icon( 'format-gallery' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-beforeafter-block-wrapper <?php echo $attributes['className'] ?>\">\n <div class=\"mos-beforeafter-block\">\n <?php if ($fields['before_image'] && $fields['after_image']) : ?>\n <?php\n $before_alt = get_post_meta($fields['before_image'], '_wp_attachment_image_alt', TRUE);\n $before_text = ($fields['before_text'])?$fields['before_text']:'Before';\n $after_alt = get_post_meta($fields['after_image'], '_wp_attachment_image_alt', TRUE);\n $after_text = ($fields['after_text'])?$fields['after_text']:'After'; \n ?>\n <div class=\"beer-slider\" data-beer-label=\"<?php echo $before_text ?>\" data-start=\"50\">\n <?php echo wp_get_attachment_image( $fields['before_image'], 'full', false, ['class'=>'before-image'] ); ?>\n <div class=\"beer-reveal\" data-beer-label=\"<?php echo $after_text ?>\"> \n <?php echo wp_get_attachment_image( $fields['after_image'], 'full', false, ['class'=>'after-image'] ); ?>\n </div>\n </div>\n <?php else : ?>\n <div class=\"text-center border rounded-3 p-10\">Please add before and after images for this section</div>\n <?php endif?>\n </div>\n </div>\n <?php\n });\n Block::make( __( 'Mos Image carousel Block' ) )\n ->add_fields( array(\n Field::make( 'select', 'image-carousel-grid', __( 'Large Device Grid' ) )\n ->set_options( array(\n '1' => 'Single Column',\n '2' => 'Two Column',\n '3' => 'Three Column',\n '4' => 'Four Column',\n '5' => 'Five Column',\n )),\n Field::make( 'select', 'image-carousel-grid-md', __( 'Medium Device Grid' ) )\n ->set_options( array(\n '1' => 'Single Column',\n '2' => 'Two Column',\n '3' => 'Three Column',\n '4' => 'Four Column',\n '5' => 'Five Column',\n )),\n Field::make( 'select', 'image-carousel-grid-sm', __( 'Small Device Grid' ) )\n ->set_options( array(\n '1' => 'Single Column',\n '2' => 'Two Column',\n '3' => 'Three Column',\n '4' => 'Four Column',\n '5' => 'Five Column',\n )),\n Field::make( 'select', 'image-carousel-autoplay', __( 'Autoplay' ) )\n ->set_options( array(\n 'true' => 'Enable',\n 'false' => 'Disable'\n )),\n Field::make( 'text', 'image-carousel-autoplay-speed', __( 'Autoplay Speed' ) )\n ->set_attribute( 'placeholder', '2000' ),\n Field::make( 'complex', 'image-carousel-slider', __( 'Services' ) )\n ->add_fields( array(\n Field::make( 'image', 'media', __( 'Image' ) ),\n Field::make( 'text', 'btn-url', __( 'URL' ) ),\n )),\n Field::make( 'select', 'image-carousel-alignment', __( 'Content Alignment' ) )\n ->set_options( array(\n 'left' => 'Left',\n 'right' => 'Right',\n 'center' => 'Center',\n ))\n ))\n ->set_icon( 'format-gallery' )\n ->set_render_callback( function ( $fields, $attributes, $inner_blocks ) {\n ?>\n <div class=\"mos-image-carousel-block-wrapper <?php echo $attributes['className'] ?>\">\n \n <?php if (sizeof($fields['image-carousel-slider'])) : ?>\n <?php\n $data_slick = 'slick-slider';\n $slidesToScroll = ($fields['image-carousel-grid'])?$fields['image-carousel-grid']:1;\n $slidesToScroll_782 = ($fields['image-carousel-grid-md'])?$fields['image-carousel-grid-md']:1;\n $slidesToScroll_600 = ($fields['image-carousel-grid-sm'])?$fields['image-carousel-grid-sm']:1;\n \n $autoplay = ($fields['image-carousel-autoplay'])?$fields['image-carousel-autoplay']:true;\n $autoplaySpeed = ($fields['image-carousel-autoplay-speed'])?$fields['image-carousel-autoplay-speed']:2000;\n $cls = 'slick-slider';\n $data_slick = '{\"slidesToShow\": '.$slidesToScroll.',\"slidesToScroll\": 1,\"autoplay\": '.$autoplay.',\"autoplaySpeed\": '.$autoplaySpeed.',\"dots\": false,\"arrows\":true,\"responsive\": [{\"breakpoint\": 782,\"settings\": {\"slidesToShow\": '.$slidesToScroll_782.',\"slidesToScroll\": 1}},{\"breakpoint\": 600,\"settings\": {\"arrows\": true,\"dots\": false,\"slidesToShow\": '.$slidesToScroll_600.',\"slidesToScroll\": 1}}]}';\n \n ?>\n <div class=\"mos-image-carousel-block <?php echo $cls ?>\" data-slick='<?php echo $data_slick ?>'>\n <?php //$image_alt = get_post_meta($fields['image-carousel-image'], '_wp_attachment_image_alt', TRUE);?>\n <?php foreach($fields['image-carousel-slider'] as $slide) : ?>\n <?php if ($slide['media']) : ?>\n <div class=\"item position-relative text-<?php echo esc_html( $fields['image-carousel-alignment'] ) ?>\" id=\"item-<?php echo $slide['_id']?>\">\n <?php echo wp_get_attachment_image($slide['media'],'full',false,array('class'=>'slick-item-img'))?>\n <?php if ($slide['btn-url']) :?>\n <a href=\"<?php echo esc_url(do_shortcode($slide['btn-url'])); ?>\" class=\"hidden-link\"></a>\n <?php endif?>\n </div>\n <?php endif?>\n <?php endforeach;?>\n </div>\n <?php endif;?>\n </div>\n <?php\n });\n}",
"function royal_add_video_post_meta_box() {\n\t\tadd_meta_box(\n\t\t\t'royal_video_post_meta_box',\n\t\t\tesc_html__( 'Post Format: Video', 'hyperx' ),\n\t\t\t'royal_display_video_post_meta_box',\n\t\t\t'post',\n\t\t\t'normal',\n\t\t\t'high'\n\t\t);\n\n\t\tadd_meta_box(\n\t\t\t'royal_video_post_meta_box',\n\t\t\tesc_html__( 'Post Format: Video', 'hyperx' ),\n\t\t\t'royal_display_video_post_meta_box',\n\t\t\t'royal_portfolio',\n\t\t\t'normal',\n\t\t\t'high'\n\t\t);\n\t}",
"public function start_previewing_theme() {}",
"function print_media_templates() {\n\t\t$options = $this->get_options();\n\t\t?>\n\t\t<script type=\"text/html\" id=\"tmpl-videopress-attachment\">\n\t\t\t<# if ( data.vp_ogg_url ) { #>\n\t\t\t<label class=\"setting vp-setting\">\n\t\t\t\t<span><?php _e( 'Ogg File URL', 'jetpack' ); ?></span>\n\t\t\t\t<input type=\"text\" value=\"{{ data.vp_ogg_url }}\" onclick=\"this.focus();this.select();\" readonly />\n\t\t\t\t<p class=\"help\"><?php _e( 'Location of the Ogg video file.', 'jetpack' ); ?></p>\n\t\t\t</label>\n\t\t\t<# } #>\n\n\t\t\t<label class=\"setting vp-setting\">\n\t\t\t\t<span><?php _e( 'Share', 'jetpack' ); ?></span>\n\t\t\t\t<input class=\"vp-checkbox\" type=\"checkbox\" <# if ( '1' === data.vp_share ) { #>checked<# } #> <# if ( ! data.can.save ) { #>disabled<# } #> />\n\t\t\t\t<label>\n\t\t\t\t\t<?php _e( 'Display share menu and allow viewers to embed or download this video', 'jetpack' ); ?>\n\t\t\t\t</label>\n\t\t\t\t<input class=\"vp-checkbox-text\" type=\"text\" value=\"{{ data.vp_share }}\" data-setting=\"vp_share\" style=\"display:none;\" />\n\t\t\t</label>\n\n\t\t\t<label class=\"setting vp-setting\">\n\t\t\t\t<span><?php _e( 'Rating', 'jetpack' ); ?></span>\n\n\t\t\t\t<?php foreach ( $this->get_available_ratings() as $value => $label ) : ?>\n\t\t\t\t<input class=\"vp-radio\" type=\"radio\" name=\"vp-radio-group\" id=\"vp-rating-<?php echo sanitize_html_class( $value ); ?>\" value=\"<?php echo esc_attr( $value ); ?>\"\n\t\t\t\t\t<# if ( '<?php echo esc_attr( $value ); ?>' === data.vp_rating ) { #>checked<# } #>\n\t\t\t\t\t<# if ( ! data.can.save ) { #>disabled<# } #> />\n\t\t\t\t<label for=\"vp-rating-<?php echo sanitize_html_class( $value ); ?>\"><?php echo esc_html( $label ); ?></label>\n\t\t\t\t<?php endforeach; ?>\n\n\t\t\t\t<input class=\"vp-radio-text\" type=\"text\" value=\"{{ data.vp_rating }}\" data-setting=\"vp_rating\" style=\"display:none;\" />\n\t\t\t</label>\n\n\t\t\t<label class=\"setting vp-setting\">\n\t\t\t\t<span><?php _e( 'Shortcode', 'jetpack' ); ?></span>\n\t\t\t\t<input type=\"text\" value=\"[wpvideo {{ data.vp_guid }}]\" onclick=\"this.focus();this.select();\" readonly />\n\t\t\t</label>\n\n\t\t\t<label class=\"setting vp-setting vp-preview\">\n\t\t\t\t<span><?php _e( 'Preview', 'jetpack' ); ?></span>\n\t\t\t\t<# if ( ! data.vp_thumbnail_url ) { #>\n\t\t\t\t\t<span class=\"videopress-preview-unavailable\"><?php esc_html_e( 'The preview is unavailable while this video is being processed.', 'jetpack' ); ?></span>\n\t\t\t\t<# } else { #>\n\t\t\t\t<a href=\"#\" class=\"videopress-preview\" id=\"videopress-thumbnail-{{ data.vp_guid }}\" data-videopress-guid=\"{{ data.vp_guid }}\"><img src=\"{{ data.vp_thumbnail_url }}\" /></a>\n\t\t\t\t<# } #>\n\t\t\t</label>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-videopress-media-modal\">\n\t\t\t<div class=\"videopress-modal\">\n\t\t\t\t<p><?php _e( 'Video Preview:', 'jetpack' ); ?></p>\n\t\t\t\t<div class=\"videopress-video-container\">{{{ data.video }}}</div>\n\t\t\t\t<p class=\"submit\">\n\t\t\t\t\t<a class=\"videopress-modal-close button\" href=\"#\"><?php _e( 'Close', 'jetpack' ); ?></a>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div class=\"videopress-modal-backdrop\"></div>\n\t\t</script>\n\n\t\t<script type=\"text/html\" id=\"tmpl-videopress-uploader\">\n\t\t\t<div class=\"videopress-errors\"></div>\n\t\t\t<form class=\"videopress-upload-form\" action=\"\" method=\"post\" target=\"videopress_upload_frame\" enctype=\"multipart/form-data\">\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"videopress_upload\" />\n\t\t\t\t<input type=\"hidden\" name=\"videopress_blog_id\" value=\"0\" />\n\t\t\t\t<input type=\"hidden\" name=\"videopress_token\" value=\"0\" />\n\t\t\t\t<?php $formats = 'ogv, mp4, m4v, mov, wmv, avi, mpg, 3gp, 3g2'; ?>\n\t\t\t\t<?php\n\t\t\t\t\t$max_upload_size = 0;\n\t\t\t\t\tif ( ! empty( $options['meta']['max_upload_size'] ) )\n\t\t\t\t\t\t$max_upload_size = absint( $options['meta']['max_upload_size'] );\n\n\t\t\t\t\t$upload_size_unit = $max_upload_size;\n\t\t\t\t\t$byte_sizes = array( 'KB', 'MB', 'GB' );\n\n\t\t\t\t\tfor ( $u = -1; $upload_size_unit > 1024 && $u < count( $byte_sizes ) - 1; $u++ )\n\t\t\t\t\t\t$upload_size_unit /= 1024;\n\n\t\t\t\t\tif ( $u < 0 ) {\n\t\t\t\t\t\t$upload_size_unit = 0;\n\t\t\t\t\t\t$u = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$upload_size_unit = (int) $upload_size_unit;\n\t\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<p><?php printf( __( 'Use the form below to upload a video to your VideoPress Library. The following video formats are supported: %s. Maximum upload file size is %d%s.', 'jetpack' ), esc_html( $formats ), esc_html( $upload_size_unit ), esc_html( $byte_sizes[ $u ] ) ); ?></p>\n\n\t\t\t\t<input type=\"file\" name=\"videopress_file\" />\n\t\t\t\t<?php submit_button( __( 'Upload Video', 'jetpack' ) ); ?>\n\t\t\t</form>\n\t\t\t<iframe width=\"0\" height=\"0\" name=\"videopress_upload_frame\"></iframe>\n\t\t</script>\n\t\t<?php\n\t}",
"public function add_format_box() {\n\n\t\t\t\tswitch ( get_post_format() ) {\n\t\t\t\t\tcase 'gallery':\n\t\t\t\t\t\t$format_class = 'images';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'link':\n\t\t\t\t\t\t$format_class = 'link';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'image':\n\t\t\t\t\t\t$format_class = 'image';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'quote':\n\t\t\t\t\t\t$format_class = 'quotes-left';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'video':\n\t\t\t\t\t\t$format_class = 'film';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'audio':\n\t\t\t\t\t\t$format_class = 'headphones';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'chat':\n\t\t\t\t\t\t$format_class = 'bubbles';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$format_class = 'pen';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$inner_content = '<div ' . FusionBuilder::attributes( 'fusion-format-box' ) . '>';\n\t\t\t\t$inner_content .= '<i ' . FusionBuilder::attributes( 'fusion-icon-' . $format_class ) . '></i>';\n\t\t\t\t$inner_content .= '</div>';\n\n\t\t\t\techo $inner_content; // phpcs:ignore WordPress.Security.EscapeOutput\n\n\t\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to include gallery add page | function gallery_add() {
include('admin/gallery-add.php');
} | [
"function add_gallery()\n{\n}",
"function gallery_manage() {\r\r\n\t\t\tinclude('admin/gallery-manage.php');\r\r\n\t\t}",
"function print_add_gallery_page()\n\t{\n\t\tglobal $wpdb;\n\t\t\n\t\t$options = odWpPhotogalleryPlugin::get_options();\n\t\t$root_dir = odWpPhotogalleryPlugin::get_rootdir();\n\t\t$i = 0;\n?>\n\t\t<div>\n\t\t\t<p><?php echo __('Here you can create new gallery from already existing folders with images.', \n\t\t\t\t\t\t\t odWpPhotogalleryPlugin::$textdomain);?></p>\n\t\t\t<p><?php printf(__('Folders of single galleries should be save only in main photogallery ' . \n\t\t\t\t 'folder as is defined in <a href=\"%1$s\">plugin\\'s options</a> (currently ' . \n\t\t\t\t '<code>%2$s</code>).<br/>' . \n\t\t\t\t 'For upload use either your favourite FTP client either plugin\\'s own ' . \n\t\t\t\t\t\t\t '<a href=\"%3$s\"><strong>wizard for uploading new images</strong></a>. If' . \n\t\t\t\t\t\t\t 'you want to upload images through your FTP client all images already ' . \n\t\t\t\t\t\t\t '<strong>should be</strong> available in all required sizes (original, ' . \n\t\t\t\t\t\t\t 'big, thumb) and saved with correct filenames (you can show to any folder of ' . \n\t\t\t\t\t\t\t 'an existing gallery to see what is meaned by <em>correct filenames</em>).', \n\t\t\t\t\t\t\t odWpPhotogalleryPlugin::$textdomain),\n\t\t\t\t\t\t\t get_bloginfo('home') . '/wp-admin.php?page=od-photogallery-settings', \n\t\t\t\t\t\t\t $options['main_gallery_dir'], \n\t\t\t\t\t\t\t get_bloginfo('home') . '/wp-admin/admin.php?page=od-photogallery-add&uf=1');?></p>\n\t\t</div>\n\t\t<h3><?php echo __('Existing directories which are not associated with any gallery', odWpPhotogalleryPlugin::$textdomain);?></h3>\n\t\t<table class=\"widefat post fixed\" cellspacing=\"0\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"col\" style=\"width:60%;\"><?php echo __('Folder', odWpPhotogalleryPlugin::$textdomain);?></th>\n\t\t\t\t\t<th scope=\"col\" style=\"width:10%; text-align:center;\"><?php echo __('Images count', odWpPhotogalleryPlugin::$textdomain);?></th>\n\t\t\t\t\t<th scope=\"col\" style=\"width:30%; text-align:center;\"> </th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tfoot>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"col\" style=\"width:60%;\"><?php echo __('Folder', odWpPhotogalleryPlugin::$textdomain);?></th>\n\t\t\t\t\t<th scope=\"col\" style=\"width:10%; text-align:center;\"><?php echo __('Images count', odWpPhotogalleryPlugin::$textdomain);?></th>\n\t\t\t\t\t<th scope=\"col\" style=\"width:30%; text-align:center;\"> </th>\n\t\t\t\t</tr>\n\t\t\t</tfoot>\n\t\t\t<tbody id=\"the-list\" class=\"list:od-photogallery\">\n<?php\n\t\t// Get all folders\n\t\t$dirs = glob($root_dir . '*', GLOB_ONLYDIR);\n\t\tif(count($dirs) > 0) {\n\t\t\tforeach($dirs as $dir) {\n\t\t\t\t$dirname = str_replace($root_dir, '', $dir);\n\t\t\t\t\n\t\t\t\t// Filter those which are not used by any of existing galleries\n\t\t\t\tif(!odWpPhotogalleryPluginModel::check_if_dir_is_used($dirname)) {\n\t\t\t\t\t$photo_count = odWpPhotogalleryPlugin::get_files_count($dirname);\n?>\n\t\t\t<tr class=\"<?php echo ($i++%2) ? 'alternate' : '';?> status-inherit\">\n\t\t\t\t<td><code style=\"font-size: 6pt;\"><?php echo $dirname;?></code></td>\n\t\t\t\t<td style=\"color:<?php echo (($photo_count!=0) ? 'green' : '#f30');?>;text-align:center;\"><?php echo $photo_count;?></td>\n\t\t\t\t<td>\n\t\t\t\t\t<?php if($photo_count == 0):?>\n\t\t\t\t\t<a href=\"admin.php?page=od-photogallery-add&dd=<?php echo $dirname;?>\"><?php echo __('Delete folder', odWpPhotogalleryPlugin::$textdomain);?></a>\n\t\t\t\t\t<?php else: ?>\n\t\t\t\t\t<a href=\"admin.php?page=od-photogallery-add&dn=<?php echo $dirname;?>&pc=<?php echo $photo_count;?>\"><?php echo __('Create gallery', odWpPhotogalleryPlugin::$textdomain);?></a>\n\t\t\t\t\t<?php endif;?>\n\t\t\t\t</td>\n\t\t\t</tr>\n<?php\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\t\n\t\tif($i == 0) {\n?>\n\t\t\t<tr class=\"status-inherit\">\n\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t<?php printf(__('<strong>There are no existing and unused directories with ' . \n\t\t\t\t\t 'images.</strong> If you want to create new one use our ' . \n\t\t\t\t\t\t\t\t '<a href=\"%s\"><strong>wizard for uploading new images</strong></a>.', \n\t\t\t\t\t\t\t\t odWpPhotogalleryPlugin::$textdomain),\n\t\t\t\t\t\t\t\t get_bloginfo('home') . '/wp-admin/admin.php?page=od-photogallery-add&uf=1');?>\n\t\t\t\t</td>\n\t\t\t</tr>\n<?php\n\t\t}\n?>\n\t\t\t</tbody>\n\t\t</table>\n\t\t<!--\n\t\t<p><?php echo __('Images in these directories already <strong>should be</strong> ' . \n\t\t 'available in all required sizes (original, big, thumb) and saved ' . \n\t\t 'with correct filenames.', odWpPhotogalleryPlugin::$textdomain);?></p>\n\t\t-->\n<?php\n\t}",
"function nm_wp_gallery_set_include() {\r\n\t\tnm_add_page_include( 'wp-gallery' );\r\n\t\t\r\n\t\treturn ''; // Returning an empty string will output the default WP gallery\r\n\t}",
"function custom_gallery($atts) {\n\t\tif ( !is_admin() ) {\n\t\t\tinclude('part-gallery.php');\n\t\t}\n\t\treturn $output;\n\t}",
"function addPhoto()\n\t{\n\t\t$com_id = $this->uri->segment('2');\n\t\t$gallery_id = $this->uri->segment('4');\n\n\t\t$gallery = $this->m_community->getGallery($gallery_id);\n\n\t\t$this->uploadImage($gallery['GALLERY_NAME'], $gallery_id);\n\t\tredirect('community/' . $com_id . '/gallery/' . $gallery_id);\n\t}",
"public function sp_video_gallery_page( )\n {\n require_once SAMPLE_DIR . '/dmc/dm-cloud-video-gallery-html.php';\n }",
"public function galleryScreen()\n {\n add_action('bp_template_title', array($this, 'title'));\n add_action('bp_template_content', array($this, 'displayControl'));\n bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));\n }",
"public function single_gallery()\n {\n $template = apply_filters( 'es_single_gallery_template_path', ES_TEMPLATES . 'property/gallery.php' );\n include $template;\n }",
"function get_gallery_pagemore_portfolio() \n{\n\tdefined( 'JEG_PAGE_ID' ) or define('JEG_PAGE_ID', $_REQUEST['pageid']);\n\tdefined( 'JEG_GALLERY_PAGE' ) or define('JEG_GALLERY_PAGE', $_REQUEST['page']);\n\tget_template_part('template/portfolio/portfolio-gallery');\n\texit;\n}",
"function ipress_loop_content_gallery() {\n\t\tget_template_part( 'templates/loop/content-gallery' );\n\t}",
"private function show() {\n\t\tglobal $MEDIA_DIRECTORY, $controller, $WT_TREE;\n\t\t$gallery_header_description = '';\n\t\t$item_id = webtrees\\Filter::get('album_id');\n\t\t$controller = new webtrees\\Controller\\PageController();\n\t\t$controller\n\t\t\t->setPageTitle(webtrees\\I18N::translate('Picture galleries'))\n\t\t\t->pageHeader()\n\t\t\t->addExternalJavaScript(WT_STATIC_URL . WT_MODULES_DIR . $this->getName() . '/galleria/galleria-1.4.2.min.js')\n\t\t\t->addExternalJavaScript(WT_STATIC_URL . WT_MODULES_DIR . $this->getName() . '/galleria/plugins/flickr/galleria.flickr.min.js')\n\t\t\t->addExternalJavaScript(WT_STATIC_URL . WT_MODULES_DIR . $this->getName() . '/galleria/plugins/picasa/galleria.picasa.min.js')\n\t\t\t->addInlineJavaScript($this->getJavaScript($item_id));\n\t\t?>\n\t\t<div id=\"gallery-page\">\n\t\t\t<div id=\"gallery-container\">\n\t\t\t\t<h2><?php echo $controller->getPageTitle(); ?></h2>\n\t\t\t\t<?php echo $gallery_header_description; ?>\n\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t\t<div id=\"gallery_tabs\" class=\"ui-tabs ui-widget ui-widget-content ui-corner-all\">\n\t\t\t\t\t<ul class=\"ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all\">\n\t\t\t\t\t<?php \n\t\t\t\t\t\t$item_list = $this->getAlbumList();\n\t\t\t\t\t\tforeach ($item_list as $item) {\n\t\t\t\t\t\t\t$languages = $this->getBlockSetting($item->block_id, 'languages');\n\t\t\t\t\t\t\tif ((!$languages || in_array(WT_LOCALE, explode(',', $languages))) && $item->album_access >= webtrees\\Auth::accessLevel($WT_TREE)) { ?>\n\t\t\t\t\t\t\t\t<li class=\"ui-state-default ui-corner-top <?php echo ($item_id == $item->block_id ? ' ui-tabs-selected ui-state-active' : ''); ?>\">\n\t\t\t\t\t\t\t\t\t<a href=\"module.php?mod=<?php echo $this->getName(); ?>&mod_action=show&album_id=<?php echo $item->block_id; ?>\">\n\t\t\t\t\t\t\t\t\t\t<span title=\"<?php echo webtrees\\I18N::translate($item->album_title); ?>\"><?php echo webtrees\\I18N::translate($item->album_title); ?></span>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<?php \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\t</ul>\n\t\t\t\t\t<div id=\"outer_gallery_container\" style=\"padding: 1em;\">\n\t\t\t\t\t<?php \n\t\t\t\t\t\tforeach ($item_list as $item) {\n\t\t\t\t\t\t\t$languages = $this->getBlockSetting($item->block_id, 'languages');\n\t\t\t\t\t\t\tif ((!$languages || in_array(WT_LOCALE, explode(',', $languages))) && $item_id == $item->block_id && $item->album_access >= webtrees\\Auth::accessLevel($WT_TREE)) {\n\t\t\t\t\t\t\t\t$item_gallery='<h4>' . webtrees\\I18N::translate($item->album_description) . '</h4>' . $this->mediaDisplay($item->album_folder_w, $item_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isset($item_gallery)) {\n\t\t\t\t\t\t\techo '<h4>' . webtrees\\I18N::translate('Image collections related to our family') . '</h4>' . $this->mediaDisplay('//', $item_id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $item_gallery;\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t}",
"public function gallery()\n\t{\n\t\t$this->data['heading_title'] = $this->config['site_name'].' | Gallery';\n\t\tRequest::session()->put('active_menu', 'gallery');\n\t\t$this->data['modules'][] = app('App\\Http\\Controllers\\ModulesController')->pinterest($visible = 1);\n return view('pages.gallery', $this->data);\n\t}",
"public function gallery() {\n\t\t$c = 1;\n\t\t$columns = $this->settings['columns'];\n\t\t$default_button_text = $this->settings['default_button_text'];\n\t\t$blocks = md_post_meta( array( 'gallery_blocks', 'blocks' ) );\n\t\t$title = md_post_meta( array( 'gallery_blocks', 'title' ) );\n\t\t$text = md_post_meta( array( 'gallery_blocks', 'text' ) );\n\t\tinclude( 'template.php' );\n\t}",
"function aeva_admin_albums_add()\n{\n\tloadSource('media/Aeva-Gallery2');\n\taeva_addAlbum(true);\n}",
"public function addalbum(){\n\t\tglobal $CONFIG;\n\t\t//pr('masuk');\n\t\treturn $this->loadView('gallery/addalbum');\n\t}",
"function hys_photogaltopage() {\n\tglobal $hys;\n\t\n\tif (@$hys['settings']['no_attachments'] == 1) return;\n\t\n\tif (isset($hys['hys_page_config']['show_pg_img'])) {\n\t\t// add meta box to page...\n\t\tadd_meta_box( 'attachments_list', __( 'Photo Gallery', 'attachments_textdomain' ), 'attachments_add', 'page', 'normal' );\n\t}\n}",
"public function loadGalleryForPage() {\n\t\t$imageNames = null;\n\t\t$imageLegends = null;\n\t\t$galleryId = $_REQUEST['id'];\n\t\t\t\t\n\t\t$galleryVO = new GalleryVO();\n\t\t$galleryVO->setGALLERY_ID ($galleryId);\t\t\t\t\n\t\t$this->galleryBO = new galleryBO();\n\t\t$newGalleryVO = $this->galleryBO->findById ($galleryVO);\n\n\t\t$imageVOArr = $newGalleryVO->getIMAGEVO_ARR();\n\t\t\n\t\t$this->config = new Config();\n\t\tforeach ($imageVOArr as $imageVO) {\n\t\t\t$filenameThumb = $this->config->__get(\"file.upload.page.thumb.folder\") . $imageVO->getNAME();\n\t\t\t$filename = $this->config->__get(\"file.upload.page.folder\") . $imageVO->getNAME();\t\t\t\t\t\t\n\t\t\tfile_put_contents ($filenameThumb, $imageVO->getIMAGE_THUMB());\n\t\t\tfile_put_contents ($filename, $imageVO->getIMAGE());\n\t\t\tchmod ($filenameThumb, 0777);\n\t\t\tchmod ($filename, 0777);\t\t\t\n\t\t\t$imageNames .= $imageVO->getNAME() . \"^\";\n\t\t\t$imageLegends .= $imageVO->getLEGEND() . \"^\";\n\t\t}\n\t\t\n\t\techo $newGalleryVO->getGALLERY_ID()\n\t\t\t . \"|\" . $newGalleryVO->getLEGEND ()\n\t\t\t . \"|\" . Utils::getFormattedHourMinuteDatetime ($newGalleryVO->getLAST_UPDATE_DT())\n\t\t\t . \"|\" . $newGalleryVO->getDESCRIPTION ()\n\t\t\t . \"|\" . $imageNames\n\t\t\t . \"|\" . $imageLegends\n\t\t\t . \"|\" . $this->renderImageGalleryForPage ($imageVOArr);\n\t}",
"public function adminGalleryAdd() {\n if (!Auth::check() || !Auth::user()->hasRole('imagemanager')) {\n return redirect(route('home'));\n }\n\n return view('admin.gallery.add');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Every Borrower has a location. | public function testHasLocation() {
$this->assertInstanceOf('NYPL\Bibliophpile\Location', $this->borrower->location());
$this->assertEquals('Anytown Library', $this->borrower->location()->name());
} | [
"public function isLocationProvided(): bool;",
"private static function getLocations() {\n\t\treturn self::get(\t'locations',\n\t\t\t\t\t\t\t\"SELECT location FROM data WHERE (state<>\" . STATE_DELETED . \")GROUP BY location ORDER BY location ASC;\",\n\t\t\t\t\t\t\ttrue );\n\t}",
"public function hasLocations(): bool;",
"public function supportsLocation()\n {\n }",
"public function listLocations();",
"public function getOfferOfLocation()\n {\n return $this->offerOfLocation;\n }",
"public function getLocations();",
"function getLocations($friends = array(), $floor){\n\t\t$query_string = \"SELECT uid, x, y FROM \".$this->tblPrefix.\"locations WHERE floor=\".$floor.\" AND (1=0\";\n\t\tif($friends != \"\"){\n\t\t\tforeach($friends as $friend)\n\t\t\t{\n\t\t\t\t$query_string .= \" OR uid=\".$friend;\n\t\t\t}\n\t\t}\n\t\t$query_string .= \") AND updated >= (DATE_ADD(NOW(), INTERVAL -\".$GLOBALS['LOCATION_VALID_TIME'].\" HOUR)) AND NOT uid=\".$this->facebook->user.\";\";\t\t\n\t\t\n\t\t$this->sql->query(\n\t\t\t$query_string,\n\t\t\tSQL_ALL,\n\t\t\tSQL_ASSOC\n\t\t) or die(mysql_error());\n\t\t\n\t\treturn $this->sql->record;\n\t}",
"function hasLocationAll($location){\n\t$loc_exp = explode(',',$location);\n\t$count_loc = count($loc_exp);\n\n\tif($count_loc > 1 ){\n\t if(!in_array(1,$loc_exp)){\n\t return false; //Add/Update\n\t }\n\t else{\n\t return true; //Cant Add/Update\n\t }\n\t}\n\telse{\n\t return false; //Add/Update\n\t}\n}",
"private function seed_locations()\n {\n $location1 = Location::create([\n 'name' => 'Owl Books, New York',\n 'address' => '1 Broadway, New York, NY, United States'\n ]);\n $location2 = Location::create([\n 'name' => 'Owl Books, San Francisco',\n 'address' => '1 2nd St, San Francisco, CA, United States'\n ]);\n $location3 = Location::create([\n 'name' => 'Owl Books, Chicago',\n 'address' => '1 Main Street, Chicago, IL, United Statess'\n ]);\n }",
"public function setLocationData()\n\t{\n\t\t$location = Locations::where('id', '=', $this->location_id)->first();\n\t\t$this->location = $location;\n\t}",
"function findAllLocations() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM locations;'));\r\n\r\n\t}",
"static function updateLocation()\n {\n $position = \\Location::get();\n if ($position) {\n if (\\DB::table('visiting_countries')->where('name', $position->countryName)->first()) {\n \\DB::table('visiting_countries')->where('name', $position->countryName)->increment('visitors');\n } else {\n \\DB::table('visiting_countries')->insert([\n 'name' => $position->countryName ? $position->countryName : '',\n 'visitors' => 1\n ]);\n }\n if (\\DB::table('visiting_browsers')->where('name', Browser::browserFamily())->first()) {\n \\DB::table('visiting_browsers')->where('name', Browser::browserFamily())->increment('visitors');\n } else {\n \\DB::table('visiting_browsers')->insert([\n 'name' => Browser::browserFamily(),\n 'visitors' => 1\n ]);\n }\n Session::put('current_ip', $position->ip);\n Session::put('location_updated_at', Carbon::now()->addMinutes(15));\n }\n }",
"public function hasLocation() {\n \t$val = $this->cacheGetPlain('has_location');\n \tif (is_null($val))\n \t\treturn $this->cacheSetPlain('has_location', $this->getOffering()->hasLocation());\n \telse\n \t\treturn $val;\n\t}",
"public function hasLocation()\n {\n return count($this->get(self::LOCATION)) !== 0;\n }",
"function updateAllLocations () {\n //updateFacebookCurrentCity();\n //updateOkCupidCurrentCity();\n }",
"public function set_current_location() {\n\t\t\t$this->location_id = get_the_ID();\n\t\t\t$meta_data = $this->wpseo_local_locations_repository->get( [ 'id' => $this->location_id ] );\n\n\t\t\t$this->location_meta['business_type'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_type'] : '';\n\t\t\t$this->location_meta['business_address'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_address'] : '';\n\t\t\t$this->location_meta['business_address_2'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_address_2'] : '';\n\t\t\t$this->location_meta['business_city'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_city'] : '';\n\t\t\t$this->location_meta['business_state'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_state'] : '';\n\t\t\t$this->location_meta['business_zipcode'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_zipcode'] : '';\n\t\t\t$this->location_meta['business_country'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_country'] : '';\n\t\t\t$this->location_meta['business_phone'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_phone'] : '';\n\t\t\t$this->location_meta['business_phone_2nd'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_phone_2nd'] : '';\n\t\t\t$this->location_meta['business_fax'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_fax'] : '';\n\t\t\t$this->location_meta['business_email'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_email'] : '';\n\t\t\t$this->location_meta['business_url'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_url'] : '';\n\t\t\t$this->location_meta['business_vat'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_vat'] : '';\n\t\t\t$this->location_meta['business_tax'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_tax'] : '';\n\t\t\t$this->location_meta['business_coc'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_coc'] : '';\n\t\t\t$this->location_meta['business_price_range'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_price_range'] : '';\n\t\t\t$this->location_meta['business_currencies_accepted'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_currencies_accepted'] : '';\n\t\t\t$this->location_meta['business_payment_accepted'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_payment_accepted'] : '';\n\t\t\t$this->location_meta['business_area_served'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_area_served'] : '';\n\t\t\t$this->location_meta['coords']['lat'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['coords']['lat'] : '';\n\t\t\t$this->location_meta['coords']['long'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['coords']['long'] : '';\n\t\t\t$this->location_meta['business_timezone'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_timezone'] : '';\n\t\t\t$this->location_meta['business_logo'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['business_logo'] : '';\n\t\t\t$this->location_meta['custom_marker'] = ! empty( $meta_data ) ? $meta_data[ $this->location_id ]['custom_marker'] : '';\n\t\t}",
"protected function __findLocationRegionByLocation() {\n $results = Cache::read('LocationRegionLocationRegionByLocation');\n\n if (false === $results) {\n $results = Set::combine(\n $this->find('all'),\n '{n}.LocationRegion.location_id',\n '{n}.LocationRegion'\n );\n Cache::write('LocationRegionLocationRegionByLocation', $results);\n }\n\n return $results;\n }",
"function generateLocationList()\n{\n $rawOutput = getTableContents('locations', 'label');\n return $rawOutput['DATA'];\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor; loads and executes checks based on the name of this report. | public function __construct() {
$base_class_name = 'SiteAuditCheck' . $this->getReportName();
$percent_override = NULL;
$checks_to_skip = array();
if (drush_get_option('skip')) {
$checks_to_skip = explode(',', drush_get_option('skip'));
}
$checks_to_perform = $this->getCheckNames();
foreach ($checks_to_perform as $key => $check_name) {
if (in_array($this->getReportName() . $check_name, $checks_to_skip)) {
unset($checks_to_perform[$key]);
}
}
if (empty($checks_to_perform)) {
// No message for audit_all.
$command = drush_parse_command();
if ($command['command'] == 'audit_all') {
return FALSE;
}
return drush_set_error('SITE_AUDIT_NO_CHECKS', dt('No checks are available!'));
}
$config = \Drupal::config('site_audit');
foreach ($checks_to_perform as $check_name) {
$class_name = $base_class_name . $check_name;
$opt_out = $config->get('opt_out.' . $this->getReportName() . $check_name) != NULL;
$check = new $class_name($this->registry, $opt_out);
// Calculate score.
if ($check->getScore() != SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO) {
// Mark if there's a major failure.
if ($check->getScore() == SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL) {
$this->hasFail = TRUE;
}
// Total.
$this->scoreTotal += $check->getScore();
// Maximum.
$this->scoreMax += SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS;
}
// Allow Report percentage to be overridden.
if ($check->getPercentOverride()) {
$percent_override = $check->getPercentOverride();
}
// Combine registry.
$this->registry = array_merge($this->registry, $check->getRegistry());
// Store all checks.
$this->checks[$class_name] = $check;
// Abort the loop if the check says to bail.
if ($check->shouldAbort()) {
break;
}
}
if ($percent_override) {
$this->percent = $percent_override;
}
else {
if ($this->scoreMax != 0) {
$this->percent = round(($this->scoreTotal / $this->scoreMax) * 100);
}
else {
$this->percent = SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
}
}
} | [
"function __construct()\n\t\t{\n\t\t\t$this->test_name = get_class($this);\n\t\t\t$this->reporter = new TestReporter();\n\t }",
"function __construct() {\n\t\t$classes = ClassInfo::subclassesFor('AdvancedReport');\n\t\tarray_shift($classes);\n\t\tself::$managed_models = array_keys($classes);\n\n\t\tparent::__construct();\n\t\t\n\t\t$this->showImportForm = false;\n\t\t\n\t}",
"private function initReporter() {\n\t\tswitch ($this->wire('config')->company) {\n\t\t\tcase 'provalley':\n\t\t\t\t$this->reporter = new StockStatus\\Provalley;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->reporter = new StockStatus();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function getReportClass($reportName);",
"private function getReportInstance()\n {\n $name = $this->getReportClassName();\n ReportFactory::loadReportClass($name);\n\n return new $name;\n }",
"public function __construct()\n {\n $this->result = unserialize(file_get_contents($this->getCoverageDir() . \"coverage.txt\"));\n $this->sortBy =\"percentage\"; // default sort\n }",
"function __construct()\n {\n $this->name = \"charts\";\n $this->title = \"Charts\";\n $this->module_category = \"<#LANG_SECTION_OBJECTS#>\";\n $this->checkInstalled();\n }",
"public function makeReport()\n {\n }",
"protected function _initialize_report_info()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $definitions = $this->_get_definition();\n\n // Handy: get the class and app name\n //----------------------------------\n\n $full_class = get_class($this);\n $matches = array();\n\n preg_match('/clearos\\\\\\apps\\\\\\(.*)\\\\\\(.*)/', $full_class, $matches);\n\n $app = $matches[1];\n $library = $matches[2];\n\n // Loop through report definitions\n // Manually the special \"overview\" report first\n //---------------------------------------------\n\n $urls = array();\n $dashboards = array();\n $report_info = array();\n\n $report_info['overview']['title'] = lang('base_overview');\n $report_info['overview']['url'] = $app;\n $urls['/app/' . $report_info['overview']['url']] = lang('base_overview');\n\n foreach ($definitions as $report => $definition) {\n\n // Non-intuitive. There are two types of reports to handle:\n // - A simple report (e.g. system load)\n // - A bunch of reports based on a key value (e.g. eth0, eth1, for the network report)\n //\n // We do some things a bit differently depending on the type\n\n // Set the report name\n $report_name = (empty($definition['key_value'])) ? $report : $definition['key_value'];\n\n // Pull in definition\n $info = $definitions[$report_name];\n\n // Add report name to the array for convenience\n $info['report'] = $report_name;\n\n // Add library info\n $info['library'] = $library;\n\n // Set basename\n if (! isset($info['basename']))\n $info['basename'] = $report_name;\n\n // Set an empty key value if one is not defined\n if (! isset($info['key_value']))\n $info['key_value'] = '';\n\n // Add URLs\n if (empty($info['key_value']))\n $info['url'] = $info['app'] . '/' . $info['basename'];\n else\n $info['url'] = $info['app'] . '/' . $info['basename'] . '/index/' . $info['key_value'];\n\n // Add default sort column if one is not specified\n // - timeline charts are sorted by the time (column 0)\n // - normal x/y are sorted by y (column 1)\n\n if (! isset($info['sort_column']))\n $info['sort_column'] = (preg_match('/timeline/', $info['chart_type'])) ? 0 : 1;\n\n // Track URLs and Dashboards\n if (! isset($info['is_detail']) || !$info['is_detail']) {\n $urls['/app/' . $info['url']] = $info['title'];\n\n $dashboards[$info['url']] = array(\n 'controller' => $info['app'] . '/' . $info['basename'],\n 'method' => 'dashboard',\n 'params' => $info['key_value']\n );\n }\n\n $report_info[$report_name] = $info;\n }\n\n // Each report should also have URLs to the other reports, so\n // Loop through again to add this information.\n //-------------------------------------------------------------\n\n foreach ($report_info as $report => $info)\n $report_info[$report]['urls'] = $urls;\n\n // And add dashboard info to special overview report\n $report_info['overview']['dashboards'] = $dashboards;\n $report_info['overview']['report'] = 'overview';\n\n return $report_info;\n }",
"public function setUp() {\n\t\t$this->report = new Report();\n\t}",
"protected function _initReport()\n {\n $reportId = (int) $this->getRequest()->getParam('id');\n $report = Mage::getModel('bs_report/report');\n if ($reportId) {\n $report->load($reportId);\n }\n Mage::register('current_report', $report);\n return $report;\n }",
"protected function _construct()\n {\n $this->_init('reporting_module_status', 'entity_id');\n }",
"protected function _validate()\n {\n if (empty($this->name)) {\n $this->addError('name', 'Report must be given a valid name.');\n }\n \n if (strlen($this->name) > 255) {\n $this->addError('name', 'Report name must be less than 255 characters.');\n }\n }",
"public function __construct($name)\n {\n parent::__construct($this->_element, $name);\n\n self::$loaded = true;\n\n $this->addValidator(\n new Validate\\ReCaptcha()\n );\n }",
"private function __construct(){\n\n self::$rsNamesArray = array(\n\n $GLOBALS['EUROPASS_RS_XML_TO_JSON'],\n $GLOBALS['EUROPASS_RS_XML_TO_WORD'],\n $GLOBALS['EUROPASS_RS_XML_TO_ODT'],\n $GLOBALS['EUROPASS_RS_XML_TO_PDF_ESP'],\n $GLOBALS['EUROPASS_RS_XML_TO_PDF_CV'],\n $GLOBALS['EUROPASS_RS_XML_TO_PDF_CV_ESP'],\n\n $GLOBALS['EUROPASS_RS_JSON_TO_XML_CV'],\n $GLOBALS['EUROPASS_RS_JSON_TO_XML_CV_ESP'],\n $GLOBALS['EUROPASS_RS_JSON_TO_XML_ESP'],\n $GLOBALS['EUROPASS_RS_JSON_TO_WORD'],\n $GLOBALS['EUROPASS_RS_JSON_TO_ODT'],\n $GLOBALS['EUROPASS_RS_JSON_TO_PDF_ESP'],\n $GLOBALS['EUROPASS_RS_JSON_TO_PDF_CV'],\n $GLOBALS['EUROPASS_RS_JSON_TO_PDF_CV_ESP'],\n \n $GLOBALS['EUROPASS_RS_XML_TO_UPGRADE'],\n $GLOBALS['EUROPASS_RS_PDF_TO_XML_EXTRACT'],\n );\n\n self::$rsInputArgsArray = array(\n '-input',\n '-output',\n '-locale',\n '-url',\n );\n \n self::$absolutePath = dirname(__FILE__).'/';\n }",
"public function __construct($_getReportResult = NULL)\n {\n parent::__construct(array('GetReportResult'=>$_getReportResult),false);\n }",
"private function parseTextReport()\n {\n $lines = file($this->pathToReport, FILE_IGNORE_NEW_LINES);\n $loadReport = NULL;\n\t\tif (is_array($lines))\n\t\t{\n\t\t\t$section = \"batch_summary\";\n\t\t\tforeach ($lines as $line)\n\t\t\t{\n\t\t\t\tif ($section == \"batch_summary\") \n\t\t\t\t{\n \tif (strpos($line, self::BATCH_ID_LINE_PREFIX) === 0)\n \t{\n \t// BATCH ID\n \t$batchID = trim(substr($line, strlen(self::BATCH_ID_LINE_PREFIX)));\n \t$this->setBatchID($batchID);\n \t} \n \telseif (strpos($line, self::BATCH_DIRECTORY_LINE_PREFIX) === 0)\n \t{\n \t// BATCH DIRECTORY NAME\n \t$batchDir = trim(substr($line, strlen(self::BATCH_DIRECTORY_LINE_PREFIX)));\n \t$this->setBatchDirectoryName($batchDir);\n \t} \n \telseif (strpos($line, self::BATCH_NAME_LINE_PREFIX) === 0)\n \t{\n \t// BATCH NAME\n \t$batchName = trim(substr($line, strlen(self::BATCH_NAME_LINE_PREFIX)));\n \t$this->setBatchName($batchName);\n \t} \n \telseif (strpos($line, self::OWNER_LINE_PREFIX) === 0)\n \t{\n \t// OWNERS\n \t$owner = trim(substr($line, strlen(self::OWNER_LINE_PREFIX)));\n \t$this->setOwner($owner);\n \t} \n \telseif (strpos($line, $this->getFileListSectionPrefix()) === 0)\n \t{\n \t// done with batch summary section -\n \t// entering the file list section\n \t$section = \"file_list\";\n \t} \n \t} \n \telseif ($section == \"file_list\")\n \t{ \n \tif (strpos($line, self::RELATION_LIST_SECTION_LINE_PREFIX) === 0){\n \t// done with file list section -\n \t// entering the relationship list section\n \t$section = \"rel_list\";\n \t} \n \telse \n \t{\n \t\t\n \t\t// treat it as a file line\n \t$fields= explode(\"\\t\", $line);\n \t\n \tif (count($fields) > 11)\n \t{\n \t\tif (!$this->isDescriptor($fields))\n \t\t{\n \t\t\tif ($this->drsVersion == DRSDropperConfig::DRS)\n \t\t\t{\n\t \t\t\t$reportFile = $this->getDRSLoadReportFile($fields);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$reportFile = $this->getDRS2LoadReportFile($fields);\n \t\t\t}\n\t\t\t\t\t\t\t\t$this->addFile($reportFile);\n \t\t}\n \t} \n } \n }\n elseif ($section == \"rel_list\")\n {\n \t//Don't need this area\n \tbreak;\n }\n\t\t\t}\n\t\t}\n return $loadReport;\n }",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t// parse the language file\n\t\t$this->engine->loadLangFile('shoppingcomparison');\n\t}",
"function __construct()\n {\n $this->name = \"system_errors\";\n $this->title = \"<#LANG_MODULE_SYSTEM_ERRORS#>\";\n $this->module_category = \"<#LANG_SECTION_SYSTEM#>\";\n $this->checkInstalled();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sort multilivel categories array by category name | RECURSIVE METHOD | function getCatTitleSort( &$categories, $level = 0, $parent = 0, $out = false, $log = false, $bread_crumbs = false )
{
foreach ($categories as $index => $category)
{
if ( $category['Parent_ID'] == $parent )
{
$bread_crumbs[$category['ID']] = $category['Parent_ID'];
$tmp[$category['ID']] = $category;
$tmp[$category['ID']]['pName'] = 'categories+name+'. $category['Key'];
$tmp[$category['ID']]['margin'] = $category['Level'] * 10 + 5;
$log[$category['Level']][$category['ID']] = $category['ID'];
unset($categories[$index]);
}
}
$this -> rlArraySort($tmp, 'name');
foreach ( $tmp as $t_item )
{
$ttmp[$t_item['ID']] = $t_item;
}
$tmp = $ttmp;
unset($ttmp);
$next_parent = array_shift($log[$level]);
if ( empty($out) )
{
$out = $tmp;
}
else
{
if ( $tmp )
{
$relations = $this -> getCatTitleBC($bread_crumbs, $parent);
eval('$out'. $relations .' = $tmp;');
}
}
unset($tmp, $relations);
if ( empty($log[$level]) )
{
unset($log[$level]);
$level++;
}
//if ( !empty($log) && !empty($categories) )
if ( $next_parent && !empty($categories) )
{
return $this -> getCatTitleSort($categories, $level, $next_parent, $out, $log, $bread_crumbs);
}
else
{
return $out;
}
} | [
"public function getSortCategories() {\n\t\t$db = JFactory::getDBO();\n\t\t$csvilog = JRequest::getVar('csvilog');\n\t\t\n\t\t/* Get all categories */\n\t\t$query = \"SELECT LOWER(category_name) AS category_name, category_child_id as cid, category_parent_id as pid\n\t\t\t\tFROM #__vm_category, #__vm_category_xref WHERE\n\t\t\t\t#__vm_category.category_id=#__vm_category_xref.category_child_id \";\n\t\t\n\t\t/* Execute the query */\n\t\t$db->setQuery($query);\n\t\t\n\t\t$records = $db->loadObjectList();\n\t\t$categories = array();\n\t\t\n\t\t/* Group all categories together according to their level */\n\t\tforeach ($records as $key => $record) {\n\t\t\t$categories[$record->pid][$record->cid] = $record->category_name;\n\t\t}\n\t\t\n\t\t/* Sort the categories and store the item list */\n\t\tforeach ($categories as $id => $category) {\n\t\t\tasort($category);\n\t\t\t$listorder = 1;\n\t\t\tforeach ($category as $category_id => $category_name) {\n\t\t\t\t/* Store the new sort order */\n\t\t\t\t$q = \"UPDATE #__vm_category\n\t\t\t\t\tSET list_order = '\".$listorder.\"'\n\t\t\t\t\tWHERE category_id = '\".$category_id.\"'\";\n\t\t\t\t$db->setQuery($q);\n\t\t\t\t$db->query();\n\t\t\t\tJRequest::setVar('currentline', JRequest::getInt('currentline', 0)+1);\n\t\t\t\t$csvilog->AddStats('information', \"Saved category \".$category_name.\" with order \".$listorder);\n\t\t\t\t$listorder++;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"private function _sorting_category_data($data)\n\t{\n\t\t// print_rr($data);\n\t\t\n\t\t// Set variable\n\t\t$arrayParentRoot = array(); // list data yang sudah tampil tapi hanya untuk yang parent_id = 0\n\t\t$arrayParentLevel1 = array();\n\t\t$arrayParentLevel2 = array();\n\t\t$result = array(); // untuk menampung output data\n\t\t\n\t\t// Loop data for sorting\n\t\t// Level Root\n\t\tif(count($data) > 0){\n\t\t\n\t\t\tforeach($data as $val){\n\t\t\t\tif($val['parent_id'] == 0 && ! in_array($val['parent_id'], $arrayParentRoot) ){\n\t\t\t\t\tarray_push($arrayParentRoot, $val['id']);\n\t\t\t\t\tarray_push($result, $val);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Loop data for sorting\n\t\t\t\t\t// Level 1\n\t\t\t\t\tforeach($data as $val_1){\n\t\t\t\t\t\tif($val_1['parent_id'] == $val['id'] && ! in_array($val_1['parent_id'], $arrayParentLevel1) ){\n\t\t\t\t\t\t\tarray_push($arrayParentLevel1, $val_1['id']);\n\t\t\t\t\t\t\t$val_1['name'] = \" \" . $val_1['name'];\n\t\t\t\t\t\t\tarray_push($result, $val_1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Loop data for sorting\n\t\t\t\t\t\t\t// Level 2\n\t\t\t\t\t\t\tforeach($data as $val_2){\n\t\t\t\t\t\t\t\tif($val_2['parent_id'] == $val_1['id'] && ! in_array($val_2['parent_id'], $arrayParentLevel2) ){\n\t\t\t\t\t\t\t\t\tarray_push($arrayParentLevel2, $val_2['id']);\n\t\t\t\t\t\t\t\t\t$val_2['name'] = \" \" . $val_2['name'];\n\t\t\t\t\t\t\t\t\tarray_push($result, $val_2);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} // end loop level 2\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} // end loop level 1\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} // end loop level Root\n\t\t\t\n\t\t}\n\t\t\n\t\t// print_rr($result);\n\t\t// $result = $data;\n\t\treturn $result;\n\t}",
"private function orderBySubCategory(array $dataSet): array\n {\n\n if(count($dataSet) === 0) {\n return $dataSet;\n }\n usort($dataSet, function ($a, $b) {\n if ($a->category === $b->category) {\n return ($a->subcategory>$b->subcategory); \n }\n return 0;\n });\n return $dataSet;\n }",
"function sort_terms_hierarchicaly(Array &$cats, Array &$into, $parentId = 0)\n{\n foreach ($cats as $i => $cat) {\n if ($cat->parent == $parentId) {\n \t//echo '<p>'.$cat->name.'</p>';\n $into[$cat->term_id] = $cat;\n unset($cats[$i]);\n }\n }\n\n foreach ($into as $topCat) {\n $topCat->children = array();\n sort_terms_hierarchicaly($cats, $topCat->children, $topCat->term_id);\n }\n}",
"private function sort_results_by_category() {\n\t\t$data = [];\n\t\tforeach ( $this->results as $result ) {\n\t\t\tif ( $result->is_hidden() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$category = $result->get_category();\n\t\t\tif ( ! isset( $data[ $category ] ) ) {\n\t\t\t\t$data[ $category ] = [];\n\t\t\t}\n\t\t\t$data[ $category ][ $result->get_id() ] = $result;\n\t\t}\n\n\t\treturn $data;\n\t}",
"public static function allCategoriesSorted()\n\t{\n\t\t$categoryRows = Category::model() -> findAll();\n\t\t$topCategories = array(); // pairs of (categ points, categ)\n\t\tforeach ($categoryRows as $record) {\n\t\t\tarray_push($topCategories, array($record -> cat_points, $record -> cat_name));\n\t\t}\n\t\trsort($topCategories);\n\t\treturn $topCategories;\n\t}",
"public function sort(array $tree);",
"function _recursiveGetCategoryCList( $parent, $level, $expcat, $_indexType = 'NUM', $cprod = false, $ccat = true)\n{\nglobal $fc, $mc;\n\n $rcat = array_keys ($mc, (int)$parent);\n $result = array(); //parents\n\n $crcat = count($rcat);\n for ($i=0; $i<$crcat; $i++) {\n\n $row = $fc[(int)$rcat[$i]];\n if (!file_exists(\"data/category/\".$row[\"picture\"])) $row[\"picture\"] = \"\";\n $row[\"level\"] = $level;\n $row[\"ExpandedCategory\"] = false;\n if ( $expcat != null )\n {\n foreach( $expcat as $categoryID )\n {\n if ( (int)$categoryID == (int)$row[\"categoryID\"] )\n {\n $row[\"ExpandedCategory\"] = true;\n break;\n }\n }\n }\n else\n $row[\"ExpandedCategory\"] = true;\n\n if ($ccat) {$row[\"products_count_category\"] = catGetCategoryProductCount( $row[\"categoryID\"], $cprod );}\n\n $row[\"ExistSubCategories\"] = ( $row[\"subcount\"] != 0 );\n\n if($_indexType=='NUM')\n $result[] = $row;\n elseif ($_indexType=='ASSOC')\n $result[$row['categoryID']] = $row;\n\n\n if ( $row[\"ExpandedCategory\"] )\n {\n //process subcategories\n $subcategories = _recursiveGetCategoryCList( $row[\"categoryID\"],\n $level+1, $expcat, $_indexType, $cprod, $ccat);\n\n if($_indexType=='NUM'){\n\n //add $subcategories[] to the end of $result[]\n for ($j=0; $j<count($subcategories); $j++)\n $result[] = $subcategories[$j];\n }\n elseif ($_indexType=='ASSOC'){\n\n //add $subcategories[] to the end of $result[]\n foreach ($subcategories as $_sub){\n\n $result[$_sub['categoryID']] = $_sub;\n }\n }\n\n }\n }\n return $result;\n}",
"public function SortChildren ();",
"function fn_cat_sort($a, $b)\n{\n /**\n * Changes categories data before the comparison\n *\n * @param array $a First category data\n * @param array $b Second category data\n */\n fn_set_hook('cat_sort_pre', $a, $b);\n\n $result = 0;\n\n if (empty($a[\"position\"]) && empty($b['position'])) {\n $result = strnatcmp($a[\"category\"], $b[\"category\"]);\n } else {\n $result = strnatcmp($a[\"position\"], $b[\"position\"]);\n }\n\n /**\n * Changes the result of categories comparison\n *\n * @param array $a First category data\n * @param array $b Second category data\n * @param int $result Result of comparison categories positions or categories names( if both categories positions are empty)\n */\n fn_set_hook('cat_sort_post', $a, $b, $result);\n\n return $result;\n}",
"function &getOrderedCategories()\n {\n $query = \"SELECT id, lang, parent_id, name, description FROM \".SQLPREFIX.\"faqcategories\";\n if (isset($this->language) && preg_match(\"/^[a-z\\-]{2,}$/\", $this->language)) {\n $query .= \" WHERE lang = '\".$this->language.\"'\";\n }\n $query .= ' ORDER BY id';\n $result = $this->db->query($query);\n while ($row = $this->db->fetch_assoc($result)) {\n $this->categoryName[$row['id']] = $row;\n $this->categories[] =& $this->categoryName[$row['id']];\n $this->children[$row['parent_id']][$row['id']] =& $this->categoryName[$row['id']];\n }\n return $this->categories;\n }",
"function lista_subcategorias_food($category) { \n $subcat_args = array(\n 'orderby' => 'name',\n 'order' => 'ASC'\n );\n //Retorna array de categorias/taxonomy do tipo 'food'\n $subcategories = get_terms('food', $subcat_args);\n $count_subcat = 0;\n $subcategoria = '';\n $pratos = retornaPratos($category->term_id);\n $cat_prato = array();\n if(!$pratos)\n $pratos = '';\n foreach($subcategories as $subcategory) {\n $args = array(\n 'post__in' => $pratos, \n 'tax_query' => array(\n array(\n 'taxonomy' => 'food',\n 'field' => 'term_id',\n 'terms' => $subcategory->term_id)\n ),\n 'post_type' => 'food'\n );\n $posts = get_posts($args);\n if ($posts) {\n $class = '';\n if($count_subcat == 0) {\n $class = 'active';\n $count_subcat = 1;\n }\n //lista Subcategorias\n switch($subcategory->name) {\n case 'Massas Artesanais':\n $subcategoria = 'Massas<span class=\"clear-row\"></span>Artesanais';\n break;\n case 'Peixes e Frutos do Mar':\n $subcategoria = 'Peixes e<span class=\"clear-row\"></span>Frutos do Mar';\n break;\n case 'Carnes e Aves':\n $subcategoria = 'Carnes e<span class=\"clear-row\"></span>Aves';\n break;\n case 'Especial da casa para 2 pessoas':\n $subcategoria = 'Especial da casa<span class=\"clear-row\"></span>para 2 pessoas'; \n break;\n default:\n $subcategoria = $subcategory->name;\n }\n \n echo '<li class=\"' . $class . '\"><a href=\"#set-'. $subcategory->slug .'-' . $category->slug . '\">' . $subcategoria . '</a></li>';\n array_push($cat_prato, $subcategory);\n }\n }\n return $cat_prato;\n }",
"function wpsc_get_terms_category_sort_filter($terms){\n\t$new_terms = array();\n\t$unsorted = array();\n\n\tforeach ( $terms as $term ) {\n\t\tif ( ! is_object( $term ) )\n\t\t\treturn $terms;\n\n\t\t$term_order = ( $term->taxonomy == 'wpsc_product_category' ) ? wpsc_get_meta( $term->term_id, 'sort_order', 'wpsc_category' ) : null;\n\t\t$term_order = (int) $term_order;\n\n\t\t// unsorted categories should go to the top of the list\n\t\tif ( $term_order == 0 ) {\n\t\t\t$term->sort_order = $term_order;\n\t\t\t$unsorted[] = $term;\n\t\t\tcontinue;\n\t\t}\n\n\t\twhile ( isset( $new_terms[$term_order] ) ) {\n\t\t\t$term_order ++;\n\t\t}\n\n\t\t$term->sort_order = $term_order;\n\t\t$new_terms[$term_order] = $term;\n\t}\n\n\tif ( ! empty( $new_terms ) )\n\t\tksort( $new_terms );\n\n\tfor ( $i = count( $unsorted ) - 1; $i >= 0; $i-- ) {\n\t\tarray_unshift( $new_terms, $unsorted[$i] );\n\t}\n\n\treturn array_values( $new_terms );\n}",
"public function reorder_cats_alphabetically()\n {\n if ( ! Session::access('can_edit_categories')) {\n return Cp::unauthorizedAccess();\n }\n\n if (($group_id = Request::input('group_id')) === FALSE OR ! is_numeric($group_id))\n {\n return false;\n }\n\n $data = $this->process_category_group($group_id);\n\n if (count($data) == 0) {\n return false;\n }\n\n foreach($data as $cat_id => $cat_data)\n {\n DB::table('categories')\n ->where('category_id', $cat_id)\n ->update(['category_order' => $cat_data[1]]);\n }\n\n return true;\n }",
"function getAllCategories($mode) {\n\t if ($mode == 1) {\n\t\t $query = \"SELECT * FROM ref_category;\";\n\t\t\tmysql_query($query) or die(mysql_error());\n\t\t $numResults=mysql_query($query);\n\t\t\t$numRows=mysql_num_rows($numResults);\n\t\t\t$categories=array();\n\t\t $i=0;\n\t\t\twhile($i < $numRows) {\n\t\t\t $row = mysql_fetch_array($numResults);\n\t\t\t array_push($categories, array(\"id\"=>$row['id'], \"name\"=>$row['name']));\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $categories;\n\t\t} else if ($mode == 2) {\n\t\t $query = \"SELECT root.id AS root_id, root.name AS root_name, down1.id AS down1_id, down1.name AS down1_name, down2.id AS down2_id, down2.name AS down2_name FROM ref_category AS root LEFT OUTER JOIN ref_category AS down1 ON down1.parent_id = root.id LEFT OUTER JOIN ref_category AS down2 ON down2.parent_id = down1.id WHERE root.parent_id IS NULL ORDER BY root_name, down1_name, down2_name\";\n\t\t\tmysql_query($query) or die(mysql_error());\n\t\t $numResults=mysql_query($query);\n\t\t\t$numRows=mysql_num_rows($numResults);\n\t\t\t$categories=array();\n\t\t $i=0;\n\t\t\t$level0Id = 0;\n\t\t\t$level1Id = 0;\n\t\t\t$level2Id = 0;\n\t\t\t$categoriesTree = array();\n\t\t\t$level1Children = array();\n\t\t\t$rootChildren = array();\n\t\t\t$leafArr = array();\n\t\t\twhile($i < $numRows) {\n\t\t\t $row = mysql_fetch_array($numResults);\n\t\t\t\t$leafArr = array();\n\t\t\t\tif ($row['down2_id'] != null) {\n\t\t\t\t $leafArr = array(\"id\"=>$row['down2_id'], \"text\"=>$row['down2_name']);\n\t\t\t\t}\n\t\t\t\tif ($level1Id == 0 || $level1Id == $row['down1_id']) {\n\t\t\t\t if (sizeof($leafArr) > 0) {\n\t\t\t\t array_push($level1Children, $leafArr);\n\t\t\t\t\t}\n\t\t\t\t\t$level1Id = $row['down1_id'];\n\t\t\t\t\t$level1Name = $row['down1_name'];\n\t\t\t\t} else {\n\t\t\t\t array_push($rootChildren, array(\"id\"=>$level1Id, \"text\"=>$level1Name, \"children\"=>$level1Children));\n\t\t\t\t\t// Reset level 1 children as level 1 element has changed.\n\t\t\t\t\t$level1Children = array();\n\t\t\t\t\t// Add leaf node (level 2) from current (level 1 changed) DB row.\n\t\t\t\t\tif (sizeof($leafArr) > 0) {\n\t\t\t\t\t array_push($level1Children, $leafArr);\n\t\t\t\t\t}\n\t\t\t\t\t// read new ID/Name of level 1.\n\t\t\t\t\t$level1Id = $row['down1_id'];\n\t\t\t\t\t$level1Name = $row['down1_name'];\n\t\t\t\t}\n\t\t\t\tif ($rootId != $row['root_id']) {\n\t\t\t\t if ($rootId == 0) {\n\t\t\t\t\t $rootId = $row['root_id'];\n\t\t\t\t\t\t$rootName = $row['root_name'];\n\t\t\t\t\t} else {\n\t\t\t\t\t array_push($categoriesTree, array(\"id\"=>$rootId, \"text\"=>$rootName, \"children\"=>$rootChildren));\n\t\t\t\t\t\t$rootChildren = array();\n\t\t\t\t\t\t$rootId = $row['root_id'];\n\t\t\t\t\t\t$rootName = $row['root_name'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\tif ($numRows > 0) {\n\t\t\t if (sizeOf($level1Children) > 0) {\n\t\t\t array_push($rootChildren, array(\"id\"=>$level1Id, \"text\"=>$level1Name, \"children\"=>$level1Children));\n\t\t\t }\n\t\t array_push($categoriesTree, array(\"id\"=>$rootId, \"text\"=>$rootName, \"children\"=>$rootChildren));\n\t\t\t}\n\t\t\treturn $categoriesTree;\n\t\t}\n\t}",
"function dsf_create_up_cat_tree() {\n\tglobal $cat_parent_array;\n\t\n\t\tif (!isset($cat_parent_array) || !is_array($cat_parent_array)){\n\t\t\t$cat_parent_array = array();\n\t\t}\n\t\t\n\t\t$categories = dsf_db_query(\"select categories_id from \" . DS_DB_SHOP . \".categories order by categories_id\");\n\t\twhile ($results = dsf_db_fetch_array($categories)){\n\t\t\t$cat_id = $results['categories_id'];\n\t\t\t\n\t\t\t\n\t\t\t$info = dsf_get_up_cat_tree($results['categories_id'], 1);\n\t\t\t\t\n\t\t\t\t\t$items = explode(':' , $info);\n\t\t\t\t\t\n\t\t\t\t\tforeach ($items as $id){\n\t\t\t\t\t\t\tif (isset($id) && (int)$id > 0){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (isset($cat_parent_array[$id])){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// check to see there is some products in that category, if there are not, we are not interested\n\t\t\t\t\t\t\t\t\t\t$pr_query = dsf_db_query(\"select products_id from \" . DS_DB_SHOP . \".products_to_categories where categories_id='\" . (int)$cat_id . \"'\");\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (dsf_db_num_rows($pr_query) > 0){\n\t\t\t\t\t\t\t\t\t\t\t// only add if there are products found\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cat_parent_array[$id] = $cat_parent_array[$id] . ':' . $cat_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$cat_parent_array[$id] = $cat_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\t}\n\t\t\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\n// we do not need to return anything, other than for consistancy. all of the results\n// have been put into the global variable $cat_parent_array()\n\nreturn true;\t\t\n\t\n}",
"function qw_sort_terms_hierarchically(\n\tArray &$cats,\n\tArray &$into,\n\t$parentId = 0\n) {\n\tif(0 == $parentId){\n\t\t//used to limit the number of expensive loops for orphans\n\t\t$cats_copy = $cats;\n\t}\n\n\tforeach ( $cats as $i => $cat ) {\n\t\tif ( $cat->parent == $parentId ) {\n\t\t\t$into[ $cat->term_id ] = $cat;\n\t\t\tunset( $cats[ $i ] );\n\t\t}\n\t}\n\n\tforeach ( $into as $topCat ) {\n\t\t$topCat->children = array();\n\t\tqw_sort_terms_hierarchically( $cats, $topCat->children, $topCat->term_id );\n\t}\n\n\t//handle terms that are orphans based on limited values\n\tif(0 == $parentId && count($cats) > 0){\n\t\twhile(count($cats) > 0){\n\t\t\tforeach($cats as $term_id => $cat){\n\t\t\t\tif(isset($cats_copy[$cat->parent])){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$cat->children = array();\n\t\t\t\t$into[$cat->term_id] = $cat;\n\t\t\t\tunset($cats[$cat->term_id]);\n\t\t\t\tqw_sort_terms_hierarchically( $cats, $cat->children, $cat->term_id );\n\t\t\t}\n\t\t}\n\t}\n}",
"function getAllSubcategories($searchedCategory, &$hierarchie, &$ingredientsArray)\n{\n $ingredientsArray[] = $searchedCategory;\n\n foreach ($hierarchie as $category => $subSuperCategories) {\n if ($searchedCategory === $category)\n {\n if (isset($subSuperCategories[\"sous-categorie\"]))\n {\n foreach ($subSuperCategories[\"sous-categorie\"] as $subcategory) {\n $ingredientsArray[] = $subcategory;\n getAllSubcategories($subcategory, $hierarchie, $ingredientsArray);\n }\n }\n }\n }\n\n $ingredientsArray = array_unique($ingredientsArray);\n}",
"function prepareCategory($products) {\n foreach($products as $key => $product) {\n $categories = [];\n foreach($product['categories'] as $catCode)\n $categories[] = $this->find($catCode);\n $products[$key]['categories'] = $categories;\n }\n return $products;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find a method on an object. | public function findMethod($object, $method) {
if (method_exists($object, $method)) {
return [$object, $method];
} else {
return null;
}
} | [
"function checker($object, $method) {\n// var_dump($object);\n// var_dump($method);\n// var_dump(method_exists($object, $method));\n if (method_exists($object, $method)) {\n $object->$method();\n }\n}",
"public static function getReflectionMethod($object, $method)\n {\n return self::getReflectionElement($object, 'method', $method);\n }",
"function find_method(string $class_name, $method_name) {\n\tglobal $classes;\n\n\tif($method_name instanceof \\ast\\Node) return 'dynamic';\n\t$class_name = strtolower($class_name);\n\t$method_name = strtolower($method_name);\n\n\tif(!empty($classes[$class_name]['methods'][$method_name])) {\n\t\treturn $classes[$class_name]['methods'][$method_name];\n\t}\n\tif(!empty($classes[$class_name]['traits'])) {\n\t\tforeach($classes[$class_name]['traits'] as $trait) {\n\t\t\tif(!empty($classes[strtolower($trait)]['methods'][$method_name])) {\n\t\t\t\treturn $classes[strtolower($trait)]['methods'][$method_name];\n\t\t\t}\n\t\t}\n\t}\n\n\t// We don't chain constructors\n\tif($method_name == '__construct') return false;\n\n\tif(!empty($classes[$class_name]['parent'])) {\n\t\tif(strtolower($classes[$class_name]['parent']) == $class_name) return $class_name;\n\t\telse return find_method($classes[$class_name]['parent'], $method_name);\n\t}\n\treturn false;\n}",
"public function testFind()\n {\n $method = Method::find($this->c, 'a');\n\n $this->assertInstanceOf(\n 'ReflectionMethod',\n $method,\n 'Make sure a ReflectionMethod instance is returned.'\n );\n\n $this->assertEquals(\n 'a',\n $method->invoke($this->c),\n 'Make sure we can invoke the private method.'\n );\n\n $this->setExpectedException(\n 'Phine\\\\Test\\\\Exception\\\\MethodException',\n 'The method \"d\" does not exist in the class \"Phine\\\\Test\\\\Test\\\\C\".'\n );\n\n Method::find($this->c, 'd');\n }",
"private function findAdderMethod($object, $property)\n {\n if (method_exists($object, $method = 'add'.$property)) {\n return $method;\n }\n\n if (class_exists('Symfony\\Component\\PropertyAccess\\StringUtil') && method_exists('Symfony\\Component\\PropertyAccess\\StringUtil', 'singularify')) {\n foreach ((array) StringUtil::singularify($property) as $singularForm) {\n if (method_exists($object, $method = 'add'.$singularForm)) {\n return $method;\n }\n }\n } elseif (class_exists('Symfony\\Component\\Form\\Util\\FormUtil') && method_exists('Symfony\\Component\\Form\\Util\\FormUtil', 'singularify')) {\n foreach ((array) FormUtil::singularify($property) as $singularForm) {\n if (method_exists($object, $method = 'add'.$singularForm)) {\n return $method;\n }\n }\n }\n\n if (method_exists($object, $method = 'add'.rtrim($property, 's'))) {\n return $method;\n }\n\n if (substr($property, -3) === 'ies' && method_exists($object, $method = 'add'.substr($property, 0, -3).'y')) {\n return $method;\n }\n }",
"function find_methods($class)\n{\n\t$args=array_slice(func_get_args(),1);\n\tforeach($args as $arg)\n\t{\n\t\tif (method_exists($class,$arg))\n\t\t\treturn $arg;\n\t}\n\t\t\t\n\treturn FALSE;\n}",
"function has_method ($object, $method) {\n\tif (!is_object($object)) {\n\t\treturn V(get_class_methods($object))->include($method);\n\t}\n\n\treturn method_exists($object, $method);\n}",
"protected function findMethodsFrom($object)\n {\n // Respect \"allMethodNames\"\n if (method_exists($object, 'allMethodNames')) {\n if ($object instanceof Extension) {\n try {\n $object->setOwner($this);\n $methods = $object->allMethodNames(true);\n } finally {\n $object->clearOwner();\n }\n } else {\n $methods = $object->allMethodNames(true);\n }\n return $methods;\n }\n\n // Get methods\n return static::findBuiltInMethods($object);\n }",
"public function getMethodResult($object, $method)\n\t{\n\t\t$method = Format::getMethodFromString($method);\n\t\tif (is_null($method))\n\t\t\treturn $method;\n\n\t\treturn call_user_func_array([$object, $method['name']], $method['parameters']);\n\t}",
"private function getReflectionMethodObject() {\n $methodsList = $this->entity()->getData();\n $methodname = array_shift($methodsList);\n $classname = $this->entityClass()->getName();\n\n $reflectionMethod = null;\n try {\n $reflectionMethod = new PStub_Reflection_Method(\n $classname, $methodname\n );\n } catch (ReflectionException $e) {\n throw new PStub_Stubber_Exception(\n 'Class ' . $classname\n . ' has no method ' . $methodname . 'defined'\n );\n }\n\n return $reflectionMethod;\n }",
"public function method($name) {\n NULL === $name && $name= 'all';\n\n try {\n $m= $this->getClass()->getMethod($name);\n } catch (ElementNotFoundException $e) {\n throw new FinderException('No such finder', new MethodNotImplementedException('Cannot find finder method', $name));\n }\n\n if (!$m->hasAnnotation('finder')) {\n throw new FinderException('Not a finder', new IllegalArgumentException($m->getName()));\n }\n \n return new FinderMethod($this, $m);\n }",
"public function findMethod($method = null)\n {\n if ($method === null) {\n return $this->getConfig('findMethod');\n }\n\n $this->setConfig('findMethod', $method);\n\n return $method;\n }",
"abstract protected function _findFile($object);",
"public function matchesMethod(\\ReflectionMethod $method);",
"public function findMatch( &$className, $methodName ) {\n\t\n\t\t$found = null;\n\t\t\n\t\tforeach( self::$liste as $pointcut ) {\n\t\t\ttry {\n\t\t\t\tif ( $pointcut->isMatch( $className, $methodName ) ) {\n\t\t\t\t\t$found = $pointcut;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch(Exception $e) {\n\n\t\t\t\tthrow new aop_exception( __METHOD__.\": expecting isMatch interface. Error: \".$e->getMessage() );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $found;\n\t}",
"public function getPrivateMethod($objectOrClass, string $name): ?ReflectionMethod\n {\n try {\n $reflector = new ReflectionClass($objectOrClass);\n\n $method = $reflector->getMethod($name);\n\n $method->setAccessible(true);\n } catch (ReflectionException $exception) {\n $method = new class () {\n public function __call($name, $arguments)\n {\n return null;\n }\n };\n }\n\n return $method;\n }",
"public static function hasMethodOfType($object, $method, $type)\n {\n if (! method_exists($object, $method)) {\n return false;\n }\n\n try {\n $reflection = new ReflectionMethod($object, $method);\n $type = 'is' . studly_case($type);\n\n return $reflection->{$type}();\n } catch (ReflectionException $exception) {\n return false;\n } catch (Error $exception) {\n return false;\n }\n }",
"private function findMethod(string $string): ?int\n {\n $file = $this->getFile();\n $searchPos = $this->getStackPos();\n\n do {\n $searchPos = $file->findNext(T_FUNCTION, ++$searchPos);\n\n $nextPos = $searchPos + 1;\n $possibleNextName = $nextPos + 2;\n } while ($searchPos && !$file->findNext(T_STRING, $nextPos, $possibleNextName, false, $string));\n\n return is_int($searchPos) ? $searchPos : null;\n }",
"public static function find($class, $name, $access = true)\n {\n $reflection = new ReflectionClass($class);\n\n while (!$reflection->hasMethod($name)) {\n if (!($reflection = $reflection->getParentClass())) {\n throw MethodException::notExist($class, $name);\n }\n }\n\n $method = $reflection->getMethod($name);\n $method->setAccessible($access);\n\n return $method;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wrapper for reactToOnFailed which makes it possible to use $this>call('reactToOnFailed') as a callback in initialize | public function callReactToOnFailed($event) {
$this->call('reactToOnFailed', $event);
} | [
"public function markAsFailed(): self;",
"public function onFail()\n {\n }",
"public function markAsFailed();",
"public function onFailure()\n {\n }",
"public function runFailed();",
"public function failing($callback)\n {\n $this->app['events']->listen(Events\\JobFailed::class, $callback);\n }",
"public function onFailure($callback)\n {\n $args = func_get_args();\n $callback = array_shift($args);\n $this->onFailureHandler = $callback;\n $this->onFailureHandlerExtraArgs = $args;\n return $this;\n }",
"public function wasNotCalled($failMessage = null) {}",
"public function markAsFailed()\n {\n $this->update(['status' => 'failed']);\n\n StackTaskFailed::dispatch($this);\n }",
"protected abstract function registerFailureExceptions();",
"public function setExceptionCallback($callback){}",
"public function onFailure() {\n\t\tif ($this->onConnected) {\n\t\t\t$this->onConnected->executeAll($this);\n\t\t\t$this->onConnected = null;\n\t\t}\n\t}",
"public function addLoadingFailedListener(callable $listener): SubscriptionInterface;",
"public function getFailureCallback()\n {\n return $this->failure_callback;\n }",
"protected function dispatchConnectionFailedEvent()\n {\n event(new ConnectionFailed($this->request));\n }",
"protected function _registerFailedAttempt() {\n\t\tMage::helper ( 'onerhino_checkoutextend' )->registerFailedAttempt ();\n\t}",
"public static function set_auth_failure_callback(\\Closure $function) {\n self::$_auth_failure_callback = $function;\n }",
"public function failed()\n {\n // Called when the job is failing...\n }",
"public function setFailureCallback(callable $failure_callback)\n {\n $this->failure_callback = $failure_callback;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ List available repos | function pkg_list_repos() {
global $g;
$repo_base = "{$g['pkg_repos_path']}/{$g['product_name']}-repo";
$result = array();
$name_files = glob("{$repo_base}-*.name");
foreach ($name_files as $name_file) {
$repo_name = file_get_contents($name_file);
if ($repo_name == false || strlen($repo_name) <= 1) {
continue;
}
$repo_name_base = "{$repo_base}-{$repo_name}";
$descr_file = "{$repo_name_base}.descr";
if (file_exists($descr_file)) {
$descr = file_get_contents($descr_file);
if ($descr == false) {
$descr = 'Unknown';
}
} else {
$descr = 'Unknown';
}
$entry = array(
'name' => $repo_name,
'path' => "{$repo_name_base}.conf",
'descr' => $descr
);
if (file_exists("{$repo_name_base}.default")) {
$entry['default'] = true;
}
$result[] = $entry;
}
return $result;
} | [
"abstract function listRepositories();",
"function listGitHubRepos() {\n\t\tglobal $gitHubToken;\n\n\t\t$c = curl_init();\n\t\tcurl_setopt($c, CURLOPT_URL, \"https://api.github.com/user/repos\");\n\t\tcurl_setopt($c, CURLOPT_CUSTOMREQUEST, \"GET\"); \n\t\tcurl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($c, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($c, CURLOPT_HTTPHEADER, array( \n\t\t\t\"User-Agent: Modus PHP Script\", \n \t\t\"Content-Type: application/json\", \n \t\t\"Accept-Language: en-US\", \n \t\t\"Authorization: token \" . getenv(\"GITHUB_TOKEN\")) \n\t\t); \n\n\t\t$output = curl_exec($c);\n\n\t\t$gitHubReposJSON = json_decode($output, true);\n\t\tcurl_close($c);\n\n\t\t$htmlStr = '<ul class=\"repolist\">';\n\t\tforeach($gitHubReposJSON as $gitHubRepo) {\n\t\t\t$htmlStr = $htmlStr . '<li><a href=\"' . $gitHubRepo['url'] . '\">' . $gitHubRepo['id'] . ' ' . $gitHubRepo['name'] . '</a></li>';\n\t\t}\n\n\t\t$htmlStr = $htmlStr . '</ul>';\n\t\tprint $htmlStr;\n\t}",
"function listRepositories($path);",
"function pkg_build_repo_list() {\n\t$repos = pkg_list_repos();\n\t$list = array();\n\n\tforeach ($repos as $repo) {\n\t\t$list[$repo['name']] = $repo['descr'];\n\t}\n\n\treturn($list);\n}",
"public function getAllRepositories();",
"function get_my_repos()\n {\n return $this->github_api_request('/user/repos');\n }",
"public function get_live_repo_list()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $shell = new Shell();\n $repo_list = array();\n\n // Check cache\n if ($this->_check_cache_repo_list(TRUE))\n return $this->cache_repo_list;\n\n // Get repos\n //----------\n $options['env'] = 'LANG=en_US';\n $options['proxy'] = TRUE;\n $exitcode = $shell->execute(self::COMMAND_YUM, '-v repolist all', TRUE, $options);\n\n if ($exitcode != 0) {\n // Run a 'clean all'...this can fix issues so next time this function is called it may work.\n $this->clean(TRUE);\n throw new Engine_Exception(lang('base_unable_to_get_software_list'), CLEAROS_WARNING);\n }\n $rows = $shell->get_output();\n foreach ($rows as $row) {\n if (preg_match(\"/(Repo-id\\s+:\\s)(.*)/\", $row, $match)) { \n $parts = explode('/', $match[2]);\n $id = trim($parts[0]);\n $repo_list[$id] = array ('packages' => 0);\n } else if (preg_match(\"/(Repo-name\\s+:\\s)(.*)/\", $row, $match)) { \n $repo_list[$id]['name'] = trim($match[2]);\n } else if (preg_match(\"/(Repo-status\\s+:\\s)(.*)/\", $row, $match)) { \n $repo_list[$id]['enabled'] = preg_match('/enabled/', $match[2]) ? TRUE : FALSE;\n } else if (preg_match(\"/(Repo-pkgs\\s+:\\s)(.*)/\", $row, $match)) { \n $repo_list[$id]['packages'] = preg_replace('/,/', '', $match[2]);\n }\n }\n \n $this->_cache_repo_list($repo_list);\n\n return $repo_list;\n }",
"public function listRepos()\n {\n if (!isset($this->reposList)) {\n $this->_populate();\n }\n\n return $this->_reposList;\n }",
"public function listAction()\n {\n $dashboardApi = $this->objectManager->get('Eww\\\\SubhhOaDashboard\\\\Service\\\\DashboardApi');\n $repositories = json_decode($dashboardApi->listRepos());\n $this->view->assign('repositories', $repositories);\n }",
"public function get_repositories(){\n $repos = array();\n $res = $this->request_api('GET', 'user/repositories', $params = array());\n if( !empty($res['response']) ){\n $repos = json_decode($res['response']);\n }\n return $repos;\n }",
"public function getRepositories(): array;",
"public function listOwn() {\n\t\treturn $this->request('/user/repos');\n\t}",
"public function reposList($username)\n\t{\n\t\t// build URL\n\t\t$url = 'repos/show/'. (string) $username;\n\n\t\t// make the call\n\t\treturn $this->doCall($url);\n\t}",
"public function getRepos()\n {\n return $this->repos;\n }",
"public function getValidRepositories();",
"public function getAllRepositories()\n {\n return $this->_repositories;\n }",
"public function getRepositories()\n {\n $token = Config::getInstance()->get('php-censor.github.token');\n\n if (!$token) {\n return null;\n }\n\n $cache = Cache::getCache(Cache::TYPE_APC);\n $rtn = $cache->get('php-censor-github-repos');\n\n if (!$rtn) {\n $orgs = $this->makeRequest('/user/orgs', ['access_token' => $token]);\n\n $params = ['type' => 'all', 'access_token' => $token];\n $repos = ['user' => []];\n $repos['user'] = $this->makeRecursiveRequest('/user/repos', $params);\n\n foreach ($orgs as $org) {\n $repos[$org['login']] = $this->makeRecursiveRequest('/orgs/'.$org['login'].'/repos', $params);\n }\n\n $rtn = [];\n foreach ($repos as $repoGroup) {\n foreach ($repoGroup as $repo) {\n $rtn['repos'][] = $repo['full_name'];\n }\n }\n\n $cache->set('php-censor-github-repos', $rtn);\n }\n\n return $rtn;\n }",
"public function repos()\n {\n try {\n $client = new Client();\n \n // retrieve the org data to compare the number of public repositories\n $org_data = $client->get('https://api.github.com/orgs/BoomTownROI');\n $org_repos = json_decode($org_data->getBody())->public_repos;\n $requested_number = $org_repos + 1;\n \n // to overcome the default page limits, increase the page limit to 1 over the number of public repos from the org data. \n $res = $client->get('https://api.github.com/orgs/BoomTownROI/repos?per_page=' . $requested_number);\n $status = json_decode($res->getStatusCode());\n $data = json_decode($res->getBody());\n $request = \"Repository\";\n\n return view('apiData', compact(['request','data', 'org_repos']));\n\n } catch(\\Exception $e) {\n $status = $e->getMessage();\n return view('error', compact('status'));\n }\n }",
"private function getRepositories()\n {\n $oauth_params = array(\n 'oauth_consumer_key' => self::OAUTH_KEY,\n 'oauth_consumer_secret' => self::OAUTH_SECRET\n );\n\n $user = new Bitbucket\\API\\User;\n $user->getClient()->addListener(\n new Bitbucket\\API\\Http\\Listener\\OAuthListener($oauth_params)\n );\n\n $response = $user->get();\n $content = json_decode($response->getContent());\n\n return $content->repositories;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SPSubDivision has many SellerStockHistories. | public function sellerStockHistories()
{
// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)
return $this->hasMany('App\SellerStockHistory','spsd_id','spsd_id');
} | [
"public function getInventoryStocks()\n {\n return $this->hasMany(InventoryStock::className(), ['sid' => 'id']);\n }",
"public function getStocklists()\n {\n return $this->hasMany(Stocklists::className(), ['sellername' => 'name']);\n }",
"public function stocks()\n {\n return $this->hasMany('App\\Models\\Stock');\n }",
"public function stocks()\n {\n return $this->hasMany(Stock::class);\n }",
"public function stocks() {\n return $this->hasMany('App\\Productable');\n }",
"public function stock()\n {\n return $this->hasMany('App\\Guild\\Bank\\Stock');\n }",
"public function getStocklists()\n {\n return $this->hasMany(Stocklists::className(), ['productsname' => 'name']);\n }",
"public function getStocks()\n {\n return $this->hasMany(Stock::className(), ['measure_unit_id' => 'id']);\n }",
"public function portfolio_stocks()\n {\n return $this->hasMany('App\\Portfolio_Stock');\n }",
"protected function stock() {\n\t\treturn $this->hasMany('App\\Stock', 'user_id');\n\t}",
"public function getFaseStocks()\n {\n return $this->hasMany(FaseStock::className(), ['idProdutoStock' => 'idProdutoStock']);\n }",
"public function getProductStockInformation()\n {\n $stockSelect = $this->adapter->select()\n ->from(\n ['c_s_i' => $this->adapter->getTableName($this->_prefix . 'cataloginventory_stock_item')],\n array('entity_id' => 'product_id', 'value'=>'is_in_stock')\n );\n\n $childrenSelect = $this->adapter->select()\n ->from(\n ['c_p_r' => $this->adapter->getTableName($this->_prefix . 'catalog_product_relation')],\n ['c_p_r.child_id']\n )\n ->joinLeft(\n ['c_p_e' => $this->adapter->getTableName($this->_prefix . 'catalog_product_entity')],\n 'c_p_e.entity_id = c_p_r.parent_id',\n ['c_p_e.entity_id']\n )\n ->join(['t_d' => new \\Zend_Db_Expr(\"( \". $stockSelect->__toString() . ' )')],\n 't_d.entity_id = c_p_r.child_id',\n ['t_d.value']\n )\n ->where('t_d.value = ?', Mage_CatalogInventory_Model_Stock::STOCK_IN_STOCK);\n\n $parentSelect = $this->adapter->select()\n ->from(\n ['c_p_r' => $this->adapter->getTableName($this->_prefix . 'catalog_product_relation')],\n ['c_p_r.parent_id', 'entity_id' => 'c_p_r.child_id']\n )\n ->joinLeft(['t_d' => new \\Zend_Db_Expr(\"( \". $stockSelect->__toString() . ' )')],\n 't_d.entity_id = c_p_r.parent_id',\n ['t_d.value']\n )\n ->where('t_d.value = ?', Mage_CatalogInventory_Model_Stock::STOCK_IN_STOCK);\n\n $childCountSql = $this->adapter->select()\n ->from(\n [\"child_select\"=> new \\Zend_Db_Expr(\"( \". $childrenSelect->__toString() . ' )')],\n [\"child_count\" => new \\Zend_Db_Expr(\"COUNT(child_select.child_id)\"), 'entity_id']\n )\n ->group(\"child_select.entity_id\");\n\n $parentCountSql = $this->adapter->select()\n ->from(\n [\"parent_select\"=> new \\Zend_Db_Expr(\"( \". $parentSelect->__toString() . ' )')],\n [\"parent_count\" => new \\Zend_Db_Expr(\"COUNT(parent_select.parent_id)\"), 'entity_id']\n )\n ->group(\"parent_select.entity_id\");\n\n $select = $this->adapter->select()\n ->from(\n ['c_s_i' => $this->adapter->getTableName($this->_prefix . 'cataloginventory_stock_item')],\n array('entity_id' => 'product_id', 'qty', 'is_in_stock')\n )\n ->joinLeft(\n ['c_p_e' => $this->adapter->getTableName($this->_prefix . 'catalog_product_entity')],\n 'c_p_e.entity_id = c_s_i.product_id',\n ['c_p_e.type_id']\n )\n ->joinLeft(\n ['c_p_r' => $this->adapter->getTableName($this->_prefix . 'catalog_product_relation')],\n 'c_s_i.product_id = c_p_r.child_id',\n ['c_p_r.parent_id']\n );\n\n if($this->isDelta)$select->where('product_id IN(?)', $this->exportIds);\n\n $configurableType = Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE;\n $groupedType = Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE;\n $finalSelect = $this->adapter->select()\n ->from(\n [\"entity_select\" => new \\Zend_Db_Expr(\"( \". $select->__toString() . \" )\")],\n [\n \"entity_select.entity_id\",\n \"entity_select.qty\",\n \"is_in_stock\" => new \\Zend_Db_Expr(\"\n (CASE \n WHEN (entity_select.type_id = '{$configurableType}' OR entity_select.type_id = '{$groupedType}') AND entity_select.is_in_stock = '1' THEN IF(child_count.child_count > 0, 1, 0)\n WHEN entity_select.parent_id IS NOT NULL AND entity_select.is_in_stock = '1' THEN IF(parent_stock.parent_count > 0, 1, 0)\n ELSE entity_select.is_in_stock\n END\n )\"\n )\n ]\n )\n\n ->joinLeft(\n [\"child_count\"=> new \\Zend_Db_Expr(\"( \". $childCountSql->__toString() . \" )\")],\n \"child_count.entity_id = entity_select.entity_id\",\n []\n )\n ->joinLeft(\n [\"parent_stock\"=> new \\Zend_Db_Expr(\"( \". $parentCountSql->__toString() . \" )\")],\n \"parent_stock.entity_id = entity_select.entity_id\",\n []\n );\n\n return $this->adapter->fetchAll($finalSelect);\n }",
"public function addStockDataProvider() {\n\t\treturn array(\n\t\t\t'branch-1' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'shop_product_variant_id' => 'variant-active-1',\n\t\t\t\t\t'shop_branch_id' => 'branch-1',\n\t\t\t\t\t'change' => 10,\n\t\t\t\t\t'shop_branch_stock_id' => 'branch-stock-1'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'stock' => array(\n\t\t\t\t\t\tarray('ShopBranchStock' => array('stock' => '20')),\n\t\t\t\t\t\tarray('ShopBranchStock' => array('stock' => '15'))\n\t\t\t\t\t),\n\t\t\t\t\t'stock_log' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'change' => 10,\n\t\t\t\t\t\t\t'notes' => 'Adding stock'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'change' => 5,\n\t\t\t\t\t\t\t'notes' => 'Adding more stock'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'change' => 5,\n\t\t\t\t\t\t\t'notes' => 'Adding some test stock'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'branch-2' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'shop_product_variant_id' => 'variant-active-1',\n\t\t\t\t\t'shop_branch_id' => 'branch-2',\n\t\t\t\t\t'change' => 5,\n\t\t\t\t\t'shop_branch_stock_id' => 'branch-stock-2'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'stock' => array(\n\t\t\t\t\t\tarray('ShopBranchStock' => array('stock' => '10')),\n\t\t\t\t\t\tarray('ShopBranchStock' => array('stock' => '20'))\n\t\t\t\t\t),\n\t\t\t\t\t'stock_log' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'change' => 5,\n\t\t\t\t\t\t\t'notes' => 'Adding stock'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'change' => 15,\n\t\t\t\t\t\t\t'notes' => 'Initial stock'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'negative-add' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'shop_product_variant_id' => 'variant-active-1',\n\t\t\t\t\t'shop_branch_id' => 'branch-2',\n\t\t\t\t\t'change' => -5,\n\t\t\t\t\t'shop_branch_stock_id' => 'branch-stock-2'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'stock' => array(\n\t\t\t\t\t\tarray('ShopBranchStock' => array('stock' => '10')),\n\t\t\t\t\t\tarray('ShopBranchStock' => array('stock' => '20'))\n\t\t\t\t\t),\n\t\t\t\t\t'stock_log' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'change' => 5,\n\t\t\t\t\t\t\t'notes' => 'Adding stock'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'change' => 15,\n\t\t\t\t\t\t\t'notes' => 'Initial stock'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'custom-message' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'shop_product_variant_id' => 'variant-active-1',\n\t\t\t\t\t'shop_branch_id' => 'branch-2',\n\t\t\t\t\t'change' => 5,\n\t\t\t\t\t'notes' => 'Yee Haa',\n\t\t\t\t\t'shop_branch_stock_id' => 'branch-stock-2'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'stock' => array(\n\t\t\t\t\t\tarray('ShopBranchStock' => array('stock' => '10')),\n\t\t\t\t\t\tarray('ShopBranchStock' => array('stock' => '20'))\n\t\t\t\t\t),\n\t\t\t\t\t'stock_log' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'change' => 5,\n\t\t\t\t\t\t\t'notes' => 'Yee Haa'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'change' => 15,\n\t\t\t\t\t\t\t'notes' => 'Initial stock'\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 product_stock()\n {\n \treturn $this->hasOne(Product_stock::class, 'product_variant_id');\n }",
"public function getVariantStocks()\n {\n return $this->getProductStocks()\n ->joinWith('stock');\n }",
"public function stock()\n {\n return $this->belongsTo(InventoryStock::class, 'stock_id', 'id');\n }",
"public function stock() {\n return $this->belongsTo('App\\StockCode', 'stock_id');\n }",
"public function scientificBranches()\n {\n return $this->hasMany('App\\ScientificBranch');\n }",
"public function getCompanyVirtualStocks($company_id)\n {\n\n \n $users = ORM::factory('User')->where('company_id','=',$company_id)->find_all();\n\n\n $virtual_stocks = ORM::factory('VirtualStock')->where('user_id','IN',$users->as_array())->find_all();\n\n// Log::instance()->add(Log::DEBUG,serialize($virtual_stocks));\n\n $result_array = array();\n \n foreach($virtual_stocks as $vs) {\n\t\t\n\t $products_in_orders = ORM::factory('OrderProduct')->where('product_id','=',$vs->product_id)->and_where('product_state','=',1)->and_where('product_user_id','=',$vs->user_id)->find_all();\n\t\t\n\t $in_orders_stock = 0;\n\t\t\n\t foreach($products_in_orders as $pio) {\n\t $in_orders_stock += $pio->product_stock_change;\n\t }\n\t if($in_orders_stock > 0) {\n\t\tcontinue;\t\n\t\t//$vs->stock -= $in_orders_stock;\n\t }else {\n \t\tarray_push($result_array, $vs->as_array());\n \t }\n }\n \n// Log::instance()->add(Log::DEBUG,serialize($result_array));\n \n return $result_array;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method checks if an element with the passed value exists in the ArrayList. | public function contains($value)
{
// initialize the return value
$isEqual = false;
// run through all elements an check if the one
// of the items is equal to the passed one
foreach($this->_items as $item) {
if ($item == $value) {
$isEqual = true;
}
}
// return false if the value is not found
return $isEqual;
} | [
"public function contains($value)\n {\n // initialize the return value\n $isEqual = false;\n // run through all elements an check if the one\n // of the items is equal to the passed one\n foreach ($this->items as $item) {\n if ($item == $value) {\n $isEqual = true;\n }\n }\n // return false if the value is not found\n return $isEqual;\n }",
"function contains($item) {\r\n return in_array($item, $this->list);\r\n }",
"public function contains( $value ) {\n\t\tforeach ( $this->lists as $list ) {\n\t\t\tif ( array_search( $value, $list->getValues() ) !== false ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function contains($element): bool;",
"function has($list, $element)\n{\n checkList($list);\n if (isEmpty($list)) {\n return false;\n }\n if (head($list) === $element) {\n return true;\n }\n\n return has(tail($list), $element);\n}",
"public function contains($element){\r\n $hash = $this->hash($element);\r\n\t\treturn array_key_exists($hash, $this->data);\r\n\t}",
"public function contains($element) {\n return array_key_exists($element, $this->elements);\n }",
"public function valueExist($value) {\n foreach ($this->data as $key => $valueItem) {\n if($valueItem==$value)\n return true;\n }\n return false;\n }",
"public function collectionHasElement(&$collection, &$element)\n {\n return $collection->contains($element);\n }",
"public function hasElement($element);",
"public function has($element): bool\n\t{\n\t\tforeach ($this->collection as $item) {\n\t\t\tif ($item === $element) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function contains($item);",
"public function exists($key){return array_key_exists($key,$this->items_array);}",
"function checkValueExistOrNot($array, $value)\n{\n if (count($array) > 0 && in_array($value, $array)) {\n return true;\n }\n return false;\n}",
"public function contains($value) {\n\t\treturn in_array($value, parent::getArrayCopy());\n\t}",
"function idExist($id)\n\t{\n\t\treset($this->list);\n\t\tfor ($i=0;$i<count($this->list);$i++)\n\t\t\tif ($this->list[$i] == $id)\n\t\t\t\treturn true;\n\t\treturn false;\n\t}",
"public function contains($item): bool;",
"private function contains($arr, $value)\r\n {\r\n for($i=0; $i< count($arr); $i++){\r\n if($arr[$i] == $value)\r\n return true;\r\n }\r\n return false;\r\n }",
"public function hasValueIn($key, $value)\n {\n if ($this->hasKey($key)) {\n $ins = $this->container[$key];\n if ($ins instanceof ListSet) {\n return $ins->contain($value);\n }\n } else {\n return false;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends an HTTP POST Request to get access token from API server. | protected static function requestAccessToken() {
$post_data = [
'grant_type' => 'password',
'client_id' => self::$client_id,
'client_secret' =>self::$client_secret,
'username' => self::$user_id,
'password' => self::$password
];
$api_end_point = "api/oauth/token";
$result= Request::sendRequest($api_end_point, $post_data);
self::saveTokens($result);
} | [
"public function requestAccessToken()\n\t\t{\n\t\t\t// Create new curl instance\n\t\t\t$crl = curl_init();\n\t\t\t\n\t\t\t// Encode Client ID and Secret for Authorization Header\n\t\t\t$encodedID = base64_encode($this->getClientId() . \":\" . $this->getClientSecret());\n\t\t\t\n\t\t\t// Construct Authorization Header\n\t\t\t$hdr = array();\n\t\t\t$hdr = array('Authorization: Basic ' . $encodedID);\n\t\t\t\n\t\t\t// Set grant_type to get client credentials\n\t\t\t$data = array('grant_type' => 'client_credentials');\n\t\t\t\n\t\t\t// Set up curl parameters\n\t\t\tcurl_setopt($crl, CURLOPT_URL, $this->account_url); \t\t\t// Set URL\n\t\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, $hdr);\t\t\t\t\t// Attach Header\n\t\t\tcurl_setopt($crl, CURLOPT_POST, true);\t\t\t\t\t\t\t// Set as POST type\n\t\t\tcurl_setopt($crl, CURLOPT_POSTFIELDS, http_build_query($data));\t// Set POST fields\n\t\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\t\t\t\t// Set up to retrieve return value\n\t\t\t\n\t\t\t// Send request and store return in $json\n\t\t\t$json = curl_exec($crl);\n\t\t\t\n\t\t\t// Close curl connection\n\t\t\tcurl_close($crl);\n\t\t\t\n\t\t\t// Convert response to associative array\n\t\t\t$responseArray = json_decode($json, true);\n\t\t\t\n\t\t\t// Store response in SESSION variables\n\t\t\t$_SESSION['tokenRetrieved'] = true;\n\t\t\t$_SESSION['tokenEndTime'] = time() + (int)$responseArray['expires_in'] - 300;\n\t\t\t$_SESSION['tokenValue'] = $responseArray['access_token'];\n\t\t}",
"public function request_access_token()\n {\n $options = $this->plugin->get_options();\n \n if ($options['client_id'] === '' || $options['client_secret'] === '') {\n return;\n }\n // get setted client instance\n $client = $this->set_up_client($options);\n \n // Redirect to mendeley login page\n $client->start_authorization_flow();\n }",
"public static function access_token() {\n\t\ttry {\n\t\t\t$request = OAuthRequest::from_request();\n\t\t\t$result = WPOAuthProvider::access_token($request);\n\n\t\t\theader('Content-Type: application/x-www-form-urlencoded');\n\t\t\techo $result;\n\t\t}\n\t\tcatch (OAuthException $e) {\n\t\t\tthrow new Exception($e->getMessage(), 401);\n\t\t}\n\t}",
"private function sendWithAccessToken() {\n curl_setopt($this->curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Authorization: Bearer ' . $this->accessToken\n ));\n }",
"private function getAccessToken() {\n\n $base = \"Basic \" . base64_encode($this->client_id . \":\" . $this->secret_id);\n $instances = new Curl();\n $instances->headers['Authorization'] = $base;\n $response = $instances->post(\"https://api.mainapi.net/token\", array(\"grant_type\" => \"client_credentials\"));\n $data = json_decode($response->body);\n $ap = (isset($data->access_token)) ? $data->access_token : null;\n $this->ap = $ap;\n }",
"public function getTokenApiEpivigila()\n {\n $guzzle = new \\GuzzleHttp\\Client();\n $response = $guzzle->post(env('TOKEN_ENDPOINT'), [\n 'form_params' => [\n 'grant_type' => 'client_credentials',\n 'client_id' => env('CLIENT_ID'),\n 'client_secret' => env('CLIENT_SECRET'),\n ],\n ]);\n\n dump(json_decode((string)$response->getBody(), true));\n return json_decode((string)$response->getBody(), true)['access_token'];\n }",
"public function testFetchApiTokenActionViaXmlHttpRequest() {\n $this->logUserIn($this->userAdmin);\n \n $params = array(\n 'user' => 'Andersbo2',\n 'pass' => 'Anders1302',\n );\n \n $this->dispatch('/fluxuser/fetchApiToken', 'POST', $params, true);\n $this->assertEquals('{\"apitoken\":\"b5e57404c1fc3fe0283766206b6bbf4c\"}', $this->getResponse()->getContent(), sprintf('Incorrect API Token received form Pivotal Tracker! Expected: %s , Actual: %s', '{\"apitoken\":\"b5e57404c1fc3fe0283766206b6bbf4c\"}', $this->getResponse()->getContent()));\n }",
"protected function requestAccessToken()\n\t{\n\t\t// prepare the oAuth2 call\n\t\t$res = $this->httpClient->post($this->authUrl, [\n\t\t\t'form_params' => [\n\t\t\t\t'grant_type' => 'client_credentials',\n\t\t\t\t'client_id' => config('laravel-billwerk.auth.client_id'),\n\t\t\t\t'client_secret' => config('laravel-billwerk.auth.client_secret'),\n\t\t\t],\n\t\t]);\n\n\t\tif ($res->getStatusCode() === 200) {\n\t\t\t//store access token on cache\n\t\t\t$body = json_decode($res->getBody());\n\t\t\tCache::put(config('laravel-billwerk.auth.token_cache_key'), $body->access_token, 60 * 24);\n\t\t\t$this->accessToken = $body->access_token;\n\t\t} else {\n\t\t\tLog::error($res->getBody());\n\t\t\tthrow new Exception('Billwerk auth error - '.$res->getStatusCode());\n\t\t}\n\t}",
"public function requestToken();",
"private function getAccessToken(){\n $baseUrl = \"https://\".Input::get('shop').\"/admin/oauth/access_token\";\n\n $headers = [\n 'Content-Type' => 'application/json',\n ];\n $body = [\n 'client_id' => $this->config['api_key'],q\n 'client_secret' => $this->config['api_secret'],\n 'code' => Input::get('code')\n ];\n\n $ch = curl_init($baseUrl);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $body);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, [\n 'Content-Type' => 'application/xml',\n ]);\n\n return json_decode(curl_exec($ch))->access_token;\n }",
"private function create_access_token() {\n $credentials = base64_encode(base64_encode($this->client_id).':'.base64_encode($this->client_secret));\n\n $ch = curl_init(\"https://api-crt.cert.havail.sabre.com/v2/auth/token\");\n $vars =\"grant_type=client_credentials\";\n $header =array(\n 'Authorization: Basic '.$credentials,\n 'Accept: */*',\n 'Content-Type: application/x-www-form-urlencoded'\n );\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_VERBOSE, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); \n curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $res= curl_exec($ch);\n curl_close($ch);\n\n return json_decode($res)->access_token;\n }",
"public function accessToken()\n {\n $server = (new OAuth)->init();\n $request = Request::createFromGlobals();\n $request->request['grant_type'] = 'authorization_code';\n\n $errorMessage = $this->_accessTokenValidation($request);\n if (!empty($errorMessage)) {\n header('HTTP/1.1 422 Unprocessable Entity');\n echo json_encode([\n 'message' => $errorMessage\n ]);\n return;\n }\n\n $server->handleTokenRequest($request)->send();\n }",
"public function get_auth_token() {\n $arg = json_encode($_REQUEST);\n return `../web/registermo $arg`;\n }",
"public function grantToken()\n {\n $request_token = BkashLiveService::bkashGetToken();\n return response()->json([\n 'token_type' => $request_token['token_type'],\n 'id_token' => $request_token['id_token'],\n 'expires_in' => $request_token['expires_in'],\n 'refresh_token' => $request_token['refresh_token'],\n ]);\n }",
"private function getRequestToken()\n\t{\n\t\t$url = self::API_URL . self::REQUEST_TOKEN_METHOD;\n\t\t$response = $this->fetch('POST', $url, '');\n\t\t$token = $this->parseTokenString($response['body']);\n\t\t$this->requestToken = $token;\n\t}",
"public function request_token()\n {\n // http_build_query sanitizes the data and prevents injection attacks\n $query = http_build_query(\n array(\n 'client_id' => $this->config->item('facebook_app_id'),\n 'redirect_uri' => site_url('facebook/access_token'),\n 'state' => $this->generateCsrfSecret(),\n 'scope' => 'email'\n )\n );\n\n redirect('http://www.facebook.com/dialog/oauth?' . $query);\n }",
"private function getAccessToken()\n {\n $response = $this->getHttpClient()->post(\"https://moneywave.herokuapp.com\".$this->tokenUrl, [\n 'form_params' => [\n \"apiKey\" => $this->apiKey,\n \"secret\" => $this->secretkey\n ]\n ]);\n\n return json_decode($response->getBody(), true)['token'];\n }",
"function requestToken() {\n $params = [\n 'client_id' => CLIENT_ID,\n 'client_secret' => CLIENT_SECRET,\n 'code' => $_GET['code'],\n 'redirect_uri' => REDIRECT_URI,\n ];\n $token = request(['url' => \"https://oauth.vk.com/access_token\", 'method' => 'GET', 'data' => $params]);\n return $token;\n}",
"public function getAccessToken()\r\n {\r\n $postData = [\r\n 'grant_type' => 'client_credentials',\r\n 'client_id' => $this->channelId,\r\n 'client_secret' => $this->channelSecret\r\n ];\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, self::REPLY_URI);\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->sslCheck);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->sslCheck);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type:application/x-www-form-urlencoded']);\r\n\r\n curl_exec($ch);\r\n curl_close($ch);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads view helper according to helperKey. | protected function loadViewHelper($helperKey) {
if (isset($this->loadedHelperFiles[strtolower($helperKey)])) {
return $this->loadedHelperFiles[strtolower($helperKey)]['class'];
}
foreach ($this->viewHelperIncludePath as $extensionKey => $viewHelperPath) {
$viewHelperRealPath = $viewHelperPath;
if (t3lib_div::isFirstPartOfStr($viewHelperPath, 'classes/')) {
$viewHelperRealPath = substr($viewHelperPath, 8);
}
if (substr($viewHelperRealPath, -1) == '/') {
$viewHelperRealPath = substr($viewHelperRealPath, 0, -1);
}
$classNamePrefix = t3lib_extMgm::getCN($extensionKey);
$possibleFilename = 'class.' . $classNamePrefix . '_' . str_replace('/', '_', $viewHelperRealPath) . '_' . strtolower(str_replace('_', '', $helperKey)) . '.php';
$possibleClassName = $classNamePrefix . '_' . str_replace('/', '_', $viewHelperRealPath) . '_' . self::underscoredToUpperCamelCase($helperKey);
$viewHelperIncludePath = t3lib_extMgm::extPath($extensionKey)
. $viewHelperPath . $possibleFilename;
if (file_exists($viewHelperIncludePath)) {
include_once($viewHelperIncludePath);
$this->loadedHelperFiles[strtolower($helperKey)] = array(
'file' => $viewHelperIncludePath,
'class' => $possibleClassName
);
return $possibleClassName;
}
}
// viewhelper could not be found
return false;
} | [
"public function helper($helper) {\n return $this->load(\"helpers/$helper.php\");\n }",
"abstract public function registerHelper($helperName);",
"private static function fetch($helper)\n\t{\n\t\tif ( in_array($helper, self::$loaded) )\n\t\t\treturn;\n\t\t\n\t\tself::$loaded[] = $helper;\n\t\t\n\t\t$pieces = explode('/', $helper);\n\t\t$name = array_pop($pieces);\n\t\t\n\t\tif ( isset($pieces[0]) && $pieces[0] == 'app' )\n\t\t\tarray_shift($pieces);\n\t\t\n\t\t$path = implode('/', $pieces) . '/';\n\t\t\n\t\t$base_dir = preg_match('#^app/#', $helper) ? self::$app_path : self::$path;\n\t\t$filename = $base_dir . $path . 'helpers.' . $name . '.php';\n\t\t\n\t\tif ( ! file_exists($filename) )\n\t\t{\n\t\t\tthrow new HelpersNotFoundException($filename);\n\t\t}\n\t\t\n\t\trequire($filename);\n\t}",
"function load_helper($helpers = array())\n{\n\tif ( ! is_array($helpers))\n\t{\n\t\t$helpers = array($helpers);\n\t}\n\n\tforeach ($helpers as $helper)\n\t{\t\t\n\t\t$helper = strtolower(str_replace(EXT, '', str_replace('_helper', '', $helper)).'_helper');\n\n\t\t$ext_helper = BASE_PATH.'php_functions/helpers/'.$helper.EXT;\t\t\n\t\tif (file_exists($ext_helper))\n\t\t{\n\t\t\tinclude_once($ext_helper);\n\t\t}\n\t\telse\n\t\t{\t\t\n\t\t\tdumper('Unable to load the requested file: helpers/'.$helper.EXT);\n\t\t}\t\n\t}\t\t\n}",
"private function loadHelpers() {\n\t\t\t// Helpers existentes no core.\n\t\t\t$core_helpers = array('Date','Html','Image','Text','Paginate');\n\n\t\t\t$this->helpers = array_merge($this->helpers, $this->config['default_helpers']);\n\t\t\t// Adiciona os helpers na view.\n\t\t\tforeach ($this->helpers as $helper) {\n\t\t\t\t$local = in_array($helper, $core_helpers) ? CORE : ROOT;\n\t\t\t\trequire $local.\"/helpers/\".$helper.\"Helper.php\";\n\t\t\t\t$class = $helper.'Helper';\n\t\t\t\t$this->add(strtolower($helper), new $class($this->i18n));\n\t\t\t}\n\n\t\t\t// Adiciona os helpers requeridos em outros helpers.\n\t\t\tforeach ($this->helpers as $helper) {\n\t\t\t\t$helper = $this->template->get(strtolower($helper));\n\t\t\t\tforeach ($helper->uses as $name) {\n\t\t\t\t\t$name = strtolower($name);\n\t\t\t\t\t$helper->$name = $this->template->get($name);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"private function loadHelpers()\n {\n //\n }",
"protected function _initViewHelpers() {\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n if (NULL === $viewRenderer->view) {\n $viewRenderer->initView();\n }\n \n $viewRenderer->view->addHelperPath('App/Frontend/View/Helper', 'App_Frontend_View_Helper');\n }",
"private function _load_helpers() {\n\t\tforeach ($this->helpers as $helper) {\n\t\t\t$this -> load -> helper($helper);\n\t\t}\n\t}",
"function _initViewHelpers()\n {\n $renderer = Zend_Controller_Action_HelperBroker::getStaticHelper(\n 'viewRenderer');\n $renderer->initView();\n $renderer->view->addHelperPath('Dlayer/View/',\n 'Dlayer_View');\n }",
"protected function _initViewHelpers()\n {\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n if (NULL === $viewRenderer->view) {\n $viewRenderer->initView();\n }\n \n $viewRenderer->view->addHelperPath('App/View/Helper', 'App_View_Helper');\n }",
"public function registerHelper($helper);",
"private function _load_helpers() {\n foreach ($this->helpers as $helper) {\n $this->load->helper($helper);\n }\n }",
"private function _load_helpers()\n {\n foreach ($this->helpers as $helper)\n {\n $this->load->helper($helper);\n }\n }",
"public function loadHelper($identifier, $params = array())\n {\n $view = $this->getView();\n \n if(KInflector::isPlural($view->getName())) \n {\n if($state = $view->getModel()->getState()) {\n $params = array_merge( $state->getData(), $params);\n }\n } \n else \n {\n if($item = $view->getModel()->getItem()) {\n $params = array_merge( $item->getData(), $params);\n }\n } \n \n return parent::loadHelper($identifier, $params);\n }",
"function include_helper() {\n\n\t\t$type = $this->get_type();\n\n\t\t$helper_file_name = HELPER_PATH.$type.'_helper.php';\n\n\t\tif (!file_exists($helper_file_name)) {\n\t\t\t$type = 'application';\n\t\t\t$helper_file_name = HELPER_PATH.$type.'_helper.php';\n\t\t}\n\n\t\tif (!file_exists($helper_file_name)) {\n\t\t\treturn false;\t\n\t\t}\t\t\n\n\t\trequire_once($helper_file_name);\t\n\n\t\t$helper_class_name = Inflector::camelize($type).'Helper';\n\n\t\tif (!class_exists($helper_class_name)) {\n\t\t\treturn false;\t\n\t\t}\n\n\t\t$this->template->helper = new $helper_class_name($this->template);\n\n\t\t$this->template->helper->template = & $this->template;\n\n\t\treturn true;\n\t}",
"protected function getViewHelper() {\n\t\tif($this->_viewHelper === null) {\n\t\t\t$this->_viewHelper = new \\App\\Helper\\View();\n\t\t}\n\t\treturn $this->_viewHelper;\n\t}",
"protected function _initViewHelpers() {\n $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n if (NULL === $viewRenderer->view) {\n $viewRenderer->initView();\n }\n \n $viewRenderer->view->addHelperPath('App/View/Helper', 'App_View_Helper');\n $viewRenderer->view->addHelperPath('App/Frontend/View/Helper', 'App_Frontend_View_Helper');\n $viewRenderer->view->addHelperPath('App/Backoffice/View/Helper', 'App_Backoffice_View_Helper');\n }",
"public function addHelper( $name, \\Aimeos\\MW\\View\\Helper\\Iface $helper );",
"public function loadHelpers()\n {\n $path = __DIR__.'/Helpers/LojaHelper.php';\n if (file_exists($path)) {\n require_once $path;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Trim the monitored job list. | public function trimMonitoredJobs()
{
$this->connection()->zremrangebyscore(
'monitored_jobs', CarbonImmutable::now()->subMinutes($this->monitoredJobExpires)->getTimestamp() * -1, '+inf'
);
} | [
"public function apmTrimAll() {\n\t\t$spacedDescription = $this->task_log_description;\n\t\tparent::apmTrimAll ();\n\t\t$this->task_log_description = $spacedDescription;\n\t}",
"public function trim_container()\n\t{\n\t\t$this->tokens = array_slice( $this->tokens, 1, -1 );\n\t}",
"private function truncateJobs()\n {\n \\DB::delete('queue_errors')\n ->execute();\n\n \\DB::delete('queue_jobs')\n ->execute();\n }",
"public function clearJobs()\n {\n return $this->clearQueue('queue');\n }",
"public function clear() {\n DelayedJobs::remove();\n }",
"public function removeIfEmpty();",
"public static function trim()\n\t{\n\t\t// allow an option to be set to override the log retention - in days\n\t\t$retention_days = Options::get( 'log_retention', 14 );\t\t// default to 14 days\n\n\t\t// make it into the string we'll use\n\t\t$retention = '-' . intval( $retention_days ) . ' days';\n\n\t\t// Trim the log table down\n\t\t$date = DateTime::create()->modify( $retention );\n\n\t\t$result = DB::query( 'DELETE FROM {log} WHERE timestamp < ?', array( $date->sql ) );\n\n\t\tif ( $result ) {\n\t\t\tEventLog::log( _t( 'Entries over %d days old were trimmed from the EventLog', array( $retention_days ) ), 'info' );\n\t\t}\n\t\telse {\n\t\t\tEventLog::log( _t( 'There was an error trimming old entries from the EventLog!' ), 'err' );\n\t\t}\n\n\t\treturn $result;\n\n\t}",
"public function trim()\n\t\t{\n\t\t\tforeach( $this->items as $key => $value )\n\t\t\t{\n\t\t\t\t$this->items[$key] = trim($value);\n\t\t\t}\n\t\t}",
"public function emptyQueue() {\n $this->client->zremrangebyscore(self::JOB_QUEUE_NAME, \"-inf\", \"inf\");\n $this->client->del(\"total_processing_time\");\n $this->client->del(\"num_jobs_processed\");\n }",
"protected function removeEmpty()\n {\n $ret_arr = array();\n foreach ($this->rows as $row) {\n $line = trim(join('', $row));\n if (!empty($line)) {\n $ret_arr[] = $row;\n }\n }\n $this->rows = $ret_arr;\n }",
"public function clearUserLastPrintJobs()\n {\n $this->collUserLastPrintJobs = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function findHistoryCleanupJobs(): array;",
"public function deleteAllJobs()\n {\n $sql = \"TRUNCATE TABLE queue\";\n $this->db->query($sql);\n \\writelog(\"all jobs in the queue has been removed\");\n }",
"function get_clean_jobs() {\n\t$all_jobs = get_all_jobs();\n\t$jobs = [];\n\tforeach($all_jobs as $jid=>$name) {\n\t\tif ((stripos($name, 'clean') !== FALSE) ||\n\t\t\t(stripos($name, 'Meeting night cleaner') !== FALSE)) {\n\t\t\t$jobs[] = $jid;\n\t\t}\n\t}\n\treturn $jobs;\n}",
"public function clearWorkers()\n {\n $this->information['workers'] = [];\n $this->changed = true;\n $this->save();\n }",
"public function trimToSize() \r\n {\r\n $this->size = $this->sizeOfQueue();\r\n }",
"public static function clearJobs()\n\t{\n\t\tforeach(self::getJobIds() as $jobId) {\n\t\t\tself::deleteJob($jobId);\n\t\t}\n\t}",
"private function removeEmptyRecords(): void\n {\n Log::info('Remove Empty Records');\n ScriptInstance::emptyData()->chunk(100, function ($instances) {\n foreach ($instances as $instance) {\n $instance->forceDelete();\n }\n });\n }",
"private function clearZombieJobs()\n {\n $tenMinIntervall = time() - self::ZOMBIE_MIN_INTERVAL;\n $jobs = $this->getJobQuery()\n ->andWhere(['<', 'start', $tenMinIntervall])\n ->all();\n \n foreach ($jobs as $job) {\n $job->setStop();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save request to transaction. | public function saveTransaction()
{
$transaction = Transaction::where('request_type', 'mandate_token')->where(['unique_id' => $this->id])->firstOrNew();
$transaction->request_type = 'mandate_token';
$transaction->unique_id = $this->id;
$transaction->orderid = $this->subscription_reference;
$transaction->response_format = $this->responseFormat ?? 'HTML';
$transaction->request_payload = $this->list()->toJson();
if (isset($this->response)) {
$transaction->request_payload = collect($this->response)->toJson();
}
$transaction->save();
} | [
"public function saveTransaction()\n {\n $transaction = new Transaction();\n $transaction->request_type = 'transaction';\n $transaction->unique_id = $this->id;\n $transaction->orderid = $this->uatPrefix . $this->reference;\n $transaction->response_format = $this->responseFormat;\n $transaction->request_payload = $this->list()->toJson();\n $transaction->save();\n }",
"public function save() {\n $transaction = $this->transaction;\n $transaction->changed = REQUEST_TIME;\n\n $transaction_array = array(\n 'transaction_id' => $transaction->transactionId,\n 'uid' => $transaction->uid,\n 'cashier' => $transaction->cashier,\n 'order_id' => $transaction->orderId,\n 'type' => $transaction->type,\n 'data' => $transaction->data,\n 'register_id' => $transaction->registerId,\n 'changed' => $transaction->changed,\n 'created' => $transaction->created,\n 'completed' => $transaction->completed,\n );\n\n if ($transaction->transactionId) {\n $primary_keys = 'transaction_id';\n }\n else {\n $primary_keys = array();\n }\n\n drupal_write_record($transaction::TABLE_NAME, $transaction_array, $primary_keys);\n $transaction->transactionId = $transaction_array['transaction_id'];\n unset($transaction_array);\n }",
"public function store()\n\t{\n\t\t$this->transaction->save(Input::all());\n\t}",
"public function submit(): void\r\n {\r\n $this->em->persist($this->transaction);\r\n $this->em->flush();\r\n }",
"public function saveTransaction()\n {\n }",
"public function save()\r\n {\r\n // Serialize request and save to session '_REQ'\r\n Session::set('_REQ', serialize($this));\r\n }",
"protected function saveRequestIfNeeded(): void {\r\n $needToSave = false;\r\n \r\n if (Config::instance()->get('application', 'log_all_requests')) {\r\n $needToSave = true;\r\n } else {\r\n if ($this->_checker->isSuspiciousRequest()) {\r\n $needToSave = true;\r\n }\r\n }\r\n \r\n if ($needToSave) {\r\n $this->_modelRequest->save();\r\n }\r\n }",
"public function commit() {\n if ($this->txUrl) {\n $this->client->post($this->txUrl . '/fcr:tx/fcr:commit');\n $this->txUrl = null;\n\n $this->killKeepTransactionAlive();\n $this->reindexResources();\n }\n }",
"private function commitRequest($request_id){\n \n if (!Yii::$app->user->can(\"admin\")) {\n throw new HttpException(403, 'You are not allowed to perform this action.');\n }\n $requests = RequestFile::find()->where(['request_id'=>$request_id])->andWhere(['granted'=>NULL])->all();\n if(sizeof($requests) == 0)\n {\n $request = Request::find()->where(['id'=>$request_id])->one();\n $request->committed=1;\n $request->save();\n }\n \n \n }",
"function save_request($request)\n\t{\n\t\t$ci = &get_instance();\n\t\t// $ci->load->database('cloud_simpi');\n\n\t\t$data = [\n\t\t\t'request' => json_encode($request),\n\t\t\t'request_at' => date('Y-m-d H:i:s'),\n\t\t\t'request_method' => $request->method,\n\t\t\t'request_agent' => $request->agent,\n\t\t\t'http_protocol' => PROTOCOL,\n\t\t\t'http_host' => HTTP_HOST,\n\t\t\t'http_method' => HTTP_METHOD,\n\t\t\t'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : NULL,\n\t\t\t'ip_address' => $request->ip_address,\n\t\t\t'is_local' => $request->is_local,\n\t\t];\n\t\t$ci->db->insert('simpi_log_api_tmp', $data);\n\t}",
"public function save(HTTPRequest $request)\n {\n $this->logs[] = $request;\n }",
"public function store(Request $request)\n\t{\n\t\tif(sizeof(PartnerTransaction::$rules) > 0)\n\t\t\t$this->validateRequestOrFail($request, PartnerTransaction::$rules);\n\n\t\t$input = $request->all();\n\n\t\t$partnerTransactions = $this->partnerTransactionRepository->create($input);\n\n\t\treturn $this->sendResponse($partnerTransactions->toArray(), \"PartnerTransaction saved successfully\");\n\t}",
"public function storeRequest()\n\t{\n\t\treturn $this->storage->store($this->request);\n\t}",
"public function save() {\n return BuyerTransaction::update((array) $this);\n }",
"public function doTransaction()\n\t{\n\t\t$this->initRequest();\n\n\t\t$this->setTransaction([\n\t\t\t'BatchClose' => []\n\t\t]);\n\t\t\n\t\treturn $this->Transaction();\n\t}",
"public function save()\n {\n $this->getEntityManager()->flush();\n }",
"public function Save()\n\t{\n\t\t$_SESSION[self::TRANSACTION_IDENTIFIER] = serialize($this);\n\t}",
"public function commit()\n\t{\n\t\tparent::commit();\n\t\t$this->hasActiveTransaction = false;\n\t}",
"public function transactionCommit();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add an activity node when an activity content item is created | function pi_activity_add_new_activity_for_activity_content_node($node, $node_function, $visible_status, $activity_title, $activity)
{
//pi_debug_message("pi_activity_add_activity_when_activity_content_node_created called for " . $content_node->nid . "(" . $content_node->title . ")");
//load the defined "activity"
if(!pi_check_is_node_of_type($activity, 'pi_activity'))
{
//pi_debug_message("pi_activity_add_activity_when_activity_content_node_created called with no activity - getting activity from details: " . $details->activity_id);
$activity = node_load(pi_activity_get_activity_nid_for_content_nid($node->nid));
}
if(pi_check_is_node_of_type($activity, 'pi_activity'))
{
pi_activity_add_activity_node_for_activity_content_node($activity, $node);
// Then set the status...
$new_activity_nid = pi_activity_get_activity_nid_for_content_nid($node->nid);
if(pi_check_is_node_of_type($activity))
{
pi_activity_set_status($nid, $actor);
}
}
else
{
drupal_set_message(t("Can't identify activity for created node @nid, of type @type", array('@nid' => $node->nid, '@type'=>$node->type)), 'error');
}
/*
//copy over current except for the activity_id
$activity_array = new stdClass();
$activity_array->title = check_plain($activity_title);
$activity_array->body = $loaded_activity->description;
$activity_array->activity_type = $loaded_activity->activity_type;
$activity_array->node_type = $loaded_activity->node_type;
$activity_array->parameters = $loaded_activity->parameters;
$activity_array->destination = $loaded_activity->destination;
$activity_array->audience = $loaded_activity->audience;
$activity_array->actor = $loaded_activity->actor;
$activity_array->weight = $loaded_activity->weight;
*/
/*
* @todo The following code changes will cause problems with the authoring interface!
* This part of the code uses the node id as activity id.
* Authoring interface generates activity id via max(activity_id) + 1. This generated
* activity_id will sooner or later conflict with a node id !
*
* Either change this code back to the original version, or change authoring interface.
*/
//$activity_array["nid"] = $node->nid;
//$new_activity_id = $node->nid;
//create the new activity
//node_save($activity_array);
//$new_activity_id = $activity_array->nid;
/* $new_activity_id = $node->nid;
//****new details object
$new_details = new stdClass;
$new_details->inquiry_id = $details->inquiry_id;
$new_details->stage_id = $details->stage_id;
$new_details->phase_id = $details->phase_id;
$new_details->activity_id = $new_activity_id;
//set status for the new activity
//$activity_status = load_activity_status($details->activity_id, $user->uid);
$activity_status = pi_activity_load_status($details->activity_id, $user->uid);
$new_activity_status = new stdClass;
$new_activity_status->inquiry_id = $details->inquiry_id;
$new_activity_status->activity_id = $new_activity_id;
$new_activity_status->uid = $activity_status['uid'];
$new_activity_status->gid = $activity_status['gid'];
$new_activity_status->node_function = $activity_status['node_function'];
$new_activity_status->visible_status = $activity_status['visible_status'];
pi_activity_set_status($new_activity_status['activity_id'], $new_status['gid'], $new_activity_status['visible_status'], $new_activity_status['node_function']);*/
/*
//set actor for the new activity
$activity_actor = load_activity_actor($details->inquiry_id, $details->activity_id, NULL, NULL);
$new_activity_actor["inquiry_id"] = $details->inquiry_id;
$new_activity_actor["activity_id"] = $new_activity_id;
///for audience smaller than actor in add activity
$actor_gid = $activity_actor[0]["gid"];
$actor_uid = $activity_actor[0]["uid"];
$actor_group_type = pi_get_type_of_group($actor_gid);
$users_group = get_group_of_type($uid, $loaded_activity->audience, $details->inquiry_id, $details->stage_id, $details->phase_id, $details->activity_id);
$audience_gid = $users_group;
$audience_group_type = $activity->audience;
if( ($actor_group_type == 'group' && $audience_group_type == 'individual') ||
($actor_group_type == 'class' && $audience_group_type != 'class' && $audience_group_type != 'multiclass') )
{
$new_activity_actor["uid"] = $uid;
$new_activity_actor["gid"] = $audience_gid;
}
else
{
$new_activity_actor["uid"] = $activity_actor[0]["uid"];
$new_activity_actor["gid"] = $activity_actor[0]["gid"];
}
insert_activity_actor($new_activity_actor);
*/
//set the stage phase activity
/* $psp_id = get_psp_id_for_stage_and_phase($details->stage_id, $details->phase_id);
if(!$psp_id)
{
$psp_id = get_psp_id_for_stage_and_phase(NULL, $details->phase_id);
}
$query = "SELECT position FROM {pi_stage_phase_activity} WHERE psp_id = %d ORDER BY position DESC";
$current_pos = db_result(db_query($query, $psp_id));
$new_pos = $current_pos + 1;
insert_stage_phase_activity($psp_id, $new_activity_id, $new_pos);
*/
//set pi activity node
/* add_new_pi_activity_node($node, $node_function, $visible_status, $new_details);
//set og if necessary for new node
if($loaded_activity->audience != "individual")
{
$users_group = get_group_of_type($uid, $loaded_activity->audience, $new_details->inquiry_id, $new_details->stage_id, $new_details->phase_id, $new_details->activity_id);
$context['groups'] = array($users_group);
og_add_group_action($node, $context);
}*/
} | [
"function _pi_activity_set_activity_content_audience(&$node, $activity_id)\r\n{\r\n\t// Add group audience data for the activity content by getting the user's associated group\r\n\t// of the given audience type\r\n\t$activity = node_load($activity_id);\r\n\tif(pi_check_is_node_of_type($activity, 'pi_activity'))\r\n\t{\r\n\t\t$audience_gids = pi_groups_get_users_audience_groups($node->uid, $activity->actor, $activity->audience);\r\n\t\t$context['groups'] = $audience_gids;\r\n\t\t//pi_debug_message(\"Adding audience group: \" . $context['groups']);\r\n\t\tog_add_group_action($node, $context);\r\n\t}\r\n\telse\r\n\t\tdrupal_set_message(t('Activity @nid is a not an activity.', array('@nid' => $activity_id), 'error'));\r\n}",
"public static function AddActivity($activity){\n $activity->Insert();\n }",
"public function addActivity($data);",
"function addActivity($activity)\r\n\t{\r\n\t\t$this->activities[$activity->getId()] = $activity;\r\n\t}",
"public static function add_comment_atom_activity_object() {\n?>\n <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>\n <activity:object>\n <activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>\n <id><?php comment_guid(); ?></id>\n <content type=\"html\" xml:base=\"<?php comment_link(); ?>\"><![CDATA[<?php comment_text(); ?>]]></content>\n <link rel=\"alternate\" href=\"<?php comment_link(); ?>\" type=\"<?php bloginfo_rss('html_type'); ?>\" />\n <thr:in-reply-to ref=\"<?php the_guid() ?>\" href=\"<?php the_permalink_rss() ?>\" type=\"<?php bloginfo_rss('html_type'); ?>\" />\n </activity:object>\n <activity:target>\n <activity:object-type>http://activitystrea.ms/schema/1.0/article</activity:object-type>\n <id><?php the_guid(); ?></id>\n <title type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_title(); ?>]]></title>\n <summary type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>\n <link rel=\"alternate\" type=\"text/html\" href=\"<?php the_permalink_rss() ?>\" />\n </activity:target>\n<?php\n }",
"function add_activity($activity_info, $activity_data)\n {\n\t\tif (array_key_exists('content_id', $activity_info)) $content_id = $activity_info['content_id'];\n\t\telse $content_id = 0;\n\n \t\t$insert_data = array(\n\t\t\t'site_id' \t \t\t=> $activity_info['site_id'],\n\t\t\t'user_id' \t \t\t=> $activity_info['user_id'],\n\t\t\t'verb'\t\t\t\t=> $activity_info['verb'],\n\t\t\t'module'\t\t\t=> $activity_info['module'],\n\t\t\t'type'\t\t\t\t=> $activity_info['type'],\n\t\t\t'content_id' \t \t=> $content_id,\n\t\t\t'data' \t \t\t=> json_encode($activity_data),\n\t\t\t'status'\t\t\t=> 'P',\n\t\t\t'created_at' \t\t=> unix_to_mysql(now())\n\t\t);\n\t\t\n\t\t$this->db->insert('activity', $insert_data);\n\t\t$activity_id = $this->db->insert_id();\n\t\t\n\t\tif ($activity_id)\n\t\t{\n\t\t\treturn $activity_id;\n\t\t}\n\t\t\n\t\treturn FALSE;\n }",
"public static function add_atom_activity_object() {\n /*\n * The object type of the current post in the Activity Streams 1 feed\n *\n * @param Object $comment_post The current post\n */\n $object_type = apply_filters( 'as1_object_type', 'article', get_post() );\n?>\n <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>\n <activity:object>\n <activity:object-type>http://activitystrea.ms/schema/1.0/<?php echo $object_type; ?></activity:object-type>\n <id><?php the_guid(); ?></id>\n <title type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_title(); ?>]]></title>\n <summary type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>\n <link rel=\"alternate\" type=\"text/html\" href=\"<?php the_permalink_rss() ?>\" />\n </activity:object>\n<?php\n }",
"public function setActivity(NodeInterface $activity);",
"public function created(Activity $activity)\n {\n\n $atom = $activity->userFeedForNotice();\n\n Log::info(\"observer ejecutandose\");\n\n $feed = route('user_feed', $activity->actor->id);\n\n Log::info(\"para el feed $feed\");\n\n $subscribers = HubSub::where('topic', $feed)->get();\n\n foreach ($subscribers as $subscriber) {\n\n $headers = array('Content-Type' => 'application/atom+xml');\n if ($subscriber->secret) {\n $hmac = hash_hmac('sha1', $atom, $subscriber->secret);\n $headers['X-Hub-Signature'] = 'sha1=' . $hmac;\n } else {\n $hmac = '(none)';\n }\n\n Log::info(\"About to push feed to $subscriber->callback for {$subscriber->getTopic()}, HMAC $hmac\");\n\n $client = new \\GuzzleHttp\\Client();\n $response = $client->request('POST', $subscriber->callback, [\n 'allow_redirects' => false,\n 'headers' => $headers,\n 'body' => $atom\n ]);\n\n $status = $response->getStatusCode(); \n\n Log::info(\"Push para el feed $feed se ejecuto con el status code: $status\");\n }\n }",
"function pi_activity_link_activity_content($node, $node_function, $visible_status, $activity_nid_to_link)\r\n{\r\n\t// First check the linked activity is valid\r\n\t$activity = node_load($activity_nid_to_link);\r\n\tif(pi_check_is_node_of_type($activity, 'pi_activity'))\r\n\t{\r\n\t\t// First create the link in pi_activity_node\r\n\t\t$activity_node = array();\r\n\t\t$activity_node['activity_id'] = $activity_nid_to_link;\r\n\t\t$activity_node['nid'] = $node->nid;\r\n\t\tdrupal_write_record('pi_activity_node', $activity_node);\r\n\r\n\t\t// Set the actor group status - get and use existing actor status if it exists otherwise\r\n\t\t// create one. Update is done by passing the key column name in drupal write record, or left\r\n\t\t// as an empty array to do an insert\r\n\t\tif($activity->audience == 'individual') {\r\n\t\t\t$activity_status_node = pi_activity_get_user_status($activity_nid_to_link, $node->uid);\r\n\t\t\t$activity_status_node['gid'] == null;\r\n\t\t\t$activity_status_node['uid'] == $node->uid;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$activity_status_node = pi_activity_get_activity_status_for_user($activity_nid_to_link, $node->uid);\r\n\t\t\t$activity_status_node['gid'] = $activity->actor;\r\n\t\t\t$activity_status_node['uid'] == null;\r\n\t\t}\r\n\r\n\t\tif($activity_status_node['gid']!=null)\r\n\t\t\t$actor_status_key = 'pas_id';\r\n\t\telse\r\n\t\t\t$actor_status_key=null;\r\n\r\n\t\t$activity_status_node['activity_id'] = $activity->nid;\r\n\t\t$activity_status_node['visible_status'] = $visible_status;\r\n\t\t$activity_status_node['node_function'] = $node_function;\r\n\t\tdrupal_write_record('pi_activity_status', $activity_status_node, $actor_status_key);\r\n\r\n\t\t// Set group audience to audience of the activity\r\n\t\t$users_group = pi_groups_get_users_audience_groups($node->uid, $activity->audience, $activity->actor);\r\n\t\t$context['groups'] = $users_group;\r\n\t\t//pi_debug_message($context['groups']);\r\n\t\tog_add_group_action($node, $context);\r\n\r\n\t\tif(!in_array($activity_status_node->gid, $users_group))\r\n\t\t{\r\n\t\t\t$activity_status_node['gid'] = $users_group;\r\n\t\t\tunset($activity_status_node['pas_id']);\r\n\t\t}\r\n\r\n\t\t//set the status for the audience to view\r\n\t\t$audience_group_nids = pi_groups_get_activity_audience($activity->actor, $audience_group_type);\r\n\t\tforeach($audience_group_nids as $audience_group_nid)\r\n\t\t\tpi_activity_set_status($activity_node->nid, $audience_group_nid, 'view', 'view');\r\n\r\n\t\t//extend activity actor to size of audience\r\n\t\t// @TODO - change the activity view to get activities with a status set for the user rather than by actor\r\n\t\tif(count($audience_group_nids)>0) {\r\n\t\t\t$activity->actor = $audience_gid[0];\r\n\t\t\tnode_save($activity);\r\n\t\t}\r\n\t\t\t\r\n\t\t//add extra status for the original actor\r\n\t\t$actor_groups = pi_groups_get_users_actor_groups($node->uid, $activity->audience, $activity->actor);\r\n\t\tforeach($actor_groups as $group_nid)\r\n\t\t\tpi_activity_set_status($activity_nid_to_link, $group_nid, $node_function, $visible_status);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tdrupal_set_message(t('Trying to link an activity content to a node that does not exist or that is not a pi_activity (nid @nid).', array('@nid'=>$activity_nid_to_link)), 'error');\r\n\t}\r\n}",
"function tuscblackchamber_mychamber_add_activity(){\n $params = array(\n );\n civicrm_api3('', '', $params);\n\n /*\n db_insert('civicrm_activity')\n ->fields(array(\n 'source_record_id' => NULL,\n 'activity_type_id' => 3,\n 'subject' => $emailSubject,\n 'activity_date_time' = format_date(REUQEST_TIME),\n 'duration' => NULL,\n 'location' => NULL,\n 'phone_id' => NULL,\n 'phone_number' => 'NULL',\n 'details' => $emailBody,\n 'status_id' => 2,\n 'priority_id' => 2,\n 'parent_id' => NULL,\n 'is_test' => 0,\n 'medium_id' => NULL,\n 'is_auto' => 0,\n 'relationship_id' => NULL,\n 'is_current_revision' => 1,\n 'original_id' => NULL,\n 'result' => NULL,\n 'is_deleted' => 0,\n 'campaign_id' => NULL,\n 'engagement_level' => NULL,\n 'weight' => NULL,\n ))\n ->execute();\n */\n}",
"function _openx_node_campaign_insert(&$node) {\n drupal_write_record('openx_manager_campaign', $node);\n}",
"public function add_activity($activity) {\n $activity->set_course($this);\n $this->activities[] = $activity;\n }",
"public function testCreateActivity()\n {\n }",
"public function addActivity()\n {\n\n $auth = Auth::user();\n\n $routeName = Route::getCurrentRoute()->getName();\n\n if (!$routeName) {\n return;\n }\n\n $mapping = new RouteActions();\n\n $activity = $mapping->get($routeName);\n\n if (!$activity) {\n return;\n }\n\n $users_activity = array(\n 'user_id' => $auth->id,\n 'ip_address' => $_SERVER['REMOTE_ADDR'],\n 'activity' => $activity,\n );\n $user_activity = new UsersActivity($users_activity);\n $user_activity->save();\n }",
"public function testActivitiesAdd()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function appendActivity(Activity $value) {\n return $this->append(self::ACTIVITY, $value);\n }",
"function stream_activity_add($type, $id, $activity_id) {\n global $cache;\n $stream = 'stream.' . $type . '.' . $id;\n $entries = $cache->get($stream);\n if (sizeof($entries) > 200) {\n array_shift($entries);\n }\n $entries[] = $activity_id;\n $cache->set($stream, $entries);\n}",
"function addActivity($on_user, $text, $notification_text, $description, $type, $relation, $type_id, $type_sub_id = '', $unique_description = '') {\n $add_activity = new UserActivity;\n $add_activity->user_id = Auth::user()->id;\n $add_activity->on_user = $on_user;\n $add_activity->text = $text;\n $add_activity->notification_text = $notification_text;\n $add_activity->description = $description;\n $add_activity->type = $type;\n $add_activity->model = $relation;\n $add_activity->type_id = $type_id;\n $add_activity->type_sub_id = $type_sub_id;\n $add_activity->unique_description = $unique_description;\n $add_activity->save();\n return TRUE;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears out the collLocalUsuarios collection (array). This does not modify the database; however, it will remove any associated objects, causing them to be refetched by subsequent calls to accessor method. | public function clearLocalUsuarios()
{
$this->collLocalUsuarios = null; // important to set this to NULL since that means it is uninitialized
} | [
"public function clearUsuarios()\n\t{\n\t\t$this->collUsuarios = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearJ811tUsuarios()\n\t{\n\t\t$this->collJ811tUsuarios = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUsers()\n\t{\n\t\t$this->collUsers = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearAvisoUsuarios()\n\t{\n\t\t$this->collAvisoUsuarios = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUsers()\n {\n $this->collUsers = null; // important to set this to NULL since that means it is uninitialized\n $this->collUsersPartial = null;\n }",
"public function clearCuentas()\n\t{\n\t\t$this->collCuentas = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUsers()\n {\n $this->collUsers = null; // important to set this to null since that means it is uninitialized\n $this->collUsersPartial = null;\n }",
"public function clearComentarios()\n {\n $this->collComentarios = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearUsuariosRelatedByIdusuario()\n {\n $this->collUsuariosRelatedByIdusuario = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearTeamUsers()\n\t{\n\t\t$this->collTeamUsers = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUsuarioTarefas()\n\t{\n\t\t$this->collUsuarioTarefas = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUsuarioCategorias()\n\t{\n\t\t$this->collUsuarioCategorias = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearAdminUsers()\n\t{\n\t\t$this->collAdminUsers = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearRlUsuarioOrgaos()\n\t{\n\t\t$this->collRlUsuarioOrgaos = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUsuarios()\n {\n $this->collUsuarios = null; // important to set this to null since that means it is uninitialized\n $this->collUsuariosPartial = null;\n\n return $this;\n }",
"public function clearUsuarioCajas()\n\t{\n\t\t$this->collUsuarioCajas = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearUserss()\n {\n $this->collUserss = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearUsuarioAmigosRelatedByIdusuario()\n {\n $this->collUsuarioAmigosRelatedByIdusuario = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearSitTicketsUsuarioss()\n\t{\n\t\t$this->collSitTicketsUsuarioss = null; // important to set this to NULL since that means it is uninitialized\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$str = iconv("utf8", "utf8//IGNORE", html_entity_decode($instr)); | function tidy_input($instr)
{
// ini_set('mbstring.substitute_character', "none");
$str = mb_convert_encoding( html_entity_decode($instr),"utf8","utf8");
return $str;
} | [
"function xmlUnescape($str){\n return html_entity_decode($str,ENT_COMPAT, \"UTF-8\");\n }",
"function htmlent_to_utf8($entstring) {\n global $htmlent2utf8;\n return strtr($entstring, $htmlent2utf8);\n}",
"function xml_undo_html_entity_char($str)\n{\n\treturn preg_replace(\"/&([0-9a-zA-z]+);/sU\", '&\\\\1;', $str);\n}",
"function unhtmlentities($string) \n{\n \t$trans_tbl = get_html_translation_table(HTML_ENTITIES);\n \t$trans_tbl = array_flip($trans_tbl);\n \t$ret = strtr ($string,$trans_tbl);\n\t\t\n \treturn preg_replace('/\\&\\#([0-9]+)\\;/me',\"chr('\\\\1')\",$ret);\n\t\n}",
"function unicode_htmlentities($str)\n\t{\n\t\t$str_arr=explode(\"&#\",$str);\n\t\t$count=count($str_arr);\n\t\t$out_str=htmlentities($str_arr[0]);\n\t\tfor($i=1;$i<$count;$i++)\n\t\t{\n\t\t\t$out_str_arr=explode(\";\",$str_arr[$i]);\n\t\t\t$count1=count($out_str_arr);\n\t\t\t$out_str.=\"&#\".$out_str_arr[0].\";\";\n\t\t\tfor($j=1;$j<$count1;$j++)\n\t\t\t{\n\t\t\t\tif($j==$count1-1)\t\n\t\t\t\t\t$out_str.=htmlentities($out_str_arr[$j]);\n\t\t\t\telse\n\t\t\t\t\t$out_str.=htmlentities($out_str_arr[$j].\";\");\n\t\t\t}\n\t\t}\n\t\treturn $out_str;\n\t}",
"function html_entity_decode_all($string) \n{\n // replace numeric entities\n $string = preg_replace_callback('~&#x([0-9a-f]+);~i', '_callback_chr_hexdec', $string);\n $string = preg_replace_callback('~&#([0-9]+);~', '_callback_chr', $string);\n# utf8 version commented out\n# $string = preg_replace_callback('~&#x([0-9a-f]+);~i', '_callback_code2utf_hexdec', $string);\n# $string = preg_replace_callback('~&#([0-9]+);~', '_callback_code2utf', $string);\n \n // replace literal entities\n $trans_tbl = get_html_translation_table(HTML_ENTITIES); \n $trans_tbl = array_flip($trans_tbl);\n# utf8 version commented out\n# foreach (get_html_translation_table(HTML_ENTITIES) as $val=>$key) $trans_tbl[$key] = utf8_encode($val);\n \n return strtr($string, $trans_tbl);\n}",
"function mb_htmlentities($str, $encoding = 'utf-8') { \n mb_regex_encoding($encoding); \n $pattern = array('<', '>', '\"', '\\''); \n $replacement = array('<', '>', '"', '''); \n for ($i=0; $i<sizeof($pattern); $i++) { \n $str = mb_ereg_replace($pattern[$i], $replacement[$i], $str); \n } \n return $str; \n}",
"function htmlEntitiesAll($str) {\n $result = \"\";\n for ($i = 0; $i < strlen($str); $i++) {\n $result .= \"&#\" . ord($str{$i}) . \";\";\n }\n return $result;\n}",
"public static function htmlEntitiesToChars($str) {\r// if (mb_detect_encoding($str) == 'UTF-8'){\r// decode decimal HTML entities added by web browser\r $str = preg_replace('/&#\\d{2,5};/ue', \"\\$this->utf8_entity_decode('$0')\", $str);\r// decode hex HTML entities added by web browser\r $str = preg_replace('/&#x([a-fA-F0-7]{2,8});/ue', \"\\$this->utf8_entity_decode('&#'.hexdec('$1').';')\", $str);\r// decode named characters\r $str = html_entity_decode($str, ENT_QUOTES, \"utf-8\");\r\r// echo $str.'<br />';\r// }\r return $str;\r }",
"public function utf8_to_entities($str) {\n $entities = '';\n $values = array();\n $lookingfor = 1;\n\n return $str;\n }",
"function xml_unescape($s) {\n return htmlspecialchars_decode($s, ENT_QUOTES);\n}",
"function entititesToUnicode ($input) {\n $htmlEntities = array_values (get_html_translation_table (HTML_ENTITIES, ENT_QUOTES));\n $entitiesDecoded = array_keys (get_html_translation_table (HTML_ENTITIES, ENT_QUOTES));\n $num = count ($entitiesDecoded);\n for ($u = 0; $u < $num; $u++) {\n $utf8Entities[$u] = '&#'.ord($entitiesDecoded[$u]).';';\n }\n // replace & back, we do not like the & pos no 95\n if ($utf8Entities[95] == \"&\") $utf8Entities[95] = \"&\";\n\n$output = str_replace ($htmlEntities, $utf8Entities, $input);\nreturn $output;\n}",
"function utf8ToHtmlEntities($str) {\n\t\t\t\n\t\t\tif(defined( '_JEXEC' )){\n\t\t\t\treturn $str;\n\t\t\t}\n\t\t\tglobal $_JC_CONFIG;\n\t\t\t\n\t\t\tif($_JC_CONFIG->get('optimiseEncoding') \n\t\t\t\t&& function_exists('mb_convert_encoding')\n\t\t\t\t&& defined('_ISO')){\n\n\t\t\t\t$iso = explode( '=', _ISO );\n\t\t\t\t$str = mb_convert_encoding($str, $iso[1], \"UTF-8\");\n\t\t\t\treturn $str;\n\t\t\t} else {\n\n\t\t\t\t$temp = $this->utf8ToUnicodeArray($str);\n\t\t\t\treturn $this->unicodeArrayToHtmlEntities($temp);\n\t\t\t}\n\t\t}",
"public function xml_undo_html_entity_char($str)\n {\n return preg_replace('/&([0-9a-zA-z]+);/sU', '&\\\\1;', $str);\n }",
"function decode2HTML ($str='') {\r\n \t \treturn htmlspecialchars_decode($str, ENT_QUOTES); \r\n}",
"function xml_unescape($str){\n \n // recursive part\n if( is_array($str) ){\n \n $keys = array_keys($str);\n $ci = count($keys);\n for( $i = 0; $i < $ci; $i++ ){\n $str[$keys[$i]] = xml_unescape($str[$keys[$i]]);\n }\n return $str;\n }\n \n // replace '&#DEC;' and '&#xHEX;' with actual symbols encoded in UTF8 \n // old variant (contain error: ÿ was not replaced with symbol)\n // if( $ci = preg_match_all('/&#(x?[0-9]+);/i', $str, $matches) ){ // look for '&#DEC;' and '&#xHEX;'\n // new: fixed\n if( $ci = preg_match_all('/&#((?:[0-9]+)|(?:x[0-F]+));/i', $str, $matches) ){ // look for '&#DEC;' and '&#xHEX;'\n \n // d_echo($matches);\n $search = array();\n $replace = array();\n \n for( $i = 0; $i < $ci; $i++ ){\n $search[] = $matches[0][$i];\n // if symbol code is given in HEX\n if( $matches[1][$i][0] === 'x' ){\n $matches[1][$i] = substr($matches[1][$i], 1); // cut 1st symbol\n $matches[1][$i] = hexdec($matches[1][$i]); // convert to decimal\n }\n $matches[1][$i] = (int)$matches[1][$i];\n $replace[] = xml_sym_decode($matches[1][$i]);\n }\n \n // replace each '&#DEC;' or '&#xHEX;' with symbol\n $str = str_replace($search, $replace, $str);\n }\n \n // replace predefined entities\n return str_replace(array('<', '>', ''', '"', '&'),\n array( '<', '>', \"'\", '\"', '&'), \n $str\n );\n}",
"function removeHtmlAccentLigature($str) {\n $str = htmlentities($str, ENT_NOQUOTES, 'utf-8');\n $str = preg_replace('#&([A-Za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml|space);#', '\\1', $str); // Supréssion accent passe 1 \n $str = preg_replace('#&([A-Za-z]{2})(?:lig);#', '\\1', $str); // Transformations des ligatures \n //echo \"Supression des accents HTML : $str<br>\";\n return $str;\n }",
"function unhtmlentities($string)\n{\n $trans_tbl = get_html_translation_table(HTML_ENTITIES);\n $trans_tbl = array_flip($trans_tbl);\n return strtr($string, $trans_tbl);\n}",
"function convert_to_utf8($str)\n{\n\t$old_charset = $_SESSION['old_charset'];\n\t\n\tif ($str === null || $str == '' || $old_charset == 'UTF-8')\n\t\treturn $str;\n\n\t$save = $str;\n\n\t// Replace literal entities (for non-UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '<') && $old_charset == 'ISO-8859-1' || $old_charset == 'ISO-8859-15')\n\t\t$str = html_entity_decode($str, ENT_QUOTES, $old_charset);\n\n\tif ($old_charset != 'UTF-8' && !seems_utf8($str))\n\t{\n\t\tif (function_exists('iconv'))\n\t\t\t$str = iconv($old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : $old_charset, 'UTF-8', $str);\n\t\telse if (function_exists('mb_convert_encoding'))\n\t\t\t$str = mb_convert_encoding($str, 'UTF-8', $old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : 'ISO-8859-1');\n\t\telse if ($old_charset == 'ISO-8859-1')\n\t\t\t$str = utf8_encode($str);\n\t}\n\n\t// Replace literal entities (for UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '>='))\n\t\t$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');\n\n\t// Replace numeric entities\n\t$str = preg_replace_callback('/&#([0-9]+);/', 'utf8_callback_1', $str);\n\t$str = preg_replace_callback('/&#x([a-f0-9]+);/i', 'utf8_callback_2', $str);\n\n\t// Remove \"bad\" characters\n\t$str = remove_bad_characters($str);\n\n\treturn $str;//($save != $str);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the level of enryption to use (see ENC_OFF or ENC_SSL) | public function setEncryption($enc)
{
$this->encryption = (int) $enc;
} | [
"public function setEncryption($enc)\n {\n if (!$enc) $enc = self::ENC_OFF;\n $this->encryption = (int) $enc;\n }",
"function setEncryptionMode($mode)\n {\n $this->encryptionMode = $mode;\n }",
"public static function setEncryption($en_on)\n\t{\n\t\tif ($en_on)\n\t\t\tself::$passwd_encrypt = true;\n\t\telse\n\t\t\tself::$passwd_encrypt = false;\n\t}",
"public function setEncrypting($value);",
"public function setEncryptionMode($mode = 'cbc', $strength = 128);",
"public function _setEncrypted($enc) { \n\n\t\t$this->encrypted = $enc;\n\n\t\t//try to decrypt\n\t\t$decrypt = baseModel::decrypt($this->value);\n\n\t\t//if encryption is set\n\t\tif($enc) { \n\n\t\t\t//and the value isn't encrypted\n\t\t\tif($decrypt === FALSE && $this->value !== null) { \n\t\t\t\t$this->value = baseModel::encrypt($this->value); \n\t\t\t}\n\t\t}\n\n\t\t//otherwise encryption is not set\n\t\telse {\n\n\t\t\t//if the value is encrypted, we need to decrypt\n\t\t\tif($decrypt !== FALSE) {\n\t\t\t\t$this->value = $decrypt;\n\t\t\t}\n\t\t}\n\n\t\treturn $enc;\n\t}",
"public function setEncryptionMode($mode)\n {\n $this->encryptionMode = $mode;\n if ($this->key instanceof RSA2) {\n $this->key = $this->key->withPadding(\n self::enc2pad($this->encryptionMode) |\n self::sig2pad($this->signatureMode)\n );\n }\n }",
"public static function setEncrypted($name, $value) { }",
"private function rewriteEnableEncryption() {\n\t\t// Encrypt flash data\n\t\tforeach ($_SESSION[$this->token . '_flash'] as $key => $value) {\n\t\t\t$_SESSION[$this->token . '_flash'][$key] = FastEncrypt::encrypt($value);\n\t\t}\n\n\t\t// Encrypt payload\n\t\tforeach ($_SESSION[$this->token] as $key => $value) {\n\t\t\t$_SESSION[$this->token][$key] = FastEncrypt::encrypt($value);\n\t\t}\n\n\t\t// Enable encryption\n\t\t$_SESSION[$this->token . '_encrypted'] = true;\n\t}",
"function set_mode($mode) {\n\t\t$this->_mcrypt_mode = $mode;\n\t}",
"function setMode($mode)\n {\n $this->_mcryptMode = $mode;\n }",
"function set_mode($mode)\n\t{\n\t\t$this->mcrypt_mode = $mode;\n\t}",
"function set_mode($mode)\n\t{\n\t\t$this->_mcrypt_mode = $mode;\n\t}",
"protected function _putencryption() {\n if (!$this->encrypted) {\n return;\n }\n $this->encryptdata['objid'] = $this->_newobj();\n $out = '<<';\n if (!isset($this->encryptdata['Filter']) OR empty($this->encryptdata['Filter'])) {\n $this->encryptdata['Filter'] = 'Standard';\n }\n $out .= ' /Filter /'.$this->encryptdata['Filter'];\n if (isset($this->encryptdata['SubFilter']) AND !empty($this->encryptdata['SubFilter'])) {\n $out .= ' /SubFilter /'.$this->encryptdata['SubFilter'];\n }\n if (!isset($this->encryptdata['V']) OR empty($this->encryptdata['V'])) {\n $this->encryptdata['V'] = 1;\n }\n // V is a code specifying the algorithm to be used in encrypting and decrypting the document\n $out .= ' /V '.$this->encryptdata['V'];\n if (isset($this->encryptdata['Length']) AND !empty($this->encryptdata['Length'])) {\n // The length of the encryption key, in bits. The value shall be a multiple of 8, in the range 40 to 256\n $out .= ' /Length '.$this->encryptdata['Length'];\n } else {\n $out .= ' /Length 40';\n }\n if ($this->encryptdata['V'] >= 4) {\n if (!isset($this->encryptdata['StmF']) OR empty($this->encryptdata['StmF'])) {\n $this->encryptdata['StmF'] = 'Identity';\n }\n if (!isset($this->encryptdata['StrF']) OR empty($this->encryptdata['StrF'])) {\n // The name of the crypt filter that shall be used when decrypting all strings in the document.\n $this->encryptdata['StrF'] = 'Identity';\n }\n // A dictionary whose keys shall be crypt filter names and whose values shall be the corresponding crypt filter dictionaries.\n if (isset($this->encryptdata['CF']) AND !empty($this->encryptdata['CF'])) {\n $out .= ' /CF <<';\n $out .= ' /'.$this->encryptdata['StmF'].' <<';\n $out .= ' /Type /CryptFilter';\n if (isset($this->encryptdata['CF']['CFM']) AND !empty($this->encryptdata['CF']['CFM'])) {\n // The method used\n $out .= ' /CFM /'.$this->encryptdata['CF']['CFM'];\n if ($this->encryptdata['pubkey']) {\n $out .= ' /Recipients [';\n foreach ($this->encryptdata['Recipients'] as $rec) {\n $out .= ' <'.$rec.'>';\n }\n $out .= ' ]';\n if (isset($this->encryptdata['CF']['EncryptMetadata']) AND (!$this->encryptdata['CF']['EncryptMetadata'])) {\n $out .= ' /EncryptMetadata false';\n } else {\n $out .= ' /EncryptMetadata true';\n }\n }\n } else {\n $out .= ' /CFM /None';\n }\n if (isset($this->encryptdata['CF']['AuthEvent']) AND !empty($this->encryptdata['CF']['AuthEvent'])) {\n // The event to be used to trigger the authorization that is required to access encryption keys used by this filter.\n $out .= ' /AuthEvent /'.$this->encryptdata['CF']['AuthEvent'];\n } else {\n $out .= ' /AuthEvent /DocOpen';\n }\n if (isset($this->encryptdata['CF']['Length']) AND !empty($this->encryptdata['CF']['Length'])) {\n // The bit length of the encryption key.\n $out .= ' /Length '.$this->encryptdata['CF']['Length'];\n }\n $out .= ' >> >>';\n }\n // The name of the crypt filter that shall be used by default when decrypting streams.\n $out .= ' /StmF /'.$this->encryptdata['StmF'];\n // The name of the crypt filter that shall be used when decrypting all strings in the document.\n $out .= ' /StrF /'.$this->encryptdata['StrF'];\n if (isset($this->encryptdata['EFF']) AND !empty($this->encryptdata['EFF'])) {\n // The name of the crypt filter that shall be used when encrypting embedded file streams that do not have their own crypt filter specifier.\n $out .= ' /EFF /'.$this->encryptdata[''];\n }\n }\n // Additional encryption dictionary entries for the standard security handler\n if ($this->encryptdata['pubkey']) {\n if (($this->encryptdata['V'] < 4) AND isset($this->encryptdata['Recipients']) AND !empty($this->encryptdata['Recipients'])) {\n $out .= ' /Recipients [';\n foreach ($this->encryptdata['Recipients'] as $rec) {\n $out .= ' <'.$rec.'>';\n }\n $out .= ' ]';\n }\n } else {\n $out .= ' /R';\n if ($this->encryptdata['V'] == 5) { // AES-256\n $out .= ' 5';\n $out .= ' /OE ('.TCPDF_STATIC::_escape($this->encryptdata['OE']).')';\n $out .= ' /UE ('.TCPDF_STATIC::_escape($this->encryptdata['UE']).')';\n $out .= ' /Perms ('.TCPDF_STATIC::_escape($this->encryptdata['perms']).')';\n } elseif ($this->encryptdata['V'] == 4) { // AES-128\n $out .= ' 4';\n } elseif ($this->encryptdata['V'] < 2) { // RC-40\n $out .= ' 2';\n } else { // RC-128\n $out .= ' 3';\n }\n $out .= ' /O ('.TCPDF_STATIC::_escape($this->encryptdata['O']).')';\n $out .= ' /U ('.TCPDF_STATIC::_escape($this->encryptdata['U']).')';\n $out .= ' /P '.$this->encryptdata['P'];\n if (isset($this->encryptdata['EncryptMetadata']) AND (!$this->encryptdata['EncryptMetadata'])) {\n $out .= ' /EncryptMetadata false';\n } else {\n $out .= ' /EncryptMetadata true';\n }\n }\n $out .= ' >>';\n $out .= \"\\n\".'endobj';\n $this->_out($out);\n }",
"public function testSettingEncryption()\n {\n // Disable Encrypting\n $this->model->setEncrypting(false);\n $this->assertFalse($this->model->getEncrypting());\n\n // Enable Encrypting\n $this->model->setEncrypting(true);\n $this->assertTrue($this->model->getEncrypting());\n }",
"public function disableEncryption();",
"public function set_encryption_none()\n\t{\n\t\treturn $this->set_encryption(self::ENCRYPTION_NONE);\n\t}",
"public function setIkeEncryption($val)\n {\n $this->_propDict[\"ikeEncryption\"] = $val;\n return $this;\n }",
"public function set_encryption_key()\n {\n \tif (APP_VER <= 2.0) return;\n\n \tif (ee()->config->item('encryption_key') != '') return;\n\n \t$config = array('encryption_key' => md5(ee()->db->username.ee()->db->password.rand()));\n\n \tee()->config->_update_config($config);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation createCSPMGCPAccountAsync Creates a new account in our system for a customer and generates a new service account for them to add access to in their GCP environment to grant us access. | public function createCSPMGCPAccountAsync($body)
{
return $this->createCSPMGCPAccountAsyncWithHttpInfo($body)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function createCSPMAwsAccountAsync($body)\n {\n return $this->createCSPMAwsAccountAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createCSPMGCPAccount($body)\n {\n list($response) = $this->createCSPMGCPAccountWithHttpInfo($body);\n return $response;\n }",
"public function createCSPMAwsAccountAsyncWithHttpInfo($body)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2';\n $request = $this->createCSPMAwsAccountRequest($body);\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 = (string) $responseBody;\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 function createCSPMAwsAccount($body)\n {\n list($response) = $this->createCSPMAwsAccountWithHttpInfo($body);\n return $response;\n }",
"public function createLogGcsAsync($options)\n {\n return $this->createLogGcsAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createCSPMAzureAccount($body)\n {\n list($response) = $this->createCSPMAzureAccountWithHttpInfo($body);\n return $response;\n }",
"public function createCustomerAsync($customer = null)\n {\n return $this->createCustomerAsyncWithHttpInfo($customer)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function customerCreateAsync($virtual_operator, $company_id, $customer_dto)\n {\n return $this->customerCreateAsyncWithHttpInfo($virtual_operator, $company_id, $customer_dto)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createClientCampaignUsingPostAsync($campaign_mapping_request)\n {\n return $this->createClientCampaignUsingPostAsyncWithHttpInfo($campaign_mapping_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function create($name, Forminator_Google_Service_Iam_CreateServiceAccountRequest $postBody, $optParams = array())\n {\n $params = array('name' => $name, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('create', array($params), \"Forminator_Google_Service_Iam_ServiceAccount\");\n }",
"public function createAServiceGroupAsync($options)\n {\n return $this->createAServiceGroupAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createCustomVclAsync($options)\n {\n return $this->createCustomVclAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createCertificatesAsync($company_id, $pre_validated_exemption_reason = null, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n return $this->createCertificatesAsyncWithHttpInfo($company_id, $pre_validated_exemption_reason, $x_avalara_client, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createAccountTypeUsingPostAsync($account_type_request)\n {\n return $this->createAccountTypeUsingPostAsyncWithHttpInfo($account_type_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createMerchantCreditAsync($wt_merchant_credit_creation_params)\n {\n return $this->createMerchantCreditAsyncWithHttpInfo($wt_merchant_credit_creation_params)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createProfileAsync($profile_create_query, $apiKey = null)\n {\n return $this->createProfileAsyncWithHttpInfo($profile_create_query, $apiKey)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createEmailCampaignAsyncWithHttpInfo($email_campaign_create, string $contentType = self::contentTypes['createEmailCampaign'][0])\n {\n $returnType = '\\EgoiClient\\EgoiModel\\HashcodeCampaign';\n $request = $this->createEmailCampaignRequest($email_campaign_create, $contentType);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 (string) $response->getBody()\n );\n }\n );\n }",
"public function projectCreateAsync($project_create_parameters, $x_phrase_app_otp = null)\n {\n return $this->projectCreateAsyncWithHttpInfo($project_create_parameters, $x_phrase_app_otp)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function createCSPMAwsAccountWithHttpInfo($body)\n {\n $request = $this->createCSPMAwsAccountRequest($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() ? (string) $e->getResponse()->getBody() : 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 switch($statusCode) {\n case 201:\n if ('\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 207:\n if ('\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 403:\n if ('\\OpenAPI\\Client\\Model\\MsaReplyMetaOnly' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\MsaReplyMetaOnly', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 429:\n if ('\\OpenAPI\\Client\\Model\\MsaReplyMetaOnly' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\MsaReplyMetaOnly', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 500:\n if ('\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\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 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 207:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\MsaReplyMetaOnly',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\MsaReplyMetaOnly',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\RegistrationAWSAccountResponseV2',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List of follow requests | public function followRequests()
{
$user = Auth::user();
$profile = UserProfile::where('user_id', $user->id)->firstOrFail();
return response()->json(FollowRequest::where('user_profile_id', $profile->id)->get());
} | [
"function getFollowRequests() {\n\t\t\t$response = $this->call(\"users/self/requested-by\");\n\t\t\tif (!isset($response->data)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$results = array();\n\t\t\tforeach ($response->data as $user) {\n\t\t\t\t$results[] = new BigTreeInstagramUser($user,$this);\n\t\t\t}\n\t\t\treturn $results;\n\t\t}",
"public function getFollows()\n {\n return $this->follows;\n }",
"public function getPendingFollowers()\n {\n return $this->getResponse(self::URL_INCOMING_FRIENDS, $this->query);\n }",
"public function followers()\n {\n $followers = array();\n\n /*Here is a connection whereby somebody followed me and I followed right back*/\n $f1 = Friendship::where('status',2)->where('user_requested',$this->id)->get();\n\n foreach($f1 as $fellowship):\n array_push($followers, \\Nyabingi\\User::find($fellowship->requester));\n endforeach;\n\n /*Here is a connection wherby somebody followed me but I have not folled the back*/\n $f2 = Friendship::where('status',1)->where('user_requested',$this->id)->get();\n\n foreach($f2 as $fellowship):\n array_push($followers, \\Nyabingi\\User::find($fellowship->requester));\n endforeach;\n\n return $followers;\n }",
"public function getFollowReferrals()\n {\n return $this->followReferrals;\n }",
"public function getFollowRequests( array $params = null ) {\n $response = $this->apiCall(\n 'get',\n $this->api_url . '/users/self/requested-by',\n $params\n );\n return $response->getRawData();\n }",
"function getUserFollowers() {\n return $this->_query(\"users/{$this->getUserID()}/followed-by\");\n }",
"public function followers()\n {\n return $this->client->followers($this->id);\n }",
"function getPageFollowers() {\n echo '{\"fan_count\": 10500}';\n }",
"public function getFollowers()\n {\n return $this->followers;\n }",
"public function twitterFollowersList(array $args = array()) {\n\n $app = $this->getContainer();\n\n // Get values from config\n $extensionConfig = $this->getConfig();\n $config = $app['config']->get('general');\n\n // Set our request method\n $requestMethod = 'GET';\n\n // Create our API URL\n $baseUrl = \"https://api.twitter.com/1.1/followers/list.json\";\n $fullUrl = $this->constructFullUrl($baseUrl, $args);\n\n // Setup our Oauth values array with values as per docs\n $oauth = $this->setOauthValues($requestMethod, $baseUrl, $args);\n\n // Create header string to set in our request\n $header = array($this->buildHeaderString($oauth));\n\n $key = 'followerslist-'.md5($fullUrl);\n if ($app['cache']->contains($key) && $extensionConfig['cache_time'] > 0) {\n // If this request has been cached and setting is not disabling cache, then retrieve it\n $result = $app['cache']->fetch($key);\n } else {\n // If not in cache then send our request to the Twitter API with appropriate Authorization header as per docs\n try {\n $result = $app['guzzle.client']->get($fullUrl, ['headers' => ['Authorization' => $header]])->getBody(true);\n } catch(\\Exception $e) {\n return ['error' => $e->getMessage()];\n }\n // Decode the JSON that is returned\n $result = json_decode($result, true);\n $app['cache']->save($key, $result, $extensionConfig['cache_time']);\n }\n\n return $result;\n }",
"public function get_follow_list(){\r\n $type = I('get.type');\r\n if($type == 'following'){//people I am following...\r\n $follower_id = session('USER_ID');\r\n $cdt = array('hs_follow.follower_id'=>$follower_id);\r\n $join_sql = 'hs_user on hs_user.id = hs_follow.followed_id';\r\n }elseif ($type == 'followed') {//people who follow me\r\n $followed_id = session('USER_ID');\r\n $cdt = array('hs_follow.followed_id'=>$followed_id);\r\n $join_sql = 'hs_user on hs_user.id = hs_follow.follower_id';\r\n }\r\n $res = $this->follow_model->join($join_sql)->where($cdt)->order('hs_follow.follow_date')->select();\r\n if($res !== false)$this->ajaxReturn(array('error'=>0,'items'=>$res));\r\n else $this->ajaxReturn(array('error'=>1,'items'=>array(),'msg'=>C('SITE_LANG.QUERY_FAILED')));\r\n }",
"function getUserFollowers($params){\n $request_uri = 'users/'.$params['username'].'/followers'.$this->format;\n \n $result = $this->doRequest($this->service_url.$request_uri, $params);\n return $result;\n }",
"function get_follow() {\n\t\t$return = array();\n\t\t\n\t\t// Check permissions\n\t\tif(!$this->permission->check()) {\n\t\t\treturn $this->permission->errorMessage();\n\t\t};\n\t\t\n\t\t// validate and sanitize\n\t\t/*$this->filter->set_request_data('tender_ID', $tender_ID);\n\t\t$this->filter->set_group_rules('tenders');\n\t\t$this->filter->set_key_rules(array('tender_ID'), 'required');\n\t\tif(!$this->filter->run()) {\n\t\t\t$return[\"alerts\"] = $this->filter->get_errors();\n\t\t\treturn $return;\n\t\t}\n\t\t$tender_ID = $this->filter->get_request_data('tender_ID');*/\n\n\t\t$query = \"SELECT * FROM follow_tender FT\"\n\t\t\t\t.\" LEFT JOIN tenders T ON T.tender_ID = FT.tender_ID\"\n\t\t\t\t.\" WHERE FT.company_ID = '{{company_ID}}'\";\n\t\t$results = $this->db->query($query, array(\n\t\t\t'company_ID' => COMPANY_ID,\n\t\t));\n\t\tif ($results) {\n\t\t\twhile ($tender = $this->db->fetch_assoc($results)) {\n\t\t\t\t$return[] = $tender;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}",
"public function testListOfTasksFollowersSuccess()\n {\n $task = $this->findOneAdminEntity();\n\n $this->getClient(true)->request('GET', $this->getBaseUrl() . '/' . $task->getId() . '/follower', [], [],\n ['Authorization' => 'Bearer ' . $this->adminToken, 'HTTP_AUTHORIZATION' => 'Bearer ' . $this->adminToken]);\n $this->assertEquals(StatusCodesHelper::SUCCESSFUL_CODE, $this->getClient()->getResponse()->getStatusCode());\n\n // We expect at least one Entity, response has to include array with data and _links param\n $response = json_decode($this->getClient()->getResponse()->getContent(), true);\n $this->assertTrue(array_key_exists('_links', $response));\n $this->assertTrue(array_key_exists('data', $response));\n }",
"public function GetFollowers()\n {\n return PublicApp::getDB()->getRecords('SELECT user_id, friend FROM friends WHERE friend = ?', $this->user_id);\n }",
"public function getFollowedUsers()\n {\n return $this->followedUsers;\n }",
"public function getUserFollowDogs(Request $request) {\n $user = $request->user();\n return $user->follows()->get();\n }",
"public function showTwFollowers()\n {\n\n set_time_limit(120);\n $count = 0;\n $consumerKey = self::get_value('twConKey');\n $consumerSecret = self::get_value('twConSec');\n $accessToken = self::get_value('twToken');\n $tokenSecret = self::get_value('twTokenSec');\n try {\n $twitter = new \\Twitter($consumerKey, $consumerSecret, $accessToken, $tokenSecret);\n $followers = $twitter->loadUserFollowers(self::get_value('twUser'));\n foreach ($followers->ids as $id) {\n echo \"<li>\n <img src='\" . $twitter->loadUserInfoById($id)->profile_image_url . \"' alt='User Image'>\n <a class='users-list-name' target='_blank' href='https://twitter.com/\" . $twitter->loadUserInfoById($id)->screen_name . \"'>\" . $twitter->loadUserInfoById($id)->name . \"</a>\n <span class='users-list-date'>Twitter</span>\n </li>\";\n $count += 1;\n if ($count == 16) {\n break;\n }\n }\n } catch (\\TwitterException $e) {\n echo \"error\";\n }\n\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set current DB version (version of schema's custom tables already installed) | public function set_db_current_version( $version ) {
$option_db = $this->get_option_db();
$option_db[ self::OPTION_DB_CURRENT_VERSION ] = $version;
update_option( self::OPTION_DB, $option_db );
} | [
"public function setCurrentVersion(DatabaseConnection $db, $version);",
"public function set_db_version( $version = NULL ) {\r\n\t\tif ( $version === NULL ) {\r\n\t\t\t$version = ( ! empty( $this->core_version ) ) ? $this->core_version : self::get_latest_version_migration();\r\n\t\t}\r\n\r\n\t\t// removing 'betaX' suffix from version\r\n\t\t$version = preg_replace( '~beta\\d~', '', $version );\r\n\r\n\t\t$current_version = get_option( 'us_db_version' );\r\n\t\tif ( $current_version != $version ) {\r\n\t\t\tupdate_option( 'us_db_version', $version, TRUE );\r\n\t\t}\r\n\t}",
"public static function save_dbversion()\n\t{\n\t\tOptions::set( 'db_version', Version::DB_VERSION );\n\t}",
"public function set_file_db_version() {\n $version = $this->get_version();\n $dbversion = $this->get_file_db_version();\n return $this->set_supporting_setting('version', $version, $dbversion);\n }",
"private function set_db_version( $version = '' ) {\n\n\t\t// If no version is passed during an upgrade, use the current version\n\t\tif ( empty( $version ) ) {\n\t\t\t$version = $this->version;\n\t\t}\n\n\t\t// Update the DB version\n\t\t$this->is_global()\n\t\t\t? update_network_option( get_main_network_id(), $this->db_version_key, $version )\n\t\t\t: update_option( $this->db_version_key, $version );\n\n\t\t// Set the DB version\n\t\t$this->db_version = $version;\n\t}",
"public function setSchemaVersion($version)\n {\n $this->pdo->exec('PRAGMA user_version='.$version);\n }",
"private static function save_db_version() {\n \t$current_db_version = get_option( 'jpid_db_version', '' );\n \t$update_db_version = empty( $current_db_version ) || version_compare( $current_db_version, JPID_DB_VERSION, '<' );\n\n \tif ( $update_db_version ) {\n \t\tupdate_option( 'jpid_db_version', JPID_DB_VERSION );\n \t}\n }",
"public static function get_dbversion()\n\t{\n\t\treturn Version::DB_VERSION;\n\t}",
"function bbp_db_version()\n{\n}",
"abstract public function setSchemaVersion($version);",
"function acf_get_db_version()\n{\n}",
"public static function update_db_version_if_not_exists() {\n\t\tif (self::get_db_version() === FALSE) {\n\t\t\tself::update_db_version();\n\t\t\tself::$_version = self::get_db_version();\n\t\t}\n\t}",
"function acf_update_db_version( $version = '' ) {\n}",
"public function getDatabaseVersion()\n {\n return $this->database_version;\n }",
"protected function _setDbLayerVersion()\n {\n $aVersions = array_keys(oxErpBase::$_aDbLayer2ShopDbVersions);\n $sVersion = array_pop($aVersions);\n oxErpBase::setVersion($sVersion);\n }",
"private function fetchDbVersion ()\n\t{\n\t\t$result = $this->queryOneRow(\"SELECT VERSION() AS version\");\n\t\tif (!empty($result)) {\n\t\t\t$dummy = explode('-', $result['version'], 2);\n\t\t\t$this->dbVersion = $dummy[0];\n\t\t}\n\t}",
"public static function upgrade(){\n\t\t// If an upgrade isn't required at this time...\n\t\tif(Tables::areUpToDate()){\n\t\t\t// ...that's that.\n\t\t\treturn;\n\t\t}\n\n\t\t/** Take whatever steps are required to update the custom database tables. */\n\n\t\t// Update the WordPress option that holds the database version.\n\t\tupdate_option(Tables::$db_version_option, Plugin::VERSION);\n\t}",
"public static function checkDatabaseVersion()\n {\n Db::get()->checkServerVersion();\n }",
"public function get_db_version()\n\t{\n\t\treturn get_option('acf_version', FALSE);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a TagValue. This method will return `PERMISSION_DENIED` if the value does not exist or the user does not have permission to view it. | public function GetTagValue(\Google\Cloud\ResourceManager\V3\GetTagValueRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/google.cloud.resourcemanager.v3.TagValues/GetTagValue',
$argument,
['\Google\Cloud\ResourceManager\V3\TagValue', 'decode'],
$metadata, $options);
} | [
"public function getTagValue()\n {\n return $this->tag_value;\n }",
"private function getPrivateUsersEntityTag()\n {\n $tag = $this->em->getRepository('APITaskBundle:Tag')->findOneBy([\n 'title' => 'Users private Tag',\n ]);\n\n if (null !== $tag) {\n return $tag;\n }\n\n $this->getClient(true)->request('POST', $this->getBaseUrl(),\n ['title' => 'Users private Tag', 'color' => '555555', 'public' => false],\n [], ['Authorization' => 'Bearer ' . $this->userToken, 'HTTP_AUTHORIZATION' => 'Bearer ' . $this->userToken]);\n $this->assertEquals(201, $this->getClient()->getResponse()->getStatusCode());\n\n // Check if Entity was created\n $createdTag = json_decode($this->getClient()->getResponse()->getContent(), true);\n $createdTag = $createdTag['data'];\n $this->assertTrue(array_key_exists('id', $createdTag));\n\n return $this->em->getRepository('APITaskBundle:Tag')->find($createdTag['id']);\n }",
"function get_value() {\n if (isset($this->value))\n return $this->value;\n \n $Tainacan_Item_Metadata = \\Tainacan\\Repositories\\Item_Metadata::get_instance();\n return $Tainacan_Item_Metadata->get_value($this);\n }",
"function get_tag_value($tag_id){\n\t\t\tif(is_int($tag_id)) {\n\t\t\t\t$get_tag_value\t\t=\t@mysql_query(\"SELECT `tag` FROM `tags` WHERE `id` = '$tag_id';\",$this->connection);\n\t\t\t\t$tag_value_result\t=\t@mysql_fetch_array($get_tag_value);\n\t\t\t\t$tag_value\t\t\t=\t(string) $tag_value_result[0];\n\t\t\t\tif (!$tag_value_result) {\n\t\t\t\t\t\tdie(\"jforg_tags.get_tag_value: Das SQL SELCT ist fehlgeschlagen - $tag_value_result\");\n\t\t\t\t}\n\t\t\t return $tag_value;\n\n\t\t\t}else{\n\t\t\t\t$vartype = gettype($tag_id);\n\t\t\t\tdie(\"jforg_tags.get_tag_value: \\$tag_id muss ein int sein, es wurde aber ein $vartype uebrgeben.\");\n\t\t\t}\n\t}",
"public function getValue()\n {\n return $this->getAttribute('disabled')\n ? null\n : $this->getAttribute('value');\n }",
"public function getTagPermission() {\n\t\tif (! is_array ( $this->content_tag_permission ) || count ( $this->content_tag_permission ) < 1) {\n\t\t\t\n\t\t\t$PermissionParameter = new Parameter ( array (\n\t\t\t\t\t'key' => 'content_tag_permission_visitor',\n\t\t\t\t\t'servicelocator' => $this->getServiceLocator () \n\t\t\t) );\n\t\t\t\n\t\t\t$UserManagement = $this->getUserManagement ();\n\t\t\t$Rank = $this->getUserRank ();\n\t\t\t\n\t\t\t$tag_id = $this->getContentTagID ();\n\t\t\t$type_id = $this->getContentTypeID ();\n\t\t\t$rawdata = array ();\n\t\t\t$QTagPermission = $this->getDatabase ();\n\t\t\t$QTagPermission->select ();\n\t\t\t$QTagPermission->columns ( array (\n\t\t\t\t\t'content_tag_permission_id',\n\t\t\t\t\t'user_access_id',\n\t\t\t\t\t'user_rank_id',\n\t\t\t\t\t'content_tag_permission_visitor',\n\t\t\t\t\t'content_tag_permission_created_date',\n\t\t\t\t\t'content_tag_permission_created_by',\n\t\t\t\t\t'content_tag_permission_modified_date',\n\t\t\t\t\t'content_tag_permission_modified_by' \n\t\t\t) );\n\t\t\t$QTagPermission->from ( array (\n\t\t\t\t\t'cdp' => 'content_tag_permission' \n\t\t\t) );\n\t\t\t$QTagPermission->where ( array (\n\t\t\t\t\t'cdp.content_tag_id' => $tag_id,\n\t\t\t\t\t'cdp.content_tag_permission_delete_status' => '0' \n\t\t\t) );\n\t\t\t$QTagPermission->order ( array (\n\t\t\t\t\t'cdp.content_tag_permission_visitor desc',\n\t\t\t\t\t'cdp.user_rank_id asc',\n\t\t\t\t\t'cdp.user_access_id asc' \n\t\t\t) );\n\t\t\t$QTagPermission->execute ();\n\t\t\tif ($QTagPermission->hasResult ()) {\n\t\t\t\twhile ( $QTagPermission->valid () ) {\n\t\t\t\t\t$rawdata = $QTagPermission->current ();\n\t\t\t\t\t\n\t\t\t\t\t$rawdata ['content_tag_permission_visitor_text'] = \"\";\n\t\t\t\t\tif ($PermissionParameter->hasResult ()) {\n\t\t\t\t\t\t$rawdata ['content_tag_permission_visitor_text'] = $PermissionParameter->getMessageByValue ( $rawdata ['content_tag_permission_visitor'] );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$rawdata ['content_tag_permission_rank_options'] = ($rawdata ['user_rank_id'] > 0 ? $this->Encrypt ( $rawdata ['user_rank_id'] ) : null);\n\t\t\t\t\t$rawdata ['content_tag_permission_user_options'] = ($rawdata ['user_access_id'] > 0 ? $this->Encrypt ( $rawdata ['user_access_id'] ) : null);\n\t\t\t\t\t\n\t\t\t\t\t$rawdata ['content_tag_permission_rank'] = ($rawdata ['user_rank_id'] > 0 ? $Rank->getMessage ( $rawdata ['user_rank_id'] ) : null);\n\t\t\t\t\t$rawdata ['content_tag_permission_user'] = ($rawdata ['user_access_id'] > 0 ? $Rank->getMessage ( $UserManagement->getRankID ( $rawdata ['user_access_id'] ) ) . \" - \" . $UserManagement->getUsername ( $rawdata ['user_access_id'] ) : null);\n\t\t\t\t\t\n\t\t\t\t\t$rawdata ['content_tag_permission_created_date_format'] = \"\";\n\t\t\t\t\tif ($rawdata ['content_tag_permission_created_date'] !== \"0000-00-00 00:00:00\") {\n\t\t\t\t\t\t$datetime = new \\DateTime ( $rawdata ['content_tag_permission_created_date'] );\n\t\t\t\t\t\t$rawdata ['content_tag_permission_created_date_format'] = $datetime->format ( 'H:i:s d-F-Y' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$rawdata ['content_tag_permission_modified_date_format'] = \"\";\n\t\t\t\t\tif ($rawdata ['content_tag_permission_modified_date'] !== \"0000-00-00 00:00:00\") {\n\t\t\t\t\t\t$datetime = new \\DateTime ( $rawdata ['content_tag_permission_modified_date'] );\n\t\t\t\t\t\t$rawdata ['content_tag_permission_modified_date_format'] = $datetime->format ( 'H:i:s d-F-Y' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$cryptID = $this->Encrypt ( $rawdata ['content_tag_permission_id'] );\n\t\t\t\t\t$rawdata ['content_tag_permission_id_modify'] = $cryptID;\n\t\t\t\t\t\n\t\t\t\t\t$this->content_tag_permission [$rawdata ['content_tag_permission_id']] = $rawdata;\n\t\t\t\t\t$QTagPermission->next ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->content_tag_permission;\n\t}",
"public function getValue(){\n\t\tif(!($value = $this->getData('value'))){\n\t\t\treturn $this->getDefaultValue();\n\t\t}\n\t\treturn $value;\n\t}",
"protected function getValue()\n {\n // before get\n if (!$this->trigger(CachePool::EVENT_GET_BEFORE)) {\n $this->setHit(false);\n return null;\n }\n\n // get string value from the pool\n $this->strval = $this->pool->getDriver()->get($this->key);\n\n // after get\n if (!$this->trigger(CachePool::EVENT_GET_AFTER)) {\n $this->setHit(false);\n $this->set(null);\n }\n\n return $this->postGetValue();\n }",
"public function getValue() {\n\t\treturn $this->cache[$this->key];\n\t}",
"public function GetValue()\n {\n return $this->_element->GetAttribute('value');\n }",
"public function getValue($value)\n {\n return $this->values->getStructValueByName($value);\n }",
"public function get()\n {\n if ($this->exception) {\n throw $this->exception;\n }\n\n return $this->value;\n }",
"public function getTagValue() : string {\n return($this->tagValue);\n }",
"public function getValue()\n {\n if ($this->hasMutator($this->attributes['meta_value'], 'getter', $this->attributes['meta_type'])) {\n return $this->mutateValue($this->attributes['meta_value'], 'getter');\n }\n\n return $this->castValue();\n }",
"public function getValue() {\n\n\t\t$value = $this->loadValueFromCache();\n\n\t\tif ($value !== null) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t$value = $this->loadValueFromDatabase();\n\n\t\tif ($value !== null) {\n\t\t\t$this->storeValueToCache($value);\n\t\t\treturn $value;\n\t\t}\n\n\t\tthrow (new ResourceNotDefinedException)->setReference($this->getKey(), $this->getLocale());\n\t}",
"public function getVal(){\n\t\t//Check for re-defined value (for example, by POST query)\n\t\tif(isset($this->value)){\n\t\t\treturn $this->value;\n\t\t\t}\n\t\t//Check for define\n\t\tif(defined($this->alias)){\n\t\t\treturn constant($this->alias);\n\t\t\t}\n\t\t//If nothing found - return default value\n\t\treturn $this->default;\n\t\t}",
"public function getPermissionValue()\n {\n if (array_key_exists(\"permissionValue\", $this->_propDict)) {\n return $this->_propDict[\"permissionValue\"];\n } else {\n return null;\n }\n }",
"function get( $value, $tag ){ $this->set_storage('general'); return $this->cache->save($value, $tag);}",
"function tagValue ($tag_name) {\n\t\treturn isset($this->params['data'][$tag_name])? $this->params['data'][$tag_name]: false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Outputs the coverage report of a metrics instance. | protected function _renderCoverage($metrics)
{
$stats = $metrics->data();
foreach ($stats['files'] as $file) {
$this->write("File: {$file}" . "\n\n");
$lines = file($file);
$coverage = $this->_collector->export($file);
if (isset($stats['line'])) {
$start = $stats['line']['start'];
$stop = $stats['line']['stop'];
} else {
$start = 0;
$stop = count($lines) - 1;
}
for ($i = $start; $i <= $stop; $i++) {
$value = isset($coverage[$i]) ? $coverage[$i] : null;
$line = str_pad($i + 1, 6, ' ', STR_PAD_LEFT);
$line .= ':' . str_pad($value, 6, ' ');
$line .= $lines[$i];
if ($value) {
$this->write($line, 'n;green');
} elseif ($value === 0) {
$this->write($line, 'n;red');
} else {
$this->write($line);
}
}
$this->write("\n\n");
}
} | [
"public function coverageReports();",
"final protected function logCoverage(): void\n {\n if (! $this->hasCoverage()) {\n return;\n }\n\n $coverageMerger = $this->getCoverage();\n assert($coverageMerger !== null);\n $codeCoverage = $coverageMerger->getCodeCoverageObject();\n assert($codeCoverage !== null);\n $codeCoverageConfiguration = null;\n if (($configuration = $this->options->configuration()) !== null) {\n $codeCoverageConfiguration = $configuration->codeCoverage();\n }\n\n $reporter = new CoverageReporter($codeCoverage, $codeCoverageConfiguration);\n\n $this->output->write('Generating code coverage report ... ');\n\n $timer = new Timer();\n $timer->start();\n\n if (($coverageClover = $this->options->coverageClover()) !== null) {\n $reporter->clover($coverageClover);\n }\n\n if (($coverageCobertura = $this->options->coverageCobertura()) !== null) {\n $reporter->cobertura($coverageCobertura);\n }\n\n if (($coverageCrap4j = $this->options->coverageCrap4j()) !== null) {\n $reporter->crap4j($coverageCrap4j);\n }\n\n if (($coverageHtml = $this->options->coverageHtml()) !== null) {\n $reporter->html($coverageHtml);\n }\n\n if (($coverageText = $this->options->coverageText()) !== null) {\n if ($coverageText === '') {\n $this->output->write($reporter->text());\n } else {\n file_put_contents($coverageText, $reporter->text());\n }\n }\n\n if (($coverageXml = $this->options->coverageXml()) !== null) {\n $reporter->xml($coverageXml);\n }\n\n if (($coveragePhp = $this->options->coveragePhp()) !== null) {\n $reporter->php($coveragePhp);\n }\n\n $this->output->writeln(\n sprintf('done [%s]', $timer->stop()->asString())\n );\n }",
"private function logCoverage()\n {\n if (!$this->hasCoverage()) {\n return;\n }\n\n $filteredOptions = $this->options->filtered;\n if (isset($filteredOptions['coverage-clover'])) {\n $clover = new \\PHP_CodeCoverage_Report_Clover();\n $clover->process($this->getCoverage()->getCoverage(), $filteredOptions['coverage-clover']);\n }\n\n if (isset($filteredOptions['coverage-html'])) {\n $html = new \\PHP_CodeCoverage_Report_HTML();\n $html->process($this->getCoverage()->getCoverage(), $filteredOptions['coverage-html']);\n }\n\n $php = new \\PHP_CodeCoverage_Report_PHP();\n $php->process($this->getCoverage()->getCoverage(), $filteredOptions['coverage-php']);\n }",
"public function writeToFile()\n {\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<metrics files=\"' . count($this->tests) . '\" functions=\"0\" cls=\"' . count($this->tests) . '\" clsa=\"0\" clsc=\"0\" roots=\"0\" leafs=\"0\" interfs=\"0\" maxdit=\"0\">';\n foreach ( $this->tests[SymfonyUnderControlTest::TEST_UNIT] as $test )\n {\n $xml .= '<file name=\"' . $test->getLibFile() . '\" classes=\"1\" functions=\"0\" loc=\"0\" cloc=\"0\" ncloc=\"0\" locExecutable=\"0\" locExecuted=\"0\" coverage=\"' . $test->getCoverage() . '\">\n <class name=\"' . $test->getName() . '\" loc=\"0\" locExecutable=\"0\" locExecuted=\"0\" aif=\"0.000000\" ahf=\"100.000000\" ca=\"0\" ce=\"0\" csz=\"0\" cis=\"0\" coverage=\"' . $test->getCoverage() . '\" dit=\"0\" i=\"1.000000\" impl=\"0\" mif=\"0.000000\" mhf=\"0.000000\" noc=\"0\" pf=\"0.000000\" vars=\"2\" varsnp=\"0\" varsi=\"2\" wmc=\"10\" wmcnp=\"10\" wmci=\"10\">\n <method name=\"main\" loc=\"0\" locExecutable=\"0\" locExecuted=\"0\" coverage=\"' . $test->getCoverage() . '\" ccn=\"0\" crap=\"6.000000\" npath=\"0\" parameters=\"0\"/>\n </class>\n </file>';\n }\n $xml .= '</metrics>';\n \n file_put_contents($this->path . '/undercontrol.coverage.xml', $xml);\n }",
"public static function getReport()\n {\n require_once 'simpletest/extensions/coverage/coverage_reporter.php';\n\n $handler = new CoverageDataHandler(self::$coverage->log);\n $report = new CoverageReporter();\n $report->reportDir = 'coverage-report';\n $report->title = 'The Coverage Report';\n $report->coverage = $handler->read();\n $report->untouched = $handler->readUntouchedFiles();\n $report->generate();\n }",
"protected function createCoverageReporter()\n {\n return new Text(50, 90, true, false);\n }",
"protected function createCoverageReport()\n {\n return $this->getReportFactory()->createReport( $this->temporaryClover );\n }",
"public function createCodeCoverageReport(\\PHP_CodeCoverage $coverage = null)\r\n {\r\n if (!isset($coverage)) {\r\n echo 'Code coverage analysis unavailable. To enable code coverage, the xdebug php module must be installed and enabled.' . PHP_EOL;\r\n\r\n return;\r\n }\r\n\r\n echo PHP_EOL . 'Creating code coverage report in clover format ... ';\r\n $writer = new \\PHP_CodeCoverage_Report_Clover;\r\n $writer->process($coverage, FULL_PATH . '/clover.xml');\r\n echo 'done' . PHP_EOL;\r\n }",
"function coverageInfo()\n {\n return $this->aggregator->coverageInfo($this->path);\n }",
"public function output(): void\n {\n $results = $this->get();\n $this->info('Time: '.$results['time']);\n $this->info('Memory: '.$results['memory']);\n $this->info('Peak: '.$results['peak']);\n\n foreach ($this->customs as $custom) {\n $this->info($custom['results']);\n }\n }",
"public function outputClover(string $file_name): void\n {\n $this->xml_writer->process($this->coverage, $file_name);\n }",
"public function showSummary()\n {\n if ( isset($_GET['order'])) {\n $this->sortBy = $_GET['order'];\n }\n\n if ( ! isset($this->result['data'])) {\n die(\"Impropper coverage report. Please regenerate\");\n }\n\n $coveredArray = $this->result[\"data\"];\n //lets sort it.\n uasort($coveredArray, array($this,\"sortArray\"));\n\n //and flip if it perhaps?\n if (isset($_GET[\"flip\"]) && $_GET[\"flip\"] == \"true\") {\n $coveredArray = array_reverse($coveredArray, true);\n }\n\n $totals = $this->result[\"totals\"];\n\n echo '<tr><td>TOTAL</td><td>' , \n $totals['percentage'] , '%</td><td>' , \n $totals['lines'] , '</td><td>' , \n $totals['covered'] , '</td><td>', \n $totals['maybe'] , '</td><td>',\n $totals['notcovered'] , '</td><td></tr>';\n\n foreach($coveredArray as $class => $info) {\n\n echo '<tr><td>';\n if ( $info['type'] == \"covered\") {\n echo '<a href=\"' , $class , '.html\">', $class , '</a>';\n }else{\n echo $class;\n }\n echo '<td>' . $info['percentage'] . ' % </td><td>' . $info['total'] . '</td><td>' . $info['covered'] . '</td><td>' . $info['maybe'] . '</td><td>' . $info['notcovered']. '</td></tr>';\n }\n }",
"private function createCloverReport()\n {\n $sxml = simplexml_load_file(dirname(__FILE__) . '/_files/clover.xml');\n return new CloverReport($sxml);\n }",
"public function printCodeCoverageResult(CodeCoverage $coverage)\n {\n $report = new Report\\Text(10, 90, false, false);\n\n echo $report->process($coverage, false);\n }",
"public function output()\n {\n $data = [\n 'classes' => [],\n 'files' => [],\n ];\n foreach ($this->processed as $type => $classes) {\n foreach ($classes as $name => $values) {\n $covered = $values['covered'];\n $total = $values['total'];\n $pct = (((int) $covered / (int) $total) * 100);\n\n $covered = str_pad((string) $covered, 7, ' ', STR_PAD_LEFT);\n $total = str_pad((string) $total, 5, ' ', STR_PAD_LEFT);\n $percentage = number_format($pct, 2).'%';\n $percentage = str_pad((string) $percentage, 10, ' ', STR_PAD_LEFT);\n\n if ($pct < 25) {\n $covered = $this->output->red($covered);\n $total = $this->output->red($total);\n $percentage = $this->output->red($percentage);\n }\n\n if ($pct < 75) {\n $covered = $this->output->black->yellow($covered);\n $total = $this->output->black->yellow($total);\n $percentage = $this->output->black->yellow($percentage);\n }\n\n if ($pct >= 75) {\n $covered = $this->output->green($covered);\n $total = $this->output->green($total);\n $percentage = $this->output->green($percentage);\n }\n\n $data[$type][] = [$name, $covered, $total, $percentage];\n }\n }\n\n $out = [];\n if (count($data['classes']) > 0) {\n array_unshift($data['classes'], ['Class', 'Covered', 'Lines', 'Percentage']);\n\n $out[] = new Table($data['classes'], [\n 'headerColor' => Graphite::YELLOW,\n 'columnSeparator' => '',\n 'headerSeparator' => '',\n 'cellPadding' => 1,\n ]);\n }\n\n if (count($data['files']) > 0) {\n array_unshift($data['files'], ['File', 'Covered', 'Lines', 'Percentage']);\n\n $out[] = new Table($data['files'], [\n 'headerColor' => Graphite::YELLOW,\n 'columnSeparator' => '',\n 'headerSeparator' => '',\n 'cellPadding' => 1,\n ]);\n }\n\n return $this->output->render(implode(\"\\n\\n\", $out));\n }",
"public function getCoverage()\n {\n return $this->coverage;\n }",
"public static function report(OutputInterface $output): float\n {\n if (! file_exists($reportPath = self::getPath())) {\n if (self::usingXdebug()) {\n $output->writeln(\n \" <fg=black;bg=yellow;options=bold> WARN </> Unable to get coverage using Xdebug. Did you set <href=https://xdebug.org/docs/code_coverage#mode>Xdebug's coverage mode</>?</>\",\n );\n\n return 0.0;\n }\n\n throw ShouldNotHappen::fromMessage(sprintf('Coverage not found in path: %s.', $reportPath));\n }\n\n /** @var CodeCoverage $codeCoverage */\n $codeCoverage = require $reportPath;\n unlink($reportPath);\n\n $totalCoverage = $codeCoverage->getReport()->percentageOfExecutedLines();\n\n /** @var Directory<File|Directory> $report */\n $report = $codeCoverage->getReport();\n\n foreach ($report->getIterator() as $file) {\n if (! $file instanceof File) {\n continue;\n }\n $dirname = dirname($file->id());\n $basename = basename($file->id(), '.php');\n\n $name = $dirname === '.' ? $basename : implode(DIRECTORY_SEPARATOR, [\n $dirname,\n $basename,\n ]);\n\n $percentage = $file->numberOfExecutableLines() === 0\n ? '100.0'\n : number_format($file->percentageOfExecutedLines()->asFloat(), 1, '.', '');\n\n $uncoveredLines = '';\n\n $percentageOfExecutedLinesAsString = $file->percentageOfExecutedLines()->asString();\n\n if (! in_array($percentageOfExecutedLinesAsString, ['0.00%', '100.00%', '100.0%', ''], true)) {\n $uncoveredLines = trim(implode(', ', self::getMissingCoverage($file)));\n $uncoveredLines = sprintf('<span>%s</span>', $uncoveredLines).' <span class=\"text-gray\"> / </span>';\n }\n\n $color = $percentage === '100.0' ? 'green' : ($percentage === '0.0' ? 'red' : 'yellow');\n\n $truncateAt = max(1, terminal()->width() - 12);\n\n renderUsing($output);\n render(<<<HTML\n <div class=\"flex mx-2\">\n <span class=\"truncate-{$truncateAt}\">{$name}</span>\n <span class=\"flex-1 content-repeat-[.] text-gray mx-1\"></span>\n <span class=\"text-{$color}\">$uncoveredLines {$percentage}%</span>\n </div>\n HTML);\n }\n\n $totalCoverageAsString = $totalCoverage->asFloat() === 0.0\n ? '0.0'\n : number_format($totalCoverage->asFloat(), 1, '.', '');\n\n renderUsing($output);\n render(<<<HTML\n <div class=\"mx-2\">\n <hr class=\"text-gray\" />\n <div class=\"w-full text-right\">\n <span class=\"ml-1 font-bold\">Total: {$totalCoverageAsString} %</span>\n </div>\n </div>\n HTML);\n\n return $totalCoverage->asFloat();\n }",
"public function admin_docs_coverage($className = null) {\n\t\t$apiClass = $this->ApiClass->findBySlug($className);\n\t\tif (empty($apiClass)) {\n\t\t\t$this->_notFound(__d('api_generator', 'No class exists with that name'));\n\t\t}\n\t\ttry {\n\t\t\t$analysis = $this->ApiClass->analyzeCoverage($apiClass);\n\t\t} catch(Exception $e) {\n\t\t\t$this->_notFound($e->getMessage());\n\t\t}\n\t\t$backwards = $this->referer();\n\t\t$this->helpers[] = 'Number';\n\t\t$this->set(compact('apiClass', 'analysis', 'backwards'));\n\t}",
"public function getCoverage()\n\t{\n\t\treturn $this->coverage;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compile a "select date" clause. | protected function selectDate(Builder $query, $select)
{
return $this->dateBasedSelect('date', $query, $select);
} | [
"function compileQuerySelect(array $statement);",
"public function compileSelect()\n {\n if (is_null($this->columns)) {\n $this->columns = array('*');\n }\n\n $select = $this->distinct ? 'SELECT DISTINCT' : 'SELECT';\n\n return $select .' ' .$this->columnize($this->columns) .' FROM {' .$this->table .'}' .$this->constraints();\n }",
"private function compile_select()\n\t{\n\t\t$sql = $this->select.' '.$this->from.' '.$this->where;\n\n\t\tif (count($this->orderings) > 0)\n\t\t{\n\t\t\t$sql .= ' ORDER BY '.implode(', ', $this->orderings);\n\t\t}\n\n\t\tif ( ! is_null($this->limit))\n\t\t{\n\t\t\t$sql .= ' LIMIT '.$this->limit;\n\t\t}\n\n\t\tif ( ! is_null($this->offset))\n\t\t{\n\t\t\t$sql .= ' OFFSET '.$this->offset;\n\t\t}\n\n\t\treturn $sql;\n\t}",
"function _GenerateDateSubQuery($fielddata=array(), $fieldid=0)\n\t{\n\t\tif (!isset($fielddata['filter'])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The only difference between the MySQL and PgSQL way of doing this is\n\t\t// the 'to date' function and the 'get day of year' function.\n\t\t$field_date = \"STR_TO_DATE(d.data, '%d/%m/%Y')\";\n\t\t$day_of_year = \"DAYOFYEAR(%s)\";\n\t\tif (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {\n\t\t\t$field_date = \"TO_DATE(d.data, 'DD/MM/YYYY')\";\n\t\t\t$day_of_year = \"EXTRACT(DOY FROM DATE (%s))\";\n\t\t}\n\n\t\t// This condition is just for the 'between' case when searching for a date where we don't care about the year (e.g. birthdays).\n\t\tif (!is_numeric($fielddata['yy_start']) || !is_numeric($fielddata['yy_end'])) {\n\t\t\t$fielddata['yy_start'] = 0;\n\t\t\t$fielddata['yy_end'] = 0;\n\t\t}\n\t\t$start_date = \"'\" . sprintf(\"%04s\", intval($fielddata['yy_start'])) . '-' . sprintf(\"%02s\", intval($fielddata['mm_start'])) . '-' . sprintf(\"%02s\", intval($fielddata['dd_start'])) . \"'\";\n\n\t\t$subquery = \"d.fieldid=\" . intval($fieldid) . \" AND (\";\n\t\tswitch ($fielddata['type']) {\n\t\t\tcase 'after':\n\t\t\t\t$subquery .= \"{$field_date} > {$start_date}\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'between':\n\t\t\t\t// The end date is only present when we're doing a 'between'.\n\t\t\t\t$end_date = \"'\" . sprintf(\"%04s\", intval($fielddata['yy_end'])) . '-' . sprintf(\"%02s\", intval($fielddata['mm_end'])) . '-' . sprintf(\"%02s\", intval($fielddata['dd_end'])) . \"'\";\n\t\t\t\tif ($fielddata['yy_start'] == 0) {\n\t\t\t\t\t// We don't care about the year.\n\t\t\t\t\t$start_date = sprintf($day_of_year, $start_date);\n\t\t\t\t\t$end_date = sprintf($day_of_year, $end_date);\n\t\t\t\t\t$field_date = sprintf($day_of_year, $field_date);\n\t\t\t\t}\n\t\t\t\t$subquery .= \"{$field_date} BETWEEN {$start_date} AND {$end_date}\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'before':\n\t\t\t\t$subquery .= \"{$field_date} < {$start_date}\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'exactly':\n\t\t\t\t$subquery .= \"{$field_date} = {$start_date}\";\n\t\t\t\tbreak;\n\t\t}\n\t\t$subquery .= \")\";\n\n\t\treturn $subquery;\n\t}",
"private function compute_source_select_clause() {\r\n $select = \" \";\r\n\r\n // label\r\n switch ($this -> viewDef -> getViewType()) {\r\n case \"Everything\" :$select .= \"YEAR(Zeit)\"; break;\r\n case \"Year\" : $select .= \"MONTH(Zeit)\"; break;\r\n case \"Month\" : $select .= \"DAY(Zeit)\"; break;\r\n case \"Day\" : $select .= \"HOUR(Zeit)\"; break;\r\n }\r\n $select .= \" AS label, \\n \";\r\n\r\n // value\r\n switch ($this -> viewDef -> getViewType()) {\r\n case \"Everything\" :$select .= \"SUM(kwh_pro15min)/1000\"; break;\r\n case \"Year\" : $select .= \"SUM(kwh_pro15min)/1000\"; break;\r\n case \"Month\" : $select .= \"SUM(kwh_pro15min)/1000\"; break;\r\n case \"Day\" : $select .= \"SUM(kwh_pro15min)\"; break;\r\n }\r\n $select.= \" AS value \\n\";\r\n\r\n return $select;\r\n }",
"protected function compileSelect()\n\t{\n\t\t$params = [];\n\n\t\t// select\n\t\t$query = 'SELECT ';\n\n\t\t// values\n\t\tif (count($this->select) === 0) {\n\t\t\t$query .= '* ';\n\t\t} else {\n\t\t\t$separator = '';\n\t\t\tforeach ($this->select as $identifier) {\n\t\t\t\tif (is_array($identifier)) {\n\t\t\t\t\tlist($identifier, $alias) = $identifier;\n\t\t\t\t} else {\n\t\t\t\t\t$alias = false;\n\t\t\t\t}\n\t\t\t\tif ($identifier instanceof \\Base\\Database\\Raw) {\n\t\t\t\t\t$query.= $separator . $identifier->expression();\n\t\t\t\t} else {\n\t\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier);\n\t\t\t\t}\n\t\t\t\tif ($alias) {\n\t\t\t\t\t$query.= ' AS ' . $this->quoteIdentifier($alias);\n\t\t\t\t}\n\t\t\t\t$separator = ', ';\n\t\t\t}\n\t\t}\n\n\t\t//distinct\n\t\tif (count($this->distinct) > 0) {\n\t\t\t$query.= ' DISTINCT ';\n\t\t\t$separator = '';\n\t\t\tforeach ($this->distinct as $identifier) {\n\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier);\n\t\t\t\t$separator = ', ';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// from\n\t\tif (is_array($this->table)) {\n\t\t\tlist($table, $alias) = $this->table;\n\t\t} else {\n\t\t\t$table = $this->table;\n\t\t\t$alias = false;\n\t\t}\n\n\t\tif ($table instanceof \\Base\\Database\\Query) {\n\t\t\tlist($subQuery, $subParams) = $table->compile();\n\t\t\t$params = array_merge($params, $subParams);\n\t\t\t$query.= ' FROM (' . $subQuery . ')';\n\t\t} else {\n\t\t\t$query.= ' FROM ' . $this->quoteTable($table);\n\t\t}\n\t\tif ($alias) {\n\t\t\t$query.= ' AS ' . $this->quoteTable($alias);\n\t\t}\n\n\n\t\t// join\n\t\tif (count($this->joins) > 0) {\n\t\t\tforeach ($this->joins as $join) {\n\t\t\t\tif (in_array(strtoupper($join['type']), ['INNER', 'OUTER', 'LEFT', 'RIGHT', 'FULL'])) {\n\t\t\t\t\t$query .= ' ' . strtoupper($join['type']) . ' JOIN ';\n\n\t\t\t\t\tif (is_array($join['table'])) {\n\t\t\t\t\t\tlist($table, $alias) = $join['table'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$table = $join['table'];\n\t\t\t\t\t\t$alias = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$query.= $this->quoteTable($table) . ' ';\n\t\t\t\t\tif ($alias) {\n\t\t\t\t\t\t$query.= 'AS ' . $this->quoteTable($alias);\n\t\t\t\t\t}\n\n\t\t\t\t\t$on = false;\n\t\t\t\t\tif (count($join['on']) > 0) {\n\t\t\t\t\t\t$on = true;\n\t\t\t\t\t\tlist($onQuery, $onParams) = $this->compileConditions($join['on'], true);\n\t\t\t\t\t\t$query .= 'ON ' . $onQuery;\n\t\t\t\t\t\t$params = array_merge($params, $onParams);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (count($join['where']) > 0) {\n\t\t\t\t\t\tlist($onWhereQuery, $onWhereParams) = $this->compileConditions($join['where']);\n\t\t\t\t\t\tif ($on === true) {\n\t\t\t\t\t\t\t$query .= ' ' . $join['where'][0]['logic'] . ' ';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$query.= $onWhereQuery;\n\t\t\t\t\t\t$params = array_merge($params, $onWhereParams);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// where\n\t\tif (count($this->where) > 0) {\n\t\t\tlist($whereQuery, $whereParams) = $this->compileConditions($this->where);\n\t\t\t$query.= ' WHERE ' . $whereQuery;\n\t\t\t$params = array_merge($params, $whereParams);\n\t\t}\n\n\t\t// group by\n\t\t$separator = ' GROUP BY ';\n\t\tforeach ($this->group as $identifier) {\n\t\t\tif ($identifier instanceof \\Base\\Database\\Raw) {\n\t\t\t\t$query.= $separator . $identifier->expression();\n\t\t\t} else {\n\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier);\n\t\t\t}\n\t\t\t$separator = ', ';\n\t\t}\n\n\t\t// having\n\t\tif (count($this->having) > 0) {\n\t\t\tlist($havingQuery, $havingParams) = $this->compileConditions($this->having);\n\t\t\t$query.= ' HAVING ' . $havingQuery;\n\t\t\t$params = array_merge($params, $havingParams);\n\t\t}\n\n\t\t// order\n\t\t$separator = ' ORDER BY ';\n\t\tforeach ($this->order as $identifier => $direction) {\n\t\t\t$direction = strtoupper($direction) === 'DESC' ? 'DESC' : 'ASC';\n\t\t\tif ($identifier instanceof \\Base\\Database\\Raw) {\n\t\t\t\t$query.= $separator . $identifier->expression() . ' ' . $direction;\n\t\t\t} else {\n\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier) . ' ' . $direction;\n\t\t\t}\n\t\t\t$separator = ', ';\n\t\t}\n\n\t\t// limit\n\t\tif ($this->limit !== false) {\n\t\t\t$query .= ' LIMIT ' . (int) $this->limit;\n\t\t}\n\n\t\t// offset\n\t\tif ($this->offset !== false) {\n\t\t\t$query .= ' OFFSET ' . (int) $this->offset;\n\t\t}\n\n\t\t// union / union_all\n\t\t$unioned = false;\n\t\tforeach ($this->union as $union) {\n\t\t\tlist($unionQuery, $unionParams) = $union->compile();\n\t\t\t$params = array_merge($params, $unionParams);\n\t\t\tif ($unioned == false) {\n\t\t\t\t$query = '(' . $query . ')';\n\t\t\t}\n\t\t\t$query.= ' UNION (' . $unionQuery . ')';\n\t\t\t$unioned = true;\n\t\t}\n\n\t\tforeach ($this->unionAll as $union) {\n\t\t\tlist($unionQuery, $unionParams) = $union->compile();\n\t\t\t$params = array_merge($params, $unionParams);\n\t\t\tif ($unioned == false) {\n\t\t\t\t$query = '(' . $query . ') ';\n\t\t\t}\n\t\t\t$query.= ' UNION ALL (' . $unionQuery . ')';\n\t\t\t$unioned = true;\n\t\t}\n\n\n\t\treturn [$query, $params];\n\t}",
"public function compile_select(DB_Query_Select $query) {\n $this->select_aliases($query->tables, $query->joins);\n $rval = 'SELECT ';\n if ($query->distinct) {\n $rval .= 'DISTINCT ';\n }\n $rval .= $this->escape_values($query->columns);\n $rval .= ' FROM ';\n $tbl_names = array();\n foreach ($query->tables as $table) {\n $tbl_names []= $this->escape_table($table);\n }\n $rval .= implode(', ', $tbl_names);\n if ( ! empty($query->hints)){\n $rval .= $this->compile_hints($query->hints);\n }\n if ( ! empty($query->joins)) {\n foreach ($query->joins as $join) {\n $rval .= ' ' . $join['type'] . ' JOIN ' . $this->escape_table($join['table']);\n $rval .= ' ON ' . $this->compile_expressions($join['conditions']);\n }\n }\n if ( ! empty($query->where_conditions)) {\n $rval .= ' WHERE '.$this->compile_expressions($query->where_conditions);\n }\n if ( ! empty($query->group_by)) {\n $rval .= ' GROUP BY '.$this->escape_values($query->group_by);\n }\n if ( ! empty($query->having_conditions)) {\n $rval .= ' HAVING '.$this->compile_expressions($query->having_conditions);\n }\n if ( ! empty($query->order_by)) {\n $rval .= ' ORDER BY ';\n foreach ($query->order_by as $ord) {\n $rval .= $this->escape_value($ord['column']).' '.$ord['direction'];\n }\n }\n if ( ! is_null($query->limit)) {\n $rval .= ' LIMIT '.$query->limit;\n }\n if ( ! is_null($query->offset)) {\n $rval .= ' OFFSET '.$query->offset;\n }\n if ( ! empty($query->unions)) {\n foreach($query->unions as $union) {\n $rval .= ' UNION ';\n if ($union['all'] == TRUE) {\n $rval .= 'ALL ';\n }\n $rval .= $this->compile_select($union['select']);\n }\n }\n return $rval;\n }",
"protected function buildSelectStatement() {\n\t\t$select = 'SELECT '\n\t\t\t. '\\'' . $this->site->getRootPageId() . '\\' as root, '\n\t\t\t. '\\'' . $this->type . '\\' AS item_type, '\n\t\t\t. 'uid, '\n\t\t\t. '\\'' . $this->indexingConfigurationName . '\\' as indexing_configuration, '\n\t\t\t. 'modificationdate';\n\n\t\treturn $select;\n\t}",
"public static function generateDateQuery($aDate)\r\n{\r\n $arr = getdate($aDate);\r\n$result = '<date>';\r\nif ($arr['year'])\r\n $result .= '<year>'.$arr['year'].'</year>';\r\nif ($arr['mon'])\r\n $result .= '<month>'.$arr['mon'].'</month>';\r\nif ($arr['mday'])\r\n $result .= '<day>'.$arr['mday'].'</day>';\r\n$result .= '</date>';\r\n\r\nreturn $result;\r\n}",
"protected function compileSelect() {\n\t\t\n\t\t$pivots = $this->query->getPivots();\n\t\t\n\t\t// add in what we want to select\n\t\t$sql = 'SELECT '. $this->compileFields();\n\n\t\t$aliases = &$this->query->getAliases();\n\t\t$relations = &$this->query->getRelations();\n\t\t\n\t\t// create a graph of the\n\t\t$graph = $this->relations->getRelationDependencies(\n\t\t\t$aliases,\n\t\t\t$relations,\n\t\t\t$this->models\n\t\t);\n\t\t\n\t\tif(!empty($graph)) {\n\t\t\t\n\t\t\t// pivots are being used, flatten the graph and translate the\n\t\t\t// nested joins into a flat set of inner joins with the conditions\n\t\t\t// in the WHERE clause\n\t\t\tif(!empty($pivots) && !empty($relations)) {\n\t\t\t\t$graph = $this->flattenRelationsGraph($graph);\n\t\t\t\t$this->compileRelationsAsPredicates();\n\t\t\t}\n\t\t\t\n\t\t\t$joins = trim($this->recursiveJoin(NULL, $graph, ''));\n\t\t\tif($joins[0] == '(') {\n\t\t\t\t$joins = substr($joins, 1, -1);\n\t\t\t}\n\t\t\t$sql .= ' FROM '. $joins;\n\t\t}\n\t\t\n\t\t\n\t\t// get parts of the query\n\t\t$this->compilePivots();\n\t\t\t\t\n\t\t$where = $this->compilePredicates('where');\n\t\t$order = $this->compilePredicates('order');\n\t\t$limit = $this->compilePredicates('limit');\n\t\t$group = $this->compilePredicates('group');\n\t\t\n\t\tif(!empty($where)) $sql .= \" WHERE \". implode(' ', $where);\n\t\tif(!empty($group)) $sql .= \" GROUP BY \". implode(' ', $group);\n\t\tif(!empty($order)) $sql .= \" ORDER BY \". implode(' ', $order);\n\t\tif(!empty($limit)) $sql .= \" LIMIT \". implode(' ', $limit);\n\t\t\n\t\t// add in the predicates and return\n\t\treturn $sql;\n\t}",
"function construct_date_SQL($pstrWhen, $pstrDate)\n\t{\n\t\tif($pstrWhen == 6 or $pstrWhen == 0)\n\t\t{\n\t\t\treturn \" \";\n\t\t}\n\t\telse\n\t\t{\t\n\t\n\t\t\tswitch ($pstrWhen) \n\t\t\t{\n\t\t\t\t//Today\n\t\t\t\tcase 1:\n\t\t\t\t\t//Si se ha perdido hoy, todos los items registrados desde ayer no se deben comprobar\n\t\t\t\t\t//El parametro del metodo viene del objeto perdido, el de la query es el posible candidato,\n\t\t\t\t\t//por lo que, se tiene que cumplir que, \n\n\t\t\t\t\tbreak;\n\t\t\t\t\t//Yesterday\n\t\t\t\tcase 2:\n\t\t\t\t\t//Le resto un dia al timestamp, ya que se perdio ayer\n\t\t\t\t\t$pstrDate = $pstrDate - 864000;\n\t\t\t\t\tbreak;\n\t\t\t\t\t//2 days ago\n\t\t\t\tcase 3:\n\t\t\t\t\t//Si se ha perdido hace dos dias , todos los items registrados desde hace 2 dias no se deben comprobar\n\t\t\t\t\t$pstrDate = $pstrDate - (864000 * 2);\n\n\t\t\t\t\tbreak;\n\t\t\t\t\t//A week ago\n\t\t\t\tcase 4:\n\t\t\t\t\t$pstrDate = $pstrDate - (864000 * 7);\n\t\t\t\t\tbreak;\n\t\t\t\t\t//A month ago\n\t\t\t\tcase 5:\n\t\t\t\t\t$pstrDate = $pstrDate - (864000 * 30);\n\t\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\n\t\t\t$strQuery = \" AND I.RegisterDate > $pstrDate \";\n\n\n\t\t\treturn $strQuery;\n\t\t}\n\t}",
"protected function genSelect($cond)\n {\n $join = '';\n foreach ($this->join as $v) {\n $join .= \" {$v['prefix']} JOIN {$v['table']} ON \".\n QueryGen::make_cond($v['on']);\n }\n $q = 'SELECT '.\n QueryGen::make_fields($this->fields).\n \" FROM {$this->from} $join WHERE $cond\";\n if ($this->groupby) {\n $q .= \" GROUP BY {$this->groupby}\";\n }\n if ($this->having) {\n $q .= ' HAVING '.\n QueryGen::make_cond($this->having);\n }\n if ($this->orderby) {\n $q .= \" ORDER BY {$this->orderby}\";\n if ($this->orderbyDesc) {\n $q .= ' DESC';\n }\n }\n if ($this->limit) {\n if ($this->skip) {\n $q .= \" LIMIT {$this->skip}, {$this->limit}\";\n } elseif (!is_array($this->limit)) {\n $q .= \" LIMIT {$this->limit}\";\n } else {\n $q .= \" LIMIT {$this->limit[0]}, {$this->limit[1]}\";\n }\n }\n\n return $q;\n }",
"function smarty_function_select_date($params, &$smarty) {\n static $counter = 0;\n \n $id = array_var($params, 'id');\n if(empty($id)) {\n $counter++;\n $id = 'select_date_' . $counter;\n } // if\n \n $params['id'] = $id;\n $params['type'] = 'text';\n \n $formatted_value = array_var($params, 'value', null, true);\n if(instance_of($formatted_value, 'DateValue')) {\n $formatted_value = date('Y/m/d', $formatted_value->getTimestamp());\n } // if\n \n $params['value'] = $formatted_value;\n \n $start_date = array_var($params, 'start_date', \"2000/01/01\", true);\n if(instance_of($start_date, 'DateValue')) {\n $start_date = date('Y/m/d', $start_date->getTimestamp());\n } // if\n \n $end_date = array_var($params, 'end_date', '2050/01/01', true);\n if(instance_of($end_date, 'DateValue')) {\n $end_date = date('Y/m/d', $end_date->getTimestamp());\n } // if\n \n $first_week_day = array_var($params, 'first_week_day', UserConfigOptions::getValue('time_first_week_day', $smarty->get_template_vars('logged_user')), true);\n \n $result = '<div class=\"select_date\">' . open_html_tag('input', $params, true);\n if($formatted_value) {\n $result .= '<script type=\"text/javascript\">Date.firstDayOfWeek = ' . $first_week_day . '; Date.format = \\'yyyy/mm/dd\\'; $(\"#' . $id . '\").datePicker().dpSetStartDate(\"' . $start_date . '\").dpSetEndDate(\"' . $end_date . '\").dpSetSelected(\"' . $formatted_value . '\");</script>';\n } else {\n $result .= '<script type=\"text/javascript\">Date.firstDayOfWeek = ' . $first_week_day . '; Date.format = \\'yyyy/mm/dd\\'; $(\"#' . $id . '\").datePicker().dpSetStartDate(\"' . $start_date . '\").dpSetEndDate(\"' . $end_date . '\");</script>';\n } // if\n \n return $result . '</div>';\n }",
"protected function getCompiledSelectClause()\n {\n return 'select ' . implode(', ', $this->select);\n }",
"function getContactRequestsByDate(string $date) {\n return select('\n SELECT ContactRequestID, ContactRequestName, ContactRequestSubject, ContactRequestMessage,\n DATE(ContactRequestDate) ContactRequestDate, ContactRequestEmail\n FROM contact_requests \n WHERE DATE(ContactRequestDate) = :date\n ', ['date' => $date]);\n}",
"public function customSelectPart()\r\n\t{\r\n\t\t$this->customSelectPart \t= $this->settingVars->dateperiod.\" AS DATE\";\r\n\t\t$this->customGroupByPart\t= \"GROUP BY DATE ORDER BY DATE DESC\";\r\n\t\t$this->getVar\t\t\t\t= \"DATE\";\r\n\t}",
"function date_selection ( $prefix, $date, $trigger = false, $num_years = 20 ) {\n $selected = ' selected=\"selected\"';\n $trigger_str = ( empty ( $trigger ) ? '' : $prefix . 'datechanged();' );\n $onchange = ( empty ( $trigger_str ) ? '' : 'onchange=\"$trigger_str\"' );\n if ( strlen ( $date ) != 8 )\n $date = date ( 'Ymd' );\n\n $thisyear = $year = substr ( $date, 0, 4 );\n $thismonth = $month = substr ( $date, 4, 2 );\n $thisday = $day = substr ( $date, 6, 2 );\n if ( $thisyear - date ( 'Y' ) >= ( $num_years - 1 ) )\n $num_years = $thisyear - date ( 'Y' ) + 2;\n\n $ret = '\n <select name=\"' . $prefix . 'day\" id=\"' . $prefix . 'day\"'\n . $onchange . '>';\n for ( $i = 1; $i <= 31; $i++ ) {\n $ret .= '\n <option value=\"' . \"$i\\\"\"\n . ( $i == substr ( $date, 6, 2 ) ? $selected : '' ) . \">$i\" . '</option>';\n }\n $ret .= '\n </select>\n <select name=\"' . $prefix . 'month\"' . $onchange . '>';\n for ( $i = 1; $i < 13; $i++ ) {\n $ret .= '\n <option value=\"' . \"$i\\\"\"\n . ( $i == substr ( $date, 4, 2 ) ? $selected : '' )\n . '>' . month_name ( $i - 1, 'M' ) . '</option>';\n }\n $ret .= '\n </select>\n <select name=\"' . $prefix . 'year\"' . $onchange . '>';\n for ( $i = -10; $i < $num_years; $i++ ) {\n $y = $thisyear + $i;\n $ret .= '\n <option value=\"' . \"$y\\\"\" . ( $y == $thisyear ? $selected : '' )\n . \">$y\" . '</option>';\n }\n return $ret . '\n </select>\n <input type=\"button\" name=\"' . $prefix . 'btn\" onclick=\"selectDate( \\''\n . $prefix . 'day\\',\\'' . $prefix . 'month\\',\\'' . $prefix . \"year','$date'\"\n . ', event, this.form );\" value=\"' . translate ( 'Select' ) . '...\" />' . \"\\n\";\n}",
"protected function _buildSelectStart() {\r\n $result_columns = join(', ', $this->_resultColumns);\r\n\r\n if ($this->_distinct) {\r\n $result_columns = 'DISTINCT ' . $result_columns;\r\n }\r\n\r\n $fragment = \"SELECT {$result_columns} FROM \" . $this->_quoteIdentifier($this->_tableName);\r\n\r\n if (!is_null($this->_tableAlias)) {\r\n $fragment .= \" \" . $this->_quoteIdentifier($this->_tableAlias);\r\n }\r\n return $fragment;\r\n }",
"protected function whereDate(Builder $query, $where)\n {\n $value = $this->parameter($where['value']);\n\n return 'cast('.$this->wrap($where['column']).' as date) '.$where['operator'].' '.$value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the size of $directory in bytes. This function gets the sum of the sizes of all files in a directory. If $countSubDirs is not provided or true, the result will include all subdirectories. | public static function getSize(string $directory, bool $countSubDirs = true): int
{
/* directory does not exist */
if (!is_string($directory) || !is_dir($directory)) {
$message = "Argument 1 '" . print_r($directory, true) . "' is not a directory.";
throw new \Yana\Core\Exceptions\Files\NotFoundException($message, \Yana\Log\TypeEnumeration::WARNING);
}
/* else determine the size */
$dir = $directory . '/';
$d = dir($dir);
$dirsize = 0;
while (false !== ($filename = $d->read()))
{
if ($filename == '.' || $filename == '..') {
continue;
} elseif (is_file($dir . $filename)) { /* accumulate file sizes */
$dirsize += filesize($dir . $filename);
} elseif ($countSubDirs === true) { /* only recurse if subdirs are to be included */
$dirsize += self::getSize($dir . $filename, true, false);
}
}
$d->close();
/* return result */
return $dirsize;
} | [
"function directorySize ($dir) {\n $size = 0;\n foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {\n $size += is_file($each) ? filesize($each) : directorySize($each);\n }\n return $size;\n }",
"static function dir_size($dir){//directory size\n\t\tif(is_array($subs=scandir($dir))){\n\t\t\t$size = 0;\n\t\t\t$subs=array_slice($subs,2,count($subs)-2);\n\t\t\tif($sub_count=count($subs)){\n\t\t\t\tfor($i=0;$i<$sub_count;$i++){\n\t\t\t\t\t$temp_sub=$dir.'/'.$subs[$i];\n\t\t\t\t\tif(is_dir($temp_sub)){\n\t\t\t\t\t\t$size+=self::dir_size($temp_sub);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$size+=filesize($temp_sub);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $size;\n\t\t}\n\t}",
"function dirSize($dir)\n {\n $size = 0;\n foreach(new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($dir)) as $file)\n {\n $size += $file->getSize();\n }\n\n if ($size >= 1073741824) {\n $fileSize = round($size / 1024 / 1024 / 1024,1) . ' GB';\n } elseif ($size >= 1048576) {\n $fileSize = round($size / 1024 / 1024,1) . ' MB';\n } elseif($size >= 1024) {\n $fileSize = round($size / 1024,1) . ' KB';\n } else {\n $fileSize = $size . ' bytes';\n }\n return $fileSize;\n }",
"private function _calculateUsage(/*string*/ $directory) {\r\n\t\t$directoryHandle = opendir($directory);\r\n\t\t$bytes = 0;\r\n\t\t\t\r\n\t\tif (is_resource($directoryHandle)) {\r\n\t\t\twhile ($nextFile = readdir($directoryHandle)) {\r\n\t\t\t\tif ($nextFile != \".\" && $nextFile != \"..\") \t{\r\n\t\t\t\t\tif (is_dir($directory . \"/\" . $nextFile)) {\r\n\t\t\t\t\t\t$bytes += $this->_calculateUsage($directory . \"/\" . $nextFile);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$bytes += filesize($directory . \"/\" . $nextFile);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tclosedir($directoryHandle);\r\n\t\t} else {\r\n\t\t\tthrow new Exception(\"Directory {$absolutDirectoryPath} does not exist or cannot be found.\");\r\n\t\t}\r\n\t\t\r\n\t\treturn $bytes;\r\n\t}",
"public static function getDirSizeCount($dir);",
"private function _calculateUsage(/*string*/ $directory) {\r\n\t\tArgumentTypeValidator::isString($directory, \"Directory must be a string.\");\r\n\t\t\r\n\t\t$bytes = 0;\r\n\t\t$directoryHandle = opendir($directory);\r\n\t\t\t\r\n\t\tif (is_resource($directoryHandle)) {\r\n\t\t\twhile ($nextFile = readdir($directoryHandle)) {\r\n\t\t\t\tif ($nextFile != \".\" && $nextFile != \"..\") \t{\r\n\t\t\t\t\tif (is_dir($directory . \"/\" . $nextFile)) {\r\n\t\t\t\t\t\t$bytes += $this->_calculateUsage($directory . \"/\" . $nextFile);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$bytes += filesize($directory . \"/\" . $nextFile);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tclosedir($directoryHandle);\r\n\t\t} else {\r\n\t\t\tthrow new Exception(\"Directory {$absolutDirectoryPath} does not exist or cannot be found.\");\r\n\t\t}\r\n\t\t\r\n\t\treturn $bytes;\r\n\t}",
"function dirsize($dir) {\r\n\r\n\t$dh = @opendir($dir);\r\n\t$size = 0;\r\n\tif($dh != false) { // dont go into this loop if the dir was not opened successfully\r\n\t\r\n\t\twhile (($file = readdir($dh)) !== false) {\r\n\t\t\r\n\t\t\tif ($file != '.' and $file != '..') {\r\n\t\t\t\r\n\t\t\t\t$path = $dir.'/'.$file;\r\n\t\t\t\tif (is_dir($path)) {\r\n\t\t\t\t\r\n\t\t\t\t\t$size += dirsize(\"$path/\");\r\n\t\t\t\t} elseif (is_file($path)) {\r\n\t\t\t\t\t$size += filesize($path);\r\n\t\t\t\t}\r\n \t}\r\n\t\t}\r\n\t\tclosedir($dh);\r\n\t}\r\n\treturn $size;\r\n}",
"static function getDirectorySizeInKb($directoryPath){\n $returnedSize = 0;\n $directory = new DirectoryIterator(realpath($directoryPath));\n\n foreach ($directory as $file) {\n if (!$file->isDot()) {\n $returnedSize += $file->getSize()/1000;\n }\n }\n\n return $returnedSize;\n }",
"public function size () {\n function rSize ($dir) {\n $folder = array_diff(scandir($dir), ['.', '..']);\n $filesize = 0;\n foreach ($folder as $file) {\n if (is_dir($dir.'/'.$file)) {\n $filesize += rSize($dir.'/'.$file);\n } else {\n $filesize += filesize($dir.'/'.$file);\n }\n }\n return $filesize;\n }\n return rSize($this->fullpath);\n }",
"function getDirectorySize($path)\n{\n $totalsize = 0;\n $totalcount = 0;\r\n $dircount = 0;\n if($handle = opendir($path))\n {\n while (false !== ($file = readdir($handle)))\n {\n $nextpath = $path . '/' . $file;\n if($file != '.' && $file != '..' && !is_link ($nextpath))\n {\n if(is_dir($nextpath))\n {\n $dircount++;\n $result = getDirectorySize($nextpath);\n $totalsize += $result['size'];\n $totalcount += $result['count'];\n $dircount += $result['dircount'];\n }\n else if(is_file ($nextpath))\n {\n $totalsize += filesize ($nextpath);\n $totalcount++;\n }\n }\n }\n }\n closedir($handle);\n $total['size'] = $totalsize;\n $total['count'] = $totalcount;\n $total['dircount'] = $dircount;\n return $total;\n}",
"function dirsize($dirname) {\n\tif(!is_dir($dirname) || !is_readable($dirname)) { return false; }\n\n\t$dirname_stack[] = $dirname;\n\t$size = 0;\n\n\tdo {\n\t $dirname = array_shift($dirname_stack);\n\t $handle = opendir($dirname);\n\t while(false !== ($file = readdir($handle))) {\n\t if($file != '.' && $file != '..' && is_readable($dirname . DIRECTORY_SEPARATOR . $file)) {\n\t if(is_dir($dirname . DIRECTORY_SEPARATOR . $file)) {\n\t $dirname_stack[] = $dirname . DIRECTORY_SEPARATOR . $file;\n\t }\n\t $size += filesize($dirname . DIRECTORY_SEPARATOR . $file);\n\t }\n\t }\n\t closedir($handle);\n\t} while(count($dirname_stack) > 0);\n\n\treturn $size;\n\n}",
"function directory_num_files($dir, $subdirs = false, $recurse = false, $count=0)\n{\n\tif (is_dir($dir))\n\t{\n\t\tif($handle = opendir($dir))\n\t\t{\n\t\t\twhile (($file = readdir($handle)) !== false)\n\t\t\t{\n\t\t\t\tif ($file == '.' || $file == '..')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse if (is_dir($dir.\"/\".$file))\n\t\t\t\t{\n\t\t\t\t\tif ($subdirs)\n\t\t\t\t\t{\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\t\telse if ($recurse)\n\t\t\t\t\t{\n\t\t\t\t\t\t$count = directory_num_files($dir.\"/\".$file, $subdirs, $recurse, $count);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (!$subdirs)\n\t\t\t\t{\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclosedir($handle);\n\t\t}\n\t}\n\n\treturn $count;\n}",
"function sed_diskcache_calc($dir, $do_subdirs = true)\n{\n\t$cnt = $sz = 0;\n\n\t$glob = glob(\"$dir/*\");\n\tif (is_array($glob))\n\t{\n\t\tforeach ($glob as $f)\n\t\t{\n\t\t\tif (is_file($f))\n\t\t\t{\n\t\t\t\t$cnt++;\n\t\t\t\t$sz += @filesize($f);\n\t\t\t}\n\t\t\telseif (is_dir($f) && $do_subdirs)\n\t\t\t{\n\t\t\t\t$a = sed_diskcache_calc($f);\n\t\t\t\t$cnt += $a[0]/*files*/ + 1/*directory*/;\n\t\t\t\t$sz += $a[1];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn array($cnt, $sz);\n}",
"function cot_diskcache_calc($dir, $do_subdirs = true)\n{\n\t$cnt = $sz = 0;\n\n\t$glob = glob(\"$dir/*\");\n\tif (is_array($glob))\n\t{\n\t\tforeach ($glob as $f)\n\t\t{\n\t\t\tif (is_file($f))\n\t\t\t{\n\t\t\t\t$cnt++;\n\t\t\t\t$sz += @filesize($f);\n\t\t\t}\n\t\t\telseif (is_dir($f) && $do_subdirs)\n\t\t\t{\n\t\t\t\t$a = cot_diskcache_calc($f);\n\t\t\t\t$cnt += $a[0]/*files*/ + 1/*directory*/;\n\t\t\t\t$sz += $a[1];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn array($cnt, $sz);\n}",
"function folder_info_size($path, $recursive=TRUE) \n{ \n\t$result = 0; \n\tif (is_dir($path) || is_readable($path)) \n\t{\n\t\t$dir = opendir($path); \n\t\twhile($file = readdir($dir))\n\t\t{\n\t\t\tif ($file != \".\" && $file != \"..\") \n\t\t\t{\n\t\t\t\tif (@is_dir(\"$path$file/\")) \n\t\t\t\t{\n\t\t\t\t\t$result += $recursive?folder_info_size(\"$path$file/\"):0; \n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$result += filesize(\"$path$file\"); \n\t\t\t\t} \n\t\t\t}\n\t\t} \n\t\t\n\t\tclosedir($dir);\n\t\treturn $result;\n\t} \n}",
"public function calculateDirectorySize(){\n\n $file_size = 0;\n $path = public_path('assets/eduplaycloud/upload/exercisesset/user-'.Auth::user()->id);\n foreach( File::allFiles($path) as $file)\n {\n $file_size += $file->getSize();\n }\n \n return number_format($file_size / 1000000,2);\n }",
"public function get_filedir_size() {\n global $CFG;\n if (empty($CFG->pathtodu)) {\n return 0;\n }\n $output = $this->exec_command(\"{$CFG->pathtodu} -sk \" . escapeshellarg($this->filedir) . ' | cut -f1');\n // Convert kilobytes to bytes.\n return $output * 1000;\n }",
"private function getDirItemsCount($directory)\n { \n if (substr($directory, -1) != DS) {\n $directory = $directory . DS; \n }\n\n $filecount = 0;\n $itemcount = 0;\n $files = glob($directory . \"*.*\");\n if ($files){\n $filecount = count($files);\n }\n $items = glob($directory . \"*\");\n if ($items){\n $itemcount = count($items);\n }\n return array($filecount, $itemcount);\n }",
"private function directorySize($path) {\n\t\t$files = $this->client->renterFiles();\n\t\t$sz = 0;\n\t\tforeach($files as $file) {\n\t\t\tif (strpos($file->siapath, $path) !== false) {\n\t\t\t\t$sz += $file->filesize;\n\t\t\t}\n\t\t}\n\t\treturn $sz;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get notifications by project_key and eventid. | public function getNotifications($project_key, $event_id)
{
$en = EventNotifications::where([ 'project_key' => $project_key, 'event_id' => $event_id ])->first();
if (!$en)
{
$en = EventNotifications::where([ 'project_key' => '$_sys_$', 'event_id' => $event_id ])->first();
}
return $en && isset($en->notifications) ? $en->notifications : [];
} | [
"public function getAllUserNotificationFromProjectId($project_id) {\n $data = Yii::app()->db->createCommand()->from('user_notification')->rightJoin('user', 'user_notification_user_id = user_id')\n ->where('user_notification_project_id=:project_id', array(':project_id' => $project_id))->queryAll();\n return $data;\n }",
"function get_notification($n_id)\n {\n \n return $this->db->get_where('Notification',array('n_id'=>$n_id))->row_array();\n }",
"function getNotification($id);",
"function get_notification($id_notification)\n {\n return $this->db->get_where('notifications',array('id_notification'=>$id_notification))->row_array();\n }",
"public function get_notification($id = NULL)\n {\n// $sql = \"SELECT user.id as userid,user.*, notifications . * \"\n// .\" FROM notifications \"\n// .\"JOIN user ON notifications.object_id = user.id\"\n// .\" WHERE (notifications.subject_id = \".$id.\") AND (notifications.status = 0)\";\n\tif(!is_null($id) && $id > 0 )\n\t{\n\t $sql = \"SELECT user.id AS userid, user. * , notifications. * FROM notifications \"\n .\"JOIN user ON notifications.object_id = user.id \"\n .\" WHERE (notifications.subject_id = \".$id.\") ORDER BY notifications.created_on DESC LIMIT 0 , 5\";\n\t return $this->db->query($sql)->result_array();\n\t}\n\t\n \n }",
"private static function get_notification( $form, $notification_id ) {\n\t\tforeach ( $form['notifications'] as $id => $notification ) {\n\t\t\tif ( $id == $notification_id ) {\n\t\t\t\treturn $notification;\n\t\t\t}\n\t\t}\n\n\t\treturn array();\n\t}",
"function getNotificationsByGroup($params) {\n $path_chunks = array('users', $params['id'], 'notifications', '@by-group', $params['groupId']);\n $query_params = array();\n if (array_key_exists('limit', $params)) $query_params['max-results'] = $params['limit'];\n if (array_key_exists('offset', $params)) $query_params['start-index'] = $params['offset'] + 1;\n return $this->typepad->get($path_chunks, $query_params, 'List<Event>');\n }",
"public function getById($id)\n {\n return $this->notification->find($id);\n }",
"static function get_jira_tickets_for_event($event_id, $conn = null) {\n $conn = $conn ?: Persistence::get_database_object();\n $columns = array('id', 'ticket');\n $table = 'jira';\n $where = array(\n 'postmortem_id' => $event_id,\n 'deleted' => 0,\n );\n if (is_null($conn)) {\n return array(\"status\" => self::ERROR,\n \"error\" => \"Couldn't get connection object.\",\n \"values\" => array());\n }\n return Persistence::get_array($columns, $where, $table, $conn);\n }",
"private static function get_form_notifications( $form_id = null ) {\n\n\t\tglobal $wpdb;\n\n\t\t// Create the return array.\n\t\t$notifications = array();\n\n\t\t// If no form ID is provided, return.\n\t\tif ( rgblank( $form_id ) ) {\n\t\t\treturn $notifications;\n\t\t}\n\n\t\t// Get needed table names.\n\t\t$meta_table = self::$objects_meta_table;\n\t\t$relationships_table = self::$relationships_table;\n\n\t\t// Get notification IDs.\n\t\t$notification_ids = $wpdb->get_col( $wpdb->prepare( \"SELECT child_id FROM {$wpdb->prefix}{$relationships_table} WHERE `parent_id` = '%d' AND `child_type` = '%s' AND `parent_type` = '%s';\", $form_id, 'notification', 'form' ) );\n\n\t\t// Get notifications.\n\t\tforeach ( $notification_ids as $notification_id ) {\n\n\t\t\t$notification = array();\n\n\t\t\t// Get notification meta.\n\t\t\t$notification_meta = $wpdb->get_results( $wpdb->prepare( \"SELECT meta_key, meta_value FROM {$wpdb->prefix}{$meta_table} WHERE `object_id` = '%d';\", $notification_id ) );\n\n\t\t\t// Prepare notification meta.\n\t\t\tforeach ( $notification_meta as $meta ) {\n\t\t\t\t$notification[ $meta->meta_key ] = $meta->meta_value;\n\t\t\t}\n\n\t\t\t// Push to notifications array.\n\t\t\t$notifications[] = $notification;\n\n\t\t}\n\n\t\t// Return notifications.\n\t\treturn $notifications;\n\n\t}",
"public function get($id)\n {\n return Notifications::find($id);\n }",
"function GetMyProjectEvents()\n\t{\n\t\t$result = $this->sendRequest(\"GetMyProjectEvents\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function getNotification();",
"function hypeapps_get_notification_by_id($id) {\n\t$svc = elgg()->{'notifications.site'};\n\n\t/* @var $svc SiteNotificationsService */\n\n\treturn $svc->getTable()->get($id) ? : false;\n}",
"function get_mail_events($event, $object)\n {\n $query = \"select `email` from `\".BIT_DB_PREFIX.\"mail_notifications` where `event`=? and (`object`=? or `object`='*')\";\n $result = $this->mDb->query($query, array($event,$object) );\n $ret = array();\n while ($res = $result->fetchRow())\n {\n $ret[] = $res[\"email\"];\n }\n return $ret;\n }",
"public function getTaskNotifications($userId){\n\n $taskRequestId = getRequestTypeId('Task');\n return $this->model->where('user_id','=',$userId)->where('is_read','=',false)->where('request_type_id','=',$taskRequestId);\n }",
"private function _fetchNotification($id, $w=false)\n {\n return $this->fetchObj($this->_getMapper(), $id, $w);\n }",
"static function getNotificationMail($key){\n return self::getPathfinderData('notification' . ($key ? '.' . $key : ''));\n }",
"public function readNotifications();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get customer login url | public function getCustomerLoginUrl()
{
return $this->customerUrl->getLoginUrl();
} | [
"public function getLoginAsCustomerUrl()\n {\n return $this->getUrl('dr_loginascustomer/index/login', ['id' => $this->getCustomerId()]);\n }",
"public function get_login_url() { }",
"function loginUrl() {\n return Mage::getUrl ( 'customer/account/login/' );\n }",
"public function getLoginUrl();",
"protected function getUrlLogin() {\r\n return $_SERVER['SCRIPT_NAME'] . '/login';\r\n }",
"protected function getLoginUrl()\n {\n }",
"protected function getLoginUrl()\n {\n return $this->router->generate($this->cas->getRouteLogin());\n }",
"public function getCustomerBeforeAuthUrl()\n {\n return $this->_objectManager->create(\n \\Magento\\Framework\\UrlInterface::class\n )->getUrl('*/*', ['_secure' => true]);\n }",
"protected function getLoginUrl()\n {\n return $this->urlGenerator->generate('login');\n }",
"protected function getLoginUrl()\n {\n return $this->router->generate('user_login');\n }",
"private function getLoginUrl(int $customerId): string\n {\n return $this->urlBuilder->getUrl('loginascustomer/login/login', ['customer_id' => $customerId]);\n }",
"public function login_url()\n {\n return $this->login_url;\n }",
"protected function getLoginUrl()\n {\n return $this->router->generate('security_login');\n }",
"protected function getLoginUrl()\n {\n return $this->router->generate('login');\n }",
"public function getCustomerRedirectURL() {\n return $this->url . str_replace(\":customerToken\", $this->customerToken, Connect2PayClient::$API_ROUTES['TRANS_DOPAY']);\n }",
"public function getLoginURL() {\n\t\treturn $this->loginURL;\n\t}",
"public function getLoginUrl()\n {\n return $this->getApiUrl().'/login';\n }",
"public function get_endpoint_login_url() {\n\t\treturn $this->endpoint_login;\n\t}",
"public function getLoginURL()\t{\n\t\t$isso_client = new ISSOClient();\n\t\treturn $isso_client -> getUrlLoginForm();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make the current field a static value so that it can not be viewed or changed by the user. | public function makeStatic(string $field_name): self
{
if (!$this->exists($field_name)) {
return $this;
}
$old = $this->members[$field_name];
$new = new StaticValue($field_name);
$new->setUserValue($old->userValue);
$this->members[$field_name] = $new;
return $this;
} | [
"public function fieldConstant();",
"public function getStaticValue()\n {\n return $this->staticValue;\n }",
"public function _field() {\n }",
"public function FrontEndMakeReadOnlyFields();",
"abstract protected function field_default();",
"function generate_read_only() {\n\t\tif ($this->value) {\n\t\t\treturn $this->value;\n\t\t} else {\n\t\t\treturn $this->empty_value;\n\t\t}\n\t}",
"public function markStatic () : void {\n\t\t$this->static = true;\n\t}",
"protected function _prepareStaticFields()\n {\n if ($this->isEnabledFlat()) {\n return $this;\n }\n return parent::_prepareStaticFields();\n }",
"protected function checkState()\n {\n if ( $this->isCanBeStatic() ){\n if ( $this->isReadonly() ){\n if ( $this->isHiddenWhenEmpty() && $this->isEmpty() ){\n $this->hidden = true;\n }\n else {\n $this->static = true;\n }\n }\n }\n }",
"abstract protected function getInitialValueField();",
"function staticTest() {\n static $my_car = \"Range Rover\";\n echo $my_car;\n}",
"static function getInstanceClassNameFromField() {\n return '';\n }",
"function setStatic() {\n\t\t$this->keywords['static'] = true;\n\t}",
"public function fieldToString()\n\t{\n\t\t$value = $this->owner->{$this->attribute};\n\t\t$this->_beforeSaveValue = $value;\n\t\t$this->owner->{$this->attribute} = $this->valueToString($value);\n\t}",
"function performReadonlyTransformation() {\n\t\t$stars = '*****';\n\n\t\t$field = new ReadonlyField($this->name, $this->title ? $this->title : '', $stars);\n\t\t$field->setForm($this->form);\n\t\t$field->setReadonly(true);\n\t\treturn $field;\n\t}",
"static function getInstanceClassNameFromField()\n {\n return '';\n }",
"function &_createStaticField($fieldName, $text = null)\n {\n $element = HTML_QuickForm::createElement('static',\n $this->_fb->getFieldName($fieldName),\n $this->_fb->getFieldLabel($fieldName),\n $text);\n $attr = $this->_getAttributes('static', $fieldName);\n $element->updateAttributes($attr);\n return $element;\n }",
"public static function getStatic()\n {\n return self::$static;\n }",
"public function performReadonlyTransformation()\n {\n $field = new ReadonlyField($this->name, $this->title, $this->value);\n $field->addExtraClass($this->extraClass());\n $field->setForm($this->form);\n return $field;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populates the result array with participants from my FB friends registered with weego | function populateResultWithFacebookParticipants($me)
{
$access_token = $me->facebookToken;
$facebook = new Facebook(array(
'appId' => '221300981231092',
'secret' => '9670bee46bf64a4e52a86716df51a8dc',
));
$facebook->setAccessToken($access_token);
$user = $facebook->getUser();
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_friends = $facebook->api('/me/friends');
$friendsArray = $user_friends['data'];
$xmlUtil = new XMLUtil();
for ($i=0; $i<count($friendsArray); $i++)
{
$fbId = $friendsArray[$i]['id'];
$c_participant = $this->getParticipantForFacebookId($fbId);
if(!$c_participant) continue;
$alreadyAdded = key_exists($c_participant->email, $this->foundParticipantDict);
if (!$alreadyAdded)
{
$this->foundParticipantDict[$c_participant->email] = '';
array_push($this->xmResultArray, $xmlUtil->GetParticipantXML($c_participant, null, 'facebook'));
}
}
} catch (FacebookApiException $e) {
$e = new ErrorResponse();
echo $e->genError(ErrorResponse::InvalidCredentialsError, 'Facebook connect failed, please try again.');
die();
}
}
else
{
$e = new ErrorResponse();
echo $e->genError(ErrorResponse::InvalidCredentialsError, 'Facebook connect failed, please try again.');
die();
}
} | [
"function getFriends(){\n\t\t\n\t\t// MOVE THIS TO A MODEL (all Fb calls, api and stuff should be in there, easier to access from anywhere)\n\t\t\n\t\tif(!$this->li){\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t//Cache::set(array('duration' => '1 hour'));\n\t\t//$results = Cache::read('fb_friends_'.GLOBAL_CACHE.FRIENDS_CACHE.'_'.$this->uid);\n\t\t$results = false;\n\t\tif($results === false || !is_array($results)){\n\t\t\t\n\t\t\t\t$data = $this->api('/me/friends');\n\t\t\t\t\n\t\t\t\tif($data !== false){\n\t\t\t\t\t$ids = Set::extract($data['data'],'{n}.id');\n\t\t\t\t\n\t\t\t\t\t//Cache::set(array('duration' => '1 hour'));\n\t\t\t\t\t//Cache::write('fb_friends_'.GLOBAL_CACHE.FRIENDS_CACHE.'_'.$this->uid, $ids);\n\t\t\t\t\n\t\t\t\t\treturn $ids;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t\t\n\t}",
"public function getFriends();",
"private function GetFriends(){\n\n if($this->get_request_method() != \"POST\"){\n $this->response('',406);\n }\n $r = json_decode(file_get_contents(\"php://input\"),true);\n //$r = $r['name'];\n $response = array();\n $db = new DbHandler();\n $session = $db->getSession();\n\n if(isset($r['uid']) && $r['uid']=='session_id'){\n $uid = $session['uid'];\n }else{\n $uid = $r['uid'];\n }\n\n $sql = \"SELECT u.uid,u.name,u.email,u.phone,u.password,u.username,u.gender,u.dobDate,u.dobMonth,u.dobYear,u.zipcode,u.city,f.fri_id,f.friend_one,f.friend_two,f.accept as accept,\n if(f.friend_one = $uid,1,0) as you,\nCASE\n \tWHEN accept IS NULL THEN 'Add as Friend'\n\tWHEN accept = 0 THEN if(f.friend_two = $uid,'Friend Request Came','Friend Request Sent')\n \tWHEN accept = 1 THEN 'Friends'\n \tWHEN accept = 2 THEN 'Friend Request Declined'\nEND as friend_accept,\nif(u.profilePic='',if(u.gender=1,'male.png','female.png'),u.profilePic) as profilePic,\n(SELECT 1 FROM user_intrests WHERE uid = $uid and intrest_uid = u.uid and type = 1) as loved\nFROM\nusers u, friends f\nWHERE u.uid = f.friend_two AND f.friend_one = $uid OR u.uid = f.friend_one AND f.friend_two = $uid\"; // WHERE username LIKE '%\".$r.\"%'\n $response = $db->getRecords($sql);\n\n if ($response != NULL) {\n $this->response($this->json($response), 200); // send user details\n }\n\n }",
"public function fbSearchUser($jsonRequest) {\r\n\r\n\tif (DEBUG)\r\n\t writelog(\"facebook_register.class.php :: fbSearchUsers() :: \", \"Starts Here \", false);\r\n\r\n\t$userId = mysql_real_escape_string(trim($jsonRequest['fbSearchUsers']['userId']));\r\n\t$fbName = mysql_real_escape_string(trim($jsonRequest['fbSearchUsers']['fbName']));\r\n\r\n\t/* query for searching users */\r\n\t$searchFacebookUser = \"SELECT * FROM facebook_friends WHERE fb_user_name LIKE '%$fbName%' AND mem_id='$userId' ORDER BY fb_user_name ASC\";\r\n\t$searchFacebookUserResult = execute_query($searchFacebookUser, true, \"select\");\r\n\r\n\t/* STARTED BY SATENDER */\r\n\t$result = array();\r\n\t$kk = 0;\r\n\tif (!empty($searchFacebookUserResult)) {\r\n\t foreach ($searchFacebookUserResult as $users) {\r\n\t\tif (!empty($users) && is_array($users)) {\r\n\t\t $getAllusers = \"select mem_id,fb_id as facebook_id, 'invite' as type,invitation_date from contact_list where mem_id='\" . $userId . \"' and status=0 and fb_id='\" . $users[\"fb_id\"] . \"' \";\r\n\t\t //$getAllusers = \"select mem_id,facebook_id from members where facebook_id='{$users['fb_id']}' AND mem_id !='$userId'\";\r\n\t\t $getAllusers .=\" UNION ALL select mem_id,facebook_id, 'member' as type,'' as invitation_date from members where is_facebook_user='y' and facebook_id not in(0,'') and facebook_id='\" . $users[\"fb_id\"] . \"'\";\r\n\t\t $getAllusersList1 = execute_query($getAllusers, true, \"select\");\r\n\r\n\t\t if (!empty($getAllusersList1)) {\r\n\t\t\tforeach ($getAllusersList1 as $getAllusersList) {\r\n\t\t\t if (!empty($getAllusersList) && is_array($getAllusersList)) {\r\n\t\t\t\tif ($getAllusersList['type'] == 'invite') {\r\n\r\n// For Facebook friend request already sent or not START \r\n\t\t\t\t $chkFBInvitation = \"select COUNT(*) as cnt from contact_list where mem_id='$userId' and status=0 and fb_id='{$users['fb_id']}' \";\r\n\t\t\t\t $chkFBInvitationResult = execute_query($chkFBInvitation, false, \"select\");\r\n// For Facebook friend request already sent or not END \r\n\t\t\t\t //$result[$kk]['mem_id'] = $getAllusersList['mem_id'];\r\n\t\t\t\t $result[$kk]['fb_id'] = mysql_real_escape_string($users['fb_id']);\r\n\t\t\t\t $result[$kk]['fb_user_name'] = mysql_real_escape_string($users['fb_user_name']);\r\n\t\t\t\t $result[$kk]['fb_img_url'] = $users['fb_img_url'];\r\n\t\t\t\t //$result[$kk]['fb_frnd_request_sent'] = 'Y';\r\n\t\t\t\t $result[$kk]['already_friend'] = 'N';\r\n\t\t\t\t $result[$kk]['fb_invitation_sent'] = 'Y';\r\n\t\t\t\t /* For Facebook friend request already sent or not START */\r\n\t\t\t\t $chkFBInvitationDate = \"select invitation_date from contact_list where mem_id='$userId' and status=0 and fb_id='{$users['fb_id']}' \";\r\n\t\t\t\t $chkFBInvitationDateResult = execute_query($chkFBInvitationDate, false, \"select\");\r\n\t\t\t\t if (!empty($chkFBInvitationDateResult) && dateDiff($chkFBInvitationDateResult['invitation_date']) < 7) {\r\n\t\t\t\t\t$result[$kk]['fb_frnd_request_sent'] = 'Y';\r\n\t\t\t\t } else {\r\n\t\t\t\t\t$result[$kk]['fb_frnd_request_sent'] = 'N';\r\n\t\t\t\t }\r\n\t\t\t\t} else {\r\n\t\t\t\t $result[$kk]['fb_id'] = mysql_real_escape_string($users['fb_id']);\r\n\t\t\t\t $result[$kk]['fb_user_name'] = mysql_real_escape_string($users['fb_user_name']);\r\n\t\t\t\t $result[$kk]['fb_img_url'] = $users['fb_img_url'];\r\n\t\t\t\t $chkInvitation = \"SELECT COUNT(*) as cnt FROM messages_system WHERE mem_id = '{$getAllusersList['mem_id']}' AND frm_id='$userId' AND messages_system.type='friend'\";\r\n\t\t\t\t $chkInvitationResult = execute_query($chkInvitation, false, \"select\");\r\n//For friend request already sent or not END \r\n\t\t\t\t $result[$kk]['mem_id'] = $getAllusersList['mem_id'];\r\n\t\t\t\t $result[$kk]['user_exists'] = 'Y';\r\n\t\t\t\t $result[$kk]['frnd_request_sent'] = $chkInvitationResult['cnt'] > 0 ? 'Y' : 'N';\r\n// For user is friend or not START \r\n\t\t\t\t $chkAlreadyFriend = \"SELECT COUNT(*) FROM network n1,network n2 WHERE n1.mem_id='{$getAllusersList['mem_id']}' AND n1.frd_id='$userId' AND n2.mem_id='$userId' AND n2.frd_id='{$getAllusersList['mem_id']}'\";\r\n\t\t\t\t $chkAlreadyFriendResult = execute_query($chkAlreadyFriend, false, \"select\");\r\n// For user is friend or not END \t\r\n\t\t\t\t $result[$kk]['already_friend'] = isset($chkAlreadyFriendResult['COUNT(*)']) && $chkAlreadyFriendResult['COUNT(*)'] > 0 ? 'Y' : 'N';\r\n// For Facebook friend request already sent or not START \r\n\t\t\t\t $chkFBInvitation = \"select COUNT(*) from contact_list where mem_id='$userId' and status=0 and fb_id='{$users['fb_id']}' \";\r\n\t\t\t\t $chkFBInvitationResult = execute_query($chkFBInvitation, false, \"select\");\r\n// For Facebook friend request already sent or not END \t\t\r\n\t\t\t\t $result[$kk]['fb_invitation_sent'] = isset($chkFBInvitationResult['COUNT(*)']) && $chkFBInvitationResult['COUNT(*)'] > 0 ? 'Y' : 'N';\r\n// For Facebook friend request already sent or not START \r\n\t\t\t\t $chkFBInvitationDate = \"select invitation_date from contact_list where mem_id='$userId' and status=0 and fb_id='{$users['fb_id']}' \";\r\n\t\t\t\t $chkFBInvitationDateResult = execute_query($chkFBInvitationDate, false, \"select\");\r\n\t\t\t\t if (!empty($chkFBInvitationDateResult) && dateDiff($chkFBInvitationDateResult['invitation_date']) < 7) {\r\n\t\t\t\t\t$result[$kk]['fb_frnd_request_sent'] = 'Y';\r\n\t\t\t\t } else {\r\n\t\t\t\t\t$result[$kk]['fb_frnd_request_sent'] = 'N';\r\n\t\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t } else {\r\n\t\t\tif (isset($users['mem_id']) && $users['mem_id'] != '') {\r\n\t\t\t $result[$kk]['mem_id'] = $users['mem_id'];\r\n\t\t\t $result[$kk]['fb_id'] = mysql_real_escape_string($users['fb_id']);\r\n\t\t\t $result[$kk]['fb_user_name'] = mysql_real_escape_string($users['fb_user_name']);\r\n\t\t\t $result[$kk]['fb_img_url'] = $users['fb_img_url'];\r\n\t\t\t $result[$kk]['fb_invitation_sent'] = 'N';\r\n\t\t\t $result[$kk]['frnd_request_sent'] = 'N';\r\n\t\t\t $result[$kk]['already_friend'] = 'N';\r\n\t\t\t $result[$kk]['fb_frnd_request_sent'] = 'N';\r\n\t\t\t}\r\n\t\t }\r\n\t\t $kk++;\r\n\t\t}\r\n\t }\r\n\t $result['count'] = $kk;\r\n\r\n\t if (DEBUG)\r\n\t\twritelog(\"FacebookConnect:facebook_registration:\", $searchFacebookUserResult, true);\r\n\r\n\t //if(!empty($searchFacebookUserResult) && is_array($searchFacebookUserResult)){\r\n\t if (!empty($result) && is_array($result)) {\r\n\r\n\t\treturn $result;\r\n\t } else {\r\n\t\treturn false;\r\n\t }\r\n\t} else {\r\n\t return false;\r\n\t}\r\n }",
"public static function get_list_of_friends();",
"public function getfriendsInformation() {\r\n $req = \"select f.id_user_f as publictoken, u.pseudo , u.firstname as firstName, u.lastname as lastName, u.age, u.city, u.imagelink, u.number, g.log as lon, g.lat,g.time\r\n from friends f, user u, usergeo g \r\n where f.id_user='$this->token' \r\n and f.id_user_f=u.publictoken \r\n and g.token_user = (select u1.token from user u1 where publictoken = f.id_user_f)\r\n and g.visible = '1'\";\r\n\r\n $res = Connection::getDbMapper()->execStatement($req);\r\n $ret = array();\r\n while (($row = mysqli_fetch_array($res, MYSQLI_ASSOC)) != NULL) {\r\n $ret[] = $row;\r\n }\r\n mysqli_free_result($res);\r\n return $ret;\r\n }",
"function gigya_get_friends($account) {\n $title = isset($account->title) ? $account->title : $account->name;\n drupal_set_title(check_plain($title));\n\n module_load_include('inc', 'gigya');\n $site_friends = array();\n $this_gigya_user = new GigyaUser($account->uid);\n if ($friends = $this_gigya_user->getFriends(array('siteUsersOnly' => TRUE))) {\n if (!empty($friends['friends'])) {\n foreach ($friends['friends'] as $friend) {\n if ($friend['isSiteUser']) {\n $site_friends[] = $friend;\n }\n }\n }\n }\n return theme('gigya_friends', array('friends' => $site_friends));\n}",
"function vikinger_get_friend_requests_sent($member_id) {\r\n global $wpdb;\r\n\r\n $prefix = $wpdb->base_prefix;\r\n $table_name = \"bp_friends\";\r\n $table = $prefix . $table_name;\r\n\r\n $sql = \"SELECT id, friend_user_id FROM $table\r\n WHERE initiator_user_id=%d AND is_confirmed=0\";\r\n\r\n $results = $wpdb->get_results($wpdb->prepare($sql, [$member_id]));\r\n\r\n $friend_requests_sent = [];\r\n\r\n if (!is_null($results)) {\r\n foreach ($results as $result) {\r\n $friend_requests_sent[] = [\r\n 'id' => absint($result->id),\r\n 'user' => vikinger_members_get(['include' => [absint($result->friend_user_id)]])[0]\r\n ];\r\n }\r\n }\r\n\r\n return $friend_requests_sent;\r\n }",
"public function fetchfriendlist($accessToken, $loggedInUserData)\n {\n //$accessToken = 'CAAFmZBOidnYkBAGDbEQEC0ZC8zV4t2kv4b2Iyb0g5HVqnEEupv8pBSb9hIiVMIYuHdwnwvvAfZBM8HNZAw62AIDM6j7dsmK04fD7iUHE8TL1hpqO2XZCGFFh9ckfzIeQryB8jHBNWSWtpOBvx4ZAndMZBGoufZAeQDA7sq00b5spaS8ZAV2iugxoXiC0bhxt9ZCCvvoasAGKzwxgZDZD';\n //$fbId = '100001119103030';\n $dataArray = array();\n if($accessToken != '') {\n $friends = $this->Facebook->getfriends($accessToken);\n \n if(count($friends)>0)\n {\n foreach ($friends[\"data\"] as $value) {\n if(isset($value[\"installed\"]) && $value[\"installed\"] == TRUE) {\n \n // get user phone detail by using fb id..\n $params = array(\n 'fields' => array('_id', 'phone_no', 'name','user_token', 'device_token', 'device_type'),\n 'conditions' => array('fb_id' => $value[\"id\"]),\n 'order' => array('name' => 1)\n );\n // Find records matching phone no.\n $results = $this->User->find('first', $params);\n \n if(count($results)>0) {\n \n // checking that starred user is following to current user or not..\n $follow_status = 'notrequested';\n \n if(count($loggedInUserData[0]['User']['following'])>0)\n {\n foreach($loggedInUserData[0]['User']['following'] as $urKey => $urVal)\n {\n if((string) $results[\"User\"]['_id'] == (string) $loggedInUserData[0]['User']['following'][$urKey]['followee_id'])\n {\n if($loggedInUserData[0]['User']['following'][$urKey]['accepted'] === true) {\n $follow_status = 'accepted';\n }\n else if($loggedInUserData[0]['User']['following'][$urKey]['accepted'] === false) {\n $follow_status = 'rejected';\n }\n else if($loggedInUserData[0]['User']['following'][$urKey]['accepted'] === null) { \n $follow_status = 'pending';\n }\n break;\n }\n }\n }\n \n $dataArray[] = array(\n 'fb_id' => $value[\"id\"],\n 'fb_name' => $value[\"name\"],\n 'fb_user_pic_url' => 'http://graph.facebook.com/'.$value[\"id\"].'/picture?type=normal',\n 'id' => (string) $results[\"User\"]['_id'],\n 'phone_no' => $results[\"User\"]['phone_no'],\n 'follow_status' => $follow_status\n );\n }\n }\n } \n }\n } \n return $dataArray;\n }",
"public function testItReturnsUserFriendsPerPage(): void\n {\n $sender = createUser();\n $recipients = createUser([], 6);\n\n foreach ($recipients as $recipient) {\n $sender->befriend($recipient);\n }\n\n $recipients[0]->acceptFriendRequest($sender);\n $recipients[1]->acceptFriendRequest($sender);\n $recipients[2]->denyFriendRequest($sender);\n $recipients[3]->acceptFriendRequest($sender);\n $recipients[4]->acceptFriendRequest($sender);\n\n\n $this->assertCount(2, $sender->getFriends(2));\n $this->assertCount(4, $sender->getFriends(0));\n $this->assertCount(4, $sender->getFriends(10));\n $this->assertCount(1, $recipients[1]->getFriends());\n $this->assertCount(0, $recipients[2]->getFriends());\n $this->assertCount(0, $recipients[5]->getFriends(2));\n\n $this->containsOnlyInstancesOf(\\App\\User::class, $sender->getFriends());\n }",
"public function friends()\n\t{\n\t\t$data = array(\n\t\t\tarray(\n\t\t\t\t'id' => 1,\n\t\t\t\t'name' => \"Charles Johnson\",\n\t\t\t\t'profile_pic' => './content/profile/chaz.jpg',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'a',\n\t\t\t\t\t\t'type' => 'phone number',\n\t\t\t\t\t\t'value' => '555-1234-1234',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'b',\n\t\t\t\t\t\t'type' =>'email',\n\t\t\t\t\t\t'value' => 'me@charlesjohnson.org',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 2,\n\t\t\t\t'name' => \"Seal Goldman\",\n\t\t\t\t'profile_pic' => './content/profile/sefi.jpg',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'a',\n\t\t\t\t\t\t'type' => 'blog',\n\t\t\t\t\t\t'value' => 'http://seal.blogger.com',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'b',\n\t\t\t\t\t\t'type' =>'fax',\n\t\t\t\t\t\t'value' => '555-999-9999',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 3,\n\t\t\t\t'name' => \"Aaron Smith\",\n\t\t\t\t'profile_pic' => './content/profile/aaron.jpg',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'a',\n\t\t\t\t\t\t'type' => 'phone number',\n\t\t\t\t\t\t'value' => '586-222-1234',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'b',\n\t\t\t\t\t\t'type' =>'email',\n\t\t\t\t\t\t'value' => 'aaront@gmail.com',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 4,\n\t\t\t\t'name' => \"James Jackson\",\n\t\t\t\t'profile_pic' => './assets/img/default.jpg',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'a',\n\t\t\t\t\t\t'type' => 'phone number',\n\t\t\t\t\t\t'value' => '313-333-1234',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'b',\n\t\t\t\t\t\t'type' =>'email',\n\t\t\t\t\t\t'value' => 'jj@gmail.com',\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\n\t\t$this->output->set_output( json_encode( array( 'response' => TRUE, 'success' => TRUE, 'data' => $data ) ) );\n\t}",
"public function actionPopulate(){\n\t\t$response = \"\";\n\t\tYii::app()->facebook->setAccessToken(Yii::app()->session[\"access_token\"]);\n\t\t$this->access_token = Yii::app()->session[\"access_token\"];\n\t\tif(!isset($_GET['uid'])){\n\t\t\t$response = '<script type=\"text/javascript\">';\n\t\t\t$response = $response.'$(document).ready(function($) {';\n\t\t\t$user_id = Yii::app()->facebook->getUser();\n\t\t\t$friends_ = Yii::app()->facebook->api('/'.$user_id.'/friends?access_token='.$this->access_token);\n\t\t\t$friends = $friends_[\"data\"];\n\t\t\tfor ($i=0;$i<count($friends);$i++){\n\t\t\t\t$user = User::model()->findByPk($friends[$i][\"id\"]);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\t$response = $response.\" $.ajax({ url:'\".Yii::app()->homeUrl.\"site/populate?uid=\".$friends[$i]['id'].\"', type: 'post'});\";\n\t\t\t\t\t$response = $response.\" $.ajax({ url:'\".Yii::app()->homeUrl.\"site/markers?uid=\".$user_id.\"&fid=\".$friends[$i]['id'].\"', type: 'post', success: function (response) { $(\\\"#friends_markers\\\").html(response); }});\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$response = $response.'});</script>';\n\t\t}else{\n\t\t\t$fb_user = Yii::app()->facebook->getInfoById($_GET['uid']);\n\t\t\t$user = User::model()->findByPk($_GET['uid']);\n\n\t\t\tif(is_null($user)){\n\t\t\t $user = new User();\n\t\t\t $user->id = $fb_user[\"id\"];\n\t\t\t $user->first_name = $fb_user[\"first_name\"];\n\t\t\t $user->last_name = $fb_user[\"last_name\"];\n\n\t\t\t $user->suggested_by = Yii::app()->session[\"jump_user_id\"];\n\t\t\t\t \n\t\t\t $external_site = ExternalSite::model()->find('url=:url', array(':url'=>$fb_user[\"link\"]));\n\t\t\t if(is_null($external_site)){\n\t\t\t\t\t$external_site = new ExternalSite();\n\t\t\t\t\t$external_site->name = $fb_user[\"name\"].\" site on Facebook\";\n\t\t\t\t\t$external_site->url = $fb_user[\"link\"];\n\t\t\t\t\t$source = SourceType::model()->find('name=:name', array(':name'=>\"Facebook\"));\n\t \t\t\t\t$external_site->source = $source->id;\n\t\t\t\t\t$external_site->save();\n\t\t\t }\n\t\t\t $user->external_site_id = $external_site->id;\n\t\t\t $user->external_site = $external_site;\n\n\t\t\t\tYii::app()->facebook->setAccessToken(Yii::app()->session[\"access_token\"]);\n\t\t\t\t$query = 'select current_location from user where uid = '.$_GET['uid'];\n $location = Yii::app()->facebook->api(array('method'=>'fql.query','query'=>$query));\n \n if(isset($location[0][\"current_location\"][\"latitude\"])){\n \t$valid_coord = false;\n \twhile($valid_coord != true){\n\t\t $user->geolocation_lat = $this->reubicateCoord($location[0][\"current_location\"][\"latitude\"]);\n\t\t\t\t\t\t$user->geolocation_long = $this->reubicateCoord($location[0][\"current_location\"][\"longitude\"]);\n\t\t\t\t\t\t$valid_coord = $this->validateCoord($user->geolocation_lat, $user->geolocation_long);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t $user->save();\n\t\t\t}\n\n\t\t\t$likes_ = Yii::app()->facebook->api('/'.$_GET['uid'].'/likes?access_token='.$this->access_token);\n\t\t $likes = $likes_[\"data\"];\n\n\t\t for ($i=0;$i<count($likes);$i++) {\n\n\t\t\t\t$category = Category::model()->find('name=:name', array(':name'=>$likes[$i][\"category\"]));\n\t\t\t\tif(!is_null($category)){\n\t\t\t\t\t$preferenceCategory = PreferencesCategories::model()->findByAttributes(array('user_id'=>$_GET['uid'],'category_id'=>$category->id));\n\t\t\t\t\tif(is_null($preferenceCategory)){\n\t\t\t\t\t\t$preferenceCategory = new PreferencesCategories();\n\t\t\t\t\t\t$preferenceCategory->user_id = $_GET['uid'];\n\t\t\t\t\t\t$preferenceCategory->user= $user;\n\t\t\t\t\t\t$preferenceCategory->category_id = $category->id;\n\t\t\t\t\t\t$preferenceCategory->category = $category;\n\t\t\t\t\t\t$preferenceCategory->count = 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$preferenceCategory->count++;\n\t\t\t\t\t}\n\t\t\t\t\t$preferenceCategory->save();\n\t\t\t\t}\n\t\t }\t\t\t\n\t\t}\n\t\techo $response;\n\t}",
"public function create_all_friends() {\n $friends = $this->getFriends();\n $results = array();\n foreach ($friends as $f) {\n $f_clusters = array();\n foreach ($f->clusters as $clus) {\n $f_clusters[] = $clus->id;\n }\n\n $f_corClusters = array();\n foreach ($f->corClusters as $corClus) {\n $f_corClusters[] = $corClus->id;\n }\n\n $results[$f->id] = array($f_clusters, $f_corClusters);\n }\n return $results;\n }",
"public function LikeFeedGetAllFriends(){\n\t\n\t\n\t$fid = isset($_POST['fid']) ? (int) $this->test_input($_POST['fid']) : 0;\n\t$myid = isset($this->USER['id']) ? (int) $this->USER['id'] : 0;\n\t$all_friends = array();\n\tif($fid && $myid){\n\t\t\n\t\t\n\t\t$res = $this->query_select(\"select `byuser` from \".tbl_feed.\" where `id`='{$fid}' limit 1\");\n\t\tforeach($res as $r):\n\t\t$r_ex = explode(',',$r['byuser']);\n\t\t\n\t\tforeach($r_ex as $uid){\n\t\t\t$friends_dt = $this->query_select(\"select u.fullname,u.id,u.profile_photo as avatar,u.gender from \".tbl_friends.\" f \n\t\t\t\t\t\t\t\t\t\t left join \".tbl_users.\" u ON u.id=f.friendid where f.friendid='{$uid}' and f.userid='{$myid}' and f.status='confirmed'\n\t\t\t\t\t\t\t\t\t\t group by u.id limit 1\");\n\t\t\t\t\t\n\t\tforeach($friends_dt as $f)\n\t\t$all_friends[] = $f;\t\n\n\t\t}\t\t\n\t\t\n\t\tendforeach;\n\t\t\n\t\t$this->template->assign(['this' => $this, 'users' => $all_friends]);\n\t\t$content = $this->template->fetch($this->theme_dir.'/profile/feed/popup/like-popup.html');\n\t\techo $content;\n\t} else echo 0;\n\t\n\t\n}",
"public function get_facebook_friends($data){\r\n\r\n if(isset($data[\"facebook_access_token\"]) && $data[\"facebook_access_token\"] != ''){\r\n $url = 'https://graph.facebook.com/me/friends?access_token='.$data[\"facebook_access_token\"];\r\n\r\n $request = Request::factory($url)\r\n ->method('GET');\r\n\r\n $response = $request->execute();\r\n\r\n $friends_json = $response->body();\r\n\r\n if(strlen($friends_json) <= 0) return false;\r\n $friends = json_decode($friends_json,true);\r\n if(isset($friends[\"error\"])){\r\n $this->_sendResponse(200, array(\"code\"=>'0','message'=>'Facebook Error: ' . $friends[\"error\"][\"message\"]));\r\n }\r\n\r\n $friend_data = $friends[\"data\"];\r\n\r\n $friend_arr = array();\r\n $my_friend = array();\r\n foreach($friend_data as $friend){\r\n $name = preg_split(\"/\\s+/\",$friend[\"name\"]);\r\n $my_friend[\"facebook_id\"] = $friend[\"id\"];\r\n $my_friend[\"first_name\"] = isset($name[0]) ? $name[0] : \"\";\r\n $my_friend[\"last_name\"] = isset($name[1]) ? $name[1] : \"\";\r\n $my_friend[\"photo\"] = \"http://graph.facebook.com/\".$friend[\"id\"].\"/picture\";\r\n $friend_arr[] = $my_friend;\r\n\r\n }\r\n return $friend_arr;\r\n }\r\n\r\n return false;\r\n\r\n }",
"public function myfriends(){\n\t\t$url = 'http://local.kizzangchef.com/api/playerinvite/myfriends/10/0';\n\t\t$token = null;\t\t\n\t\t$method = 'get';\n\t\t$api_key = $this->getKey();\n\t\t$params = array();\n\t\t$response = $this->doCurl($url, $params, $api_key, $token, $method);\n\t\tvar_dump($response);\n\t\texit;\n\t}",
"function testFriendmatching(){\n \n $params = (object) array(\n 'id' => 882,\n 'hashed_number' => '+14152549393',\n 'hashed_list' => array('hash666_7','hash9_7','+14152549391','hash665_7'),\n );\n \n $users = new BIM_App_Users();\n $friends = $users->matchFriends( $params );\n \n print_r( json_encode( $friends ) );\n}",
"protected function userFriends(){\r\n if ($this->method == 'GET'){\r\n //userID will be the first argument of the endpoint URI.\r\n $userID = $this->args[0];\r\n //userToken will be the second argument of the endpoint URI.\r\n $userToken = $this->args[1];\r\n //Create an instance of the UserToken class.\r\n $this->UserToken = new UserToken();\r\n\r\n $userIDFromJWT = $this->UserToken->verifyUserToken($userToken);\r\n\r\n $data = array(); //an array to hold the data returned to the client\r\n\r\n if($userIDFromJWT !== NULL){\r\n //the $userIDFromJWT is not null, therefore the userToken is valid.\r\n //Create an instance of the User class and get all friends data related to the userID we received as a parameter.\r\n $this->User = new User();\r\n $data['friends'] = $this->User->getUserFriends($userID);\r\n $data['responseStatus'] = \"success\"; //add the responseStatus key to the array that we send back.\r\n return $data;\r\n }else{\r\n //Log this error\r\n $this->ErrorHandler->createLogEntry(\"userFriends\", \"User Token is not valid.\");\r\n throw new Exception(\"User token is not valid.\");\r\n }\r\n }else{\r\n throw new Exception(\"Only accepts GET requests\");\r\n }\r\n }",
"protected function getFriends()\n {\n $url = $this->getBaseUrl() . '&action=2';\n $request = $this->send($url);\n \n $friends = simplexml_load_string($request->getBody());\n foreach($friends->friend as $friend)\n {\n $attributes = $friend->attributes();\n echo $attributes['name'] . \"\\n\";\n }\n $attributes = $friends->listfriend->attributes();\n echo $attributes['nb'] . ' friend(s)' . \"\\n\";\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all matching storewide emails against the provided $order and $triggers and sort by priority | protected function get_matching_storewide_emails( $order, $triggers, $always_send = false ) {
$matched_emails = array();
$category_ids = $this->get_category_ids_from_order( $order );
$emails = fue_get_emails( 'twitter', FUE_Email::STATUS_ACTIVE, array(
'meta_query' => array(
'relation' => 'AND',
array(
'key' => '_interval_type',
'value' => $triggers,
'compare' => 'IN'
),
array(
'key' => '_product_id',
'value' => 0
),
array(
'key' => '_category_id',
'value' => 0
)
)
) );
foreach ( $emails as $email ) {
// excluded categories
$meta = maybe_unserialize($email->meta);
$excludes = (isset($meta['excluded_categories'])) ? $meta['excluded_categories'] : array();
if ( !is_array( $excludes ) ) {
$excludes = array();
}
if ( count($excludes) > 0 ) {
foreach ( $category_ids as $cat_id ) {
if ( in_array( $cat_id, $excludes ) )
continue 2;
}
}
if ( $this->exclude_customer_based_on_purchase_history( fue_get_customer_from_order( $order ), $email ) ) {
continue;
}
$matched_emails[] = $email;
}
return $matched_emails;
} | [
"protected function get_matching_product_emails( $order, $triggers, $always_send = false ) {\n\t\t$item_ids = $this->get_product_ids_from_order( $order );\n\t\t$product_ids = array();\n\t\t$variation_ids = array();\n\n\t\tforeach ( $item_ids as $item_id ) {\n\t\t\t$product_ids[] = $item_id['product_id'];\n\n\t\t\tif ( $item_id['variation_id'] ) {\n\t\t\t\t$variation_ids[] = $item_id['variation_id'];\n\t\t\t}\n\t\t}\n\n\t\t$product_ids = array_unique( $product_ids );\n\t\t$variation_ids = array_unique( $variation_ids );\n\n\t\t// product match\n\t\t$always_send_value = ( $always_send ) ? array( 1 ) : array( 0, '' );\n\t\t$args = array(\n\t\t\t'meta_query' => array(\n\t\t\t\t'relation' => 'AND',\n\t\t\t\tarray(\n\t\t\t\t\t'key' => '_interval_type',\n\t\t\t\t\t'value' => $triggers,\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => '_product_id',\n\t\t\t\t\t'value' => 0,\n\t\t\t\t\t'compare' => '!=',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => '_product_id',\n\t\t\t\t\t'value' => array_merge( $product_ids, $variation_ids ),\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => '_always_send',\n\t\t\t\t\t'value' => $always_send_value,\n\t\t\t\t\t'compare' => 'IN',\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\n\t\t$product_emails = fue_get_emails( 'storewide', FUE_Email::STATUS_ACTIVE, $args );\n\n\t\t// Loop through the product matches and queue the top result\n\t\t$matched_product_emails = array();\n\t\tforeach ( $product_emails as $email ) {\n\n\t\t\t$meta = maybe_unserialize( $email->meta );\n\t\t\t$include_variations = isset( $meta['include_variations'] ) && $meta['include_variations'] == 'yes';\n\n\t\t\tif ( $this->exclude_customer_based_on_purchase_history( fue_get_customer_from_order( $order ), $email ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// exact product match\n\t\t\tif ( in_array( $email->product_id, $product_ids ) || in_array( $email->product_id, $variation_ids ) ) {\n\t\t\t\t$matched_product_emails[] = $email;\n\t\t\t} elseif ( $include_variations && in_array( $email->product_id, $variation_ids ) ) {\n\t\t\t\t$matched_product_emails[] = $email;\n\t\t\t}\n}\n\n\t\treturn $matched_product_emails;\n\t}",
"private function get_order_ids_for_storewide_email( $email ) {\n\t\t$wpdb = Follow_Up_Emails::instance()->wpdb;\n\t\t$trigger = $email->trigger;\n\t\t$orders = array();\n\n\t\tif ( $trigger == 'cart' ) {\n\t\t\t// cart is an unsupported trigger\n\t\t\treturn $orders;\n\t\t}\n\n\t\tif ( in_array( $trigger, Follow_Up_Emails::instance()->fue_wc->get_order_statuses() ) ) {\n\t\t\t// count the number of orders matching the email's order status trigger\n\t\t\t// and exclude those Order IDs that are in the email queue, sent or unsent\n\t\t\t$status = 'wc-'. $email->trigger;\n\t\t\t$orders = $wpdb->get_col( $wpdb->prepare(\n\t\t\t\t\"SELECT ID\n\t\t\t\t\tFROM {$wpdb->posts} p\n\t\t\t\t\tWHERE p.post_status = %s\n\t\t\t\t\tAND p.post_type = 'shop_order'\n\t\t\t\t\tAND (\n\t\t\t\t\t\tSELECT COUNT(id)\n\t\t\t\t\t\tFROM {$wpdb->prefix}followup_email_orders\n\t\t\t\t\t\tWHERE order_id = p.ID\n\t\t\t\t\t\tAND email_id = %d\n\t\t\t\t\t) = 0\",\n\t\t\t\t$status,\n\t\t\t\t$email->id\n\t\t\t) );\n\t\t} elseif ( $trigger == 'first_purchase' ) {\n\t\t\t// get the order IDs of customers with only 1 order\n\t\t\t$customer_orders = $wpdb->get_col(\n\t\t\t\t\"SELECT order_id\n\t\t\t\t\tFROM {$wpdb->prefix}followup_customer_orders\n\t\t\t\t\tGROUP BY followup_customer_id\n\t\t\t\t\tHAVING COUNT(followup_customer_id) = 1\"\n\t\t\t);\n\n\t\t\tif ( count( $customer_orders ) > 0 ) {\n\t\t\t\t$queue_orders = $wpdb->get_col( $wpdb->prepare(\n\t\t\t\t\t\"SELECT order_id\n\t\t\t\t\tFROM {$wpdb->prefix}followup_email_orders\n\t\t\t\t\tWHERE order_id IN (\". implode( ',', array_map( 'absint', $customer_orders ) ) .\")\n\t\t\t\t\tAND email_id = %d\",\n\t\t\t\t\t$email->id\n\t\t\t\t) );\n\n\t\t\t\t// exclude orders that are already in the queue\n\t\t\t\tforeach ( $customer_orders as $customer_order ) {\n\t\t\t\t\tif ( !in_array( $customer_order, $queue_orders ) ) {\n\t\t\t\t\t\t$orders[] = $customer_order;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif ( $trigger == 'product_purchase_above_one' ) {\n\t\t\t// Get the orders of customers with more than 1 order\n\t\t\t$customers = $wpdb->get_col(\n\t\t\t\t\"SELECT followup_customer_id\n\t\t\t\t\tFROM {$wpdb->prefix}followup_customer_orders\n\t\t\t\t\tGROUP BY followup_customer_id\n\t\t\t\t\tHAVING COUNT(followup_customer_id) > 1\"\n\t\t\t);\n\n\t\t\tforeach ( $customers as $customer_id ) {\n\t\t\t\t$customer_orders = $wpdb->get_col( $wpdb->prepare(\n\t\t\t\t\t\"SELECT order_id\n\t\t\t\t\t\tFROM {$wpdb->prefix}followup_customer_orders\n\t\t\t\t\t\tWHERE followup_customer_id = %d\n\t\t\t\t\t\tORDER BY order_id ASC\",\n\t\t\t\t\t$customer_id\n\t\t\t\t) );\n\n\t\t\t\tif ( count( $customer_orders ) > 0 ) {\n\t\t\t\t\t// drop the customer's first order\n\t\t\t\t\t$customer_orders = array_slice( $customer_orders, 1 );\n\n\t\t\t\t\t$queue_orders = $wpdb->get_col( $wpdb->prepare(\n\t\t\t\t\t\t\"SELECT order_id\n\t\t\t\t\t\tFROM {$wpdb->prefix}followup_email_orders\n\t\t\t\t\t\tWHERE order_id IN (\". implode( ',', array_map( 'absint', $customer_orders ) ) .\")\n\t\t\t\t\t\tAND email_id = %d\",\n\t\t\t\t\t\t$email->id\n\t\t\t\t\t) );\n\n\t\t\t\t\t// exclude orders that are already in the queue\n\t\t\t\t\tforeach ( $customer_orders as $customer_order ) {\n\t\t\t\t\t\tif ( !in_array( $customer_order, $queue_orders ) ) {\n\t\t\t\t\t\t\t$orders[] = $customer_order;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif ( empty( $orders ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn array( $email->id => $orders );\n\t}",
"public function searchOrdersForReview()\n {\n $websites = $this->helper->getwebsites(true);\n\n foreach ($websites as $website) {\n $apiEnabled = $this->helper->isEnabled($website);\n if ($apiEnabled\n && $this->helper->getWebsiteConfig(\n \\Dotdigitalgroup\\Email\\Helper\\Config::XML_PATH_CONNECTOR_SYNC_ORDER_ENABLED,\n $website\n )\n && $this->helper->getOrderStatus($website)\n && $this->helper->getDelay($website)\n ) {\n $storeIds = $website->getStoreIds();\n if (empty($storeIds)) {\n continue;\n }\n\n $orderStatusFromConfig = $this->helper->getOrderStatus(\n $website\n );\n $delayInDays = $this->helper->getDelay(\n $website\n );\n\n $campaignCollection = $this->campaignCollection->create()\n ->addFieldToFilter('event_name', 'Order Review');\n\n $campaignOrderIds = $campaignCollection->getColumnValues(\n 'order_increment_id'\n );\n\n $fromTime = $this->date;\n $fromTime->subDay($delayInDays);\n $toTime = clone $fromTime;\n $to = $toTime->toString('YYYY-MM-dd HH:mm:ss');\n $from = $fromTime->subHour(2)\n ->toString('YYYY-MM-dd HH:mm:ss');\n\n $created = ['from' => $from, 'to' => $to, 'date' => true];\n\n $collection = $this->orderCollection->create()\n ->addFieldToFilter(\n 'main_table.status',\n $orderStatusFromConfig\n )\n ->addFieldToFilter('main_table.created_at', $created)\n ->addFieldToFilter(\n 'main_table.store_id',\n ['in' => $storeIds]\n );\n\n if (!empty($campaignOrderIds)) {\n $collection->addFieldToFilter(\n 'main_table.increment_id',\n ['nin' => $campaignOrderIds]\n );\n }\n\n //process rules on collection\n $collection = $this->rulesFactory->create()\n ->process(\n $collection,\n \\Dotdigitalgroup\\Email\\Model\\Rules::REVIEW,\n $website->getId()\n );\n\n if ($collection->getSize()) {\n $this->reviewCollection[$website->getId()] = $collection;\n }\n }\n }\n }",
"public function get_orders_for_email( $order_ids, $email ) {\n if ( $email->type != 'wootickets' ) {\n return $order_ids;\n }\n\n $wpdb = Follow_Up_Emails::instance()->wpdb;\n\n if ( $email->product_id ) {\n $order_ids = $wpdb->get_col($wpdb->prepare(\n \"SELECT DISTINCT order_id\n FROM {$wpdb->prefix}followup_order_items\n WHERE product_id = %d\n OR variation_id = %d\",\n $email->product_id,\n $email->product_id\n ));\n } elseif ( $email->category_id ) {\n $order_ids = $wpdb->get_col($wpdb->prepare(\n \"SELECT DISTINCT order_id\n FROM {$wpdb->prefix}followup_order_categories\n WHERE category_id = %d\",\n $email->category_id\n ));\n } else {\n $ticket_ids = $wpdb->get_col(\n \"SELECT DISTINCT post_id\n FROM {$wpdb->postmeta}\n WHERE meta_key = '_tribe_wooticket_for_event'\n AND meta_value > 0\"\n );\n\n if ( !empty( $ticket_ids ) ) {\n $ids_csv = implode( ',', array_map( 'absint', $ticket_ids ) );\n\n $order_ids = $wpdb->get_col(\n \"SELECT DISTINCT order_id\n FROM {$wpdb->prefix}followup_order_items\n WHERE product_id IN ( {$ids_csv} )\n OR variation_id IN ( {$ids_csv} )\"\n );\n }\n }\n\n if ( empty( $order_ids ) ) {\n return array();\n }\n\n return array( $email->id => $order_ids );\n }",
"public function getMails($count = null, $order = 'new'){\n $uids = $this->mailboxConnection->searchMailbox();\n rsort($uids); //get the latest email ids\n if ($count){\n $this->limit = $count;\n $this->max = $this->limit > 0 ? $this->limit : $this->max;\n }\n $uids = array_splice($uids,0,$this->max);\n rsort($uids); //reorder appropriately\n $emailsOverview = $this->mailboxConnection->getMailsInfo($uids); //get array of all email ids\n krsort($emailsOverview); //Sort an associative array in descending order, according to the key\n return $emailsOverview;\n }",
"function fn_get_order_statuses_email_templates()\n{\n /** @var \\Tygh\\Template\\Mail\\Repository $repository */\n $repository = Tygh::$app['template.mail.repository'];\n\n $result = array();\n $email_templates = $repository->find(array(\n array('code', 'LIKE', 'order_notification._')\n ));\n\n foreach ($email_templates as $template) {\n list($code, $status) = explode('.', $template->getCode(), 2);\n $status = strtoupper($status);\n\n $result[$status][$template->getArea()] = $template;\n }\n\n return $result;\n}",
"private function getOrdersByTemplate($template)\n {\n $status = EmailConfig::authorizedStatus();\n $email_config = EmailConfig::fetchAll(Context::getContext()->language->id);\n $current = new DateTime();\n $hoursToSubtract = (int)$email_config[0]['relance'];\n $current->sub(new DateInterval(\"PT{$hoursToSubtract}H\"));\n $next = clone($current);\n $current->add(new DateInterval(\"PT1H\"));\n $date_from = $next->format('Y-m-d H:i:s') ; \n $date_to = $current->format('Y-m-d H:i:s');\n //var_dump($date_from);die;\n $orders = EmailConfig::getOrders($status,$date_from,$date_to);\n return $orders;\n }",
"function getPubMatchEmailTargets($enforceEmailFreq=false) {\r\n\t\tglobal $pub_matching_experimental, $pub_matching_email_limit,\r\n\t\t\t$pub_matching_email_days;\r\n\t\t// avoid duplicating all this SQL by templating it\r\n\t\t$selTemplate = \"(SELECT m.unique_hash, p.project_pi_lastname,\r\n\t\t\t\tp.project_pi_firstname, p.project_pi_mi, p.project_pi_email,\r\n\t\t\t\tm.article_id, m.email_count, TPL_CUSTOM_TYPE, m.match_id\r\n\t\t\tFROM redcap_pub_matches m JOIN TPL_TABLE p\r\n\t\t\t\tON (m.TPL_PID_NAME = p.project_id TPL_EXT_JOIN)\r\n\t\t\tWHERE p.project_pi_pub_exclude IS NOT NULL AND\r\n\t\t\t\tp.project_pi_pub_exclude = 0 AND\r\n\t\t\t\t\" . ($enforceEmailFreq ? \"m.email_count < ? AND DATEDIFF(NOW(), IFNULL(m.email_time, '1970-01-01')) >= ? AND\" : '') . \"\r\n\t\t\t\tm.matched IS NULL TPL_PROJ_FILTER)\";\r\n\t\t$selRedcap = str_replace(array('TPL_TABLE', 'TPL_PID_NAME', 'TPL_EXT_JOIN', 'TPL_PROJ_FILTER', 'TPL_CUSTOM_TYPE'),\r\n\t\t\t\t\t\tarray('redcap_projects', 'project_id', '', 'AND purpose = ' . self::PURPOSE_RESEARCH . ' AND status > 0', \"'REDCap' AS custom_type\"), $selTemplate);\r\n\t\t$selExternal = str_replace(array('TPL_TABLE', 'TPL_PID_NAME', 'TPL_EXT_JOIN', 'TPL_PROJ_FILTER', 'TPL_CUSTOM_TYPE'),\r\n\t\t\t\t\t\tarray('redcap_projects_external', 'external_project_id', 'AND m.external_custom_type = p.custom_type', ($pub_matching_experimental ? '' : ' AND 1=0'), 'p.custom_type'), $selTemplate);\r\n\t\t// exclude any matches referencing articles that the PI has previously matched\r\n\t\t$query = \"SELECT * FROM ($selRedcap UNION $selExternal) u\r\n\t\t\tWHERE u.article_id NOT IN\r\n\t\t\t\t(SELECT DISTINCT m3.article_id\r\n\t\t\t\tFROM redcap_pub_matches m3\r\n\t\t\t\tWHERE m3.matched IS NOT NULL)\r\n\t\t\tORDER BY project_pi_lastname, project_pi_firstname\";\r\n\t\t$targets = array();\r\n\t\t$usedEmails = array(); // [email addr] = object\r\n\t\t$emailArticleMap = array(); // [email addr][article ID] = true\r\n\t\t$emailCounts = array(); // [email addr] = min times the PI was emailed\r\n\t\t$emailTypes = array(); // [email addr][custom type] = custom type\r\n\t\t$emailMatchIds = array(); // [email addr][] = pub_matches IDs\r\n\t\t$params = $enforceEmailFreq ? array($pub_matching_email_limit, $pub_matching_email_days,\r\n\t\t\t\t$pub_matching_email_limit, $pub_matching_email_days) : array();\r\n\t\t$objs = $this->getObjects($query, $params);\r\n\t\tforeach ($objs as $obj) {\r\n\t\t\t$emailArticleMap[$obj->project_pi_email][$obj->article_id] = true;\r\n\t\t\tif (empty($usedEmails[$obj->project_pi_email])) {\r\n\t\t\t\t$usedEmails[$obj->project_pi_email] = $obj;\r\n\t\t\t\t$targets[] = $obj;\r\n\t\t\t}\r\n\t\t\tif (!array_key_exists($obj->project_pi_email, $emailCounts))\r\n\t\t\t\t$emailCounts[$obj->project_pi_email] = $obj->email_count;\r\n\t\t\telse $emailCounts[$obj->project_pi_email] = min($emailCounts[$obj->project_pi_email], $obj->email_count);\r\n\t\t\tif (!empty($obj->custom_type)) $emailTypes[$obj->project_pi_email][$obj->custom_type] = $obj->custom_type;\r\n\t\t\tif (empty($emailMatchIds[$obj->project_pi_email]))\r\n\t\t\t\t$emailMatchIds[$obj->project_pi_email] = array();\r\n\t\t\t$emailMatchIds[$obj->project_pi_email][] = $obj->match_id;\r\n\t\t}\r\n\t\t// add misc aggregate data to the targets\r\n\t\tforeach ($targets as $pi) {\r\n\t\t\t$pi->ArticleCount = count($emailArticleMap[$pi->project_pi_email]);\r\n\t\t\tunset($pi->email_count);\r\n\t\t\t$pi->MinEmailCount = $emailCounts[$pi->project_pi_email];\r\n\t\t\t$pi->CustomTypes = $emailTypes[$pi->project_pi_email];\r\n\t\t\t$pi->MatchIds = $emailMatchIds[$pi->project_pi_email];\r\n\t\t}\r\n\t\treturn $targets;\r\n\t}",
"function send_quote_select_emails($oid_filter) {\n global $wpdb;\n $order_row = $wpdb->get_row(\"SELECT * FROM orders WHERE oid = '$oid_filter'\", ARRAY_A); //get all of the order details\n $related_quotes = $wpdb->get_results(\"SELECT * FROM quotes WHERE oid = '$oid_filter'\", ARRAY_A); //get all related quotes\n $order_name = $order_row['order_name'];\n\n foreach ($related_quotes as $quote){\n $vid = $quote['vid'];\n $vendor_row = $wpdb->get_row(\"SELECT * FROM vendor_info WHERE vid = '$vid' LIMIT 1\", ARRAY_A);\n $subject = \"\";\n $msg = \"\";\n if($quote['quote_status'] = 'Quote Accepted') {\n $subject = 'Your Quote Was Accepted!';\n $msg = \"Congratulations! Your quote for Order $order_name (Order Number $oid_filter) was accepted. Please log in to see the order details.\";\n } else if ($quote['quote_status'] = 'Quote Not Accepted') {\n $subject = 'Your Quote Was Not Accepted';\n $msg = \"Your quote for Order $order_name (Order Number $oid_filter) was not accepted. However your account will be credited\n for your bid per our terms.\";\n } else {\n $subject = 'Order Has Been Cancelled';\n $msg = \"Your quote for Order $order_name (Order Number $oid_filter) was not accepted because the order was cancelled by the customer\n prior to selecting a winning bid. However your account will be credited for your bid per our terms.\";\n }\n $email1 = $vendor_row['contact_email'];\n $email2 = $vendor_row['alt_email'];\n $email_array = array($email1);\n if ($email2 != NULL) {\n $email_array[] = $email2;\n }\n $headers[] = 'From: Merafab Notify <notify@merafab.com>';\n wp_mail($email_array, $subject, $msg, $headers);\n }\n}",
"function get_relevant_email($emails){\n\tglobal $aPreferableEmails;\n\t\n\t$bestEmails = array();\n\t\n\tif(count($emails) != 1){\n\t\tforeach( $emails as $email ){\n\t\t\t$em = explode( '@', $email, 2);\n\t\t\t\n\t\t\tif( in_array($em[0], $aPreferableEmails) ){\n\t\t\t\t$bestEmails[ array_search($em[0], $aPreferableEmails) ] = $email;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( $bestEmails ){\n\t\t\tksort($bestEmails);\n\t\t\t\n\t\t\treturn reset($bestEmails);\n\t\t}\n\t}\n\t\n\treturn implode(\";\",$emails);\n}",
"function order_status_updated( $order_id ) {\n\n $order = WC_FUE_Compatibility::wc_get_order($order_id);\n\n $queued = array();\n $triggers = $this->get_order_triggers( $order, Follow_Up_Emails::get_email_type( 'twitter' ) );\n\n $product_emails = $this->get_matching_product_emails( $order, $triggers, false );\n $queued = array_merge( $queued, $this->queue_product_emails( $product_emails, $order ) );\n\n $product_always_send_emails = $this->get_matching_product_emails( $order, $triggers, true );\n $queued = array_merge( $queued, $this->queue_always_send_product_emails( $product_always_send_emails, $order ) );\n\n $category_emails = $this->get_matching_category_emails( $order, $triggers, false );\n $queued = array_merge( $queued, $this->queue_category_emails( $category_emails, $order ) );\n\n $category_always_send_emails = $this->get_matching_category_emails( $order, $triggers, true );\n $queued = array_merge( $queued, $this->queue_always_send_category_emails( $category_always_send_emails, $order ) );\n\n $storewide_always_send_emails = $this->get_matching_storewide_emails( $order, $triggers, true );\n $queued = array_merge( $queued, $this->queue_storewide_emails( $storewide_always_send_emails, $order ) );\n\n if ( count( $queued ) == 0 ) {\n $storewide_emails = $this->get_matching_storewide_emails( $order, $triggers );\n $this->queue_storewide_emails( $storewide_emails, $order );\n }\n\n $this->add_order_notes_to_queued_emails( $queued );\n\n }",
"function searchByTrackerIdWithOrder($tracker_id) {\n //$sql = sprintf(\"SELECT ar.id, ar.source_field_id, ar.source_value_id, ar.target_field_id, ar.rule_type, ar.target_value_id \".\n // \" FROM tracker_rule AS ar \".\n // \" INNER JOIN tracker_field_usage AS afu1 ON (ar.source_field_id = afu1.field_id AND ar.group_artifact_id = afu1.group_artifact_id) \".\n // \" INNER JOIN tracker_field_usage AS afu2 ON (ar.target_field_id = afu2.field_id AND ar.group_artifact_id = afu2.group_artifact_id) \".\n // \" LEFT JOIN tracker_field_value_list AS afvls \".\n // \" ON (ar.source_field_id = afvls.field_id AND ar.group_artifact_id = afvls.group_artifact_id AND ar.source_value_id = afvls.value_id) \".\n // \" LEFT JOIN tracker_field_value_list AS afvlt \".\n // \" ON (ar.target_field_id = afvlt.field_id AND ar.group_artifact_id = afvlt.group_artifact_id AND ar.target_value_id = afvlt.value_id) \".\n // \" WHERE ar.group_artifact_id = %s \".\n // \" ORDER BY afu1.place, afu2.place, afvls.order_id, afvlt.order_id, ar.id\",\n\t //\t\t$this->da->quoteSmart($tracker_id));\n $sql = sprintf(\"SELECT ar.id, ar.source_field_id, ar.source_value_id, ar.target_field_id, ar.rule_type, ar.target_value_id \".\n \" FROM tracker_rule AS ar \".\n \" WHERE ar.tracker_id = %s \".\n \" ORDER BY ar.id\",\n\t\t\t\t$this->da->quoteSmart($tracker_id));\n return $this->retrieve($sql);\n }",
"public function getSentOrders()\n {\n // Get all orders that are processing\n $all_orders = Mage::getModel('sales/order')\n ->getCollection()\n ->addFieldToFilter('state', 'processing')\n ;\n\n $sent_order_ids = array();\n foreach ($all_orders as &$order) {\n $status_histories = Mage::getResourceModel('sales/order_status_history_collection')\n ->setOrderFilter($order)\n ->setOrder('created_at', 'desc')\n ->setOrder('entity_id', 'desc')\n ->addFieldToFilter('status', Notive_Astral_Model_Observers_Order::ASTRAL_ORDER_STATUS_CODE_OK)\n ; // $status_histories\n\n // The order was sent to Astral\n if (count($status_histories) > 0) {\n $sent_order_ids[] = $order->getId();\n }\n }\n $orders = Mage::getModel('sales/order')\n ->getCollection()\n ->addFieldToFilter('entity_id', array('in'=>$sent_order_ids))\n ; // $orders\n\n return $orders;\n }",
"public function send()\n {\n if (!Mage::getStoreConfig(Epoint_SwissPostSales_Helper_Order::ENABLE_SEND_ORDER_CONFIG_PATH)) {\n return;\n }\n // Check if the date is configured.\n if(!Mage::getStoreConfig(\n Epoint_SwissPostSales_Helper_Order::XML_CONFIG_PATH_FROM_DATE \n )){\n \tMage::helper('swisspost_api')->log(\n Mage::helper('core')->__('Error on send order cron, from date filter is not configured!')\n );\n return ; \n }\n $status_filter = explode(',', \n \tMage::getStoreConfig(self::ENABLE_SEND_ORDER_STATUS_CONFIG_PATH)\n );\n if(is_array($status_filter)){\n \t$status_filter = array_map('trim', $status_filter);\n }\t\n $from_date = date('Y-m-d H:i:s', strtotime(Mage::getStoreConfig(\n Epoint_SwissPostSales_Helper_Order::XML_CONFIG_PATH_FROM_DATE)\n )\n );\n // All orders without odoo code id\n $order_collection = Mage::getModel('sales/order')\n ->getCollection()\n // Join invoices, send only \n ->join(array('invoice' => 'sales/invoice'), \n 'invoice.order_id=main_table.entity_id', \n array('invoice_entity_id'=>'entity_id'), null , 'left')\n ->addAttributeToFilter(\n 'main_table.created_at',\n array('gt' => $from_date)\n )\n ->addFieldToFilter(\n 'main_table.status',\n array(array('in'=>array($status_filter)))\n )\n ->addAttributeToFilter(\n 'main_table.'.Epoint_SwissPostSales_Helper_Data::ORDER_ATTRIBUTE_CODE_ODOO_ID,\n array(array('null' => true),\n array('eq' => 0)\n )\n );\n // Add group \n $order_collection->getSelect()->group('main_table.entity_id');\n // Add Limit \n $order_collection->getSelect()->limit((int)Mage::getStoreConfig(Epoint_SwissPostSales_Helper_Order::XML_CONFIG_PATH_CRON_LIMIT)); \n foreach ($order_collection as $order_item) {\n $order = Mage::getModel('sales/order')->load($order_item->getId());\n // check if can be sent again\n if(Mage::helper('swisspostsales/Order')->isConnected($order)){\n \t Mage::helper('swisspost_api')->log(\n Mage::helper('core')->__('Stop sending again order: %s, odoo id: %s', $order->getId(), \n $order->getData(Epoint_SwissPostSales_Helper_Data::ORDER_ATTRIBUTE_CODE_ODOO_ID)\n )\n );\n \tcontinue;\n }\n // The order was not invoiced ???\n if(!$order->getInvoiceCollection()){\n \tMage::helper('swisspost_api')->log(\n Mage::helper('core')->__('Stop sending again order, no invoice: %s', $order->getId()\n )\n );\n \tcontinue;\n }\n Mage::helper('swisspost_api/Order')->createSaleOrder($order);\n }\n }",
"public static function walker()\n {\n $args = array(\n 'numberposts' => apply_filters('wooms_orders_number', 5),\n 'post_type' => 'shop_order',\n 'post_status' => 'any',\n 'meta_key' => 'wooms_order_sync',\n 'meta_compare' => 'EXISTS',\n );\n\n $orders = get_posts($args);\n\n if (empty($orders)) {\n return false;\n }\n\n do_action('wooms_logger', __CLASS__,\n sprintf('Старт очереди отправки заказов - %s', date(\"Y-m-d H:i:s\"))\n );\n\n $result_list = [];\n foreach ($orders as $order) {\n $check = self::update_order($order->ID);\n if (false != $check) {\n update_post_meta($order->ID, 'wooms_send_timestamp', date(\"Y-m-d H:i:s\"));\n $result_list[] = $order->ID;\n }\n }\n\n if (empty($result_list)) {\n return false;\n }\n\n return $result_list;\n }",
"public static function fetchSystemtriggers()\n {\n $triggers = array();\n $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/' . SITE_NAME . '.ini', 'actiontriggers');\n if ($config) {\n $triggers = $config->actiontriggers->toArray();\n $additionalSystemTriggersPath = Zend_Controller_Action_HelperBroker::getExistingHelper('website')->getPath() . 'system'.DIRECTORY_SEPARATOR.'system-action-emails.ini';\n if (file_exists($additionalSystemTriggersPath)) {\n $additionalSystemTriggers = new Zend_Config_Ini($additionalSystemTriggersPath, 'actiontriggers');\n if (!empty($additionalSystemTriggers) && !empty($triggers['seotoaster']['trigger'])) {\n $additionalSystemTriggers = $additionalSystemTriggers->actiontriggers->toArray();\n if (!empty($additionalSystemTriggers['seotoaster']) && !empty($additionalSystemTriggers['seotoaster']['trigger'])) {\n $triggers['seotoaster']['trigger'] = array_merge($triggers['seotoaster']['trigger'],\n $additionalSystemTriggers['seotoaster']['trigger']);\n }\n }\n }\n }\n\n return $triggers;\n }",
"private function email_notification_query_setup()\n\t{\n\t\t// Get parameters\n\t\tif (ee()->input->get('sort_col') != NULL)\n\t\t{\n\t\t\tif (ee()->input->get('sort_dir') != NULL && ee()->input->get('sort_dir') == \"desc\")\n\t\t\t{\n\t\t\t\tee()->db->order_by(ee()->input->get('sort_col'), 'DESC');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tee()->db->order_by(ee()->input->get('sort_col', 'ASC'));\n\t\t\t}\n\t\t}\n\n\t\t$search_phrase = NULL;\n\t\t// We verify POST first, because it's what is sent by the search form\n\t\tif (ee()->input->post('search') != NULL && ee()->input->post('search') != \"\")\n\t\t{\n\t\t\t$search_phrase = ee()->input->post('search');\n\t\t}\n\t\telse if\t(ee()->input->get('search') != NULL && ee()->input->get('search') != \"\")\n\t\t{\n\t\t\t$search_phrase = ee()->input->get('search');\n\t\t}\n\t\t\n\t\tif ($search_phrase)\n\t\t{\n\t\t\t$this->_keywords = $search_phrase;\n\t\t\t$sql_filter_where = \"(`email_address` LIKE '%\".ee()->db->escape_like_str($search_phrase).\"%' OR `url_to_match` LIKE '%\".ee()->db->escape_like_str($search_phrase).\"%' )\";\n\t\t\tee()->db->where($sql_filter_where, NULL, TRUE);\n\t\t}\n\t\t\n\t\tif (ee()->input->get('filter_by_interval'))\n\t\t{\n\t\t\t$interval = ee()->input->get('filter_by_interval');\n\t\t\tif ($interval == \"interval_always\")\n\t\t\t{\n\t\t\t\tee()->db->where('interval', 'always');\n\t\t\t}\n\t\t\telse if ($interval == \"interval_once\")\n\t\t\t{\n\t\t\t\tee()->db->where('interval', 'once');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}",
"function get_all_emails_easy($ucn,$icmsdb,$emailhost) {\n $countynum=substr($ucn,0,2);\n $dbh=db_connect($countynum);\n $counties=load_conf_file(\"county_db_info.json\");\n $dbtype=$counties->{$countynum}->{database_type};\n $dbtype=strtolower($dbtype);\n# $case=case_base_info($icsmdb,$dbh,$ucn,$dbtype);\n#$case[id];\n $id=find_case_id($icmsdb,$dbh,$ucn,$dbtype);\n # was \n $ccisucn=sqlgetonep($icmsdb,\"select ucn_src from search where ucn=? top 1\",array($ucn));\n $schedb=db_connect(\"eservice\");\n $parties=get_parties($dbh,$schedb,$id,$dbtype,$unused);\n if (count($parties)>0) {\n foreach ($parties as $party) {\n $disdate=$party[12];\n if ($disdate!=\"\") { next; }\n $email=$party[7];\n if ($email!=\"\") { $allemails=add_email($allemails,$email); }\n }\n }\n $attorneys=get_attorneys($dbh,$schedb,$id,$dbtype,$ccisucn); \n # gets clerk, bar, and portal\n if (count($attorneys)>0) {\n foreach ($attorneys as $atty) {\n # NOTE: no dismissal date for attorneys in this array?\n $clerkemail=$atty[6];\n $baremail=$atty[7];\n $portalemails=$atty[8];\n if ($portalemails!=\"\") { # if present, ignore clerk and bar\n $portalarr=explode(\",\",$portalemails);\n foreach ($portalarr as $portalemail) {\n $allemails=add_email($allemails,$portalemail);\n }\n } else {\n if ($clerkemail!=\"\") { $allemails=add_email($allemails,$clerkemail); }\n if ($baremail!=\"\") { $allemails=add_email($allemails,$baremail); }\n }\n }\n }\n # \n # NOW, get email addresses for all folks who've subscribed to alerts \n # for this division\n #\n $div=sqlgetonep($icmsdb,\"select division from search where ucn=? limit 1\",array($ucn));\n $division=\"$countynum-$div\";\n $setlist=sqlarrayp($icmsdb,\"select user,json from config where module='config'\",array());\n if (count($setlist)>0) {\n foreach ($setlist as $set) {\n list($user,$json)=$set;\n $stuff=json_decode($json);\n list($email)=explode(\",\",$stuff->{email}); # use first email address.\n if ($email==\"\") { # they didn't set one--degrade gracefully\n $email=\"$user$emailhost\";\n }\n $alerts=$stuff->{alerts};\n if ($alerts && strpos($division,$alerts)!==false) { # add this email...\n $allemails=add_email($allemails,$email);\n }\n }\n }\n $allemails=str_replace(\";\",\",\",$allemails);\n return substr($allemails,0,-1); # remove final ;\n}",
"function wcfmmp_reports_get_order_report_data_args( $args ) {\r\n \tglobal $WCFM, $wpdb, $_POST, $wp;\r\n \t\r\n \tif ( !isset( $wp->query_vars['wcfm-reports-sales-by-product'] ) ) return $args;\r\n \tif( $args['query_type'] != 'get_results' ) return $args;\r\n \t\r\n \t$user_id = $this->vendor_id;\r\n \t\r\n \t$products = $WCFM->wcfm_marketplace->wcfmmp_get_vendor_products( $this->vendor_id );\r\n\t\t\r\n\t\t//$args['order_types'] = wc_get_order_types( 'sales-reports' );\r\n\t\t$args['where'][] = array( 'key' => 'order_item_meta__product_id.meta_value', 'operator' => 'in', 'value' => $products );\r\n \t\r\n \treturn $args;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set article secondary IDs of this submission. | function setArticleSecIds($articleSecIds) {
return $this->articleSecIds = $articleSecIds;
} | [
"public function setIdArticle($_idArticle)\n\t{\n\t\t$this->_idArticle = $_idArticle;\n\t}",
"function setArticleSecondarySponsors($articleSponsors) {\r\n\t\treturn $this->articleSecondarySponsors = $articleSponsors;\r\n\t}",
"final function setArticle_id($value) {\n\t\treturn $this->setArticleId($value);\n\t}",
"protected function setArticleId($art_id, $clang_id = -1)\n {\n global $REX;\n $REX['ARTICLE_ID'] = $art_id;\n if($clang_id > -1)\n $REX['CUR_CLANG'] = $clang_id;\n }",
"private function setSecondary($secondaryURL){\n\t\t\t$this->urlSecondary = $secondaryURL;\n\t\t}",
"public function massAuthorIdAction()\n {\n $articleIds = $this->getRequest()->getParam('article');\n if (!is_array($articleIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('medvslav_news2')->__('Please select articles.')\n );\n } else {\n try {\n foreach ($articleIds as $articleId) {\n $article = Mage::getSingleton('medvslav_news2/article')->load($articleId)\n ->setAuthorId($this->getRequest()->getParam('flag_author_id'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d articles were successfully updated.', count($articleIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('medvslav_news2')->__('There was an error updating articles.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }",
"public function setSubCategoryIdsAttribute($sub_category_ids)\n {\n $this->attributes['sub_category_ids'] = is_string($sub_category_ids) ? $sub_category_ids : implode(',', $sub_category_ids);\n }",
"public function setSecondaryId($value) {\n if (empty($value))\n throw new InvalidArgumentException('An secondaryId must have a value');\n $this->secondaryIdId = $value;\n return $this;\n }",
"public function getSecondaryIds() {\n return [];\n }",
"function setAssignmentID( $primaryID )\n {\n $this->setValueByFieldName( 'assignment_id', $primaryID );\n return;\n }",
"function set_new_article_id( &$title ) { # Checked for HTML and MySQL insertion attacks\n\t\t$dbw = wfGetDB( DB_MASTER );\n\t\t$dbw->update( 'tasks',\n\t\t\tarray( 'task_page_id' => $title->getArticleID() ), # SET\n\t\t\tarray( 'task_page_title' => $title->getPrefixedDBkey() ), # WHERE\n\t\t\t__METHOD__ );\n\t}",
"public function setIdentifierValues($entity, array $id);",
"function changePubId($articleId, $pubIdType, $pubId) {\n\t\t$this->updateSetting($articleId, 'pub-id::'.$pubIdType, $pubId, 'string');\n\t}",
"public function massInstitutionIdAction(){\r\n\t\t$secondaryIds = $this->getRequest()->getParam('secondary');\r\n\t\tif(!is_array($secondaryIds)) {\r\n\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('enrollments')->__('Please select secondary.'));\r\n\t\t} \r\n\t\telse {\r\n\t\t\ttry {\r\n\t\t\t\tforeach ($secondaryIds as $secondaryId) {\r\n\t\t\t\t$secondary = Mage::getSingleton('enrollments/secondary')->load($secondaryId)\r\n\t\t\t\t\t\t\t->setInstitutionId($this->getRequest()->getParam('flag_institution_id'))\r\n\t\t\t\t\t\t\t->setIsMassupdate(true)\r\n\t\t\t\t\t\t\t->save();\r\n\t\t\t\t}\r\n\t\t\t\t$this->_getSession()->addSuccess($this->__('Total of %d secondary were successfully updated.', count($secondaryIds)));\r\n\t\t\t}\r\n\t\t\tcatch (Mage_Core_Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e) {\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('enrollments')->__('There was an error updating secondary.'));\r\n\t\t\t\tMage::logException($e);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->_redirect('*/*/index');\r\n\t}",
"function setArticleId($value) {\n\t\treturn $this->setColumnValue('article_id', $value, BaseModel::COLUMN_TYPE_INTEGER);\n\t}",
"protected function set_product_ids() {\n\n\t\t// get the products selected for the report\n\t\t$this->product_ids = isset( $_GET['product_ids'] ) ? array_filter( array_map( 'absint', (array) $_GET['product_ids'] ) ) : array();\n\t}",
"public function setId_article(int $id_article)\n {\n $this->id_article = $id_article;\n\n return $this;\n }",
"public function setArticleId($id){\n $this->addParams('id', $id);\n }",
"public function setExtras($extras) {\n $this->extras = NULL;\n $this->extras_id = array();\n\n foreach ($extras as $extra) {\n if ($extra instanceof ExtraApi) {\n $this->extras_id[] = $extra->getId();\n }\n else {\n if (is_int($extra)) {\n $this->extras_id[] = $extra;\n }\n }\n }\n\n $this->toSave['extras.id'] = implode(';', $this->extras_id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the PothNbr column Example usage: $query>filterByPothnbr('fooValue'); // WHERE PothNbr = 'fooValue' $query>filterByPothnbr('%fooValue%', Criteria::LIKE); // WHERE PothNbr LIKE '%fooValue%' | public function filterByPothnbr($pothnbr = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($pothnbr)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PurchaseOrderDetailReceivingTableMap::COL_POTHNBR, $pothnbr, $comparison);
} | [
"public function filterByPonbr($ponbr, $comparison = null) {\n\t\treturn $this->filterByPothnbr($ponbr, $comparison);\n\t}",
"public function filterByPhadicellnbr($phadicellnbr = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($phadicellnbr)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PhoneBookTableMap::COL_PHADICELLNBR, $phadicellnbr, $comparison);\n }",
"public function filterByPothrcptnbr($pothrcptnbr = null, $comparison = null)\n {\n if (is_array($pothrcptnbr)) {\n $useMinMax = false;\n if (isset($pothrcptnbr['min'])) {\n $this->addUsingAlias(PoReceivingHeadTableMap::COL_POTHRCPTNBR, $pothrcptnbr['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($pothrcptnbr['max'])) {\n $this->addUsingAlias(PoReceivingHeadTableMap::COL_POTHRCPTNBR, $pothrcptnbr['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PoReceivingHeadTableMap::COL_POTHRCPTNBR, $pothrcptnbr, $comparison);\n }",
"public function setPothnbr($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->pothnbr !== $v) {\n $this->pothnbr = $v;\n $this->modifiedColumns[PoReceivingHeadTableMap::COL_POTHNBR] = true;\n }\n\n if ($this->aPurchaseOrder !== null && $this->aPurchaseOrder->getPohdnbr() !== $v) {\n $this->aPurchaseOrder = null;\n }\n\n return $this;\n }",
"public function scopePropertyNumber($query,$propertynumber)\n\t{\n\t\treturn $query->where('propertynumber','=',$propertynumber);\n\t}",
"public function setPothrcptnbr($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->pothrcptnbr !== $v) {\n $this->pothrcptnbr = $v;\n $this->modifiedColumns[PoReceivingHeadTableMap::COL_POTHRCPTNBR] = true;\n }\n\n return $this;\n }",
"public function filterByPnum($pnum = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($pnum)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $pnum)) {\n $pnum = str_replace('*', '%', $pnum);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(SupplierProductJobTableMap::COL_PNUM, $pnum, $comparison);\n }",
"public function setPothinvcnbr($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->pothinvcnbr !== $v) {\n $this->pothinvcnbr = $v;\n $this->modifiedColumns[PoReceivingHeadTableMap::COL_POTHINVCNBR] = true;\n }\n\n return $this;\n }",
"public function filterByPohdnbr($pohdnbr = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($pohdnbr)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PurchaseOrderDetailTableMap::COL_POHDNBR, $pohdnbr, $comparison);\n }",
"public function filterByPonbr($ponbr = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($ponbr)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CartdetTableMap::COL_PONBR, $ponbr, $comparison);\n }",
"public function filterByOrdernbr($ordernbr = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($ordernbr)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(WmpickdetTableMap::COL_ORDERNBR, $ordernbr, $comparison);\n }",
"public function filterByPartNumber($partNumber = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($partNumber)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $partNumber)) {\n\t\t\t\t$partNumber = str_replace('*', '%', $partNumber);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ItemPeer::PART_NUMBER, $partNumber, $comparison);\n\t}",
"public function filterByNumrue($numrue = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($numrue)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $numrue)) {\n $numrue = str_replace('*', '%', $numrue);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(InfosTableMap::COL_NUM_RUE, $numrue, $comparison);\n }",
"public function searchPoItemNumberAction($poNum, $minDate, $maxDate)\n {\n\t$filterDate = PoManagerControllerUtility::convertDateFilter($minDate, $maxDate);\n\t$repository = $this->getDoctrine()\n\t ->getManager()\n\t\t\t ->getRepository('AchPoManagerBundle:PoItem');\n\t\n\t$request = $this->getRequest();\n\n\t$poItems = $repository->findPoNum($poNum, $filterDate, ($request->query->get('match') == 'exact') );\n\t\n\treturn $this->generateResponse($request, $poItems);\n }",
"public function filter($criteria, $resultsPerPage, $pageNum,\n $sortColumn=null) {\n\n $dbh = getDBConnection();\n if (is_null($this->columnNames)) {\n $this->populateColumnNames();\n }\n\n // Build the query\n $sql = \"select SQL_CALC_FOUND_ROWS * from $this->model where 1 \";\n foreach (array_keys($criteria) as $columnName) {\n if (in_array($columnName, $this->columnNames) == false) {\n throw new ColumnDoesNotExist(\"$this->model.$columnName\");\n }\n $sql .= \"and $columnName = :$columnName \";\n }\n $sortDirection = 'asc';\n if (is_null($sortColumn)) {\n $sortColumn = 'id';\n } else {\n if ($sortColumn[0] == '-') {\n $sortColumn = substr($sortColumn, 1);\n $sortDirection = 'desc';\n }\n if (in_array($sortColumn, $this->columnNames) == false) {\n throw new ColumnDoesNotExist(\"$this->model.$sortColumn\");\n }\n self::checkIdentifier($sortColumn);\n }\n $sql .= \"order by $sortColumn $sortDirection limit :offset, :count\";\n $stmt = $dbh->prepare($sql);\n\n // Bind the values\n foreach ($criteria as $columnName => $value) {\n $stmt->bindValue(\":$columnName\", $value);\n }\n $offset = $resultsPerPage * ($pageNum - 1);\n $stmt->bindValue(':offset', $offset, PDO::PARAM_INT);\n $stmt->bindValue(':count', $resultsPerPage, PDO::PARAM_INT);\n \n // Execute the query and get the results\n $stmt->execute();\n $stmt->setFetchMode(PDO::FETCH_CLASS, $this->model);\n $instances = $stmt->fetchAll();\n \n // Set paging output variables\n $this->resultsPerPage = $resultsPerPage;\n $stmt = $dbh->query('select found_rows()');\n $this->resultsCount = (int) $stmt->fetchColumn(); \n $this->pageNum = $pageNum;\n $this->pageCount = ceil($this->resultsCount / $resultsPerPage);\n $this->firstResultNum = $offset + 1;\n $this->lastResultNum = $offset + count($instances);\n \n return $instances;\n }",
"public function setPoNumber($poNumber);",
"private function search_partial_order_number($number, $args)\n {\n }",
"public function setPhadihomenbr($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->phadihomenbr !== $v) {\n $this->phadihomenbr = $v;\n $this->modifiedColumns[PhoneBookTableMap::COL_PHADIHOMENBR] = true;\n }\n\n return $this;\n }",
"public function actionFilterSetHosNum()\n\t{\n\t\t$this->setFilter('hos_num', $_POST['hos_num']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field fixed64 end_timestamp = 2; | public function setEndTimestamp($var)
{
GPBUtil::checkUint64($var);
$this->end_timestamp = $var;
return $this;
} | [
"public function getEndTimestamp() {}",
"public function getTimestampEnd()\n {\n return $this->timestamp_end;\n }",
"public function getEndTimestamp()\n {\n return isset($this->end_timestamp) ? $this->end_timestamp : '';\n }",
"public function getEndTimestamp()\n {\n return $this->endTimestamp;\n }",
"public function getEndTs()\n {\n return $this->end_ts;\n }",
"function GetEndTimestamp () {\n return $this->hunt_end_timestamp;\n }",
"public function setEndDateTime($timestamp);",
"public function getEnd()\n {\n return $this->end_time;\n }",
"public function getEndTimeOffset()\n {\n return $this->end_time_offset;\n }",
"public function setEndTimestampMicros($var)\n {\n GPBUtil::checkInt64($var);\n $this->end_timestamp_micros = $var;\n\n return $this;\n }",
"public function getTimeEnd();",
"public function getEventEnd(){\n $fromTime = $this->getFrom();\n $date = $this->getDate();\n $date->setTime($fromTime->hour, $fromTime->minute);\n return $date->format('Ymd') . \"T\" . $date->format('His') . \"Z\";\n }",
"public function setEndTimestamp($value)\n {\n return $this->set('EndTimestamp', $value);\n }",
"public function getEvEnd()\n {\n return $this->getDtEnd()->getTimestamp();\n }",
"function get_end_time() {\n return $this->end_time;\n }",
"public function getEndtime2()\n {\n return $this->endtime2;\n }",
"public function getEndTableAttribute()\n {\n return Carbon::parse($this->end)->format('Y-m-d H:i');\n }",
"public function getEnd()\n {\n if (array_key_exists(\"end\", $this->_propDict)) {\n if (is_a($this->_propDict[\"end\"], \"\\Beta\\Microsoft\\Graph\\Model\\TimeCardEvent\") || is_null($this->_propDict[\"end\"])) {\n return $this->_propDict[\"end\"];\n } else {\n $this->_propDict[\"end\"] = new TimeCardEvent($this->_propDict[\"end\"]);\n return $this->_propDict[\"end\"];\n }\n }\n return null;\n }",
"public function get_end_time() {\n\t\treturn $this->end_time;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END DOMESTIC RESPONSE START GET DOMESTIC TRANSIT TIME | function _getDmstcTransitTimes() {
$transitreq = 'USERID="' . MODULE_SHIPPING_USPS_USERID . '">' .
'<OriginZip>' . SHIPPING_ORIGIN_ZIP . '</OriginZip>' .
'<DestinationZip>' . $this->dest_zip . '</DestinationZip>';
$transitpriorityreq = 'API=PriorityMail&XML=' . urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
$transitexpressreq = 'API=ExpressMailCommitment&XML=' . urlencode( '<ExpressMailCommitmentRequest USERID="' . MODULE_SHIPPING_USPS_USERID . '"><OriginZIP>' . SHIPPING_ORIGIN_ZIP . '</OriginZIP><DestinationZIP>' . $this->dest_zip . '</DestinationZIP><Date></Date></ExpressMailCommitmentRequest>');
$transitparcelreq = 'API=StandardB&XML=' . urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
$usps_server = 'production.shippingapis.com';
$api_dll = 'shippingAPI.dll';
$body = '';
if (!class_exists('httpClient')) {
include(DIR_FS_CATALOG . DIR_WS_CLASSES . 'http_client.php');
}
$http = new httpClient();
if ($http->Connect($usps_server, 80)) {
$http->addHeader('Host', $usps_server);
$http->addHeader('User-Agent', 'IntenseCart');
$http->addHeader('Connection', 'Close');
if ($http->Get('/' . $api_dll . '?' . $transitpriorityreq)) $transpriorityresp = $http->getBody();
if ($http->Get('/' . $api_dll . '?' . $transitexpressreq)) $transexpressresp = $http->getBody();
if ($http->Get('/' . $api_dll . '?' . $transitparcelreq)) $transparcelresp = $http->getBody();
$http->Disconnect();
} else {
return false;
}
$prioritytime = '';
$expresstime = '';
$parceltime = '';
$doc = XML_unserialize($transpriorityresp);
if( isset($doc['PriorityMailResponse']['Days']) ){
// add processing time..
$doc['PriorityMailResponse']['Days'] += $this->processing;
$prioritytime =
MODULE_SHIPPING_USPS_TEXT_ESTIMATED
. $doc['PriorityMailResponse']['Days']
. ' '
. (
$doc['PriorityMailResponse']['Days'] == 1
?
MODULE_SHIPPING_USPS_TEXT_DAY
:
MODULE_SHIPPING_USPS_TEXT_DAYS
)
;
}
$doc = XML_unserialize($transparcelresp);
if( isset($doc['StandardBResponse']['Days']) ){
// add processing time..
$doc['StandardBResponse']['Days'] += $this->processing;
$parceltime =
MODULE_SHIPPING_USPS_TEXT_ESTIMATED
. $doc['StandardBResponse']['Days']
. ' '
. (
$doc['StandardBResponse']['Days'] == 1
?
MODULE_SHIPPING_USPS_TEXT_DAY
:
MODULE_SHIPPING_USPS_TEXT_DAYS
)
;
}
$doc = XML_unserialize($transexpressresp);
// print_r( $doc );
if( isset($doc['ExpressMailCommitmentResponse']['Commitment']) ){
if( isset($doc['ExpressMailCommitmentResponse']['Commitment']['CommitmentName']) ){ // single date
$sequence = str_replace(
array(
'Next',
'Days',
'Day'
),
array(
'1',
MODULE_SHIPPING_USPS_TEXT_DAYS,
MODULE_SHIPPING_USPS_TEXT_DAY
),
$doc['ExpressMailCommitmentResponse']['Commitment']['CommitmentName']
);
} else { // multiple dates returned, choose longest time
$seqlist = array();
foreach( $doc['ExpressMailCommitmentResponse']['Commitment'] as $commit ){
if( isset($commit['CommitmentName']) ){
$seqlist[] = str_replace(
array(
'Next',
'Days',
'Day'
),
array(
'1',
MODULE_SHIPPING_USPS_TEXT_DAYS,
MODULE_SHIPPING_USPS_TEXT_DAY
),
$commit['CommitmentName']
);
}
}
rsort($seqlist);
$sequence = $seqlist[0];
}
$expresstime = MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $sequence;
}
return array(
'express' => $expresstime,
'priority' => $prioritytime,
'parcel' => $parceltime
);
} | [
"public function getDeserveTime()\n {\n return $this->deserve_time;\n }",
"public function getEventTimeEnd()\n {\n }",
"public function getResponseTime()\n {\n return $this->status[self::STATUS_REQUEST_TIME];\n }",
"public function getEventEnd(){\n $fromTime = $this->getFrom();\n $date = $this->getDate();\n $date->setTime($fromTime->hour, $fromTime->minute);\n return $date->format('Ymd') . \"T\" . $date->format('His') . \"Z\";\n }",
"function parseDomesticLegacyAPITransitTimeResults($transresp) {\n global $logfilename;\n if (MODULE_SHIPPING_USPS_DEBUG_MODE == 'Logs') {\n $fp = @fopen($logfilename, 'a');\n fwrite($fp, date('M d Y G:i:s') . ' -- TRANSIT TIME PARSING (domestic legacy API)' . \"\\n\\n\");\n }\n foreach ($transresp as $service => $val) {\n $val = json_decode(json_encode(simplexml_load_string($val)),TRUE);\n switch (TRUE) {\n case (preg_match('#Priority Mail Express#i', $service)):\n $time = $val['CommitmentTime'];\n if ($time == '' || $time == 'No Data') {\n $time = '1 - 2 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;\n } else {\n $time = 'Tomorrow by ' . $time;\n }\n break;\n case (preg_match('#Priority MailTM#i', $service)):\n $time = $val['Days'];\n if ($time == '' || $time == 'No Data') {\n $time = '2 - 3 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;\n } elseif ($time == '1') {\n $time .= ' ' . MODULE_SHIPPING_USPS_TEXT_DAY;\n } else {\n $time .= ' ' . MODULE_SHIPPING_USPS_TEXT_DAYS;\n }\n break;\n case (preg_match('#Standard Post#i', $service)):\n $time = $val['Days'];\n if ($time == '' || $time == 'No Data') {\n $time = '4 - 7 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;\n } elseif ($time == '1') {\n $time .= ' ' . MODULE_SHIPPING_USPS_TEXT_DAY;\n } else {\n $time .= ' ' . MODULE_SHIPPING_USPS_TEXT_DAYS;\n }\n break;\n case (preg_match('#First\\-Class#i', $service)):\n $time = '2 - 5 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;\n break;\n case (preg_match('#Media Mail Parcel#i', $service)):\n default:\n $time = '';\n }\n $this->transittime[$service] = $time == '' ? '' : ' (' . $time . ')';\n//echo 'USPS parseDomesticLegacyAPITransitTimeResults $service: ' . $service . ' $val[CommitmentTime]: ' . ($val['CommitmentTime'] == '' ? '***' : $val['CommitmentTime']) . ' $val[Days]: ' . ($val['Days'] == '' ? '***' : $val['Days']) . ' $time: ' . ($time == '' ? '***' : $time) . ' FINAL: $this->transittime[$service]: ' . $this->transittime[$service] . '<br>';\n // do logging if the file was opened earlier by the config switch\n if ($fp) {\n fwrite($fp, date('M d Y G:i:s') . ' -- Transit Time' . \"\\nService\" . $service . \"\\nCommitmentTime (from USPS): \" . $val['CommitmentTime'] . \"\\nDays(from USPS): \" . $val['Days'] . \"\\n\" . '$time (calculated): ' . $time . \"\\nTranslation:\" . $this->transittime[$service] . \"\\n\\n\");\n }\n }\n // close log file if opened\n if ($fp) {\n fclose($fp);\n }\n }",
"function NodeTimeOut()\n\t{\n\t\techo \"\\nEvento de respuesta AnsTestNodeLink lanzado!!!\";\n\t\n\t\t//la func response solo responde al cliente que mando la trama que origino este nodetimeout\n\t\t$this->responseClientFunction( \"clienteNodeTimeOut\", array() );\n\t}",
"public function transit_time_helper($response){\n\t\tif (!property_exists($response,'TransitResponse'))\n\t\t\treturn 99;\n\t\t$services=$response->TransitResponse->ServiceSummary;\n\t\tforeach($services as $service){\n\t\t\tif($service->Service->Code=='GND')\n\t\t\t\treturn $service->EstimatedArrival->BusinessDaysInTransit;\n\t\t}\n\t\treturn 99;\n\t}",
"public function getResponseTime()\n {\n return $this->responseTime;\n }",
"public function getLastResponseInfo() {}",
"public function end_trace() {\n\t\t$this->request_end_microtime = microtime( true );\n\t\t$this->request_end_timestamp = $this->format_timestamp( $this->request_end_microtime );\n\n\t\treturn $this->request_end_timestamp;\n\t}",
"public function getTimeEnd();",
"public function getLastTransaction()\n {\n return $this->_mandrillResponse;\n }",
"public function getLastResponseTime()\n {\n return $this->_getProperty('lastresponsetime');\n }",
"public function getConsultReplyTime()\n {\n return $this->consult_reply_time;\n }",
"public function getCompletedTime();",
"public function getSmartDeliveryTimeEnd() {\n\t\treturn null;\n\t}",
"public function getRecommandEndTime() {\n return $this->get(self::RECOMMANDENDTIME);\n }",
"final public function getOperationTime(){}",
"public function testArdorGetTimeItemWillReturnArdorTime():void {\n\n // Prepare\n\n $now = Carbon::now();\n $response = new ArdorMockResponse(200, ['unixtime' => time(), 'time' => $now->timestamp, 'requestProcessingTime' => 0]);\n\n // Tests\n\n $server = new ArdorServerHandler();\n\n $result = $server->setClient($this->createApiMock([$response]))->getTimeItem();\n $this->assertEquals($now->toDateTimeString(), $result->carbon->toDateTimeString());\n\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads a schema from a string (containing serialized export of schema) | public function loadSchemaFromString($schema) {
$this->tables = unserialize($schema);
} | [
"public function loadSchemaFromString( $schema )\n\t{\n\t\t$this->tables = unserialize( $schema );\n\t}",
"public function registerSchemaFromString($schemaStr) {}",
"public static function getStructureFromString($schema);",
"private function _loadSchema()\r\n {\r\n if (!$this->_schema) {\r\n $schemaClass = $this->_collectionName . 'Schema';\r\n Ox_LibraryLoader::loadCode($schemaClass,array($this->_schemaDirectory),false);\r\n if (class_exists($schemaClass)) {\r\n $this->_schema = new $schemaClass();\r\n } else {\r\n $this->_schema = null;\r\n }\r\n }\r\n }",
"public function loadSchemaCode(string $schemaName);",
"public function load(string $schemaName): JsonDb;",
"public function loadSchemaPatterns()\n {\n $string = file_get_contents($this->getSchemaPath());\n $json = json_decode($string, true);\n\n $this->schema_patterns['networks_types'] = explode(\n '|',\n str_replace(\n ['^(', ')$'],\n ['', ''],\n $json['properties']['content']['properties']['networks']['items']['properties']['type']['pattern']\n )\n );\n }",
"protected function readSchema($schema)\n {\n if (is_string($schema) && file_exists($schema)) {\n $content = file_get_contents($schema);\n $schema = json_decode($content, true);\n }\n\n if (!is_array($schema)) {\n throw new Exception('Invalid file content, expected array got ' . gettype($file));\n }\n\n if (isset($schema['schema'])) {\n $this->schema = array_replace_recursive($this->schema, $schema['schema']);\n\n if (isset($schema['default'])) {\n $this->defaults = array_replace_recursive($this->defaults, $schema['default']);\n }\n } else {\n $this->schema = array_replace_recursive($this->schema, $schema);\n }\n }",
"public function loadFromString(string $string)\n {\n\n }",
"protected static function loadSchema()\n {\n return true;\n }",
"public static function load_pico_schema() {\n self::init_db();\n $schema_path = join( '/', array( APPLICATION_ROOT, self::SQLITE_SCHEMA_FILE ));\n $contents = file_get_contents( $schema_path );\n\n $dbh = Nano_Db::getAdapter();\n\n foreach ( explode( ';', $contents ) as $sql ) {\n $dbh->query( $sql );\n }\n }",
"abstract protected function _load_schema($information_schema);",
"public function buildSchema(string $class): Schema;",
"protected function loadSchema()\n {\n return true;\n }",
"public static function schema()\n {\n if (!file_exists(self::SCHEMA_FILENAME)) {\n throw new \\Exception(\"SaintCoinach schema ex.json file missing at: \". self::SCHEMA_FILENAME);\n }\n \n $schema = \\GuzzleHttp\\json_decode(\n file_get_contents(self::SCHEMA_FILENAME)\n );\n \n return $schema;\n }",
"public function loadSchema($file)\n {\n $doc = file_get_contents($file);\n if ($doc === false) {\n throw new FileNotFoundException(\"The schema '$file' could not be found.\");\n }\n\n $schema = json_decode($doc, true);\n if ($schema === null) {\n throw new JsonException(\"The schema '$file' does not contain a valid JSON document. JSON error: \" . json_last_error());\n }\n\n $this->schema = $schema;\n }",
"public function deserialize(string $string, string $type): object;",
"public function loadSpreadsheetFromString(string $contents): Spreadsheet\n {\n // Create new Spreadsheet\n $spreadsheet = new Spreadsheet();\n\n // Load into this instance\n return $this->loadStringOrFile('data://text/plain,' . urlencode($contents), $spreadsheet, true);\n }",
"public static function loadString(string $string): Graph\n {\n $loader = new FbpParser($string);\n $definition = $loader->run();\n\n return self::loadDefinition($definition);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Function:ShowHiddenInfoBox Created on Jul 05, 2013 Updated on Aug 25, 2013 Description: Show hidden info media box. In: Out:Hidden login box. | function ShowHiddenInfoBox()
{
echo " <div class=\"popup\" id=\"info_box\">\n";
echo " <form method=\"post\" action=\"#\">\n";
echo " <div class=\"close_left\"> </div>\n";
echo " <div class=\"close_right\">x</div>\n";
echo " <div class=\"title\">Info Box</div>\n";
//echo " <div class=\"message\"></div>\n";
echo " <div id=\"info_main\">\n";
echo " <div id=\"info_wrapper_left\">\n";
echo " <div id=\"info_left\"></div>\n";
echo " </div>\n";
echo " <div id=\"info_right\" class=\"fanart_space\">\n";
echo " <div id=\"info_fanart\"><img src=\"images/no_fanart.jpg\"></div>\n";
echo " <div id=\"info_video\"> </div>\n";
echo " <div id=\"info_audio\"> </div>\n";
echo " <div id=\"info_aspect\"> </div>\n";
echo " <div id=\"info_mpaa\"> </div>\n";
echo " </div>\n";
echo " <div id=\"info_plot\">Plot</div>\n";
echo " <div id=\"info_plot_text\"></div>\n";
echo " </div>\n";
echo " <div class=\"button\">\n";
echo " <button type=\"button\" class=\"close\">Close</button>\n";
echo " </div>\n";
echo " </form>\n";
echo " </div>\n";
} | [
"function thd_re_info_show_box() {\n\tthd_meta_box_callback(thd_re_meta_box_fields(), 'page');\n}",
"function showBox($head = null, $contents = null, $nooutput=0)\n\t{\n\t\tparent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);\n\t}",
"function thd_re_post_info_show_box() {\n\tthd_meta_box_callback(thd_re_post_meta_box_fields(), 'post');\n}",
"function showBox($head = null, $contents = null, $nooutput=0)\r\n {\r\n\t\treturn parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);\r\n\t}",
"function dispLoggedIn($arrLoginInfo) {\n\tglobal $MAIN_ROOT;\n\n\t/*\n\t $arrLoginInfo['memberID'] = $memberID;\n\t$arrLoginInfo['memberUsername'] = $memberUsername;\n\t$arrLoginInfo['memberRank'] = $memberRank;\n\t$arrLoginInfo['pmCID'] = $pmCID;\n\t$arrLoginInfo['pmCount'] = $dispPMCount;\n\t*/\n\n\t\n\t$dispLoggedinBox = \"\n\t\n\t\t<div class='loggedInBox'>\n\t\t\n\t\t\t<div style='float: left; width: 48%; overflow: hidden; text-overflow: ellipsis; height: 28px'>\n\t\t\t<b>Account Name:</b><br>\n\t\t\t<a href='\".$MAIN_ROOT.\"profile.php?mID=\".$arrLoginInfo['memberID'].\"'>\".$arrLoginInfo['memberUsername'].\"</a>\n\t\t\t</div>\n\t\t\t<div style='float: right; width: 48%; overflow: hidden; text-overflow: ellipsis; height: 28px'>\n\t\t\t<b>Rank:</b><br>\n\t\t\t\".$arrLoginInfo['memberRank'].\"\n\t\t\t</div>\n\t\t\t<div style='clear: both'></div>\n\t\t\t<div style='margin-top: 3px'>\n\t\t\t\t<b>Member Options:</b>\n\t\t\t\t<p align='center' style='margin: 0px; padding: 0px'>\n\t\t\t\t\t<a href='\".$MAIN_ROOT.\"members'>My Account</a> - \n\t\t\t\t\t<a href='\".$MAIN_ROOT.\"members/console.php?cID=\".$arrLoginInfo['pmCID'].\"'>PM Inbox \".$arrLoginInfo['pmCountDisp'].\"</a> - \n\t\t\t\t\t<a href='\".$MAIN_ROOT.\"members/signout.php'>Sign Out</a>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\t\";\n\t\n\t/*\n\t\t<div class='loggedInIMG'></div>\n\t\t<div class='menuLinks' style='padding-left: 8px'>\n\t\t\t<b>Account Name:</b><br>\n\t\t\t<a href='\".$MAIN_ROOT.\"profile.php?mID=\".$arrLoginInfo['memberID'].\"'>\".$arrLoginInfo['memberUsername'].\"</a>\n\t\t\t<hr style='width: 135px; margin: 6px 1px; padding: 0px; border: dotted whitesmoke 1px'>\n\t\t\t<b>Rank:</b><br>\n\t\t\t\".$arrLoginInfo['memberRank'].\"\n\t\t\t<hr style='width: 135px; margin: 6px 1px; padding: 0px; border: dotted whitesmoke 1px'>\n\t\t\t<b>Member Options:</b><br>\n\t\t\t<b>·</b> <a href='\".$MAIN_ROOT.\"members'>My Account</a><br>\n\t\t\t<b>·</b> <a href='\".$MAIN_ROOT.\"members/console.php?cID=\".$arrLoginInfo['pmCID'].\"'>PM Inbox \".$arrLoginInfo['pmCountDisp'].\"</a><br>\n\t\t\t<b>·</b> <a href='\".$MAIN_ROOT.\"members/signout.php'>Sign Out</a><br>\t\t\n\t\t</div>\n\t\n\t\";\n\t*/\n\t\n\t\n\treturn $dispLoggedinBox;\n}",
"private function show_hidden() {\n\n if (!empty($this->_hiddenfields)) {\n\n foreach ($this->_hiddenfields as $name => $value) {\n ?>\n <input type=\"hidden\" name=\"<?php echo $name; ?>\" id=\"<?php echo $name; ?>\" value=\"<?php echo $value; ?>\">\n <?php\n }\n\n // Clear the array\n $this->_hiddenfields = array();\n\n }\n }",
"function dispLoggedIn($arrLoginInfo) {\n\tglobal $MAIN_ROOT;\n\n\t/*\n\t $arrLoginInfo['memberID'] = $memberID;\n\t$arrLoginInfo['memberUsername'] = $memberUsername;\n\t$arrLoginInfo['memberRank'] = $memberRank;\n\t$arrLoginInfo['pmCID'] = $pmCID;\n\t$arrLoginInfo['pmCount'] = $dispPMCount;\n\t*/\n\t\n\t$dispLoggedinBox = \"\n\n\t\t<div class='loggedInIMG'></div>\n\t\t<div class='loggedInInfo'>\n\t\t\t<b>Account Name:</b> <a href='\".$MAIN_ROOT.\"profile.php?mID=\".$arrLoginInfo['memberID'].\"'>\".$arrLoginInfo['memberUsername'].\"</a><br>\n\t\t\t<b>Rank:</b> \".$arrLoginInfo['memberRank'].\"\n\t\t\t\n\t\t\t<div style='font-size: 10px; padding: 0px; position: relative; margin-left: -13px; margin-top: 8px; text-align: center; width: 254px'>\t<span style='font-size: 11px'><b>Member Options</b></span><br><a href='\".$MAIN_ROOT.\"members'>My Account</a> - <a href='\".$MAIN_ROOT.\"members/console.php?cID=\".$arrLoginInfo['pmCID'].\"'>PM Inbox \".$arrLoginInfo['pmCountDisp'].\"</a><br><a href='\".$MAIN_ROOT.\"members/signout.php'>Sign Out</a></div>\n\t\t</div>\n\";\n\n\t\n\t\n\treturn $dispLoggedinBox;\n}",
"function dispLoggedIn($arrLoginInfo) {\n\tglobal $MAIN_ROOT;\n\n\t/*\n\t $arrLoginInfo['memberID'] = $memberID;\n\t$arrLoginInfo['memberUsername'] = $memberUsername;\n\t$arrLoginInfo['memberRank'] = $memberRank;\n\t$arrLoginInfo['pmCID'] = $pmCID;\n\t$arrLoginInfo['pmCount'] = $dispPMCount;\n\t*/\n\n\t$memberInfo = $arrLoginInfo['memberInfo'];\n\t\n\tif($memberInfo['profilepic'] == \"\") {\n\t\t$memberInfo['profilepic'] = $MAIN_ROOT.\"themes/ghost/images/defaultprofile.png\";\n\t}\n\telse {\n\t\t$memberInfo['profilepic'] = $MAIN_ROOT.$memberInfo['profilepic'];\n\t}\n\t\n\t$dispLoggedinBox = \"\n\t\n\t\t<div class='loggedInProfilePic'>\n\t\t\t<img src='\".$memberInfo['profilepic'].\"' style='width: 75px; height: 100px; border: solid #4c555f 1px'>\n\t\t</div>\n\t\t\n\t\t<div class='loggedInInfo'>\n\t\t\t<div style='margin-bottom: 5px'>\n\t\t\t\t<b>Account Name:</b><br>\n\t\t\t\t<a href='\".$MAIN_ROOT.\"profile.php?mID=\".$memberInfo['member_id'].\"'>\".$memberInfo['username'].\"</a>\n\t\t\t</div>\n\t\t\t<div style='margin-bottom: 8px'>\n\t\t\t\t<b>Rank:</b><br>\n\t\t\t\t\".$arrLoginInfo['memberRank'].\"\n\t\t\t</div>\n\t\t\t<div style='text-align: center'>\n\t\t\t\t<b>Member Options:</b><br>\n\t\t\t\t<a href='\".$MAIN_ROOT.\"members'>My Account</a> - <a href='\".$MAIN_ROOT.\"members/console.php?cID=\".$arrLoginInfo['pmCID'].\"'>PM Inbox \".$arrLoginInfo['pmCountDisp'].\"</a> - <a href='\".$MAIN_ROOT.\"members/signout.php'>Sign Out</a>\n\t\t\t</div>\n\t\t</div>\n\t\";\t\n\t\n\t/*\n\t\t<div class='loggedInIMG'></div>\n\t\t<div class='menuLinks' style='padding-left: 8px'>\n\t\t\t<b>Account Name:</b><br>\n\t\t\t<a href='\".$MAIN_ROOT.\"profile.php?mID=\".$arrLoginInfo['memberID'].\"'>\".$arrLoginInfo['memberUsername'].\"</a>\n\t\t\t<hr style='width: 135px; margin: 6px 1px; padding: 0px; border: dotted whitesmoke 1px'>\n\t\t\t<b>Rank:</b><br>\n\t\t\t\".$arrLoginInfo['memberRank'].\"\n\t\t\t<hr style='width: 135px; margin: 6px 1px; padding: 0px; border: dotted whitesmoke 1px'>\n\t\t\t<b>Member Options:</b><br>\n\t\t\t<b>·</b> <a href='\".$MAIN_ROOT.\"members'>My Account</a><br>\n\t\t\t<b>·</b> <a href='\".$MAIN_ROOT.\"members/console.php?cID=\".$arrLoginInfo['pmCID'].\"'>PM Inbox \".$arrLoginInfo['pmCountDisp'].\"</a><br>\n\t\t\t<b>·</b> <a href='\".$MAIN_ROOT.\"members/signout.php'>Sign Out</a><br>\t\t\n\t\t</div>\n\t\n\t\";\n\t*/\n\t\n\t\n\treturn $dispLoggedinBox;\n}",
"function PrintHidden($szName, $szValue) {\n global $mc_bTRUE, $mc_bFALSE, $mc_szDatabasePath, $mc_szFormsPath, $m_bOnlyOneHint, $m_szHintsPrinted, $m_bFirstPageView;\n\n\t# Prints a hidden field and stores its value\n\tprint \"<INPUT TYPE=\\\"hidden\\\" NAME=\\\"$szName\\\" VALUE=\\\"$szValue\\\">\";\n}",
"function ShowHiddenActionBox()\r\n{\r\n // Note: This should als be used for Import and CleanLibrary.\r\n echo \" <div class=\\\"popup\\\" id=\\\"action_box\\\">\\n\";\r\n echo \" <form method=\\\"post\\\" action=\\\"#\\\">\\n\";\r\n echo \" <div class=\\\"close_left\\\"> </div>\\n\"; \r\n echo \" <div class=\\\"close_right\\\">x</div>\\n\";\r\n echo \" <div class=\\\"id\\\"></div>\\n\";\r\n echo \" <div class=\\\"xbmcid\\\"></div>\\n\";\r\n echo \" <div class=\\\"title\\\">Action Box</div>\\n\";\r\n echo \" <div class=\\\"message\\\"><br/></div>\\n\";\r\n \r\n // Refresh or Import div's.\r\n echo \" <div id=\\\"transfer\\\"><br/></div>\\n\";\r\n echo \" <div id=\\\"ready\\\"><br/></div>\\n\";\r\n \r\n echo \" <div id=\\\"action_wrapper\\\">\\n\";\r\n echo \" <div id=\\\"action_thumb\\\"><img src=\\\"\\\"/></div>\\n\";\r\n echo \" </div>\\n\";\r\n echo \" <div id=\\\"action_title\\\"> </div>\\n\";\r\n echo \" <div id=\\\"action_sub\\\"> </div>\\n\";\r\n echo \" <div class=\\\"progress\\\"></div>\\n\"; \r\n echo \" <div class=\\\"button\\\">\\n\";\r\n echo \" <button type=\\\"button\\\" class=\\\"yes\\\">Yes</button>\\n\";\r\n echo \" <button type=\\\"button\\\" class=\\\"no\\\">No</button>\\n\";\r\n echo \" </div>\\n\";\r\n echo \" </form>\\n\"; \r\n echo \" </div>\\n\";\r\n}",
"public function getHiddenInfo(){\n\t\treturn ($this->getHidden() ? 'yes' : 'no');\n\t}",
"public function show_info()\n {\n $vars = $this->get_info();\n\n if (!empty($vars['from']) && !empty($vars['date']) && $vars['timeout'] > 0) {\n $this->api->output->show_message('lastlogin.lastlogin_info', 'notice', $vars, false, $vars['timeout']);\n }\n }",
"function hiddenArtist($artist){\n\t\techo \"<input type='text' name='viewArtistId' value='$artist' style='display:none'></input>\";\n\t}",
"public function printHidden() {\n echo \"<input type='text' name='\" . $this->name . \"' class='hidden' value='\" . $this->value . \"'>\";\n }",
"function show_login_box()\n{\n\t$Feul = new Feul;\n\t//If The User Is Not Logged In - Display Login Box - If They Are Logged In, Display Nothing\n\tif(!isset($_SESSION['LoggedIn']))\n\t{\t\n\t\techo $Feul->getData('logincontainer');\n\t\t$is_loggedIn = $Feul->checkLogin();\n\t\t//HTML Code For Login Container\n\t\t?>\n\t\t<div id=\"login_box\" style=\"\">\n\t\t\t<h2 class=\"login_h2\">Вход</h2>\n\t\t\t<?php\n\t\t\t\tif(isset($_POST['username']) && isset($_POST['password']) && isset($_POST['login-form']) && $is_loggedIn == false)\n\t\t\t\t{\n\t\t\t\t\techo '<div class=\"error\">Sorry, your account could not be found. Please try again.</div>';\n\t\t\t\t}\n\t\t\t?>\n\t\t\t<form method=\"post\" action=\"<?php echo $_SERVER['REQUEST_URI']; ?>\" name=\"loginform\" id=\"loginform\">\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"username\">Имя пользователя: </label>\n\t\t\t\t\t<input type=\"text\" name=\"username\" class=\"user_login_username\" />\n\t\t\t\t</p>\n\t\t\t\t<p>\n\t\t\t\t\t<label for=\"username\">Пароль: </label>\n\t\t\t\t\t<input type=\"password\" name=\"password\" class=\"user_login_password\" />\n\t\t\t\t</p>\n\t\t\t\t<p>\n\t\t\t\t\t<input type=\"submit\" class=\"user_login_submit\" value=\"Войти\"/>\n\t\t\t\t</p>\n\t\t\t\t<input type=\"hidden\" name=\"login-form\" value=\"login\" />\n\t\t\t</form>\n\t\t\t<div style=\"clear:both\"></div>\n\t\t</div>\n\t\t<?php\n\t}\n}",
"function ffw_staff_hidden_callback( $args ) {\n global $ffw_staff_settings;\n\n $hidden = isset($args['hidden']) ? $args['hidden'] : false;\n\n if ( isset( $ffw_staff_settings[ $args['id'] ] ) )\n $value = $ffw_staff_settings[ $args['id'] ];\n else\n $value = isset( $args['std'] ) ? $args['std'] : '';\n\n $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';\n $html = '<input type=\"hidden\" class=\"' . $size . '-text\" id=\"ffw_staff_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_staff_settings_' . $args['section'] . '[' . $args['id'] . ']\" value=\"' . esc_attr( stripslashes( $value ) ) . '\"/>';\n $html .= '<label for=\"ffw_staff_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['std'] . '</label>';\n\n echo $html;\n}",
"function dfcg_ui_hidden_wpms() {\r\n\tglobal $dfcg_options;\r\n\t?>\r\n\t\t\r\n\t<?php // Always hidden in WPMS ?>\r\n\t<input name=\"dfcg_plugin_settings[imageurl]\" type=\"hidden\" value=\"<?php echo $dfcg_options['imageurl']; ?>\" />\r\n\t<input name=\"dfcg_plugin_settings[defimgfolder]\" type=\"hidden\" value=\"<?php echo $dfcg_options['defimgfolder']; ?>\" />\r\n\t<input name=\"dfcg_plugin_settings[defimgid]\" type=\"hidden\" value=\"<?php echo $dfcg_options['defimgid']; ?>\" />\r\n\t\t\r\n<?php }",
"public function ferry_after_login() {\n\t\tif ( ! empty( $_REQUEST[ self::SHOW_AFTER_LOGIN ] ) && isset( $this->registered[ $_REQUEST[ self::SHOW_AFTER_LOGIN ] ] ) ) {\n\t\t\techo '<input type=\"hidden\" name=\"' . esc_attr( self::SHOW_AFTER_LOGIN ) . '\" value=\"' . esc_attr( $_REQUEST[ self::SHOW_AFTER_LOGIN ] ) . '\">';\n\t\t}\n\t}",
"function AddHidden($name, $value)\n\t{\n\t\techo \"<input type=hidden id=$name name=$name value=\\\"$value\\\">\\n\";\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears out the collC001tForenses collection (array). This does not modify the database; however, it will remove any associated objects, causing them to be refetched by subsequent calls to accessor method. | public function clearC001tForenses()
{
$this->collC001tForenses = null; // important to set this to NULL since that means it is uninitialized
} | [
"public function clearC004tActaAies()\n\t{\n\t\t$this->collC004tActaAies = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearCasos()\n\t{\n\t\t$this->collCasos = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearCuentas()\n\t{\n\t\t$this->collCuentas = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clear( )\n {\n $this->collection = array( );\n }",
"public function clearC006tEvidenciasRelatedByCoCustodio()\n\t{\n\t\t$this->collC006tEvidenciasRelatedByCoCustodio = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearContratos()\n\t{\n\t\t$this->collContratos = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearC005tActaAnies()\n\t{\n\t\t$this->collC005tActaAnies = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearContadors()\n\t{\n\t\t$this->collContadors = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearViajes()\n {\n $this->collViajes = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearTbfilacalouross()\n\t{\n\t\t$this->collTbfilacalouross = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearDatas()\n {\n $this->collDatas = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clear() {\n // Drop collection.\n $this->collection->drop();\n }",
"public function clearConsents()\n\t{\n\t\t$this->collConsents = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clear() {\n $objects =& $this->associates();\n foreach ($objects as $associate) {\n $this->association->remove_associate($this->record, $this->proxy, $associate);\n }\n $this->associates = array();\n $this->count = 0;\n }",
"public function clearRecibos()\n\t{\n\t\t$this->collRecibos = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearCuentaCorrientes()\n\t{\n\t\t$this->collCuentaCorrientes = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearWhyCames()\n {\n $this->collWhyCames = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearRems()\n {\n $this->collRems = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearFtesalaryadvances()\n {\n $this->collFtesalaryadvances = null; // important to set this to NULL since that means it is uninitialized\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the value appears to have tags in it we'll run it through the parse_globals method. | private function parseTags($value)
{
if (strpos($value, '{') !== FALSE && strpos($value, '}') !== FALSE)
{
return ee()->TMPL->parse_globals($value);
}
return $value;
} | [
"function _parseGlobals($template)\n\t{\n\t\t$globalVars = $this->_globals;\n\t\t$this->_applyModifers($template, $globalVars);\n\n\t\tforeach( $globalVars as $key => $value )\n\t\t{\n\t\t\tif( is_array( $value ) )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$var = $this->_startTag.$key.$this->_endTag;\n\t\t\t$this->_templates[$template]['result'] = str_replace( $var, $value, $this->_templates[$template]['result'] );\n\t\t}\n\t\treturn true;\n\t}",
"protected function parseTagValue($tagValue)\n {\n }",
"private function processToken(&$value) {\n if (is_string($value)) {\n $token_service = \\Drupal::token();\n\n $token_info = $token_service->getInfo();\n\n if ($found_tokens = $token_service->scan($value)) {\n foreach ($found_tokens as $context => $token_group) {\n if (in_array($context, array_keys($token_info['types']))) {\n foreach ($token_group as $token) {\n $context_variable = str_replace('-','_', $context);\n\n \\Drupal::moduleHandler()->alter('dx8_' . $context . '_drupal_token_context', $context_variable);\n\n // If token has been detected replace potential breaking chars with nothing as they are not valid\n $context = str_replace(['[', ']', '{', '}'], '', $context);\n\n $twig_token = '[token.' . str_replace([\n '[',\n ']',\n '{',\n '}',\n ], '', $token) . '|' . $context . '|' . $context_variable . ']';\n $value = str_replace($token, $twig_token, $value);\n }\n }\n }\n }\n }\n }",
"abstract public function parseValue($value);",
"function parse_php ($value)\n{\n\tob_start();\n\t$value = preg_replace('/\\<\\?([^php|^=])/', 'gimle-hopefully-safe-replace-string$1', $value);\n\teval('?>' . $value);\n\t$return = ob_get_contents();\n\tob_end_clean();\n\t$return = str_replace('gimle-hopefully-safe-replace-string', '<?', $return);\n\treturn $return;\n}",
"function scan_globals() {\n reset($GLOBALS);\n foreach ($GLOBALS as $k=>$v)\n $GLOB[$k]=$v;\n $this->assign(\"PHP\",$GLOB); /* access global variables as {PHP.HTTP_HOST} in your template! */\n }",
"abstract protected function parsingTag();",
"private function globalVariable($value) {\r\n if ($value != null) {\r\n $this->_except(\"Directive \\\"\" . $this->key . \"\\\" does not accept an argument\");\r\n }\r\n\r\n $globval = $this->caller->_globals()->get($this->caller->identifier());\r\n if ($globval != null) { # invoke GET behavior\r\n echo \"USING GET BEHAVIOR IN \" . $this->caller->identifier() . \"<br>\\n\";\r\n $this->caller->replace($globval); #FIXME: this should replace the caller with the global reference, not just use the global value\r\n }\r\n else { # invoke SET behavior\r\n echo \"USING SET BEHAVIOR IN \" . $this->caller->identifier() . \"<br>\\n\";\r\n $this->caller->_globals()->add(new Resource($this->caller->identifier(), $this->caller));\r\n }\r\n }",
"public function ParseLanguageVariables(){\n\t\tpreg_match_all('#\\{\\$lang\\.([^}]*)\\}#is', $this->TemplateData, $matches);\n\n\t\tforeach($matches[1] as $regexKey=>$value){\n\t\t\t$value = $this->Tpl2PhpVars($value, $this->GetLangFunction.'(', ')');\n\t\t\t$this->TemplateData = str_replace($matches[0][$regexKey], '<?php echo '.$value.'; ?>', $this->TemplateData);\n\t\t}\n\t}",
"public function parse($value);",
"function parse() {\n $str = $this->content;\n foreach ($this->vars as $name=>$val) {\n $str = str_replace('{'.$name.'}', $val, $str);\n }\n // return template content with real values\n return $str;\n\n }",
"function _parseVar ($wholetag, $tag, $varname, $escape, $format, $namespace) {\r\n\t\t\tif (!empty($namespace)) $namespace = substr($namespace, 0, -1);\r\n\t\t\t$wholetag = stripslashes($wholetag);\r\n\r\n\t\t\tif (count($this->_namespace) == 0 || $namespace == 'global') {\r\n\t\t\t\t$var1 = '$this->_vars[\\''.$varname.'\\']';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$var1build = \"\\$this->_arrvars\";\r\n\t\t\t\t$numnamespaces = count($this->_namespace);\r\n\t\t\t\tfor ($i=0; $i < $numnamespaces; $i++) {\r\n\t\t\t\t\tif ($this->_namespace[$i] == $namespace || (($i + 1) == $numnamespaces && !empty($namespace))) {\r\n\t\t\t\t\t\t$var1build .= \"['\".$namespace.\"'][\\$_\".$i.\"]\";\r\n\t\t\t\t\t\tbreak 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$var1build .= \"['\".$this->_namespace[$i].\"'][\\$_\".$i.\"]\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$var1 = $var1build . '[\\''.$varname.'\\']';\r\n\r\n\t\t\t\tif ($this->OPTIONS['GLOBAL_VARS'] && empty($namespace)) {\r\n\t\t\t\t\t$var2 = '$this->_vars[\\''.$varname.'\\']';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$beforevar = '';\r\n\t\t\t$aftervar = '';\r\n\t\t\tif (!empty($escape) && isset($this->ESCAPE_TAGS[$escape])) {\r\n\t\t\t\t$beforevar .= $this->ESCAPE_TAGS[$escape]['open'];\r\n\t\t\t\t$aftervar = $this->ESCAPE_TAGS[$escape]['close'] . $aftervar;\r\n\t\t\t}\r\n\r\n\t\t\tif (!empty($format)) {\r\n\t\t\t\tif (isset($this->FORMAT_TAGS[$format])) {\r\n\t\t\t\t\t$beforevar .= $this->FORMAT_TAGS[$format]['open'];\r\n\t\t\t\t\t$aftervar = $this->FORMAT_TAGS[$format]['close'] . $aftervar;\r\n\t\t\t\t}\r\n\t\t\t\telseif (function_exists($format)) {\r\n\t\t\t\t\t$beforevar .= $format.'(';\r\n\t\t\t\t\t$aftervar = ')'. $aftervar;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// build return values\r\n\t\t\t$retstr = 'if ('.$var1.' !== null) { ';\r\n\t\t\t$retstr .= 'print('.$beforevar.$var1.$aftervar.'); ';\r\n\t\t\t$retstr .= '}';\r\n\r\n\t\t\tif (@$var2) {\r\n\t\t\t\t$retstr .= ' elseif ('.$var2.' !== null) { ';\r\n\t\t\t\t$retstr .= 'print('.$beforevar.$var2.$aftervar.'); ';\r\n\t\t\t\t$retstr .= '}';\r\n\t\t\t}\r\n\r\n\t\t\tswitch (strtolower($this->OPTIONS['UNKNOWNS'])) {\r\n\t\t\t\tcase 'comment':\r\n\t\t\t\t\t$comment = addcslashes('<!-- unknown variable '.ereg_replace('<!--|-->', '', $wholetag).'//-->', '\"');\r\n\t\t\t\t\t$retstr .= ' else { print(\"'.$comment.'\"); $this->_setUnknown(\"'.$varname.'\"); }';\r\n\t\t\t\t\treturn $retstr;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'leave':\r\n\t\t\t\t\t$retstr .= ' else { print(\"'.addcslashes($wholetag, '\"').'\"); $this->_setUnknown(\"'.$varname.'\"); }';\r\n\t\t\t\t\treturn $retstr;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'print':\r\n\t\t\t\t\t$retstr .= ' else { print(\"'.htmlspecialchars($wholetag, ENT_QUOTES).'\"); $this->_setUnknown(\"'.$varname.'\"); }';\r\n\t\t\t\t\treturn $retstr;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ignore':\r\n\t\t\t\t\treturn $retstr;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'remove':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$retstr .= ' else { $this->_setUnknown(\"'.$varname.'\"); }';\r\n\t\t\t\t\treturn $retstr;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}",
"public function populatePostGlobals()\n {\n $matches = [];\n foreach ($this->vars as $v) {\n if (preg_match('/^(.*)\\[(.*)\\]$/', key($v), $matches)) {\n $varname = self::sanitizeVarname($matches[1]);\n if (!isset($_POST[$varname])) {\n $_POST[$varname] = [];\n }\n if (!empty($matches[2])) {\n $_POST[$varname][$matches[2]] = [];\n }\n if (is_array($_POST[$varname])) {\n if (empty($matches[2])) {\n $_POST[$varname][] = current($v);\n } else {\n $_POST[$varname][$matches[2]] = current($v);\n }\n } else {\n $_POST[$varname] = [current($v)];\n }\n } else {\n $varname = self::sanitizeVarname(key($v));\n $_POST[$varname] = current($v);\n }\n }\n }",
"public function valueHasVar($value) {\n\t\tif(self::stringHasOperator($value)) return false;\n\t\tif(strpos($value, '.') !== false) {\n\t\t\tlist($name, $subname) = explode('.', $value);\n\t\t} else {\n\t\t\t$name = $value;\n\t\t\t$subname = '';\n\t\t}\n\t\tif(!in_array($name, $this->allowedParseVars)) return false;\n\t\tif(strlen($subname) && $this->wire('sanitizer')->fieldName($subname) !== $subname) return false;\n\t\treturn true; \n\t}",
"private function collect_variables() {\n\t\t/*\n\t\t * Make sure we are working with a variable,\n\t\t * get its value if so.\n\t\t */\n\n\t\tif (\n\t\t\t'T_VARIABLE' !==\n\t\t\t\t$this->tokens[ $this->stackPtr ]['type']\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t$current_var_name = $this->tokens[\n\t\t\t$this->stackPtr\n\t\t]['content'];\n\n\t\t/*\n\t\t * Find assignments ( $foo = \"bar\"; )\n\t\t * -- do this by finding all non-whitespaces, and\n\t\t * check if the first one is T_EQUAL.\n\t\t */\n\n\t\t$t_item_key = $this->phpcsFile->findNext(\n\t\t\t[ T_WHITESPACE ],\n\t\t\t$this->stackPtr + 1,\n\t\t\tnull,\n\t\t\ttrue,\n\t\t\tnull,\n\t\t\ttrue\n\t\t);\n\n\t\tif ( false === $t_item_key ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'T_EQUAL' !== $this->tokens[ $t_item_key ]['type'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 1 !== $this->tokens[ $t_item_key ]['length'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Find encapsulated string ( \"\" )\n\t\t */\n\t\t$t_item_key = $this->phpcsFile->findNext(\n\t\t\t[ T_CONSTANT_ENCAPSED_STRING ],\n\t\t\t$t_item_key + 1,\n\t\t\tnull,\n\t\t\tfalse,\n\t\t\tnull,\n\t\t\ttrue\n\t\t);\n\n\t\tif ( false === $t_item_key ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * We have found variable-assignment,\n\t\t * register its name and value in the\n\t\t * internal array for later usage.\n\t\t */\n\n\t\t$current_var_value =\n\t\t\t$this->tokens[ $t_item_key ]['content'];\n\n\t\t$this->variables_arr[ $current_var_name ] =\n\t\t\tstr_replace( \"'\", '', $current_var_value );\n\t}",
"public function testSetTagValueProcessor()\n {\n $listener = new Listener();\n $listener->setTagValueProcessor(function (&$text, $tag) {\n $text = \"processed-$tag-$text\";\n });\n\n $parser = new Parser();\n $parser->addListener($listener);\n $parser->parseFile(__DIR__ . '/../resources/valid/basic.bib');\n\n $entries = $listener->export();\n $entry = $entries[0];\n $this->assertSame('processed-type-basic', $entry['type']);\n $this->assertSame('processed-foo-bar', $entry['foo']);\n }",
"abstract protected function processVariableInString(File $phpcsFile, $stackPtr);",
"protected function parseVariable()\n\t{\n\t\t$this->skipToken();\n\t\treturn $this->parseVarDeclaration();\n\t}",
"function parseTags($template) {\n\t\t$result = array();\n\t\t$suchmuster = '/\\$\\{(\\w*):(\\w*\\|?\\w+)\\}/i';\n\t\t$temp = array();\n\t\tpreg_match_all($suchmuster, $template, $temp, PREG_SET_ORDER);\n\t\tforeach ($temp as $item) {\n\t\t\t$result[$item[1] . ':' . $item[2]] = array('type' => $item[1], 'value' => $item[2]);\n\t\t}\n\t\t$this->tags = $result;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare each SCSS file for aggregation. | protected function filesPrepareFileContents($filepath){
// Get the file contents
$data = file_get_contents($filepath);
$this->includedFiles[$filepath] = $filepath;
// Look for internal imports
preg_match_all('/(?<!\/\/)(?<!\t)(?<! )@import ["|\'](.*)["|\'];/', $data, $results);
if(!empty($results[1])){
$info = pathinfo($filepath);
foreach($results[1] as $name){
// Imports that are bourbon are allowed to pass through as SASSquatch
// support them.
if(strpos($name, 'bourbon') !== false) continue;
$importpath = $info['dirname'] . '/' . $name .'.scss';
// Add an unscore per SCSS to the filename.
$importpath = str_replace('/' . basename($importpath), '/_' . basename($importpath), $importpath);
$filedata = '// SONAR IGNORE IMPORT '.$name;
$pattern = '/(?<!\/\/)(?<!\t)(?<! )@import ["|\']('. str_replace('/', '\/', $name) .')["|\'];/';
// Files only need to be included once
if(!isset($this->includedFiles[$importpath])){
if(file_exists($importpath)){
$filedata = $this->filesPrepareFileContents($importpath);
}
}
$data = preg_replace($pattern, $filedata, $data);
}
}
$data = "// SONAR IMPORT $filepath\n" . $data;
// TODO: Remove once node-sass has imagePath support
$data = preg_replace('!image-url\([\'|"](.*?)[\'|"]\)!', 'url('.$this->imagesPath().'/$1)', $data);
// TODO: Remove once node-sass has fontPath support
$data = preg_replace('!font-url\([\'|"](.*?)[\'|"]\)!', 'url('.$this->fontsPath().'/$1)', $data);
return $data;
} | [
"private function sass() {\n\t\t// get all sass dirs\n\t\tforeach ($this->localStatic[ __FUNCTION__ ] as $dir) {\n\t\t\t$this->start('Converting SASS to CSS in ' . $dir);\n\n\t\t\tforeach (glob($dir . DIRECTORY_SEPARATOR . '*.{scss,sass}', GLOB_BRACE) as $file) {\n\t\t\t\t//skip if partial\n\t\t\t\t$output = basename($file);\n\t\t\t\tif (substr($output, 0, 1) === '_')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$this->start('Working on ' . $output);\n\t\t\t\t\n\t\t\t\t$scss = (substr($file, -5) === '.scss');\n\t\t\t\t\n\t\t\t\t// Add Constants variables \n\t\t\t\tif(isset($GLOBALS[\"constants\"])) {\n\t\t\t\t\t$old = $file;\n\t\t\t\t\t// sass which will actuall be compiled [hidden]\n\t\t\t\t\t$file .= md5(time()) . '.sex';\n\t\t\t\t\t$f = fopen($file, 'w');\n\t\t\t\t\texec('attrib +H ' . escapeshellarg($file));\n\n\t\t\t\t\t// get the URL Constants\n\t\t\t\t\t$const = array();\n\t\t\t\t\tforeach ($GLOBALS[\"constants\"] as $name => $val)\n\t\t\t\t\t\t$const[] = '$const-' . str_replace('\\\\', '-', strtolower($name)) . ': \\'' . $val . '\\' !default;';\n\t\t\t\t\t\n\t\t\t\t\t// add URL vars to temp sass file\n\t\t\t\t\tfwrite($f, implode(PHP_EOL, $const));\n\t\t\t\t\tfwrite($f, file_get_contents($old));\n\t\t\t\t\tfclose($f);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// the correct path for output\n\t\t\t\techo $output = $this->tmp[ __FUNCTION__ ] . $output;\n\t\t\t\t$output = substr($output, 0, -4) . 'css';\n\n\t\t\t\t// make sure path is ready\n\t\t\t\tself::readyDir($output);\n\n\n\t\t\t\t// run sass\n\t\t\t\t$this->runLocal(['sass',\n\t\t\t\t\t($scss ? '--scss' : null),\n\t\t\t\t\t'--trace',\n\t\t\t\t\t'--unix-newlines',\n\t\t\t\t\t\n\t\t\t\t\t'--style',\n\t\t\t\t\t($this->compress ? 'compressed --sourcemap=none' : 'expanded -l'),\n\t\t\t\t\t\n\t\t\t\t\t$file,\n\t\t\t\t\t$output,\n\t\t\t\t]);\n\n\t\t\t\t$this->finish();\n\t\t\t}\n\t\t\t\n\t\t\tforeach (glob($dir . DIRECTORY_SEPARATOR . '*.sex') as $file)\n\t\t\t\tunlink($file);\n\n\t\t\t$this->finish();\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"protected function initScss() {\n\t\t$sass = $this->sass;\n\t\t$scsses = get_default($this->config, 'scss');\n\t\tif($sass && $scsses) {\n\t\t\t// Add the include path, so that others can just import the scss this widget provided\n\t\t\t$sass->addIncludePath(path_join($this->base_dir, 'scss'));\n\n\t\t\t$scss_config = $scsses;\n\t\t\t$depends = get_default($scss_config, 'depends');\n if($depends) {\n\t\t\t\tif(!is_array($depends)) {\n\t\t\t\t\t$depends = array($depends);\n\t\t\t\t}\n\n\t\t\t\tforeach($depends as $d) {\n\t\t\t\t\tclips_add_scss($d);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\n\t\t\t// Add the scss files\n\t\t\t$files = get_default($scss_config, 'files');\n\t\t\tif($files) {\n\t\t\t\tif(!is_array($files))\n\t\t\t\t\t$files = array($files);\n foreach($files as $o) {\n\t\t\t\t\tif(is_array($o)) {\n\t\t\t\t\t\tforeach($o as $k => $v) {\n\t\t\t\t\t\t\t// This is file => query part\n\t\t\t\t\t\t\tif(!browser_match($v)) {\n\t\t\t\t\t\t\t\t// If the browser won't match this\n\t\t\t\t\t\t\t\t// JavaScript\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$file = $k;\n\t\t\t\t\t\t\tclips_add_scss(path_join($this->rel_dir, 'scss', $file));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$file = $o;\n\t\t\t\t\tclips_add_scss(path_join($this->base_dir, 'scss', $file));\n }\n }\n\t\t}\n\t}",
"protected function processCSSfiles() {\n // fetch all remaining css contents\n $this->getCSSfiles();\n\n // minify, compress and merging\n foreach ($this->css as $relation => $cssByRelation) {\n foreach ($cssByRelation as $media => $cssByMedia) {\n $mergedContent = '';\n $firstFreeIndex = -1;\n foreach ($cssByMedia as $index => $cssProperties) {\n $newFile = '';\n\n // file should be minified\n if ($this->extConfig['css.']['minify.']['enable'] === '1' &&\n !$cssProperties['minify-ignore']\n ) {\n $newFile = $this->minifyCSSfile($cssProperties);\n }\n\n // file should be merged\n if ($this->extConfig['css.']['merge.']['enable'] === '1' &&\n !$cssProperties['merge-ignore']\n ) {\n if ($firstFreeIndex < 0) {\n $firstFreeIndex = $index;\n }\n\n // add content\n $mergedContent .= $cssProperties['content'] . LF;\n\n // remove file from array\n unset($this->css[$relation][$media][$index]);\n\n // we doesn't need to compress or add a new file to the array,\n // because the last one will finally not be needed anymore\n continue;\n }\n\n // file should be compressed instead?\n if ($this->extConfig['css.']['compress.']['enable'] === '1' &&\n function_exists('gzcompress') && !$cssProperties['compress-ignore']\n ) {\n $newFile = $this->compressCSSfile($cssProperties);\n }\n\n // minification or compression was used\n if ($newFile !== '') {\n $this->css[$relation][$media][$index]['file'] = $newFile;\n $this->css[$relation][$media][$index]['content'] =\n $cssProperties['content'];\n $this->css[$relation][$media][$index]['basename'] =\n $cssProperties['basename'];\n }\n }\n\n // save merged content inside a new file\n if ($this->extConfig['css.']['merge.']['enable'] === '1' && $mergedContent !== '') {\n if ($this->extConfig['css.']['uniqueCharset.']['enable'] === '1') {\n $mergedContent = $this->uniqueCharset($mergedContent);\n }\n\n // Change from scriptmergerbless begin\n $SplitCSS = new SplitCSS($this->extConfig);\n $cssData = $SplitCSS->init($mergedContent);\n\n foreach($cssData as $mergedContent) {\n // Change from scriptmergerbless end\n if ($this->extConfig['css.']['uniqueCharset.']['enable'] === '1') {\n $mergedContent = $this->uniqueCharset($mergedContent);\n }\n // create property array\n $properties = array(\n 'content' => $mergedContent,\n 'basename' => 'head-' . md5($mergedContent) . '.merged'\n );\n\n // write merged file in any case\n $newFile = $this->tempDirectories['merged'] . $properties['basename'] . '.css';\n if (!file_exists($newFile)) {\n t3lib_div::writeFile($newFile, $properties['content']);\n }\n\n // file should be compressed\n if ($this->extConfig['css.']['compress.']['enable'] === '1' &&\n function_exists('gzcompress')\n ) {\n $newFile = $this->compressCSSfile($properties);\n }\n\n // add new entry\n $this->css[$relation][$media][$firstFreeIndex]['file'] = $newFile;\n $this->css[$relation][$media][$firstFreeIndex]['content'] =\n $properties['content'];\n $this->css[$relation][$media][$firstFreeIndex]['basename'] =\n $properties['basename'];\n\n $firstFreeIndex++;\n // Change from scriptmergerbless begin\n }\n // Change from scriptmergerbless end\n\n }\n }\n }\n\n // write the conditional comments and possibly merged css files back to the document\n $this->writeCSStoDocument();\n }",
"function fett_sonar_scss_alter(&$groups){\n if(!empty($groups[0]) && !empty($groups[1])){\n $files = array(\n 'libraries/foundation/scss/foundation/_functions.scss',\n 'assets/scss/libraries/_variables.scss',\n 'assets/scss/libraries/_mixins.scss',\n 'assets/scss/libraries/_foundation.scss',\n 'assets/scss/_variables.scss',\n 'assets/scss/_mixins.scss',\n 'assets/scss/libraries/_foundation.scss',\n 'libraries/foundation/scss/foundation/components/_global.scss',\n );\n $includes = array();\n foreach($files as $needle){\n foreach($groups[0] as $key => $file){\n if(strpos($key, $needle) !== FALSE){\n $file['every_page'] = FALSE;\n $includes[$key] = $file;\n $includes[$key]['weight'] = $includes[$key]['weight'] - $includes[$key]['group'];\n }\n }\n }\n $groups[1] = $includes + $groups[1];\n }\n}",
"public static function updateSassResources()\n {\n $files = [\n 'app.scss',\n '_mixins.scss',\n '_grid.scss',\n '_vars.scss',\n '_skeleton.scss',\n ];\n\n static::copyNewFiles($files, 'resources/sass', 'resource_path', 'sass');\n }",
"function generate_file()\r\n { \r\n if(!class_exists('\\Leafo\\ScssPhp\\Compiler')) return;\r\n // Theme\r\n $scss_dir = get_template_directory() . '/assets/scss/';\r\n $css_dir = get_template_directory() . '/assets/css/';\r\n $css_file = $css_dir . 'theme.css';\r\n // Child Theme\r\n $child_scss_dir = get_stylesheet_directory() . '/assets/scss/';\r\n $child_css_dir = get_stylesheet_directory() . '/assets/css/';\r\n $child_css_file = $child_css_dir . 'child-theme.css';\r\n\r\n $this->scssc = new \\Leafo\\ScssPhp\\Compiler();\r\n $this->scssc->setImportPaths( $scss_dir );\r\n\r\n $_options = $scss_dir . 'options.scss';\r\n\r\n $this->redux->filesystem->execute( 'put_contents', $_options, array(\r\n 'content' => $this->options_output()\r\n ) );\r\n \r\n /**\r\n * build source map\r\n * this used for load scss file when dev_mode is on\r\n * @source: https://github.com/leafo/scssphp/wiki/Source-Maps\r\n */\r\n $this->scssc->setSourceMap(\\Leafo\\ScssPhp\\Compiler::SOURCE_MAP_FILE);\r\n if(is_child_theme()){\r\n $this->scssc->setSourceMapOptions(array(\r\n 'sourceMapWriteTo' => $child_css_file . \".map\",\r\n 'sourceMapURL' => \"child-theme.css.map\",\r\n 'sourceMapFilename' => $child_css_file,\r\n 'sourceMapBasepath' => $child_scss_dir,\r\n 'sourceRoot' => $child_scss_dir,\r\n ));\r\n } else {\r\n $this->scssc->setSourceMapOptions(array(\r\n 'sourceMapWriteTo' => $css_file . \".map\",\r\n 'sourceMapURL' => \"theme.css.map\",\r\n 'sourceMapFilename' => $css_file,\r\n 'sourceMapBasepath' => $scss_dir,\r\n 'sourceRoot' => $scss_dir,\r\n ));\r\n }\r\n // end build source map\r\n \r\n /* $this->scssc->setFormatter('Leafo\\ScssPhp\\Formatter\\Nested'); */\r\n $this->scssc->setFormatter('Leafo\\ScssPhp\\Formatter\\Crunched');\r\n \r\n $this->redux->filesystem->execute( 'put_contents', $css_file, array(\r\n 'content' => $this->scssc->compile( '@'.'import \"theme.scss\"' )\r\n ) );\r\n if(is_child_theme()){\r\n $this->redux->filesystem->execute( 'put_contents', $child_css_file, array(\r\n 'content' => $this->scssc->compile( '@'.'import \"child-theme.scss\"' )\r\n ) );\r\n }\r\n }",
"private function finalize_styles() {\n\t\t$stylesheet_groups = [\n\t\t\tself::STYLE_AMP_CUSTOM_GROUP_INDEX => [\n\t\t\t\t'source_map_comment' => \"\\n\\n/*# sourceURL=amp-custom.css */\",\n\t\t\t\t'cdata_spec' => $this->style_custom_cdata_spec,\n\t\t\t\t'included_count' => 0,\n\t\t\t\t'import_front_matter' => '', // Extra @import statements that are prepended when fetch fails and validation error is rejected.\n\t\t\t],\n\t\t\tself::STYLE_AMP_KEYFRAMES_GROUP_INDEX => [\n\t\t\t\t'source_map_comment' => \"\\n\\n/*# sourceURL=amp-keyframes.css */\",\n\t\t\t\t'cdata_spec' => $this->style_keyframes_cdata_spec,\n\t\t\t\t'included_count' => 0,\n\t\t\t\t'import_front_matter' => '',\n\t\t\t],\n\t\t];\n\n\t\t$imported_font_urls = [];\n\n\t\t// Divide pending stylesheet between custom and keyframes, and calculate size of each (before tree shaking).\n\t\tforeach ( $this->pending_stylesheets as $i => $pending_stylesheet ) {\n\t\t\tforeach ( $pending_stylesheet['tokens'] as $j => $part ) {\n\t\t\t\tif ( is_string( $part ) && 0 === strpos( $part, '@import' ) ) {\n\t\t\t\t\t$stylesheet_groups[ $pending_stylesheet['group'] ]['import_front_matter'] .= $part; // @todo Not currently relayed in stylesheet data.\n\t\t\t\t\tunset( $this->pending_stylesheets[ $i ]['tokens'][ $j ] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $pending_stylesheet['imported_font_urls'] ) ) {\n\t\t\t\t$imported_font_urls = array_merge( $imported_font_urls, $pending_stylesheet['imported_font_urls'] );\n\t\t\t}\n\t\t}\n\n\t\t// Process the pending stylesheets.\n\t\tforeach ( array_keys( $stylesheet_groups ) as $group ) {\n\t\t\t$stylesheet_groups[ $group ]['included_count'] = $this->finalize_stylesheet_group( $group, $stylesheet_groups[ $group ] );\n\t\t}\n\n\t\t// If we're not working with the document element (e.g. for Customizer rendered partials) then there is nothing left to do.\n\t\tif ( empty( $this->args['use_document_element'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add style[amp-custom] to document.\n\t\tif ( $stylesheet_groups[ self::STYLE_AMP_CUSTOM_GROUP_INDEX ]['included_count'] > 0 ) {\n\t\t\t/*\n\t\t\t * On AMP-first themes when there are new/rejected validation errors present, a parsed stylesheet may include\n\t\t\t * @import rules. These must be moved to the beginning to be honored.\n\t\t\t */\n\t\t\t$css = $stylesheet_groups[ self::STYLE_AMP_CUSTOM_GROUP_INDEX ]['import_front_matter'];\n\n\t\t\t$css .= implode( '', $this->get_stylesheets() );\n\t\t\t$css .= $stylesheet_groups[ self::STYLE_AMP_CUSTOM_GROUP_INDEX ]['source_map_comment'];\n\n\t\t\t// Create the style[amp-custom] element and add it to the <head>.\n\t\t\t$this->amp_custom_style_element = $this->dom->createElement( 'style' );\n\t\t\t$this->amp_custom_style_element->setAttribute( 'amp-custom', '' );\n\t\t\t$this->amp_custom_style_element->appendChild( $this->dom->createTextNode( $css ) );\n\t\t\t$this->dom->head->appendChild( $this->amp_custom_style_element );\n\t\t}\n\n\t\t/*\n\t\t * Add font stylesheets from CDNs which were extracted from @import rules.\n\t\t * We can't add crossorigin=anonymous to these since such a CORS request would not be made in the non-AMP version,\n\t\t * and so if the service worker cached the opaque response on the non-AMP version then it wouldn't be usable in\n\t\t * the AMP version if it was requested with CORS.\n\t\t */\n\t\tforeach ( array_unique( $imported_font_urls ) as $imported_font_url ) {\n\t\t\t$link = $this->dom->createElement( 'link' );\n\t\t\t$link->setAttribute( 'rel', 'stylesheet' );\n\t\t\t$link->setAttribute( 'href', $imported_font_url );\n\t\t\t$this->dom->head->appendChild( $link );\n\t\t}\n\n\t\t// Add style[amp-keyframes] to document.\n\t\tif ( $stylesheet_groups[ self::STYLE_AMP_KEYFRAMES_GROUP_INDEX ]['included_count'] > 0 ) {\n\t\t\t$css = $stylesheet_groups[ self::STYLE_AMP_KEYFRAMES_GROUP_INDEX ]['import_front_matter'];\n\n\t\t\t$css .= implode(\n\t\t\t\t'',\n\t\t\t\twp_list_pluck(\n\t\t\t\t\tarray_filter(\n\t\t\t\t\t\t$this->pending_stylesheets,\n\t\t\t\t\t\tstatic function( $pending_stylesheet ) {\n\t\t\t\t\t\t\treturn $pending_stylesheet['included'] && self::STYLE_AMP_KEYFRAMES_GROUP_INDEX === $pending_stylesheet['group'];\n\t\t\t\t\t\t}\n\t\t\t\t\t),\n\t\t\t\t\t'serialized'\n\t\t\t\t)\n\t\t\t);\n\t\t\t$css .= $stylesheet_groups[ self::STYLE_AMP_KEYFRAMES_GROUP_INDEX ]['source_map_comment'];\n\n\t\t\t$style_element = $this->dom->createElement( 'style' );\n\t\t\t$style_element->setAttribute( 'amp-keyframes', '' );\n\t\t\t$style_element->appendChild( $this->dom->createTextNode( $css ) );\n\t\t\t$this->dom->body->appendChild( $style_element );\n\t\t}\n\n\t\t$this->remove_admin_bar_if_css_excluded();\n\t\t$this->add_css_budget_to_admin_bar();\n\t}",
"private function getSassFiles()\n\t{\n\t\t$files = $this->fs->Allfiles($this->sassDirectory);\n\n\t\t$sass = ['imports' => [], 'main' => ''];\n\n\t\tforeach($files as $file) {\n\t\t\t$fileName = $this->makeFileName($file);\n\t\t\t$content = $this->fs->get($file->getRealPath());\n\n\t\t\tif ($fileName === $this->mainFile) {\n\t\t\t\t$sass['main'] = $content;\n\t\t\t} else if ($fileName === $this->variablesFile) {\n\t\t\t\t$sass['variables'] = $this->formatVariables($content);\n\t\t\t} else {\n\t\t\t\t$sass['imports'][$fileName] = $content;\n\t\t\t}\n\t\t}\n\n\t\treturn $sass;\n\t}",
"public function minifyCss() {\n $inputDir = BASE_DIR . '/assets/css/compiled/';\n $outputDir = BASE_DIR . '/public/css/';\n foreach ($this->cssFiles as $bundle => $components) {\n $css = '';\n foreach ($components as $file) {\n $css .= exec(BASE_DIR . \"/vendor/sass/bin/sass \" . $inputDir.$file . \" --scss --style compressed\");\n }\n file_put_contents($outputDir . $bundle, $css);\n }\n }",
"public function processScssFile($file)\n {\n if (!preg_match('/\\.scss$/', $file)) { // Not a scss file\n return $file;\n }\n if (!empty(self::$processed_files[$file])) { // already processed\n return self::$processed_files[$file];\n }\n\n $scss_file = $file;\n\n // return if not a file\n if (!is_file(Director::getAbsFile($scss_file))) {\n self::$processed_files[$file] = $file;\n\n return $file;\n }\n\n // Generate CSS filename including original path to avoid conflicts.\n // eg: themes/site/css/file.scss becomes themes-site-css-file.css\n $url_friendly_css_name = $this->file_name_filter->filter(\n str_replace('/', '-', preg_replace('/\\.scss$/i', '', $scss_file))\n ) . '.css';\n\n $css_file = self::getProcessedCSSFolder() . '/' . $url_friendly_css_name;\n\n $output_file = $this->asset_handler->getContentURL($css_file);\n\n // absolute path to asset\n $real_src = Director::getAbsFile($scss_file);\n $real_path = Path::join(PUBLIC_PATH, Director::makeRelative($output_file));\n\n if (is_null($output_file) || $this->is_dev\n && (filemtime($real_path) < filemtime($real_src) || isset($_GET['flushstyles']))\n ) {\n $base_url = Director::baseURL();\n\n $base_folder = Director::baseFolder();\n\n $scss_base = dirname($base_url . $scss_file) . '/';\n\n $scss = new Compiler();\n\n if ($this->is_dev) {\n $scss->setFormatter('ScssPhp\\ScssPhp\\Formatter\\Expanded');\n } else {\n $scss->setFormatter('ScssPhp\\ScssPhp\\Formatter\\Crunched');\n }\n\n $scss->addImportPath(dirname(Director::getAbsFile($scss_file)) . '/');\n\n $variables = $this->config->get(__CLASS__, 'variables');\n\n $variables['BaseURL'] = '\"' . $base_url . '\"';\n\n $variables['BaseFolder'] = '\"' . $base_folder . '\"';\n\n $theme_dir = rtrim(\n $this->config->get(__CLASS__, 'theme_dir'),\n '/'\n ) . '/';\n\n if ($theme_dir) {\n $variables['ThemeDir'] = '\"' . $base_url\n . rtrim(ltrim($theme_dir, '/'), '/') . '\"';\n }\n\n $scss->setVariables($variables);\n\n $map_options = [];\n\n $sourcemap = $this->config->get(__CLASS__, 'sourcemap');\n if ($sourcemap\n && $this->is_dev\n && in_array(strtolower($sourcemap), ['inline', 'file'])\n ) {\n $map_options = [\n 'sourceMapRootpath' => $scss_base,\n 'sourceMapBasepath' => dirname(Director::getAbsFile($scss_file)),\n ];\n\n if ('inline' == strtolower($sourcemap)) {\n $scss->setSourceMap(Compiler::SOURCE_MAP_INLINE);\n $scss->setSourceMapOptions($map_options);\n } elseif ('file' == strtolower($sourcemap)) {\n $map_options['sourceMapWriteTo'] = $css_file . '.map';\n $map_options['sourceMapURL'] = basename($css_file . '.map');\n $scss->setSourceMapOptions($map_options);\n $scss->setSourceMap(Compiler::SOURCE_MAP_FILE);\n }\n }\n\n $scss_filename = basename($scss_file);\n\n $result = $scss->compileString(\n file_get_contents(Director::getAbsFile($scss_file)),\n $scss_filename\n );\n\n if (!empty($map_options['sourceMapWriteTo'])) {\n $this->asset_handler->setContent(\n $map_options['sourceMapWriteTo'],\n $result->getSourceMap()\n );\n }\n\n $this->asset_handler->setContent($css_file, $result->getCss());\n $output_file = $this->asset_handler->getContentURL($css_file);\n }\n\n $parsed_file = Director::makeRelative($output_file);\n\n self::$processed_files[$file] = $parsed_file;\n self::$processed_files[$parsed_file] = $parsed_file;\n\n return $parsed_file;\n }",
"static public function compile($format_style = \"scss_formatter\")\n {\n $scss_compiler = new scssc();\n // set the path where your _mixins are\n $scss_compiler->setImportPaths(Self::$scssFolder);\n // set css formatting (normal, nested or minimized), @see http://leafo.net/scssphp/docs/#output_formatting\n $scss_compiler->setFormatter($format_style);\n // get all .scss files from scss folder\n $filelist = glob(Self::$scssFolder . \"*.scss\");\n // step through all .scss files in that folder\n foreach ($filelist as $file_path) {\n // get path elements from that file\n $file_path_elements = pathinfo($file_path);\n // get file's name without extension\n $file_name = $file_path_elements['filename'];\n // get all lines in file\n $lines = Self::getFileLines($file_path);\n $lines = Self::processImports($lines,$file_path_elements);\n if (count($lines)) {\n // add the extra lines\n $lines = Self::extraLines($lines);\n // implode the array into one big string\n $string_sass = implode($lines);\n // compile this SASS code to CSS\n $string_css = $scss_compiler->compile($string_sass);\n $cssFile = Self::$cssFolder . $file_name . \".css\";\n // if file exists\n if (file_exists($cssFile)) {\n // attempt delete\n unlink($cssFile);\n }\n // write CSS into file with the same filename, but .css extension\n file_put_contents($cssFile, $string_css);\n }\n }\n\n }",
"protected function generateScssSupport() {\n if ($this->build['theme_scss_support']) {\n // Open info file.\n $info = $this->retrieveInfoFile();\n // Let's find all the CSS files available to us from our parent themes.\n $library_overrides = $this->processStyleOverrides($this->build['parent']);\n // assign the overrides to the .info array\n // @todo - what happens if a subtheme manually created overrides? Need some merge here.\n $info['libraries-override'] = $library_overrides;\n // Save .info file.\n $this->updateInfoFile($info);\n }\n }",
"protected function pushStylesheets(){\n if(count($this->stylesheets) > 0){\n $this->add_variables(array('stylesheets' => $this->stylesheets));\n }\n }",
"private function prepare()\n {\n $this->prepareFileDirectory();\n }",
"function csstools_compile_sass($dirname, $base_url = false)\n{\n csstools_sass_exec($dirname, true, $base_url);\n foreach(scandir($dirname) as $file) {\n if (preg_match('/\\.css$/', $file) && !preg_match('/\\-min\\.css$/', $file)) {\n $newpath = filesystem_minified_path($dirname . '/' . $file);\n rename($dirname.'/'.$file, $newpath);\n }\n }\n csstools_sass_exec($dirname, false, $base_url);\n}",
"protected static function updateSass()\n {\n // Clean up all the files in the sass folder\n tap(new Filesystem, function ($filesystem) {\n if ($filesystem->exists(resource_path('assets/sass'))) {\n $filesystem->cleanDirectory(resource_path('assets/sass'));\n }\n });\n }",
"public static function compile_all() {\n\t\t$in_file = APP_INCLUDE_ABSPATH . 'view/sass/';\n\t\tif (Config::has_feature(ConfigSASS::KEEP_DIRECTORY_STRUCTURE)) {\n\t\t\t$out_file = APP_INCLUDE_ABSPATH . Config::get_value(ConfigSASS::OUTPUT_DIR);\n\t\t\treturn self::run_cli_with($in_file, $out_file);\n\t\t} else {\n\t\t\treturn self::compile_dir($in_file);\n\t\t}\n\t}",
"private function registerCssFiles() {\n foreach( $this->assetsInfo as $info ){\n $cssFile = $info['name'];\n if (substr($cssFile, -strlen(\".css\")) == \".css\"){\n $cssPath = $info['publishPath'] . \"/\" . $cssFile;\n Yii::app()->getClientScript()->registerCssFile($cssPath);\n }\n }\n }",
"protected static function updateSass()\n {\n copy(__DIR__.'/../stubs/Assets/sass/_variables.scss', resource_path('assets/sass/_variables.scss'));\n copy(__DIR__.'/../stubs/Assets/sass/app.scss', resource_path('assets/sass/app.scss'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update value of currency | public function updatevalue()
{
\Ideas\Shop\Models\Currency::updateCurrencyValue();
Flash::success("You've just updated currency");
$url = Backend::url('ideas/shop/currency/index');
return redirect($url);
} | [
"public function testUpdateCurrency()\n {\n }",
"public function updated(Currency $currency)\n {\n //\n }",
"function changeCurrency($exchangeRate) {\r\n\t\treturn $this->update('UPDATE article_source SET amount = amount*'.$exchangeRate);\r\n }",
"function ps_1761_update_currencies()\n{\n // Force cache reset of languages (load locale column)\n ObjectModel::disableCache();\n\n /** @var Currency[] $currencies */\n $currencies = Currency::getCurrencies(true, false);\n $context = Context::getContext();\n $container = isset($context->controller) ? $context->controller->getContainer() : null;\n if (null === $container) {\n $container = SymfonyContainer::getInstance();\n }\n\n /** @var LocaleRepository $localeRepoCLDR */\n $localeRepoCLDR = $container->get('prestashop.core.localization.cldr.locale_repository');\n // CLDR locale give us the CLDR reference specification\n $cldrLocale = $localeRepoCLDR->getLocale($context->language->getLocale());\n\n foreach ($currencies as $currency) {\n if ((int) $currency->precision !== 6 || !empty((int) $currency->numeric_iso_code)) {\n continue;\n }\n // CLDR currency gives data from CLDR reference, for the given language\n $cldrCurrency = $cldrLocale->getCurrency($currency->iso_code);\n if (!empty($cldrCurrency)) {\n $currency->precision = (int) $cldrCurrency->getDecimalDigits();\n $currency->numeric_iso_code = $cldrCurrency->getNumericIsoCode();\n }\n Db::getInstance()->execute(\n 'UPDATE `' . _DB_PREFIX_ . 'currency`\n SET `precision` = ' . $currency->precision . ', `numeric_iso_code` = ' . $currency->numeric_iso_code . '\n WHERE `id_currency` = ' . $currency->id\n );\n }\n\n ObjectModel::enableCache();\n}",
"public function charge_currency()\n {\n }",
"public function formatCurrency($value, $currency){}",
"public function setCurrency(?CurrencyColumn $value): void {\n $this->getBackingStore()->set('currency', $value);\n }",
"function mlw_update_currency_rate( $l_curr, $r_curr, $new_rate ) {\n\t$model = mlw_get_model();\n\t$model->update_currency_rate( $l_curr, $r_curr, $new_rate );\n}",
"public function test_update_currency(){\n\n\t\t$code = strtoupper( __FUNCTION__ );\n\n\t\t$status = APP_Currencies::add_currency( $code, array() );\n\t\t$this->assertTrue( $status );\n\n\t\t$currency_args = array(\n\t\t\t'name' => 'Updated',\n\t\t\t'symbol' => 'UUU',\n\t\t\t'display' => '{updated}',\n\t\t\t'code' => $code\n\t\t);\n\n\t\tAPP_Currencies::update_currency( $code, $currency_args );\n\t\t$this->assertEquals( APP_Currencies::get_currency( $code ), $currency_args );\n\t}",
"public function setCurrencyAttribute($value)\n\t{\n\t\t$this->attributes['currency'] = strtoupper($value);\n\t}",
"public function setCurrency(?Currency $value): void {\n $this->getBackingStore()->set('currency', $value);\n }",
"protected function setUserCurrencyRate()\n {\n // Get the latest exchange rate from ExchangeRate API (base is your own currency)\n $url = 'https://api.exchangeratesapi.io/latest?base='.$this->myCurrencyCode.'&symbols='.$this->userCurrencyCode;\n $retrievedData = json_decode(file_get_contents($url), true);\n // Your user's rate casted from string to float\n $this->userCurrencyRate = self::formatNumberNoRound($retrievedData['rates'][$this->userCurrencyCode]);\n }",
"public function maybe_update_currency_to_euro() {\n global $wpdb;\n\n $current_version = $this->config->get( 'version' );\n\n // check, if the current version is greater than or equal 0.9.8\n if ( version_compare( $current_version, '0.9.8', '>=' ) ) {\n\n // map old values to new ones\n $meta_key_mapping = array(\n 'Teaser content' => 'laterpay_post_teaser',\n 'Pricing Post' => 'laterpay_post_pricing',\n 'Pricing Post Type' => 'laterpay_post_pricing_type',\n );\n\n $this->logger->info(\n __METHOD__,\n array(\n 'current_version' => $current_version,\n 'meta_key_mapping' => $meta_key_mapping,\n )\n );\n\n // update the currency to default currency 'EUR'\n update_option( 'laterpay_currency', $this->config->get( 'currency.default' ) );\n\n // remove currency table\n $sql = 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'laterpay_currency';\n $wpdb->query( $sql );\n }\n }",
"public function updateTotalNetPrice();",
"public function updateGcAmountAction()\n {\n $result = array(\n 'updated'=>false\n );\n $amount = $this->getRequest()->getParam('amount');\n if (substr($amount, 0, 1) == '$') {\n $amount = substr($amount, 1);\n }\n $amount = (int)$amount;\n $cardNumber = $this->getRequest()->getParam('id');\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n $card = Mage::helper('snap_card')->getCard($quote, $cardNumber);\n \n if (!$card || $amount > Snap_Card_Model_Giftcard::getTotalBalanceAmount($card[\"balance_info\"])){\n $result['msg'] = $this->__('Not enough funds on balance');\n } else if ($amount > 0 ) {\n \n $decryptedPin = Mage::helper('snap_card')->decryptPin(\"\" . $card[\"pin\"]);\n Mage::getModel('snap_card/giftcard')\n ->loadByCode($cardNumber, $decryptedPin)\n ->setNewAmount($amount)\n ->updateQuote();\n \n \n $result['amount'] = Mage::helper('snap_card')->formatPrice($amount);\n $result['updated'] = true;\n\n $result['html'] = $this->getLayout()->createBlock('checkout/cart_totals')\n ->setTemplate('checkout/cart/totals.phtml')\n ->toHtml();\n \n \n //Set Loyalty Redeem Amount & Balance.\n $result['loyaltyBalance'] = '';\n $result['loyaltyRedeemAmount'] = '';\n \n $redeemAmount = Mage::helper('snap_card')->getLoyaltyRedeemAmount();\n $result['loyaltyRedeemAmount'] = Mage::helper('core')->formatPrice($redeemAmount, false);\n \n $balanceAmount = Mage::helper('snap_card')->getLoyaltyBalanceAmount();\n $balanceAmount -= $redeemAmount;\n $result['loyaltyBalance'] = Mage::helper('core')->formatPrice($balanceAmount, false);\n \n }\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }",
"public function setCurrency($currency);",
"function set_currency_format(){\n if (!$this->Crud_model->admin_permission('currency')) {\n redirect(base_url() . 'admin');\n }\n\n $this->db->where('type', 'currency_format');\n $this->db->update('business_settings', array(\n 'value' => $this->input->post('currency_format')\n ));\n\n $this->db->where('type', 'symbol_format');\n $this->db->update('business_settings', array(\n 'value' => $this->input->post('symbol_format')\n ));\n\n $this->db->where('type', 'no_of_decimals');\n $this->db->update('business_settings', array(\n 'value' => $this->input->post('no_of_decimals')\n ));\n\n recache();\n }",
"public function updateExchangeRate()\n {\n $rate = $this->exchangeRates->getRate(CurrenciesInterface::USD);\n\n if ($rate) {\n $this->invoice->rate = $rate;\n\n return $this->invoice->save();\n }\n\n return false;\n }",
"private function changeCurrentCurrency() {\n if(!empty($_POST['currency_id'])) return $this->setCurrent(intval($_POST['currency_id']));\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Processes a block passed by reference based on its type. | protected function processBlock(&$block)
{
if ($this->format == self::FMT_RAR50)
return $this->processBlockR50($block);
// Block type: ARCHIVE
if ($block['head_type'] == self::BLOCK_MAIN) {
// Unpack the remainder of the Archive block header
$block += self::unpack('vreserved1/Vreserved2', $this->read(6));
// Parse Archive flags
if ($block['head_flags'] & self::MAIN_VOLUME) {
$block['is_volume'] = true;
$this->isVolume = true;
}
if ($block['head_flags'] & self::MAIN_AUTH) {
$block['has_auth'] = true;
$this->hasAuth = true;
}
if ($block['head_flags'] & self::MAIN_RECOVERY) {
$block['has_recovery'] = true;
$this->hasRecovery = true;
}
if ($block['head_flags'] & self::MAIN_PASSWORD) {
$block['is_encrypted'] = 1;
$this->isEncrypted = true;
}
}
// Block type: ARCHIVE END
elseif ($block['head_type'] == self::BLOCK_ENDARC) {
$block['more_volumes'] = (bool) ($block['head_flags'] & self::ENDARC_NEXT_VOLUME);
}
// Block type: NULL BLOCK (zero-padded)
elseif ($block['head_type'] == self::BLOCK_NULL) {
$remainder = $this->length - $block['offset'] - $block['head_size'];
if ($remainder < self::HEADER_SIZE) {
$block['next_offset'] = $this->length;
$block['add_size'] = $remainder;
}
}
// Block type: FILE or SUBBLOCK (new style)
elseif ($block['head_type'] == self::BLOCK_FILE || $block['head_type'] == self::BLOCK_SUB) {
// Unpack the remainder of the block header
$block += self::unpack(self::FORMAT_FILE_HEADER, $this->read(25));
// Large file sizes
if ($block['head_flags'] & self::FILE_LARGE) {
$block += self::unpack('Vhigh_pack_size/Vhigh_unp_size', $this->read(8));
$block['pack_size'] = self::int64($block['pack_size'], $block['high_pack_size']);
$block['unp_size'] = self::int64($block['unp_size'], $block['high_unp_size']);
}
// Is this a directory entry?
if (($block['head_flags'] & self::FILE_DICTMASK) == self::FILE_DIRECTORY) {
$block['is_dir'] = true;
}
// Filename: unicode
if ($block['head_flags'] & self::FILE_UNICODE) {
// Split the standard filename and unicode data from the file_name field
$fn = explode("\x00", $this->read($block['name_size']));
// Decompress the unicode filename, encode the result as UTF-8
$uc = new RarUnicodeFilename($fn[0], $fn[1]);
if ($ucname = $uc->decode()) {
$block['file_name'] = @iconv('UTF-16LE', 'UTF-8//IGNORE//TRANSLIT', $ucname);
// Fallback to the standard filename
} else {
$block['file_name'] = $fn[0];
}
// Filename: non-unicode
} else {
$block['file_name'] = $this->read($block['name_size']);
}
// Salt (optional)
if ($block['head_flags'] & self::FILE_SALT) {
$block['salt'] = $this->read(8);
}
// Extended time fields (optional)
if ($block['head_flags'] & self::FILE_EXTTIME) {
$block['ext_time'] = true;
}
// Encrypted with password?
if ($block['head_flags'] & self::FILE_PASSWORD) {
$block['has_password'] = true;
}
// Continued from previous volume?
if ($block['head_flags'] & self::FILE_SPLIT_BEFORE) {
$block['split_before'] = true;
}
// Continued in next volume?
if ($block['head_flags'] & self::FILE_SPLIT_AFTER) {
$block['split_after'] = true;
}
// Increment the file count
if ($block['head_type'] == self::BLOCK_FILE) {
$this->fileCount++;
}
// Update next header block offset
if (($block['head_type'] == self::BLOCK_FILE && !in_array(self::BLOCK_FILE, $this->headersOnly['type']))
|| ($block['head_type'] == self::BLOCK_SUB && !in_array($block['file_name'], $this->headersOnly['subtype']))
) {
$block['next_offset'] += $block['pack_size'];
}
}
// Parse any useful Subblock info
if ($block['head_type'] == self::BLOCK_SUB) {
// Authenticity verification
if ($block['file_name'] == self::SUBTYPE_AUTHVER) {
$block += self::unpack('vav_name_size', $this->read(2));
$block['av_file_name'] = $this->read($block['av_name_size']);
$block += self::unpack('vav_unknown/vav_cname_size', $this->read(4)); // guesswork
$block['av_created_by'] = $this->read($block['av_cname_size']);
}
}
} | [
"abstract public static function register_block_type(): void;",
"public function unregister_block_process($type)\n {\n // Check if we're unregistering the block incorrectly.\n if(is_object($this->current_block_process) && $type != $this->current_block_process->get_type())\n {\n CTE_Compiler::trigger_error('Cannot end other block types until current block type is closed.', null, __FUNCTION__, __LINE__, ERR_USER_ERROR, __FILE__);\n }\n else\n {\n switch($type)\n {\n case BLOCK_PROCESS__SECTION:\n $this->unregister_section();\n break;\n case BLOCK_PROCESS__FOREACH:\n $this->unregister_foreach();\n break;\n }\n \n $this->current_block_process = array_pop($this->block_process_stack);\n }\n \n $this->block_balance[$type]--;\n }",
"public function reconsiderblock($blockhash) {\n\n $args = $this->args;\n $args[ \"method\" ] = __FUNCTION__;\n $args[ \"params\" ] = [ \"$blockhash\" ];\n\n $res = $this->call($args);\n if ($res)\n return $res[ \"result\" ];\n }",
"public function proc_block() {\n\t\t// Sets $this->block to an array of the CS code elements in $this->rawcode. Nested blocks will also have been recursively parsed by proc_block().\n\t\n\t\t$block_lines = explode(\"\\n\", $this->rawcode);\n\t\t\n\t\t// Add next block of cs code to $this->block. proc_line() may array_shift() more lines off $block_lines.\n\t\twhile($line = array_shift($block_lines)) {\n\t\t\t$first_line_num = $this->linenum;\n\t\t\t$obj = $this->proc_line($line, $block_lines);\n\t\t\tif($obj === false) continue; // Don't need to process a spacer line further... (Could $obj be false in other cases?)\n\t\t\t$obj->linenum = $first_line_num;\n\t\t\t$this->add_cselt($obj);\n\t\t\tif($debug) echo $line.\"<br>\\n\";\n\t\t\tif($debug) \"[$first_line_num]Type: \".$obj->type.\", Body: \\n\".$obj->rawcode.\"<br>\\n\"; // Instead of showing rawcode, should show the object data, but this is just for debugging anyway and will be removed.\n\t\t\t$this->linenum++;\n\t\t}\n\t}",
"public function getGenericBlock();",
"public function register_block_process($type)\n {\n // Add current block process to the stack, first stack value will (must) be NULL.\n $this->block_process_stack[] = $this->current_block_process;\n \n // Get checked vars before we re-define current_block_process.\n $isset_checked_objects = NULL;\n if(is_object($this->current_block_process))\n {\n $isset_checked_objects = $this->current_block_process->get_isset_checked_objects();\n }\n \n $this->current_block_process = new CTE_Block_Process($type);\n $this->block_balance[$type]++;\n \n if($isset_checked_objects !== NULL)\n {\n $this->current_block_process->set_isset_checked_objects($isset_checked_objects);\n }\n }",
"private function extractBlock($name, $type) {\n \n /* Define form of the start and end tag */\n $start_tag = '{'. $type .' ' . $name . '}';\n $end_tag = '{END ' . $name . '}';\n \n /* Find positions of the start and end tag */\n $start_tag_pos = strpos($this->source, $start_tag);\n $end_tag_pos = strpos($this->source, $end_tag);\n \n /* If there is no such a block, or one of the tags is missing, return a nice error message */\n if ($start_tag_pos === false || $end_tag_pos === false) {\n \n die (\"Error: block {\" . $name . \"} not found.\");\n \n } else {\n \n /* Find the start of the block, excluding start tag */\n $block_start = $start_tag_pos + strlen($start_tag);\n \n /* End of the block is on the position where end tag starts */\n $block_end = $end_tag_pos;\n \n /* Extract the content of the block*/\n $block = substr($this->source, $block_start, $block_end - $block_start);\n \n /* Remove the whole start tag */\n $this->source = deleteFromString($this->source, $start_tag_pos, strlen($start_tag));\n \n /* Remove the whole end tag, but first find the position of the end tag again, because start tag is already missing */\n $end_tag_pos = strpos($this->source, $end_tag);\n $this->source = deleteFromString($this->source, $end_tag_pos, strlen($end_tag));\n \n /* Return the content of the block and the starting position of the block */\n $arr['content'] = $block;\n $arr['start'] = $start_tag_pos;\n return $arr;\n \n }\n }",
"function acf_register_block_type( $block ) {\n\t\n\t// Validate block type settings.\n\t$block = acf_validate_block_type( $block );\n\t\n\t/**\n\t * Filters the arguments for registering a block type.\n\t *\n\t * @since\t5.8.9\n\t *\n\t * @param\tarray $block The array of arguments for registering a block type.\n\t */\n $block = apply_filters( 'acf/register_block_type_args', $block );\n \n // Require name.\n if( !$block['name'] ) {\n\t $message = __( 'Block type name is required.', 'acf' );\n\t _doing_it_wrong( __FUNCTION__, $message, '5.8.0' );\n\t\treturn false;\n }\n \n\t// Bail early if already exists.\n\tif( acf_has_block_type($block['name']) ) {\n\t\t$message = sprintf( __( 'Block type \"%s\" is already registered.' ), $block['name'] );\n\t\t_doing_it_wrong( __FUNCTION__, $message, '5.8.0' );\n\t\treturn false;\n\t}\n\t\n\t// Add to storage.\n\tacf_get_store( 'block-types' )->set( $block['name'], $block );\n\t\n\t// Register block type in WP.\n\tif( function_exists('register_block_type') ) {\n\t\tregister_block_type($block['name'], array(\n\t\t\t'attributes'\t\t=> acf_get_block_type_default_attributes(),\n\t\t\t'render_callback'\t=> 'acf_rendered_block',\n\t\t));\n\t}\n\t\n\t// Register action.\n\tadd_action( 'enqueue_block_editor_assets', 'acf_enqueue_block_assets' );\n\t\n\t// Return block.\n\treturn $block;\n}",
"public function register() {\n\t\t$registered = register_block_type( $this->type, $this->args );\n\t\tif ( false === $registered ) {\n\t\t\tLogger::log(\n\t\t\t\t'error',\n\t\t\t\t'block_not_registered',\n\t\t\t\t'The provided block failed to register. Register block type provides a __doing_it_wrong warning explaining more.',\n\t\t\t\t[ 'ref' => $this->type, 'expects' => 'string' ]\n\t\t\t);\n\t\t} else {\n\t\t\tLogger::log(\n\t\t\t\t'notice',\n\t\t\t\t'block_registered',\n\t\t\t\t'The provided block was registered successfully.',\n\t\t\t\t[ 'ref' => $this->type, 'args' => $this->args ]\n\t\t\t);\n\t\t}\n\t}",
"public function tagBlock(Block $block): void;",
"function acf_get_block_type($name)\n{\n}",
"public function createBlock($type) {\n $this->completeNode();\n $this->current->appendNode($type);\n }",
"public function wrap_block_render_callbacks() {\n\t\tforeach ( \\WP_Block_Type_Registry::get_instance()->get_all_registered() as $block_type ) {\n\t\t\tif ( ! $block_type->is_dynamic() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$block_type->render_callback = new Wrapped_Callback( // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited\n\t\t\t\t$block_type->render_callback,\n\t\t\t\t$this,\n\t\t\t\tfunction( $invocation_args, $func_args ) use ( $block_type ) {\n\t\t\t\t\treturn new Block_Invocation(\n\t\t\t\t\t\t$this,\n\t\t\t\t\t\t$this->incrementor,\n\t\t\t\t\t\t$this->database,\n\t\t\t\t\t\t$this->file_locator,\n\t\t\t\t\t\t$this->dependencies,\n\t\t\t\t\t\tarray_merge(\n\t\t\t\t\t\t\t$invocation_args,\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'name' => $block_type->name,\n\t\t\t\t\t\t\t\t'attributes' => isset( $func_args[0] ) ? $func_args[0] : [],\n\t\t\t\t\t\t\t\t'content' => isset( $func_args[1] ) ? $func_args[1] : null,\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\tfunction ( Block_Invocation $invocation, $func_args ) {\n\t\t\t\t\t$return = call_user_func_array( $invocation->function, $func_args );\n\t\t\t\t\treturn $this->output_annotator->get_before_invocation_placeholder_annotation( $invocation ) . $return . $this->output_annotator->get_after_invocation_placeholder_annotation( $invocation );\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}",
"public function _processBlock()\n {\n $i=0;\n\n //\n // Create render-target for blocks. We use reset() to re-cycle this\n // object in the foreach loop.\n //\n $context =& $this->mRoot->mContext;\n\n foreach ($this->_mBlockChain as $blockProcedure) {\n //\n // This is a flag indicating whether the controller needs to call\n // the logic of the block.\n //\n $usedCacheFlag = false;\n\n $cacheInfo = null;\n\n if ($this->isEnableCacheFeature() && $blockProcedure->isEnableCache()) {\n //\n // Reset the block cache information structure, and initialize.\n //\n $cacheInfo =& $blockProcedure->createCacheInfo();\n\n $this->mSetBlockCachePolicy->call(new XCube_Ref($cacheInfo));\n $filepath = $cacheInfo->getCacheFilePath();\n\n //\n // If caching is enable and the cache file exists, load and use.\n //\n if ($cacheInfo->isEnableCache() && $this->existActiveCacheFile($filepath, $blockProcedure->getCacheTime())) {\n $content = $this->loadCache($filepath);\n if ($blockProcedure->isDisplay() && !empty($content)) {\n $context->mAttributes['legacy_BlockShowFlags'][$blockProcedure->getEntryIndex()] = true;\n $context->mAttributes['legacy_BlockContents'][$blockProcedure->getEntryIndex()][] = [\n 'id' => $blockProcedure->getId(),\n 'name' => $blockProcedure->getName(),\n 'title' => $blockProcedure->getTitle(),\n 'content' => $content,\n 'weight' => $blockProcedure->getWeight()\n ];\n }\n\n $usedCacheFlag = true;\n }\n }\n\n if (!$usedCacheFlag) {\n $blockProcedure->execute();\n\n $renderBuffer = null;\n if ($blockProcedure->isDisplay()) {\n $renderBuffer =& $blockProcedure->getRenderTarget();\n\n $context->mAttributes['legacy_BlockShowFlags'][$blockProcedure->getEntryIndex()] = true;\n $context->mAttributes['legacy_BlockContents'][$blockProcedure->getEntryIndex()][] = [\n 'name' => $blockProcedure->getName(),\n 'title'=>$blockProcedure->getTitle(),\n 'content'=>$renderBuffer->getResult(),\n 'weight'=>$blockProcedure->getWeight(),\n 'id' => $blockProcedure->getId(),\n ];\n } else {\n //\n // Dummy save\n //\n $renderBuffer = new XCube_RenderTarget();\n }\n\n if ($this->isEnableCacheFeature() && $blockProcedure->isEnableCache() && is_object($cacheInfo) && $cacheInfo->isEnableCache()) {\n $this->cacheRenderTarget($cacheInfo->getCacheFilePath(), $renderBuffer);\n }\n }\n\n unset($blockProcedure);\n }\n XCube_DelegateUtils::call('Legacy.SetupModuleContextSuccess', is_object($this->mRoot->mContext->mModule)? $this->mRoot->mContext->mModule->mXoopsModule : null);\n }",
"function unregister_block_type($name)\n {\n }",
"protected function register_block_type() {\n\t\tregister_block_type(\n\t\t\t$this->get_block_type(),\n\t\t\tarray(\n\t\t\t\t'render_callback' => $this->get_block_type_render_callback(),\n\t\t\t\t'editor_script' => $this->get_block_type_editor_script( 'handle' ),\n\t\t\t\t'editor_style' => $this->get_block_type_editor_style(),\n\t\t\t\t'style' => $this->get_block_type_style(),\n\t\t\t\t'attributes' => $this->get_block_type_attributes(),\n\t\t\t\t'supports' => $this->get_block_type_supports(),\n\t\t\t)\n\t\t);\n\t}",
"function _preprocessBlock(&$blk)\n {\n // Complex (non-scalar) blocks are not processed.\n if (is_array($blk->value) || is_object($blk->value)) return true;\n\n // Check for pragma.\n $name = strtolower($blk->name);\n if (strpos($name, $this->PRAGMA_PRE) === 0) {\n $pragma = substr($name, strlen($this->PRAGMA_PRE));\n $func = \"_pragma_\".ucfirst($pragma);\n if (method_exists($this, $func)) {\n $r = call_user_func(array(&$this, $func), &$blk);\n if (!$r) return false;\n }\n }\n\n // Run modifiers.\n if ($blk->raw) return true;\n foreach (array_reverse($this->config['modifier']) as $re=>$codes) {\n if (!preg_match(\"/^(?:$re)$/si\", $blk->name)) continue;\n foreach (array_reverse($codes) as $code) {\n list ($cls, $name) = explode(\"::\", $code);\n if (!$name) { $name = $cls; $cls = null; }\n $blk->value = call_user_func($cls? array($cls, $name) : $name, $blk->value, &$this, $blk);\n if ($blk->value === false) return false;\n }\n }\n\n // All done.\n return true;\n }",
"protected function parseBlocks()\n\t{\n\t\t$this->tmpl = preg_replace_callback(self::REGEXP_BLOCK, array($this, 'parseBlockCallback'), $this->tmpl);\n\t}",
"public function getPType() {\n return 'block';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fill a hash with all content types and their identifiers. | private function getContentTypesHash(): array
{
$contentTypeHash = [];
foreach ($this->contentTypeService->loadContentTypeGroups() as $contentTypeGroup) {
foreach ($this->contentTypeService->loadContentTypes($contentTypeGroup) as $contentType) {
$contentTypeHash[$contentType->getName()] = $contentType->identifier;
}
}
ksort($contentTypeHash);
return $contentTypeHash;
} | [
"function setupContentTypes() {\n\t\tglobal $gLibertySystem, $gBitSmarty, $gBitSystem;\n\t\tforeach( $gLibertySystem->mContentTypes as $cName => $cType ) {\n\t\t\tif ( $gBitSystem->isPackageActive( $cType['handler_package'] ) ) {\n\t\t\t\t$contentTypes[$cType['content_type_guid']] = $gLibertySystem->getContentTypeName( $cType['content_type_guid'] );\n\t\t\t}\n\t\t}\n\t\tasort($contentTypes);\n\t\t$gBitSmarty->assign( 'calContentTypes', $contentTypes );\n\t}",
"public function get_hash_types()\n {\n if (!isset($this->_hashTypes)) {\n $types = array();\n //Current hash type:\n //Current hash type:\n $types['core:sha1'] = array (\n 'length' => 40,\n 'saltLength' => 0,\n 'name' => 'Salted SHA-1 Hash',\n\n );\n\n //plain-text (no hash):\n $types['core:plain'] = array (\n 'length' => -1,\n 'saltLength' => 0,\n 'name' => 'Plain Text',\n\n );\n\n //For old encryption...\n $types['core:old_auctions'] = array (\n 'length' => -1,\n 'saltLength' => 0,\n //no name, so it doesn't show as a choice\n );\n\n //PHP native password hashing (uses BCRYPT, requires PHP 5.5 or higher)\n if (function_exists('password_hash')) {\n $types['core:php_native'] = array(\n 'length' => 60,\n 'saltLength' => -1,\n 'name' => 'BCRYPT Hash (most secure)'\n );\n }\n\n $this->_hashTypes = $types;\n //allow addons to register their own types\n geoAddon::triggerUpdate('notify_geoPC_get_hash_types');\n }\n\n return $this->_hashTypes;\n }",
"private function loadMimetypes() {\n\t\t$qb = $this->dbConnection->getQueryBuilder();\n\t\t$qb->select('id', 'mimetype')\n\t\t\t->from('mimetypes');\n\n\t\t$result = $qb->execute();\n\t\t$results = $result->fetchAll();\n\t\t$result->closeCursor();\n\n\t\tforeach ($results as $row) {\n\t\t\t$this->mimetypes[$row['id']] = $row['mimetype'];\n\t\t\t$this->mimetypeIds[$row['mimetype']] = $row['id'];\n\t\t}\n\t}",
"public function register_content_types() {\n\t\tforeach ( $this->content_types as $content_type_class ) {\n\t\t\t$this->register_content_type( new $content_type_class() );\n\t\t}\n\t}",
"protected function LegacyContentTypeMap()\n {\n $oldToNew = array(\n 'author' => 'Author',\n 'block' => 'Block',\n 'breadcrumb' => 'Breadcrumb',\n 'camtasia' => 'Camtasia',\n 'computercode' => 'Computercode',\n 'directory' => 'Directory',\n 'flickr' => 'Flickr',\n 'googlemap' => 'GoogleMap',\n 'heading' => 'Heading',\n 'html' => 'Html',\n 'joinposition' => 'JoinPosition',\n 'modulefunc' => 'ModuleFunc',\n 'openstreetmap' => 'OpenStreetMap',\n 'pagenavigation' => 'PageNavigation',\n 'pagesetter_pub' => 'PagesetterPub',\n 'pagesetter_publist' => 'PagesetterPublist',\n 'quote' => 'Quote',\n 'rss' => 'Rss',\n 'slideshare' => 'Slideshare',\n 'vimeo' => 'Vimeo',\n 'youtube' => 'YouTube',\n );\n return $oldToNew;\n }",
"function getEntriesByTypes() {\n $result = array();\n foreach ($this->bibdb as $b) {\n $result[$b->getType()][] = $b;\n }\n return $result;\n }",
"protected function handleHashids()\n {\n foreach ($this->data as $key => $value) {\n if (str_contains($key, 'hashid')) {\n if ($key == 'hashid') {\n $this->data['id'] = hashid($value);\n } else {\n $new_key = str_before($key, '_hashid');\n $this->data[$new_key] = hashid($value);\n unset($this->data[$key]);\n }\n }\n }\n }",
"public function extractIdentifiersData(): void\n {\n foreach ($this->searchTree as $type => $identifier) {\n if (array_key_exists($type, $this->typeMap)) {\n $this->resourceOutput['identifiers'][] = [\n 'value' => $identifier,\n 'type' => $this->typeMap[$type],\n ];\n }\n }\n }",
"public function replaceContentTypeCache($contentTypeCache) {\n global $wpdb;\n\n // Replace existing content type cache\n $wpdb->query(\"TRUNCATE TABLE {$wpdb->base_prefix}h5p_libraries_hub_cache\");\n foreach ($contentTypeCache->contentTypes as $ct) {\n // Insert into db\n $wpdb->insert(\"{$wpdb->base_prefix}h5p_libraries_hub_cache\", array(\n 'machine_name' => $ct->id,\n 'major_version' => $ct->version->major,\n 'minor_version' => $ct->version->minor,\n 'patch_version' => $ct->version->patch,\n 'h5p_major_version' => $ct->coreApiVersionNeeded->major,\n 'h5p_minor_version' => $ct->coreApiVersionNeeded->minor,\n 'title' => $ct->title,\n 'summary' => $ct->summary,\n 'description' => $ct->description,\n 'icon' => $ct->icon,\n 'created_at' => self::dateTimeToTime($ct->createdAt),\n 'updated_at' => self::dateTimeToTime($ct->updatedAt),\n 'is_recommended' => $ct->isRecommended === TRUE ? 1 : 0,\n 'popularity' => $ct->popularity,\n 'screenshots' => json_encode($ct->screenshots),\n 'license' => json_encode(isset($ct->license) ? $ct->license : array()),\n 'example' => $ct->example,\n 'tutorial' => isset($ct->tutorial) ? $ct->tutorial : '',\n 'keywords' => json_encode(isset($ct->keywords) ? $ct->keywords : array()),\n 'categories' => json_encode(isset($ct->categories) ? $ct->categories : array()),\n 'owner' => $ct->owner\n ), array(\n '%s',\n '%d',\n '%d',\n '%d',\n '%d',\n '%d',\n '%s',\n '%s',\n '%s',\n '%s',\n '%d',\n '%d',\n '%d',\n '%d',\n '%s',\n '%s',\n '%s',\n '%s',\n '%s',\n '%s',\n '%s'\n ));\n }\n }",
"private function post_types() {\n\n\t\t$post_types = include_once(self::get_schema_path( __FUNCTION__, 'content' ));\n\n\t\tforeach ( $post_types as $post_type => $args ) {\n\t\t\tregister_post_type( $post_type, $args );\n\t\t}\n\t}",
"public function core_notify_geoPC_get_hash_types()\n {\n //Use this as the time to register a hash type, like the example here.\n $geoPC = geoPC::getInstance();\n\n //NOTE: By specifying the name, this becomes a possible selection as the default\n //hash type to use in the admin at \"Admin Tools & Settings > Security Settings > General Security Setings\"\n //Also, note that this is a fully working example, it will hash the password\n //using a random generated salt with variable length. We do NOT recommend\n //use of MD5 hash, in fact the opposite as it has been proven vulnerable\n //to various attacks. This is JUST an example, we only chose it due to it's simplicity\n //so that the focus is on \"how\" to implement your own custom hash, not to\n //create a custom hash that people might wish to use...\n $geoPC->register_hash_type($this->name, 'md5_Simple', 'Simple MD5 with Salt', 32, -1);\n\n //Since we specified the \"type\" as md5, it will use a function named\n //auth_md5 to generate the password, which you will find next.\n }",
"static public function &list_content_types()\n\t{\n\t\t$gCms = cmsms();\n\t\tif (!isset($gCms->variables['contenttypes']))\n\t\t{\n\t\t\tself::find_content_types();\n\t\t}\n\n\t\t$result = array();\n\t\t$contenttypes =& $gCms->variables['contenttypes'];\n\t\tforeach( $contenttypes as $key => $placeholder )\n\t\t{\n\t\t\t$result[$placeholder->classname] = $placeholder->friendlyname;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public static function getHashes()\n {\n return array(\n 'library/Jrahmy/DeferJs/Defer.php' => 'c012b8dd6d359e268b6e60a0d4de2690',\n 'library/Jrahmy/DeferJs/Listener.php' => '8e2781624cf1286cb3c52a68563931a7',\n\n\t\t);\n }",
"private static function initTypeIds()\n {\n if ( self::$type_ids === null ) {\n self::$type_ids = array(\n /** @see \\Bookly\\Backend\\Modules\\Sms\\Controller::executeSendTestSms */\n 'test_message' => 0,\n\n 'client_approved_appointment' => 1,\n 'client_approved_appointment_cart' => 2,\n 'client_cancelled_appointment' => 3,\n 'client_follow_up' => 4,\n 'client_new_wp_user' => 5,\n 'client_pending_appointment' => 6,\n 'client_pending_appointment_cart' => 7,\n 'client_reminder' => 8,\n 'staff_agenda' => 9,\n 'staff_approved_appointment' => 10,\n 'staff_cancelled_appointment' => 11,\n 'staff_pending_appointment' => 12,\n 'client_rejected_appointment' => 13,\n 'staff_rejected_appointment' => 14,\n 'client_birthday_greeting' => 15,\n 'client_reminder_1st' => 16,\n 'client_reminder_2nd' => 17,\n 'client_reminder_3rd' => 18,\n\n Notification::TYPE_STAFF_DAY_AGENDA => 9,\n Notification::TYPE_CUSTOMER_BIRTHDAY => 15,\n Notification::TYPE_APPOINTMENT_START_TIME => 19,\n Notification::TYPE_LAST_CUSTOMER_APPOINTMENT => 20,\n Notification::TYPE_CUSTOMER_APPOINTMENT_STATUS_CHANGED => 21,\n Notification::TYPE_CUSTOMER_APPOINTMENT_CREATED => 22,\n\n // Recurring Appointments add-on => [31-38],\n // Waiting List add-on => [51-53],\n // Packages add-on => [81-82],\n );\n\n self::$type_ids = Lib\\Proxy\\Shared::prepareNotificationTypeIds( self::$type_ids );\n }\n }",
"public function getContentTypes() {\n $ctypes = uc_product_types();\n $ctypes = array_combine($ctypes, $ctypes);\n return array_keys($ctypes);\n }",
"abstract public function generateFieldTypeHash( $hashElementName, $hashValue );",
"public static function LegacyContentTypeMap()\n {\n $map = array('pagesetter_pub' => 'ClipPub', 'pagesetter_publist' => 'ClipPublist');\n return $map;\n }",
"public function getContentTypeMap()\n\t{\n\t\treturn $this->class_to_contenttype;\n\t}",
"function exodus_update_content_types( $content_types ) {\n\n\t// Add page templates to existing content types\n\t$content_types['sermon']['page_templates']\t\t= array( 'sermons.php', 'sermon-topics.php', 'sermon-books.php', 'sermon-series.php', 'sermon-speakers.php', 'sermon-dates.php' );\n\t$content_types['event']['page_templates']\t\t= array( 'events-upcoming.php', 'events-calendar.php', 'events-past.php' );\n\t$content_types['people']['page_templates']\t\t= array( 'people.php' );\n\t$content_types['location']['page_templates'] \t= array( 'locations.php' );\n\t$content_types['gallery']['page_templates'] \t= array( 'gallery.php', 'galleries.php' );\n\t$content_types['contact']['page_templates'] \t= array( 'contact.php' );\n\t$content_types['blog']['page_templates'] \t\t= array( 'blog.php' );\n\n\treturn $content_types;\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Part of Section 4.3.2. of the CSS syntax 3 specification This consumes a comment and returns an unofficial COMMENT token. This function assumes that the next two (2) input code point have already been verified to be the start of a comment. If the next two input code point are U+002F SOLIDUS (/) followed by a U+002A ASTERISK (), consume them and all following code points up to and including the first U+002A ASTERISK () followed by a U+002F SOLIDUS (/), or up to an EOF code point. Return to the start of this step. If the preceding paragraph ended by consuming an EOF code point, this is a parse error. | private function consumeCommentToken(): Comment
{
$isNotAsterisk = static function (string $codePoint): bool {
if ($codePoint === self::ASTERISK) {
return false;
}
return true;
};
// Consume initial SOLIDUS and ASTERISK
$comment = $this->inputStream->next() . $this->inputStream->next();
do {
$comment .= $this->readWhile($isNotAsterisk);
if ($this->inputStream->isEndOfStream()) {
$this->inputStream->error('Encountered EOF during comment parsing');
return new Comment($comment);
}
// Looks like end of comment but is not
if (
$this->inputStream->peek(0) === self::ASTERISK
&& $this->inputStream->peek(1) !== self::SOLIDUS
) {
// Consume ASTERISK
$comment .= $this->inputStream->next();
}
} while (
$this->inputStream->peek(0) !== self::ASTERISK
|| $this->inputStream->peek(1) !== self::SOLIDUS
);
// Consume final ASTERISK and SOLIDUS
$comment .= $this->inputStream->next() . $this->inputStream->next();
return new Comment($comment);
} | [
"protected function parseComment()\n {\n if (!$this->peekChar('/')) {\n return;\n }\n\n if ($this->peekChar('/', 1)) {\n return new ILess_Node_Comment($this->matchReg('/\\G\\/\\/.*/'), true, $this->position, $this->env->currentFileInfo);\n } //elseif($comment = $this->matchReg('/\\G\\/\\*(?:[^*]|\\*+[^\\/*])*\\*+\\/\\n?/'))\n elseif ($comment = $this->matchReg('/\\\\G\\/\\*(?s).*?\\*+\\/\\n?/')) {\n return new ILess_Node_Comment($comment, false, $this->position, $this->env->currentFileInfo);\n }\n }",
"protected function scanComment()\n {\n $matches = array();\n\n if (preg_match('/^ *\\/\\/(-)?([^\\n]+)?/', $this->input, $matches)) {\n $this->consumeInput(mb_strlen($matches[0]));\n $token = $this->takeToken('comment', isset($matches[2]) ? $matches[2] : '');\n $token->buffer = !isset($matches[1]) || '-' !== $matches[1];\n\n return $token;\n }\n }",
"protected function scanComment()\n {\n $matches = [];\n\n if (preg_match('/^ *\\/(\\!)?([^\\n]+)?/', $this->input, $matches)) {\n $this->consumeInput(mb_strlen($matches[0]));\n $token = $this->takeToken('comment', isset($matches[2]) ? $matches[2] : '');\n $token->buffer = isset($matches[1]) && $matches[1] == '!';\n\n return $token;\n }\n }",
"function parseComment()\r\n\t{\r\n\t\t$this->start = $this->reader->mark();\r\n\t\t// skip over the comment\r\n\t\t$stop = $this->reader->skipUntil('--%>');\r\n\t\tif (is_null($stop))\r\n\t\t{\r\n\t\t\tthrow_exception(new PhaseException('Comment not properly ended.'));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->reader->skipSpaces();\r\n\t\treturn '';\r\n\t}",
"private function parseComment() {\n\t\t$this->readUntil($txt, \"\\x0A\", \"\\x0D\");\n\t\treturn $txt;\n\t}",
"private function lexCommentStatement()\n {\n $this->lexDelimitedExpressionStatement(\n TokenTypes::T_COMMENT_OPEN,\n $this->commentDelimiters[0],\n TokenTypes::T_COMMENT_CLOSE,\n $this->commentDelimiters[1],\n false\n );\n }",
"protected function lexComment() {\n if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {\n throw new Twig_Error_Syntax('Unclosed comment', $this->lineno, $this->filename);\n }\n\n $value = substr($this->code, $this->cursor, $match[0][1] - $this->cursor);\n $token = new Twig_Extensions_Extension_Gettext_Token(Twig_Extensions_Extension_Gettext_Token::COMMENT, $value, $this->lineno);\n $this->commentTokens[] = $token;\n $this->moveCursor($value . $match[0][0]);\n }",
"protected function lexComment()\n {\n if (preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {\n $comment = substr($this->code, $this->cursor, $match[0][1] - $this->cursor);\n $this->pushToken(\\Twig_Token::BLOCK_START_TYPE);\n $this->pushToken(\\Twig_Token::NAME_TYPE, 'comment');\n $this->pushToken(\\Twig_Token::TEXT_TYPE, $comment);\n $this->pushToken(\\Twig_Token::BLOCK_END_TYPE);\n }\n\n // Pass back to the normal lexer to skip past the comment.\n return parent::lexComment();\n }",
"protected function scanComment()\n {\n\n if (!$this->match(\"\\\\/\\\\/(-)?[\\t ]*\"))\n return;\n\n $this->consumeMatch();\n\n $token = $this->createToken('comment');\n $token['rendered'] = $this->getMatch(1) ? false : true;\n\n yield $token;\n\n foreach ($this->scanTextBlock() as $token)\n yield $token;\n }",
"protected function next() {\n $c = $this->get();\n\n if ($c === '/') {\n switch($this->peek()) {\n case '/':\n for (;;) {\n $c = $this->get();\n\n if (ord($c) <= self::ORD_LF) {\n return $c;\n }\n }\n\n case '*':\n $this->get();\n\n for (;;) {\n switch($this->get()) {\n case '*':\n if ($this->peek() === '/') {\n $this->get();\n return ' ';\n }\n break;\n\n case null:\n throw new JSMinException('Unterminated comment.');\n }\n }\n\n default:\n return $c;\n }\n }\n\n return $c;\n }",
"protected function next()\n {\n $c = $this->get();\n\n if ($c === '/') {\n switch ($this->peek()) {\n case '/':\n for (; ;) {\n $c = $this->get();\n\n if (ord($c) <= self::ORD_LF) {\n return $c;\n }\n }\n\n case '*':\n $this->get();\n\n for (; ;) {\n switch ($this->get()) {\n case '*':\n if ($this->peek() === '/') {\n $this->get();\n\n return ' ';\n }\n break;\n\n case null:\n throw new JSMinException('Unterminated comment.');\n }\n }\n\n default:\n return $c;\n }\n }\n\n return $c;\n }",
"private function readComment(): bool\n {\n $this->readWhitespace();\n if (!$this->readChar('#')) {\n return false;\n }\n $type = strpbrk($this->data[$this->position] ?? '', '~|,:.') ?: '';\n $this->position += strlen($type);\n // Only a single space might be optionally added\n $this->readChar(' ');\n switch ($type) {\n case '':\n $data = $this->readCommentString();\n $this->translation->getComments()->add($data);\n break;\n case '~':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception(\"Inconsistent use of #~{$this->getErrorPosition()}\");\n }\n $this->translation->disable();\n $this->isDisabled = true;\n break;\n case '|':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception('Cannot redeclare the previous comment #|, '\n . \"ensure the definitions are in the right order{$this->getErrorPosition()}\");\n }\n $this->inPreviousPart = true;\n $this->translation->setPreviousContext($this->readIdentifier('msgctxt'));\n $this->translation->setPreviousOriginal($this->readIdentifier('msgid', true));\n $this->translation->setPreviousPlural($this->readIdentifier('msgid_plural'));\n $this->inPreviousPart = false;\n break;\n case ',':\n $data = $this->readCommentString();\n foreach (array_map('trim', explode(',', trim($data))) as $value) {\n $this->translation->getFlags()->add($value);\n }\n break;\n case ':':\n $data = $this->readCommentString();\n foreach (preg_split('/\\s+/', trim($data)) as $value) {\n if (preg_match('/^(.+)(:(\\d*))?$/U', $value, $matches)) {\n $line = isset($matches[3]) ? intval($matches[3]) : null;\n $this->translation->getReferences()->add($matches[1], $line);\n }\n }\n break;\n case '.':\n $data = $this->readCommentString();\n $this->translation->getExtractedComments()->add($data);\n break;\n }\n\n return true;\n }",
"protected function consumeSingleLineComment()\n {\n $comment = '';\n while (true) {\n $get = $this->get();\n $comment .= $get;\n if (ord($get) <= self::ORD_LF) { // end of line reached\n // if IE conditional comment\n if (preg_match('/^\\\\/@(?:cc_on|if|elif|else|end)\\\\b/', $comment)) {\n $this->keptComment .= \"/{$comment}\";\n }\n return;\n }\n }\n }",
"public function testSCAN_PATTERN_COMMENT() {\n\t\t$pattern = \\TYPO3\\TypoScript\\Core\\Parser::SCAN_PATTERN_COMMENT;\n\t\t$this->assertEquals(preg_match($pattern, '/* This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a block comment start.');\n\t\t$this->assertEquals(preg_match($pattern, '# This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a hash comment start.');\n\t\t$this->assertEquals(preg_match($pattern, '// This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a double slash comment start.');\n\t\t$this->assertEquals(preg_match($pattern, ' # This is a comment start ...'), 1, 'The SCAN_PATTERN_COMMENT pattern did not match a hash comment start with preceeding whitespace.');\n\t\t$this->assertEquals(preg_match($pattern, '/ This is not a comment start ...'), 0, 'The SCAN_PATTERN_COMMENT pattern matched a single slash.');\n\t\t$this->assertEquals(preg_match($pattern, '*/ This is not a comment start ...'), 0, 'The SCAN_PATTERN_COMMENT pattern matched a comment block ending.');\n\t}",
"protected function consumeSingleLineComment()\n\t{\n\t\t$comment = '';\n\t\twhile (true) {\n\t\t\t$get = $this->get();\n\t\t\t$comment .= $get;\n\t\t\tif (ord($get) <= self::ORD_LF) { // end of line reached\n\t\t\t\t// if IE conditional comment\n\t\t\t\tif (preg_match('/^\\\\/@(?:cc_on|if|elif|else|end)\\\\b/', $comment)) {\n\t\t\t\t\t$this->keptComment .= \"/{$comment}\";\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"protected function consumeMultipleLineComment()\r\n {\r\n $this->get();\r\n $comment = '';\r\n for(;;) {\r\n $get = $this->get();\r\n if ($get === '*') {\r\n if ($this->peek() === '/') { // end of comment reached\r\n $this->get();\r\n if (0 === strpos($comment, '!')) {\r\n // preserved by YUI Compressor\r\n if (!$this->keptComment) {\r\n // don't prepend a newline if two comments right after one another\r\n $this->keptComment = \"\\n\";\r\n }\r\n $this->keptComment .= \"/*!\" . substr($comment, 1) . \"*/\\n\";\r\n } else if (preg_match('/^@(?:cc_on|if|elif|else|end)\\\\b/', $comment)) {\r\n // IE conditional\r\n $this->keptComment .= \"/*{$comment}*/\";\r\n }\r\n return;\r\n }\r\n } elseif ($get === null) {\r\n throw new JSMin_UnterminatedCommentException(\r\n \"JSMin: Unterminated comment at byte {$this->inputIndex}: /*{$comment}\");\r\n }\r\n $comment .= $get;\r\n }\r\n }",
"protected function consumeMultipleLineComment()\n {\n $this->get();\n $comment = '';\n for(;;) {\n $get = $this->get();\n if ($get === '*') {\n if ($this->peek() === '/') { // end of comment reached\n $this->get();\n if (0 === strpos($comment, '!')) {\n // preserved by YUI Compressor\n if (!$this->keptComment) {\n // don't prepend a newline if two comments right after one another\n $this->keptComment = \"\\n\";\n }\n $this->keptComment .= \"/*!\" . substr($comment, 1) . \"*/\\n\";\n } else if (preg_match('/^@(?:cc_on|if|elif|else|end)\\\\b/', $comment)) {\n // IE conditional\n $this->keptComment .= \"/*{$comment}*/\";\n }\n return;\n }\n } elseif ($get === null) {\n throw new JSMin_UnterminatedCommentException(\n \"JSMin: Unterminated comment at byte {$this->inputIndex}: /*{$comment}\");\n }\n $comment .= $get;\n }\n }",
"public function test_singleline_comment_idenfier_position() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $processedstring = $lang->create_from_string('abc // com');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $processedstring->stream->tokens;\r\n $this->assertTrue(count($errors) == 0);\r\n $this->assertTrue(count($tokens) == 2);\r\n $this->assertTrue($tokens[0]->position()->colstart() == 0);\r\n $this->assertTrue($tokens[0]->position()->colend() == 2);\r\n $this->assertTrue($tokens[1]->position()->colstart() == 4);\r\n $this->assertTrue($tokens[1]->position()->colend() == 9);\r\n }",
"protected function scanExtractedComment()\n {\n return $this->scan('ExtractedComment', '/^#\\.\\s*(.+)\\s*$/');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lists all cliente entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$clientes = $em->getRepository('AppBundle:Cliente')->findAll();
return $this->render('EmrBundle:cliente:index.html.twig', array(
'clientes' => $clientes,
));
} | [
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('UnimedClienteBundle:Cliente')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MDWRosantBundle:Clientes')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function indexAction() {\n\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('AgpBundle:Cliente')->findAll(); \n \n return $this->render('AgpBundle:Cliente:index.html.twig', array(\n\t\t 'entities' => $entities,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clientes = $em->getRepository('AppBundle:Cliente')->findAll();\n\n return $this->render('cliente/index.html.twig', array(\n 'clientes' => $clientes,\n ));\n }",
"public function listar(){\n $clientes = Cliente::get();\n\n return ($clientes);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clients = $em->getRepository('ClientBundle:Client')->findAll();\n\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n ));\n }",
"public function actionIndex()\n {\n $searchModel = new TblClientesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function clientList ()\n {\n $clients_number = $this->Client->find('count');\n \n $current_page = 1;\n $max_per_page = 20;\n $total_pages = $this->getNumberOfPages($clients_number,$max_per_page);\n \n $clients = $this->getPaginatedList($max_per_page, $current_page);\n $this->set(array ('clients', 'total_pages', 'current_page', 'max_per_page'), array ($clients, $total_pages, $current_page, $max_per_page));\n \n }",
"public function getClientsAction()\n {\n $this->throwIfClientNot('backend');\n $clientManager = $this->get(\n 'fos_oauth_server.client_manager.default'\n );\n\n $class = $clientManager->getClass();\n\n return $this->getDoctrine()->getRepository($class)->findAll();\n }",
"function clientsListAction()\n\t{\n\t\t$searchParameters=$this->_request->getParams();\n\t\t\n\t\t$client_obj = new Ep_Quote_Client();\n\t\t$clients=$client_obj->getClients($searchParameters);\n\t\tif($clients!='NO')\n\t\t\t$this->_view->clients =$clients;\n\t\t\n\t\t$this->_view->client_creators=$client_obj->getClientCreatorUsers();\t\n\t\t\n\t\t$this->render('clients-list');\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $userClients = $em->getRepository('UsersBundle:UserClient')->findAll();\n\n return $this->render('UsersBundle:userclient:index.html.twig', array(\n 'userClients' => $userClients,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppBundle:Cuenta')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"function Listar_Clientes()\n\t {\n\t\tlog_message('INFO','#TRAZA| CLIENTES | Listar_Clientes() >> ');\n\t\t$data['list'] = $this->Clientes->Listar_Clientes();\n return $data;\n\t }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('FnxAdminBundle:ServicoEscala')->findAll();\n\n return array('entities' => $entities);\n }",
"public function getClientes(){\n\n\t\t\t$clientes = $this->query(\"SELECT * FROM devedores\");\n\t\t\treturn $clientes;\n\t\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clienteContactos = $em->getRepository('GestionBundle:ClienteContacto')->findAll();\n\n return $this->render('clientecontacto/index.html.twig', array(\n 'clienteContactos' => $clienteContactos,\n ));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4ContableBundle:Egreso')->findAll();\n\n return array('entities' => $entities);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clienteTipos = $em->getRepository('AppBundle:ClienteTipo')->findAll();\n\n return $this->render('clientetipo/index.html.twig', array(\n 'clienteTipos' => $clienteTipos,\n ));\n }",
"private function getClientList()\n {\n return Client::get()\n ->filter(['active' => true])\n ->sort('LastFetch')\n ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the is_con_deemed_releasable column Example usage: $query>filterByIsConDeemedReleasable(true); // WHERE is_con_deemed_releasable = true $query>filterByIsConDeemedReleasable('yes'); // WHERE is_con_deemed_releasable = true | public function filterByIsConDeemedReleasable($isConDeemedReleasable = null, $comparison = null)
{
if (is_string($isConDeemedReleasable)) {
$isConDeemedReleasable = in_array(strtolower($isConDeemedReleasable), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(ReportPeer::IS_CON_DEEMED_RELEASABLE, $isConDeemedReleasable, $comparison);
} | [
"public function filterOwnedOrManaged();",
"public function filterByActive()\n {\n return $this->filterByResignationId(null, \\Criteria::ISNULL);\n }",
"public function filter()\n {\n $this->items->filter([$this->filter, 'viewable']);\n }",
"public function getDatatableFilterAttribute($datatable_filter)\r\n {\r\n return $datatable_filter == 1 ? true : false;\r\n }",
"public function getBudgetFilter()\n {\n return $this->budget_filter;\n }",
"public function filterable(): bool;",
"protected function filterColumn()\n {\n return $this->filter_column;\n }",
"public function whereFilter()\n {\n\n }",
"public function isFilterable();",
"protected function applyColumnFilter()\n {\n $this->columns->each->bindFilterQuery($this->model());\n }",
"public function isFilter() {\n return $this->definition['filter'] === TRUE;\n }",
"private function hasFilterableAttribute()\n {\n return $this->productHelper->getFilterableAttributeCode(\n $this->registry->registry('current_custom_entity')\n ) !== '';\n }",
"public function filterByCumulableReduction($cumulableReduction = null, $comparison = null)\n\t{\n\t\tif (is_string($cumulableReduction)) {\n\t\t\t$cumulable_reduction = in_array(strtolower($cumulableReduction), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n\t\t}\n\t\treturn $this->addUsingAlias(Oops_Db_DiscountPeer::CUMULABLE_REDUCTION, $cumulableReduction, $comparison);\n\t}",
"public function DataListHasFilter() {\n\t\treturn true;\n\t}",
"public function getFilterQueries(){}",
"public function getFilterQueries() {}",
"function isFilterable(): bool;",
"public function filterByInactive()\n {\n return $this->filterByResignationId(null, \\Criteria::ISNOTNULL);\n }",
"public function filters(): array\n {\n return [\n WherePivot::make('approved')->asBoolean(),\n ];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the given request has a valid app_id. | protected function hasValidAppId(Request $request)
{
$app = Game::findOrFail($request->input('app_id'));
// Set encryption key
$this->key = $app->key;
return true;
} | [
"public function isValidApplicationId()\n {\n if ($this->applicationId === $this->requestBody->context->System->application->applicationId) {\n return true;\n }\n throw new AlexaValidationException('Invalid Application Id. Request came from an unknown application.');\n }",
"public static function validateAppId($app_id) {\t\n\t\tif (\n\t\t\t!empty($app_id) &&\n\t\t\t$app_id > 0 &&\n\t\t\t$app_id < CONST_CORE_MAX_INT &&\n\t\t\t$app_id == CONST_CORE_APPID\n\t\t\t) {\n\t\t\treturn true;\n\t\t\t}\n\t\treturn false;\n\t}",
"public function hasAppid()\n {\n return $this->appid !== null;\n }",
"public function hasAppId()\n {\n return $this->app_id !== null;\n }",
"function check_requirements()\n\t{\n\t\tif (!$this->obj_app->verify_id())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested app (\". $this->obj_app->id .\") does not exist - possibly the app has been deleted?\");\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}",
"function has_app($app)\n\t{\n\t\treturn in_array($app, $this->apps);\n\t}",
"protected function CheckAppId($AppId){\n if(preg_match($this->AppStores[$this->TargtedStore]['regex'],$AppId)){\n return true;\n }\n return false;\n }",
"public function hasAppIdsList()\n {\n return $this->app_ids !== null;\n }",
"static function validApplication($appId, $user=null) {\n\t\t\n\t\t\t$valid = false;\n\t\t\n\t\t\n\t\t\t//valid app ID\n\t\t\tif (is_numeric($appId) && $appId>=0) {\n\t\t\n\t\t\t\t//retrieve user\n\t\t\t\tif (!$user) {\n\t\t\t\t\t$user = Auth::CMSuser()->user();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//valid user\n\t\t\t\tif (isset($user) && is_numeric($user->id) && $user->id>=0) {\n\t\t\t\t\t\n\t\t\t\t\t$result = CMSSecurityPermission::select('id')\n\t\t\t\t\t\t->where('user', '=', $user->id)\n\t\t\t\t\t\t->whereHas('group', function($query) use ($appId) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//user is part of application security group\n\t\t\t\t\t\t\t$query->where('application', '=', $appId);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//at least one permission is specified\n\t\t\t\t\t\t\t$query->where(function($whereQuery) {\n\t\t\t\t\t\t\t\tforeach (CMSAccess::$PERMISSIONS as $permission) {\n\t\t\t\t\t\t\t\t \t$whereQuery->orWhere('permission', 'LIKE', '%\"' . $permission . '\"%');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t})\n\t\t\t\t\t\t->count();\n\t\n\t\t\t\t\t//check user has permission\n\t\t\t\t\t$valid = $result>0;\n\t\t\t\t\t\n\t\t\t\t} //end if (valid user)\n\t\t\n\t\t\t} //end if (valid application ID)\n\t\t\n\t\t\n\t\t\treturn $valid;\n\t\t\t\n\t\t}",
"protected function isOptionalIDValid($key, $request)\n {\n if (isset($request[$key]) && !empty($request[$key]) &&\n ($request[$key] == '-1' || ctype_digit((string) $request[$key])))\n {\n return true;\n }\n\n return false;\n }",
"public function isValidApiKeyApp($api_key) {\n $stmt = $this->conn->prepare(\"SELECT id from apps WHERE api_key = ?\");\n $stmt->bind_param(\"s\", $api_key);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }",
"public function appExistsInOlp($app_id)\n\t{\n\t\t$return = TRUE;\n\t\tif (is_numeric($app_id))\n\t\t{\n\t\t\t//Inner join a bunch of the data to make sure\n\t\t\t//we have the right data.\n\t\t\t$query = \"SELECT\n\t\t\t\tcount(*) as cnt\n\t\t\tFROM\n\t\t\t\tapplication\n\t\t\tINNER JOIN personal_encrypted USING (application_id)\n\t\t\tINNER JOIN bank_info_encrypted USING (application_id)\n\t\t\tINNER JOIN residence USING (application_id)\n\t\t\tINNER JOIN loan_note USING (application_id)\n\t\t\tINNER JOIN income USING (application_id)\n\t\t\tWHERE\n\t\t\t\tapplication_id = $app_id\";\n\t\t\ttry \n\t\t\t{\n\t\t\t\t$res = $this->sql->Query($this->database, $query);\n\t\t\t\tif ($row = $this->sql->Fetch_Object_Row($res))\n\t\t\t\t{\n\t\t\t\t\t$return = ($row->cnt > 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$this->applog->Write(__CLASS__.'::'.__METHOD__.':Exception: '.$e->getMessage());\n\t\t\t\t$return = TRUE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->applog->Write(__CLASS__.'::'.__METHOD__.\": Invalid application id ({$app_id})\");\n\t\t}\n\t\treturn $return;\n\t}",
"public function hasGamePlayedAppId()\n {\n return $this->game_played_app_id !== null;\n }",
"public function hasCreatorAppid()\n {\n return $this->creator_appid !== null;\n }",
"public static function assertHasId($request)\n\t{\n\t\tif (empty($request['id'])) {\n\t\t\tself::throwError('Missing \"id\" property in request');\n\t\t}\n\t}",
"public static function isValid($maybeAppId) {\n return !!preg_match('/^[a-f\\d]{24}$/i', $maybeAppId);\n }",
"public function validate_app($app)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n // return lang('policy_manager_app_invalid');\n }",
"public function check_availability() {\n \n // Verify if app_id and app_secret exists\n if ( ($this->app_id != '') AND ( $this->app_secret != '') ) {\n \n return true;\n \n }\n \n }",
"public function check_availability() {\n \n // Verify if app_id and app_secret exists\n if ( ($this->app_id != '') AND ( $this->app_secret != '') ) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Output only. The postdeploy Job. This is the postdeploy job in the phase. This is the last job of the phase. Generated from protobuf field .google.cloud.deploy.v1.Job postdeploy_job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; | public function getPostdeployJob()
{
return $this->postdeploy_job;
} | [
"public function setPostdeployJob($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Deploy\\V1\\Job::class);\n $this->postdeploy_job = $var;\n\n return $this;\n }",
"public function getPostdeployJobRun()\n {\n return $this->readOneof(15);\n }",
"public function setDeployJob($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Deploy\\V1\\Job::class);\n $this->deploy_job = $var;\n\n return $this;\n }",
"public function getDeployJobRun()\n {\n return $this->readOneof(9);\n }",
"public function getSavedJobPostingId() {\n\t\treturn $this->savedJobPostingId;\n\t}",
"public function getPostProcess()\n {\n if (!$this->hasPostProcess() && $this->hasDefaultPostProcess()) {\n $this->setPostProcess($this->getDefaultPostProcess());\n }\n return $this->postProcess;\n }",
"public function getJob()\n {\n return $this->job;\n }",
"public function ApplyToJobPosting($jobPostingID, $resumeID) {\r\n\r\n $jobpostingresponse = $this->job->JobPostingRequest($this->accesskeyId, $this->associationId, $this->secretaccessId, $jobPostingID, $resumeID\r\n );\r\n\r\n return $jobpostingresponse;\r\n }",
"public function postponeIfNeeded()\n {\n if ($this->server->project->is_deploying) {\n \\Log::debug(\"Releaseing job for {$this->server->name} back into the queue.\");\n $this->release((int)env('POSTPONMENT_INTERVAL', 30));\n return true;\n }\n return false;\n }",
"public function getDeployment()\n {\n return $this->deployment;\n }",
"public abstract function post(Job &$job);",
"public function getMutateJob()\n {\n return $this->mutate_job;\n }",
"public function getTriggerJobReply()\n {\n return $this->get(self::_TRIGGER_JOB_REPLY);\n }",
"public function getLastBuild()\n {\n return $this->get('job.builds.last');\n }",
"public function getLatestJob()\n {\n return $this->latest_job;\n }",
"public function getLastPost() {\n\t\treturn $this->lastPost;\n\t}",
"public function getJobInstance()\n {\n return $this->jobInstance;\n }",
"public function getPredeploy()\n {\n return $this->predeploy;\n }",
"public function getJob():string\n {\n return $this->job;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
public function __construct(IMethod $methodRepository = null) | public function __construct(MethodRepository $methodRepository = null)
{
$this->methodRepository = ($methodRepository) ? $methodRepository : new MethodRepository();
} | [
"public function __construct(InterventionRepository $interventionRepo)\n {\n \t$this->InterventionRepo = $interventionRepo;\n }",
"public function __construct(CargoRepositoryContract $cargoRepository)\n {\n $this->cargoRepository = $cargoRepository;\n }",
"public function __construct(ModuloRepositoryContract $moduloRepository)\n {\n $this->moduloRepository = $moduloRepository;\n }",
"public function __construct($service, $method) {\n $this->service = $service;\n $this->method = $method;\n }",
"public function __construct(EquipeRepositoryContract $equipeRepository)\n {\n $this->equipeRepository = $equipeRepository;\n }",
"public function __constructor(FooRepository $repository)\n {\n $this->repository = $repository;\n }",
"public function __construct(CityRepositoryInterface $cityRepo){\n\t\t$this -> cityRepo = $cityRepo;\n\t}",
"public function __construct(PokemonRepositoryInterface $pokemonRepository)\n {\n $this->pokemonRepository = $pokemonRepository;\n }",
"public function __construct($providerMethod)\n {\n $this->providerMethod = $providerMethod;\n }",
"public function __construct(UserRepositoryContract $repository)\n {\n $this->repository = $repository;\n }",
"public function __construct(ProductRepositoryInterface $productRepo)\n {\n $this->productRepo = $productRepo;\n }",
"public function __construct( VoucherRepository $repository )\n {\n // Repository to persist data\n $this->repository = $repository;\n }",
"public function __construct(MovieRepository $movieRepository)\n {\n $this->movieRepository = $movieRepository;\n }",
"public function __construct(InspectionRepository $inspectionRepository){\n $this->inspectionRepository = $inspectionRepository;\n }",
"public function __construct(ArticleRatingRepository $repository)\n {\n $this->repositories = $repository;\n }",
"public function __construct(IdentificationTypeRepository $identificationTypeRepo)\n {\n \t$this->identificationTypeRepo = $identificationTypeRepo;\n }",
"public function __construct(\n private AirplaneSitRepository $airplaneSitRepository\n )\n {\n //\n }",
"public function __construct(StoreFileRepository $repository){\n $this->repository = $repository;\n }",
"public function __construct(EnterpriseRepository $enterpriseRepo)\n {\n \t$this->enterpriseRepo = $enterpriseRepo;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check for language schema | public function testSchema()
{
$client = static::createRestClient();
$client->request('GET', '/schema/i18n/language/collection', [], [], ['HTTP_ACCEPT_LANGUAGE' => 'en,de']);
$results = $client->getResults();
$this->assertEquals('A Language available for i18n purposes.', $results->items->description);
$this->assertEquals(array('id', 'name'), $results->items->required);
$properties = $results->items->properties;
$this->assertEquals('string', $properties->id->type);
$this->assertEquals('Language Tag', $properties->id->title);
$this->assertEquals('A RFC2616 language tag.', $properties->id->description);
$this->assertEquals('object', $properties->name->type);
$this->assertEquals('Language', $properties->name->title);
$this->assertEquals('Common name of a language.', $properties->name->description);
$this->assertEquals('string', $properties->name->properties->en->type);
} | [
"public function hasLanguage() : bool;",
"public function hasLanguage(): bool;",
"protected function _ValidateLanguage()\t\t\t\t\t\t\t\t\t\t\t\t {}",
"protected function checkLanguage()\n\t{\n\t\t$objDataProvider = $this->getDC()->getDataProvider();\n\n\t\t// Check if DP is multilanguage\n\t\tif ($this->getDC()->getDataProvider() instanceof InterfaceGeneralDataMultiLanguage)\n\t\t{\n\t\t\t$this->blnMLSupport = true;\n\t\t\t$this->objLanguagesSupported = $objDataProvider->getLanguages($this->getDC()->getId());\n\t\t\t$this->strCurrentLanguage = $objDataProvider->getCurrentLanguage();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->blnMLSupport = false;\n\t\t\t$this->objLanguagesSupported = null;\n\t\t\t$this->strCurrentLanguage = null;\n\t\t}\n\t}",
"public function need_autocomplete_language () {\n\n $this->test_config_initialized();\n\n return ($this->database_config['conn_schema']['correct_language'] ? true : false);\n }",
"public function isLanguageAlterable();",
"protected function checkLang(){\n $this->current_lang = \\Request::get('lang') !== null ? e(\\Request::get('lang')) : 'en';\n if(!in_array($this->current_lang, $this->language_available)) {\n abort(404);\n }\n }",
"private function validate_language()\n\t{\n\t\t$this->form_validation->set_rules('language', lang('language'), 'trim|required');\n\n\t\treturn $this->form_validation->run();\n\t}",
"protected function isInconsistentLanguageHandlingAllowed() : bool {}",
"public function checkLanguage() {\n if (!isset($this->language) || $this->language === '') {\n die('Missing mandatory param \"language\".');\n };\n\n // Verifying if Language is within the available options\n $lanArr = ['english', 'italian'];\n if (in_array($this->language, $lanArr)) {\n $this->language = strval($this->language);\n return $this->language;\n } else {\n die(\"Input \\\"language\\\" $this->language. Language parameter options are \\\"English\\\" or \\\"Italian\\\".\");\n };\n }",
"public function isMultiLanguage();",
"public function testValidateLanguage()\n {\n $oLang = new oxLang();\n\n $this->assertEquals( 1, $oLang->validateLanguage( 1 ) );\n $this->assertEquals( 0, $oLang->validateLanguage( 3 ) );\n $this->assertEquals( 0, $oLang->validateLanguage( 'xxx' ) );\n }",
"public static function checkMultilingual()\n\t{\n\t\treturn (file_exists(TL_ROOT . '/system/drivers/DC_Multilingual.php') && count(self::getAvailableLanguages()) > 1) ? true : false;\n\t}",
"function supportedLanguage($lang){\n if(in_array(strtolower($lang), getOption('supported_languages'))){\n return true;\n }\n\n return false;\n}",
"protected function checkLang()\n {\n $this->current_lang = \\Request::get('lang') !== null ? e(\\Request::get('lang')) : 'en';\n if(!in_array($this->current_lang, $this->language_available)) {\n abort(404);\n }\n }",
"function avaliableLanguage($lang){\n if(in_array(strtolower($lang),enabledLanguagesList())){\n return true;\n }\n\n return false;\n}",
"function _checkLanguageExistence($language) {\n global $basePath;\n\n if (file_exists($basePath.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.$language.'.lang.php')) {\n return true;\n } else {\n return false;\n }\n }",
"public function languageAvailable($lang){\n if($this->_usePOEditor()) return array_key_exists($lang, $this->getListLanguage());\n return file_exists($_SERVER['DOCUMENT_ROOT'].FILE_PATH.\"/public/lang/\".$lang.\".json\");\n }",
"public function testLang()\n\t{\n\t\t$lang_available = Lang::get_lang_available();\n\t\t$keys = array_keys(Lang::get_lang());\n\n\t\tforeach ($lang_available as $code) {\n\t\t\t$lang_test = Lang::factory()->make($code);\n\t\t\t$locale = $lang_test->get_locale();\n\n\t\t\tforeach ($keys as $key) {\n\t\t\t\t$this->assertArrayHasKey($key, $locale, 'Language ' . $lang_test->code() . ' is incomplete.');\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BlackBerry specific platform override payload. Include either alert or both body and content_type. | function blackberry($alert, $body=null, $contentType=null)
{
$payload = array();
if (!is_null($alert)) {
$payload["alert"] = $alert;
return $payload;
}
if (is_null($body) or is_null($contentType)) {
throw new InvalidArgumentException("Either alert or both body and contentType must be set.");
}
$payload["body"] = $body;
$payload["content_type"] = $contentType;
return $payload;
} | [
"function ios($alert=null, $badge=null, $sound=null, $contentAvailable=false,\n $extra=null, $expiry=null, $priority=null, $category=null, $interactive=null, \n $mutableContent=false, $mediaAttachment=null, $title=null, $subtitle=null, $collapseId=null)\n{\n $payload = array();\n if ($alert) {\n $payload[\"alert\"] = $alert;\n }\n if ($badge) {\n if (is_string($badge)) {\n if (preg_match(AUTOBADGE_FORMAT, $badge) === 0) {\n throw new InvalidArgumentException(\"Invalid autobadge string\");\n }\n } elseif (!is_int($badge)) {\n throw new InvalidArgumentException(\"Invalid badge type\");\n }\n $payload[\"badge\"] = $badge;\n }\n if ($sound) {\n $payload[\"sound\"] = $sound;\n }\n if ($contentAvailable) {\n $payload[\"content_available\"] = true;\n }\n if ($extra) {\n $payload[\"extra\"] = $extra;\n }\n if ($expiry) {\n if (!is_int($expiry) && !is_string($expiry)) {\n trigger_error(\"Expiry must either be an integer, or string of a timestamp in ISO UTC format.\",\n E_USER_WARNING);\n die();\n }\n $payload[\"expiry\"] = $expiry;\n }\n if ($priority) {\n if(!is_int($priority)) {\n trigger_error(\"iOS priority must be an integer.\",\n E_USER_WARNING);\n die();\n } \n $payload[\"priority\"] = $priority;\n }\n if ($category) {\n if (!is_string($category)) {\n trigger_error(\"iOS category must be a string.\",\n E_USER_WARNING);\n die();\n }\n $payload[\"category\"] = $category;\n }\n if ($interactive) {\n $payload[\"interactive\"] = $interactive;\n }\n if ($mutableContent) {\n $payload[\"mutable_content\"] = true;\n }\n if ($mediaAttachment) {\n $payload[\"media_attachment\"] = $mediaAttachment;\n }\n if ($title) {\n if (!is_string($title)) {\n trigger_error(\"iOS title must be a string.\",\n E_USER_WARNING);\n die();\n }\n $payload[\"title\"] = $title;\n }\n if ($subtitle) {\n $payload[\"subtitle\"] = $subtitle;\n }\n if ($collapseId) {\n $payload[\"collapse_id\"] = $collapseId;\n }\n\n return $payload;\n}",
"private function setPayload($payload)\n\t{\n\t\tif ( (is_string($payload) && empty($payload)) || (is_array($payload) && count($payload) == 0) )\n\t\t{\n\t\t\t// Empty strings or arrays are not allowed\n\t\t\tthrow new \\InvalidArgumentException('Invalid payload for message. Payload was empty, but not null)');\n\t\t}\n\t\telse if (is_array($payload) || null === $payload)\n\t\t{\n\t\t\tif ( isset($payload['aps']) )\n\t\t\t{\n\t\t\t\t// Reserved key is used\n\t\t\t\tthrow new \\InvalidArgumentException('Invalid payload for message. Custom payload may not contain the reserved \"aps\" key.');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// This is okay, set as payload\n\t\t\t\t$this->payload = $payload;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Try to decode JSON string payload\n\t\t\t$payload = json_decode($payload, true);\n\n\t\t\t// Check if decoding the payload worked\n\t\t\tif (null === $payload) {\n\t\t\t\tthrow new \\InvalidArgumentException('Invalid payload for message. Payload was invalid JSON.');\n\t\t\t}\n\n\t\t\t// Set as payload\n\t\t\t$this->payload = $payload;\n\t\t}\n\t}",
"private function createPayload(): Payload\n {\n return new Payload(new Aps(new Alert()));\n }",
"private function process_notification_data($payload){\n \n if(!array_key_exists('title',$payload) || empty($payload['title'])){\n return new WP_Error('invalid_notification_payload',__(\"Notification data invalid format. Check again.\",WR_TEXT_DOMAIN),array('status'=>400));\n }\n \n $notification = array();\n\n\t\t$payload['data']['type']='type';\n if(array_key_exists('data',$payload) && !empty($payload['data'])){\n $notification['data'] = $payload['data'];\n\t\t\tunset($payload['data']);\n }\n \n \n $notification['notification'] = $payload;\n// \t\tunset($notification['notification']['click_action']);\n\t\n // $notification_keys = array(\n // 'title','body','image'\n // ); \n // foreach($notification_keys as $key){\n // if(array_key_exists($key,$payload)){\n // $notification['notification'][$key]= $payload[$key];\n // }\n // }\n \n \n\t\t$notification['collapse_key'] = $payload['title'];\n\n\n// $notification['android']=array(\n// 'ttl'=>1000,\n// 'collapse_key'=> 'asa',\n// 'notification'=> $payload,\n// 'priority'=> $payload['priority'],\n// );\n\n// $notification['webpush']=array(\n// 'headers'=>array(\n// 'ttl'=>1000\n// ),\n// 'data'=>$payload['data'],\n// 'notification'=>$payload,\n// 'fcm_options'=>array(\n// 'link'=>$payload['click_action'],\n// 'analytics_label'=>$payload['title']\n// ),\n// );\n\n// $notification['apns']= array(\n// 'headers'=>$payload['data'],\n// 'payload'=>$payload,\n// 'fcm_options'=>array(\n// \"analytics_label\"=> $payload['title'],\n// \"image\" => $payload['image'] \n// )\n// );\n\n $notification['fcm_options']=array(\n \"analytics_label\"=> $payload['title'],\n );\n $notification['direct_boot_ok']=true;\n \n\n if(array_key_exists('priority',$payload)){\n $notification['priority'] = $payload['priority'];\n }\n\n return $notification;\n }",
"protected function PreparePayload() {\n $this->payload['template_type'] = $this->type;\n $this->payload['top_element_style'] = $this->topElementStyle;\n $this->payload['elements'] = $this->elements;\n\n if (isset($this->button)) {\n $this->payload['buttons'][] = $this->button;\n }\n }",
"public function setUpdateBody()\n {\n $data = $this->getPostData();\n\n /* Add payload here */\n $body = [\n\n 'id' => isset($data['id']) ? $data['id'] : '', \n\n 'code' => isset($data['name']) ? $data['name'] : '',\n 'is_active' => isset($data['is_active']) ? $data['is_active'] : 'Y',\n 'description' => isset($data['description']) ? $data['description'] : '',\n 'creation_date' => date('Y-m-d H:i:s'),\n 'created_by' => \\Session::get('logged_user')['username'],\n 'updated_date' => date('Y-m-d H:i:s'),\n 'updated_by' => \\Session::get('logged_user')['username']\n\n ];\n\n $this->updateBody = $body;\n\n }",
"public function setPayload($value);",
"public function setPayload($payload);",
"protected function addToPayload()\n\t{\n\t\t\n\t}",
"function als_alert_default_args() {\n\n\t/**\n\t * Filters the default alert args.\n\t *\n\t * @since 1.0.0\n\t */\n\treturn apply_filters( 'als_alert_default_args', array(\n\t\t'post_ID' => 0,\n\t\t'content' => '',\n\t\t'color' => 'default',\n\t\t'type' => 'inset-banner',\n\t\t'icon' => 'default',\n\t\t'time_range' => '',\n\t\t'popup_image' => '',\n\t\t'popup_image_small'=> '',\n\t\t'user_interaction' => 'none',\n\t\t'button_text' => '',\n\t\t'button_link' => '',\n\t\t'button_new_tab' => '',\n\t) );\n}",
"public function setPayload($payload)\n {\n $this->ok = true;\n $this->payload = $payload;\n }",
"public function setPayload() {\r\n $url = \"http://zonehmirrors.org/defaced/2017/09/16/kosmik.id/kosmik.id/\";\r\n $payload = '-0-hacked-by-'.$this->credentials->user.'-\"><center><iframe src='.$url.' height=620px width=1100px scrolling=no frameborder=0>';\r\n return $payload;\r\n }",
"public function sendPayload($payload)\n {\n }",
"public function setSaveBody()\n {\n $data = $this->getPostData();\n\n /* Add payload here */\n $body = [\n\n 'name' => isset($data['name']) ? $data['name'] : '',\n\n ];\n $this->saveBody = $body;\n }",
"public function setPayload($payload)\n {\n $this->payload = $payload;\n }",
"protected function PreparePayload() \n {\n $this->payload['template_type'] = $this->type;\n $this->payload['sharable'] = $this->isSharable;\n $this->payload['image_aspect_ratio'] = $this->aspectRatio;\n $this->payload['elements'] = $this->elements;\n }",
"public function postApplications6d917118Ios()\n {\n return '{\n \"id\": \"22debd80-04ab-4213-ac6f-18d6c0c106fe\",\n \"name\": \"An ios variant\",\n \"description\": \"And a description on the variant\",\n \"variantID\": \"13f663bc-6321-4fc0-b8e1-77429d6c180c\",\n \"secret\": \"ed92f308-67ae-4315-b7d7-57b0c206574d\",\n \"developer\": \"user\",\n \"production\": false,\n \"type\": \"ios\"\n}';\n }",
"private function alertMethods()\n {\n $mailOn = $this->getPostValue('mailon') !== null ? '1' : '0';\n $this->model('Setting')->set(\"alert-mail\", $mailOn);\n\n $telegramOn = $this->getPostValue('telegramon') !== null ? '1' : '0';\n $this->model('Setting')->set(\"alert-telegram\", $telegramOn);\n\n $slackOn = $this->getPostValue('slackon') !== null ? '1' : '0';\n $this->model('Setting')->set(\"alert-slack\", $slackOn);\n\n $discordOn = $this->getPostValue('discordon') !== null ? '1' : '0';\n $this->model('Setting')->set(\"alert-discord\", $discordOn);\n }",
"function processPlatformshPayload() {\n $show_routes = $this->config['routes'];\n $show_configurations = $this->config['configurations'];\n\n $json = $this->request->getContent();\n $platformsh = json_decode($json);\n\n if (empty($platformsh)) {\n throw new \\RuntimeException('Invalid Platform.sh webhook payload');\n }\n\n // Author name\n $name = $platformsh->payload->user->display_name;\n\n // Branch\n $branch = 'not-found-on-payload';\n if (!empty($platformsh->parameters->environment)) {\n $branch = $platformsh->parameters->environment;\n }\n else if (!empty($platformsh->payload->environment->name)) {\n $branch = $platformsh->payload->environment->name;\n }\n\n // Project\n $project = $platformsh->project;\n\n // Region/project url\n $host = $this->config['region'] . '.platform.sh';\n $project_url = \"https://$host/projects/$project/environments/$branch\";\n\n // Optional project name\n if ($this->config['project']) {\n $project = $this->config['project'];\n }\n\n // Commits\n if (!empty($platformsh->payload->commits_count)) {\n $commits_count = $platformsh->payload->commits_count;\n $commits_count_str = \"$commits_count commit\" . ($commits_count > 1 ? 's' : '');\n\n $c = 0;\n foreach ($platformsh->payload->commits as $commit) {\n $sha = substr($commit->sha, 0, 8);\n $commits[] = \"$sha: {$commit->message} - {$commit->author->name}\";\n $c++;\n if ($c == $this->config['commit_limit']) {\n $commits[] = \"... and more, only $c were shown.\";\n break;\n }\n }\n $commits = implode(\"\\n\", $commits);\n $this->slack->attach(array(\n 'text' => $commits,\n 'fallback' => $commits,\n 'color' => '#345',\n ));\n }\n\n $debug = false;\n\n // Handle webhook\n switch ($platformsh->type) {\n case 'environment.push':\n $this->slack_text = \"$name pushed $commits_count_str to branch `$branch` of <$project_url|$project>\";\n if ($branch == 'master') {\n $show_configurations = true;\n }\n break;\n\n case 'environment.branch':\n $this->slack_text = \"$name created a branch `$branch` of <$project_url|$project>\";\n $show_routes = true;\n break;\n\n case 'environment.delete':\n $this->slack_text = \"$name deleted the branch `$branch` of <$project_url|$project>\";\n break;\n\n case 'environment.merge':\n $this->slack_text = \"$name merged branch `{$platformsh->parameters->from}` into `{$platformsh->parameters->into}` of <$project_url|$project>\";\n if ($platformsh->parameters->into == 'master') {\n $show_configurations = true;\n }\n break;\n\n case 'environment.subscription.update':\n $this->slack_text = \"$name updated the subscription of <$project_url|$project>\";\n $show_configurations = true;\n break;\n\n case 'project.domain.create':\n case 'project.domain.update':\n $this->slack_text = \"$name updated domain `{$platformsh->payload->domain->name}` of <$project_url|$project>\";\n if (!empty($platformsh->payload->domain->ssl->has_certificate)) {\n $this->slack->attach(array(\n 'title' => 'SSL',\n 'text' => \"*CA: * {$platformsh->payload->domain->ssl->ca}\\n*Expires: * {$platformsh->payload->domain->ssl->expires_on}\",\n 'fallback' => \"CA: {$platformsh->payload->domain->ssl->ca}\\n\",\n 'color' => $this->config['attachment_color'],\n 'mrkdwn_in' => array('text'),\n ));\n }\n break;\n\n case 'environment.backup':\n $this->slack_text = \"$name created the snapshot `{$platformsh->payload->backup_name}` from `$branch` of <$project_url|$project>\";\n break;\n\n case 'environment.deactivate':\n $this->slack_text = \"$name deactivated the environment `$branch` of <$project_url|$project>\";\n break;\n\n case 'environment.variable.create':\n $this->slack_text = \"$name created variable `{$platformsh->payload->variable->name}` on <$project_url|$project>\";\n break;\n\n case 'environment.variable.update':\n $this->slack_text = \"$name updated variable `{$platformsh->payload->variable->name}` on <$project_url|$project>\";\n break;\n\n case 'environment.variable.delete':\n $this->slack_text = \"$name deleted variable `{$platformsh->payload->variable->name}` on <$project_url|$project>\";\n break;\n\n default:\n $this->slack_text = \"$name triggerred an unhandled webhook `{$platformsh->type}` to branch `$branch` of <$project_url|$project>\";\n if ($this->config['debug']) {\n $debug = true;\n $this->slack->attach(array(\n 'text' => 'JSON saved to ' . $filename,\n 'fallback' => 'JSON saved to ' . $filename,\n 'color' => $this->config['attachment_color'],\n ));\n }\n break;\n }\n\n if ($debug || ($this->config['debug'] && $this->config['debug_all'])) {\n $filename = $this->config['debug'] . '/platformsh2slack.' . $platformsh->type . '.' . time() . '.json';\n file_put_contents($filename, $json);\n }\n\n // Result\n $this->slack->attach(array(\n 'text' => ucfirst($platformsh->result),\n 'fallback' => ucfirst($platformsh->result),\n 'color' => $platformsh->result == 'success' ? 'good' : 'danger',\n ));\n\n // Environment configuration\n if ($show_configurations && preg_match('/Environment configuration:(.*)Environment routes/s', $platformsh->log, $matches)) {\n $environment_configuration = $this->trim($matches[1]);\n $this->slack->attach(array(\n 'title' => 'Environment configuration',\n 'text' => $environment_configuration,\n 'fallback' => $environment_configuration,\n 'color' => $this->config['attachment_color'],\n ));\n }\n\n // Environment routes\n if ($show_routes && preg_match('/Environment routes:(.*)/s', $platformsh->log, $matches)) {\n $routes = $this->trim($matches[1]);\n $this->slack->attach(array(\n 'title' => 'Environment routes',\n 'text' => $routes,\n 'fallback' => $routes,\n 'color' => $this->config['attachment_color'],\n ));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate Shopping Fee Take the maximum value of Fee By Dimension, Fee By Weight | public function getShoppingFee(): float
{
return max($this->getFeeByDimension(), $this->getFeeByWeight());
} | [
"public function getMaxWeight() {\n $jsonModel = Mage::getModel('synergeticagency_gls/jsonimport');\n $fieldName = 'maxweight';\n $originCountryId = Mage::getStoreConfig(Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID, $this->getStore());\n $shipToCountryId = $this->_getCurrentShipment()->getShippingAddress()->getCountryId();\n if($this->isParcelshopDelivery()) {\n $fieldName = 'parcelshopweight';\n }\n if($this->isDomestic()) {\n $maxWeight = $jsonModel->getDomesticValueByOriginCountryId($originCountryId,$fieldName);\n } else {\n $maxWeight = $jsonModel->getForeignValueByOriginAndForeignCountryId($originCountryId,$shipToCountryId,$fieldName);\n }\n return $maxWeight;\n }",
"private function getFeeByWeight()\n {\n return 0;\n }",
"protected function getFeeByDimension(): float\n {\n return $this->product->width *\n $this->product->height *\n $this->product->depth *\n $this->coefficients['dimension'];\n }",
"public function getMaximumAmount();",
"public function getFeeByWeight(): float\n {\n return $this->product->getWeight() * $this->weightCoefficient;\n }",
"protected function getFeeByWeight(): float\n {\n return $this->product->weight * $this->coefficients['weight'];\n }",
"public function getMaxPrice();",
"public function calculateMaxMFB($taxableincome, $mfbrate, $daysperweek) {\n\t\t\n\t\t$maxmfb = $taxableincome;\n\t\t\n\t\t$maxmfb = $maxmfb * ($mfbrate);\n\t\t\n\t\t//$maxmfb = $maxmfb * ($daysperweek / 5);\n\t\t\n\t\treturn $maxmfb;\n\t}",
"private function getMaximumAmountOfEarnedIncomeSubjectToRetirementFee(){\n $multiplier = 8.07;\n\n return $this->baseAmounts->getIncomeBaseAmountForCurrentYear() * $multiplier;\n }",
"public function getMaxWeight(): int;",
"public function getProcessorFee();",
"protected function CalculateMaxStorageBurden()\n {\n if ($this->m_aOriginalData[self::PROPERTY_MAX_STOARGE_BURDEN] != $this->m_aData[self::PROPERTY_MAX_STOARGE_BURDEN])\n {\n $fAdd = $this->m_aData[self::PROPERTY_MAX_STOARGE_BURDEN] - $this->m_aOriginalData[self::PROPERTY_MAX_STOARGE_BURDEN];\n \n $sSQL = \" UPDATE T_CoopOrder SET fMaxStorageBurden = Nullif(IfNull(fMaxStorageBurden,0) + (\" . $fAdd . \"),0) \" .\n \" WHERE CoopOrderKeyID = \" . $this->m_aData[self::PROPERTY_COOP_ORDER_ID] . ';';\n \n $this->RunSQL($sSQL);\n \n //also update internal variable for display\n $this->m_aData[self::PROPERTY_COOP_ORDER_MAX_STORAGE_BURDEN] += $fAdd;\n }\n }",
"public function getPriceMax()\n {\n return $this->pricemax;\n }",
"public function getForwarderFee(): float;",
"public function getShipmentFeeProduct()\n {\n }",
"public function getEstablishmentFeeExchange($id){\n\n\n\n $tender = pnotice::whereid($id)->first();\n if($tender->ptype_id==2)\n {\n $fees = pestabishmentfee::wherelocality(Auth::user()->company->locality)->get();\n if(count($fees)>0){\n foreach($fees as $fee){\n if($fee->lower < $tender->bidbond && $tender->bidbond < $fee->upper && $fee->validity = $tender->period){\n $amount = $fee->value/$this->getExchangeRate();\n return $amount;\n }\n }\n }\n}\n\n return 0;\n\n}",
"function advanced_cost_apply( $summ , $form , $bktype , $days_array , $is_get_description = false ){\r\n //if ($summ == 0 ) return $summ;\r\n $booking_form_name='';\r\n if (isset($_POST['booking_form_type']) ){\r\n if (! empty($_POST['booking_form_type'])) {\r\n $booking_form_name = $_POST['booking_form_type'];\r\n $booking_form_name = str_replace(\"\\'\",'',$booking_form_name);\r\n if ($booking_form_name == 'standard') $booking_form_name = '';\r\n }\r\n }\r\n\r\n//debuge($form);\r\n $additional_cost = 0; // advanced cost, which will apply\r\n $booking_form_show = get_form_content ($form, $bktype);\r\n\r\n//debuge($booking_form_show);\r\n if ($booking_form_name === '') { $field__values = get_bk_option( 'booking_advanced_costs_values' ); } // Get saved advanced cost structure for STANDARD form\r\n else { $field__values = get_bk_option( 'booking_advanced_costs_values_for' . $booking_form_name ); }\r\n//debuge($field__values, $booking_form_name);\r\n $full_procents = 1;\r\n $advanced_cost_hint = array();\r\n if ( $field__values !== false ) { // Its exist\r\n if ( is_serialized( $field__values ) ) $field__values_unserilize = unserialize($field__values);\r\n else $field__values_unserilize = $field__values;\r\n $booking_form_show['content'] ='';\r\n\r\n \r\n\r\n if (! empty($field__values_unserilize)) { // Checking\r\n if (is_array($field__values_unserilize)) {\r\n foreach ($field__values_unserilize as $key_name => $value) { // repeat in format \"visitors\" => array (\"1\"=>25, \"2\"=>\"200%\")\r\n $key_name= trim($key_name); // Get trim visitors name (or some other)\r\n \r\n $advanced_cost_hint[$key_name] = array( 'value' => $value );\r\n// debuge($key_name, $value);\r\n// debuge($booking_form_show);\r\n if (isset( $booking_form_show[$key_name] )) { // Get value sending from booking form like this $booking_form_show[\"visitors\"]\r\n $selected_value = $booking_form_show[$key_name];\r\n\r\n\r\n if ( is_array($selected_value) ) $selected_value_array = $selected_value;\r\n else {\r\n if ( strpos($selected_value,',')===false )\r\n $selected_value_array = array($selected_value);\r\n else $selected_value_array = explode(',',$selected_value);\r\n }\r\n\r\n//debuge($value, $selected_value_array);\r\n foreach ($selected_value_array as $selected_value ) {\r\n $selected_value = trim($selected_value);\r\n $selected_value = str_replace(' ','_',$selected_value);\r\n if (\r\n ($selected_value == '') ||\r\n ($selected_value == 'yes') ||\r\n ($selected_value == __('yes' ,'booking') )\r\n ) $selected_value = 'checkbox';\r\n\r\n if ( isset($value[$selected_value]) ) { // check how its value for selected value in cash or procent\r\n $additional_single_cost = $value[$selected_value]; \r\n $additional_single_cost = str_replace(',','.',$additional_single_cost);\r\n $full_additional_single_cost = 0;\r\n if ( strpos($additional_single_cost, '%') !== false ) { // %\r\n if ( strpos($additional_single_cost, '+') !== false ) {\r\n $additional_single_cost = str_replace('%','',$additional_single_cost);\r\n $additional_single_cost = str_replace('+','',$additional_single_cost);\r\n $additional_single_cost = floatval($additional_single_cost); \r\n $full_additional_single_cost = floatval( $summ * ( $additional_single_cost/100) );\r\n $advanced_cost_hint[$key_name]['fixed'] = $full_additional_single_cost;\r\n $additional_cost += $full_additional_single_cost; \r\n } else {\r\n $additional_single_cost = str_replace('%','',$additional_single_cost);\r\n $additional_single_cost = floatval($additional_single_cost);\r\n $advanced_cost_hint[$key_name]['percent'] = ( ( $additional_single_cost * 1 /100) );\r\n $full_procents = ( ( $additional_single_cost * $full_procents /100) );\r\n//debuge('$full_procents, $additional_single_cost', $full_procents, $additional_single_cost); \r\n }\r\n }elseif ( strpos($additional_single_cost, '/day') !== false ) { // per day\r\n $additional_single_cost = str_replace('/day','',$additional_single_cost);\r\n $additional_single_cost = floatval($additional_single_cost);\r\n $full_additional_single_cost = floatval($additional_single_cost)*count($days_array); \r\n $advanced_cost_hint[$key_name]['fixed'] = $full_additional_single_cost;\r\n $additional_cost += $full_additional_single_cost;\r\n }elseif ( strpos($additional_single_cost, '/night') !== false ) { // per day\r\n $additional_single_cost = str_replace('/night','',$additional_single_cost);\r\n $additional_single_cost = floatval($additional_single_cost);\r\n $nights_count = (count($days_array)-1);\r\n if ($nights_count==0) $nights_count = 1;\r\n $full_additional_single_cost = floatval($additional_single_cost)*$nights_count;\r\n $advanced_cost_hint[$key_name]['fixed'] = $full_additional_single_cost;\r\n $additional_cost += $full_additional_single_cost;\r\n }else{ // cashe\r\n $full_additional_single_cost = floatval($additional_single_cost);\r\n $advanced_cost_hint[$key_name]['fixed'] = $full_additional_single_cost;\r\n $additional_cost += $full_additional_single_cost;\r\n } \r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n \r\n if ( $is_get_description ) {\r\n \r\n foreach ( $advanced_cost_hint as $key_name => $array_values ) {\r\n\r\n if (! isset($advanced_cost_hint[$key_name]['cost_hint']))\r\n $advanced_cost_hint[$key_name]['cost_hint'] = '';\r\n\r\n if ( isset($array_values['percent'])) {\r\n\r\n if ( get_bk_option( 'booking_advanced_costs_calc_fixed_cost_with_procents' ) == 'On' ) {\r\n $tot_sum = ( ($summ + $additional_cost) * $full_procents );\r\n $advanced_cost_hint[$key_name]['cost_hint'] = $tot_sum - $tot_sum / $advanced_cost_hint[$key_name]['percent'] ;\r\n } else { \r\n//debuge($summ , $full_procents ) ;\r\n $tot_sum = ( ($summ ) * $full_procents );\r\n \r\n $advanced_cost_hint[$key_name]['cost_hint'] = $tot_sum - $tot_sum / $advanced_cost_hint[$key_name]['percent'] ;\r\n//debuge($tot_sum,$advanced_cost_hint[$key_name]['percent'], $advanced_cost_hint[$key_name]['cost_hint']); \r\n }\r\n\r\n } else if ( isset($array_values['fixed'])) {\r\n $advanced_cost_hint[$key_name]['cost_hint'] = $advanced_cost_hint[$key_name]['fixed'];\r\n }\r\n }\r\n \r\n $show_advanced_cost_hints = array();\r\n foreach ( $advanced_cost_hint as $key => $value ) {\r\n $show_advanced_cost_hints[$key . '_hint'] = $value['cost_hint'];\r\n }\r\n \r\n//debuge($advanced_cost_hint);\r\n return $show_advanced_cost_hints;\r\n }\r\n\r\n\r\n if ( get_bk_option( 'booking_advanced_costs_calc_fixed_cost_with_procents' ) == 'On' ) {\r\n return ($summ + $additional_cost) * $full_procents;\r\n } else { \r\n return $summ * $full_procents + $additional_cost ;\r\n }\r\n }",
"private function getFeeObject()\n {\n return $this->registry->registry('mageworx_multifees_fee');\n }",
"function construct_final_value_fee($bidid = 0, $userid = 0, $pid = 0, $mode = '', $cattype = '')\r\n {\r\n global $ilance, $myapi, $ilconfig, $phrase;\r\n \r\n $ilance->subscription = construct_object('api.subscription');\r\n\t\t\t\t// Murugan\r\n $userid=intval($userid);\r\n\t\t\t\t\r\n $tiers = $price = $total = $remaining = $fvf = 0;\r\n \r\n ($apihook = $ilance->api('construct_final_value_fee_start')) ? eval($apihook) : false;\r\n \r\n // fetch awarded bid amount\r\n $project = $ilance->db->query(\"\r\n SELECT *\r\n FROM \" . DB_PREFIX . \"project_bids\r\n WHERE project_id = '\" . intval($pid) . \"'\r\n AND bid_id = '\" . intval($bidid) . \"'\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n if ($ilance->db->num_rows($project) > 0)\r\n {\r\n $resproject = $ilance->db->fetch_array($project);\r\n \r\n // awarded bid amount\r\n if ($resproject['bidamounttype'] == 'entire' OR $resproject['bidamounttype'] == 'item' OR $resproject['bidamounttype'] == 'lot' OR $resproject['bidamounttype'] == 'weight')\r\n {\r\n if ($resproject['qty'] <= 0)\r\n {\r\n $resproject['qty'] = 1;\r\n }\r\n \r\n $bidamount = ($resproject['bidamount'] * $resproject['qty']);\r\n }\r\n else\r\n {\r\n if ($resproject['estimate_days'] <= 0)\r\n {\r\n $resproject['estimate_days'] = 1;\r\n }\r\n \r\n $bidamount = ($resproject['bidamount'] * $resproject['estimate_days']);\r\n }\r\n \r\n // #### fvf commission logic : who gets charged? #######\r\n $bidderid = ($cattype == 'product') ? $resproject['project_user_id'] : $resproject['user_id'];\r\n \r\n // #### ARE WE USING FIXED CATEGORY FEES? ##############\r\n // first check if admin uses fixed fees in this category\r\n // admin defines fixed fees within AdminCP > Distribution > Categories > (edit mode)\r\n if ($ilance->categories->usefixedfees($cid) AND !empty($resproject['bidamounttype']))\r\n {\r\n // #### let's output our fixed commission amount\r\n $fvf = $ilance->categories->fixedfeeamount($cid);\r\n }\r\n \r\n // #### NO FIXED CATEGORIES FEES > CHECK FINAL VALUE GROUP #############\r\n else\r\n {\r\n // fetch final value group for this category\r\n // we are at this point because the admin has not defined fixed fees\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Murugan Changes On NOv 12\r\n\t\t\t\t\t\t\t\t$subid=$ilance->db->query(\" \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tSELECT user.subscriptionid, user.user_id, sub.subscriptiongroupid, perm.value\r\n FROM \" . DB_PREFIX . \"subscription_user user\r\n LEFT JOIN \" . DB_PREFIX . \"subscription sub ON (sub.subscriptionid = user.subscriptionid)\r\n LEFT JOIN \" . DB_PREFIX . \"subscription_permissions perm ON (perm.subscriptiongroupid = sub.subscriptiongroupid)\r\n WHERE user.user_id = '\" . intval($userid) . \"'\r\n\t\t\t\t\t\t\t\t AND sub.active = 'yes'\r\n AND user.active = 'yes'\r\n AND perm.subscriptiongroupid = sub.subscriptiongroupid\r\n AND perm.accessname = 'fvffees' \");\r\n\t\t\t\t\t\t\t\t\t\t\r\n /* $categories = $ilance->db->query(\"\r\n SELECT finalvaluegroup\r\n FROM \" . DB_PREFIX . \"categories\r\n WHERE cid = '\" . intval($cid) . \"'\r\n \", 0, null, __FILE__, __LINE__);*/\r\n // murugan changes \r\n //if ($ilance->db->num_rows($categories) > 0)\r\n\t\t\t\t\t\t\t\t if ($ilance->db->num_rows($subid) > 0)\r\n {\r\n // $cats = $ilance->db->fetch_array($categories);\r\n $cats = $ilance->db->fetch_array($subid);\r\n\t\t\t\t\t\t\t\t\t\t // Murugan Changes On Nov 16\r\n // if (!empty($cats['finalvaluegroup']))\r\n\t\t\t\t\t\t\t\t\t if (!empty($cats['value']))\r\n {\r\n // Murugan Changes On Nov 12\r\n\t\t\t\t\t\t\t\t\t\t\t /*$finalvalues = $ilance->db->query(\"\r\n SELECT tierid, groupname, finalvalue_from, finalvalue_to, amountfixed, amountpercent, state, sort\r\n FROM \" . DB_PREFIX . \"finalvalue\r\n WHERE groupname = '\" . $ilance->db->escape_string($cats['finalvaluegroup']) . \"'\r\n AND state = '\" . $ilance->db->escape_string($cattype) . \"'\r\n ORDER BY finalvalue_from ASC\r\n \", 0, null, __FILE__, __LINE__);*/\r\n \r\n\t\t\t\t\t\t\t\t\t\t\t\t$finalvalues = $ilance->db->query(\"\r\n SELECT tierid, groupname, finalvalue_from, finalvalue_to, amountfixed, amountpercent, state, sort\r\n FROM \" . DB_PREFIX . \"finalvalue\r\n WHERE lower(groupname) = '\" . $ilance->db->escape_string(strtolower($cats['value'])) . \"'\r\n AND state = '\" . $ilance->db->escape_string($cattype) . \"'\r\n ORDER BY finalvalue_from ASC\r\n \", 0, null, __FILE__, __LINE__);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n $totaltiers = (int)$ilance->db->num_rows($finalvalues);\r\n \r\n if ($totaltiers == 1)\r\n {\r\n // #### SINGLE FVF TIER LOGIC ##############################\r\n $fees = $ilance->db->fetch_array($finalvalues);\r\n \r\n if ($bidamount >= $fees['finalvalue_from'])\r\n {\r\n if ($fees['amountfixed'] > 0)\r\n {\r\n $fvf += $fees['amountfixed'];\r\n $fv = $fees['amountfixed'];\r\n }\r\n else\r\n {\r\n $fvf += ($bidamount * $fees['amountpercent'] / 100);\r\n $fv = ($bidamount * $fees['amountpercent'] / 100);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n // #### MULTIPLE FVF TIER LOGIC ############################\r\n if ($totaltiers > 0)\r\n {\r\n while ($fees = $ilance->db->fetch_array($finalvalues))\r\n {\r\n $tiers++;\r\n if ($fees['finalvalue_to'] != '-1')\r\n {\r\n if ($bidamount >= $fees['finalvalue_from'] AND $bidamount <= $fees['finalvalue_to'])\r\n {\r\n $bid = ($bidamount - ($fees['finalvalue_to'] - $fees['finalvalue_from'])); \r\n if ($tiers == 1)\r\n {\r\n if ($fees['amountfixed'] > 0)\r\n {\r\n // fixed\r\n $fvf += $fees['amountfixed'];\r\n $fv = $fees['amountfixed'];\r\n }\r\n else\r\n {\r\n // percentage\r\n $fvf += ($bidamount * $fees['amountpercent'] / 100);\r\n $fv = ($bidamount * $fees['amountpercent'] / 100);\r\n }\r\n }\r\n else\r\n {\r\n if ($fees['amountfixed'] > 0)\r\n {\r\n // fixed\r\n $fvf += $fees['amountfixed'];\r\n $fv = $fees['amountfixed'];\r\n }\r\n else\r\n {\r\n // percent\r\n $fvf += ($remaining * $fees['amountpercent'] / 100);\r\n $fv = ($remaining * $fees['amountpercent'] / 100); \r\n }\r\n }\r\n \r\n break;\r\n }\r\n else\r\n {\r\n // the fees must go on! .-)\r\n if ($fees['amountfixed'] > 0)\r\n {\r\n // fixed\r\n $fvf += $fees['amountfixed'];\r\n $fv = $fees['amountfixed'];\r\n }\r\n else\r\n {\r\n // percent\r\n $fvf += (($fees['finalvalue_to'] - $fees['finalvalue_from']) * $fees['amountpercent'] / 100);\r\n $fv = (($fees['finalvalue_to'] - $fees['finalvalue_from']) * $fees['amountpercent'] / 100);\r\n }\r\n \r\n // calculate remaining bid amount for next tier\r\n $bid = ($bidamount - ($fees['finalvalue_to'] - $fees['finalvalue_from']));\r\n $remaining = ($bid - $fees['finalvalue_from']);\r\n }\r\n }\r\n else\r\n {\r\n // ie: 1000.01 to -1 denotes 1000.01 - (and above)\r\n if ($bidamount >= $fees['finalvalue_from'])\r\n {\r\n if ($fees['amountfixed'] > 0)\r\n {\r\n $fvf += $fees['amountfixed'];\r\n $fv = $fees['amountfixed'];\r\n }\r\n else\r\n {\r\n $fvf += ($remaining * $fees['amountpercent'] / 100);\r\n $fv = ($remaining * $fees['amountpercent'] / 100); \r\n }\r\n \r\n // calculate remaining bid amount for next tier\r\n $bid = ($bidamount - $fees['finalvalue_from']);\r\n $remaining = ($bid - $fees['finalvalue_from']);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } \r\n }\r\n \r\n // check if we're exempt from final value fees\r\n if (!empty($bidderid) AND $bidderid > 0 AND $ilance->subscription->check_access($bidderid, 'fvfexempt') == 'yes')\r\n {\r\n $fee = 0;\r\n }\r\n \r\n if ($fvf > 0)\r\n {\r\n ($apihook = $ilance->api('construct_final_value_fee_end')) ? eval($apihook) : false;\r\n \r\n // #### taxes on final valuefees ###############\r\n\t\t\t\t$ilance->tax = construct_object('api.tax');\r\n\t\t\t\t$extrainvoicesql = '';\r\n\t\t\t\tif ($ilance->tax->is_taxable(intval($bidderid), 'finalvaluefee'))\r\n\t\t\t\t{\r\n\t\t\t\t\t// #### fetch tax amount to charge for this invoice type\r\n\t\t\t\t\t$taxamount = $ilance->tax->fetch_amount(intval($bidderid), $fee, 'finalvaluefee', 0);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// #### fetch total amount to hold within the \"totalamount\" field\r\n\t\t\t\t\t$totalamount = ($fee + $taxamount);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// #### fetch tax bit to display when outputing tax infos\r\n\t\t\t\t\t$taxinfo = $ilance->tax->fetch_amount(intval($bidderid), $fee, 'finalvaluefee', 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// #### extra bit to assign tax logic to the transaction \r\n\t\t\t\t\t$extrainvoicesql = \"\r\n\t\t\t\t\t\tistaxable = '1',\r\n\t\t\t\t\t\ttotalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\r\n\t\t\t\t\t\ttaxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\r\n\t\t\t\t\t\ttaxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\r\n\t\t\t\t\t\";\r\n\t\t\t\t}\r\n \r\n // #### CHARGE FVF LOGIC #######################################\r\n if ($mode == 'charge')\r\n {\r\n // do we have funds in online account?\r\n $account = $ilance->db->query(\"\r\n SELECT available_balance, total_balance, autopayment\r\n FROM \" . DB_PREFIX . \"users\r\n WHERE user_id = '\" . intval($bidderid) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n if ($ilance->db->num_rows($account) > 0)\r\n {\r\n $res = $ilance->db->fetch_array($account);\r\n \r\n $avail = $res['available_balance'];\r\n $total = $res['total_balance'];\r\n \r\n if ($total >= $fvf AND $res['autopayment'])\r\n {\r\n // create a paid final value fee\r\n $invoiceid = $this->insert_transaction(\r\n 0,\r\n intval($pid),\r\n 0,\r\n intval($bidderid),\r\n 0,\r\n 0,\r\n 0,\r\n $phrase['_final_value_fee_for_auction'] . ' - ' . fetch_auction('project_title', intval($pid)) . ' #' . intval($pid),\r\n sprintf(\"%01.2f\", $fvf),\r\n sprintf(\"%01.2f\", $fvf),\r\n 'paid',\r\n 'debit',\r\n 'account',\r\n DATETIME24H,\r\n DATETIME24H,\r\n DATETIME24H,\r\n $phrase['_auto_debit_from_online_account_balance'],\r\n 0,\r\n 0,\r\n 1\r\n );\r\n \r\n // update invoice mark as final value fee invoice type\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"invoices\r\n SET\r\n $extrainvoicesql\r\n isfvf = '1'\r\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // update final value fee field in bid table & project table for awarded amount\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"project_bids\r\n SET fvf = '\" . sprintf(\"%01.2f\", $fvf) . \"'\r\n WHERE bid_id = '\" . intval($bidid) . \"'\r\n AND project_id = '\" . intval($pid) . \"'\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"projects\r\n SET fvf = '\" . sprintf(\"%01.2f\", $fvf) . \"',\r\n isfvfpaid = '1',\r\n fvfinvoiceid = '\" . intval($invoiceid) . \"'\r\n WHERE project_id = '\" . intval($pid) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // update account balance\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"users\r\n SET available_balance = available_balance - \" . sprintf(\"%01.2f\", $fvf) . \",\r\n total_balance = total_balance - \" . sprintf(\"%01.2f\", $fvf) . \"\r\n WHERE user_id = '\" . intval($bidderid) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // track income history\r\n insert_income_spent(intval($bidderid), sprintf(\"%01.2f\", $fvf), 'credit');\r\n \r\n // #### REFERRAL SYSTEM TRACKER ############################\r\n update_referral_action('fvf', intval($bidderid)); \r\n }\r\n else\r\n {\r\n // create an unpaid final value fee\r\n $invoiceid = $this->insert_transaction(\r\n 0,\r\n intval($pid),\r\n 0,\r\n intval($bidderid),\r\n 0,\r\n 0,\r\n 0,\r\n $phrase['_final_value_fee_for_auction'] . ' - ' . fetch_auction('project_title', intval($pid)) . ' #' . intval($pid),\r\n sprintf(\"%01.2f\", $fvf),\r\n '',\r\n 'unpaid',\r\n 'debit',\r\n 'account',\r\n DATETIME24H,\r\n DATEINVOICEDUE,\r\n '',\r\n $phrase['_please_pay_this_invoice_soon_as_possible'],\r\n 0,\r\n 0,\r\n 1\r\n );\r\n \r\n // update invoice mark as final value fee invoice type\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"invoices\r\n SET\r\n $extrainvoicesql\r\n isfvf = '1'\r\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // update final value fee field in bid & project table for awarded amount\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"project_bids\r\n SET fvf = '\" . sprintf(\"%01.2f\", $fvf) . \"'\r\n WHERE bid_id = '\" . intval($bidid) . \"'\r\n AND project_id = '\" . intval($pid) . \"'\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"projects\r\n SET fvf = '\" . sprintf(\"%01.2f\", $fvf) . \"',\r\n isfvfpaid = '0',\r\n fvfinvoiceid = '\" . intval($invoiceid) . \"'\r\n WHERE project_id = '\" . intval($pid) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n }\r\n }\r\n }\r\n \r\n // #### REFUND FVF LOGIC #######################################\r\n else if ($mode == 'refund')\r\n {\r\n // let's refund this final value fee due to an unaward by the buyer\r\n // find out if the provider paid this fvf or learn if it's still unpaid\r\n \r\n // fetch the most recent fvf for this particular project id\r\n $maxinvoicesql = $ilance->db->query(\"\r\n SELECT MAX(invoiceid) AS maxinvoiceid\r\n FROM \" . DB_PREFIX . \"invoices\r\n WHERE projectid = '\" . intval($pid) . \"'\r\n AND user_id = '\" . intval($bidderid) . \"'\r\n AND isfvf = '1'\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n if ($ilance->db->num_rows($maxinvoicesql) > 0)\r\n { \r\n $maxid = $ilance->db->fetch_array($maxinvoicesql);\r\n $invsql = $ilance->db->query(\"\r\n SELECT invoiceid, status, paid\r\n FROM \" . DB_PREFIX . \"invoices\r\n WHERE projectid = '\" . intval($pid) . \"'\r\n AND user_id = '\" . intval($bidderid) . \"'\r\n AND isfvf = '1'\r\n AND invoiceid = '\" . $maxid['maxinvoiceid'] . \"'\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n if ($ilance->db->num_rows($invsql) > 0)\r\n {\r\n $invres = $ilance->db->fetch_array($invsql);\r\n \r\n // #### UNPAID FVF HANDLER #####################\r\n if ($invres['status'] == 'unpaid')\r\n {\r\n // provider hasn't paid final value fee yet! let's cancel this invoice\r\n // so they do not see any pending/unpaid invoices for this project\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"invoices\r\n SET status = 'cancelled',\r\n custommessage = '\" . $ilance->db->escape_string($phrase['_awarded_bid_was_unawarded_by_the_owner_of_this_project_invoice_cancelled']) . \"'\r\n WHERE invoiceid = '\" . $invres['invoiceid'] . \"'\r\n LIMIT 1\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // reset final value fees for this project\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"projects\r\n SET fvf = '0.00',\r\n isfvfpaid = '0',\r\n fvfinvoiceid = '0'\r\n WHERE project_id = '\" . intval($pid) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n // perhaps an email gets dispatched informing the provider\r\n // that the final value fee has been cancelled\r\n }\r\n \r\n // #### PAID FVF HANDLER #######################\r\n else if ($invres['status'] == 'paid')\r\n {\r\n // provider already paid the site for the final value fee \r\n // so let's refund this amount and update the providers account balance\r\n if ($invres['paid'] > 0)\r\n {\r\n // create a final value fee credit to the service provider\r\n $refundinvoiceid = $this->insert_transaction(\r\n 0,\r\n intval($pid),\r\n 0,\r\n intval($bidderid),\r\n 0,\r\n 0,\r\n 0,\r\n $phrase['_final_value_fee_refund_credit_for_auction'] . ' #' . intval($pid),\r\n sprintf(\"%01.2f\", $invres['paid']),\r\n sprintf(\"%01.2f\", $invres['paid']),\r\n 'paid',\r\n 'credit',\r\n 'account',\r\n DATETIME24H,\r\n DATETIME24H,\r\n DATETIME24H,\r\n '',\r\n 0,\r\n 0,\r\n 1\r\n ); \r\n \r\n // track income history\r\n insert_income_spent($bidderid, sprintf(\"%01.2f\", $invres['paid']), 'debit');\r\n \r\n // re credit the provider online account\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"users\r\n SET available_balance = available_balance + \" . $invres['paid'] . \",\r\n total_balance = total_balance + \" . $invres['paid'] . \"\r\n WHERE user_id = '\" . intval($bidderid) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // we should also update the bid and project table fvf fields back to 0.00\r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"project_bids\r\n SET fvf = '0.00'\r\n WHERE project_id = '\" . intval($pid) . \"'\r\n AND user_id = '\" . intval($bidderid) . \"'\r\n AND fvf > 0\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n $ilance->db->query(\"\r\n UPDATE \" . DB_PREFIX . \"projects\r\n SET fvf = '0.00',\r\n isfvfpaid = '0',\r\n fvfinvoiceid = '0'\r\n WHERE project_id = '\" . intval($pid) . \"'\r\n \", 0, null, __FILE__, __LINE__);\r\n \r\n // perhaps an email gets dispatched informing the provider\r\n // that the final value fee has been refunded\r\n \r\n // additionally, another email to admin advising the loss of FVF funds.\r\n }\r\n } \r\n }\r\n }\r\n }\r\n \r\n return 1;\r\n }\r\n }\r\n \r\n return 0;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the deleteBySourceEntity() method. | public function testDeleteBySourceEntity() {
// Create 2 fake registers on the database table, one for each entity.
$i = 0;
foreach ($this->testEntities as $entity) {
$i++;
$source_vid = ($entity instanceof RevisionableInterface && $entity->getRevisionId()) ? $entity->getRevisionId() : 0;
$this->injectedDatabase->insert($this->tableName)
->fields([
'target_id' => $i,
'target_type' => 'fake_type_' . $i,
'source_id' => $entity->id(),
'source_type' => $entity->getEntityTypeId(),
'source_langcode' => $entity->language()->getId(),
'source_vid' => $source_vid,
'method' => 'entity_reference',
'field_name' => 'body',
'count' => 1,
])
->execute();
}
/** @var \Drupal\entity_usage\EntityUsage $entity_usage */
$entity_usage = $this->container->get('entity_usage.usage');
// Delete only one of them, by source.
$entity_usage->deleteBySourceEntity($this->testEntities[0]->id(), $this->testEntities[0]->getEntityTypeId());
$event = \Drupal::state()->get('entity_usage_events_test.usage_delete_by_source_entity', []);
$this->assertSame($event['event_name'], Events::DELETE_BY_SOURCE_ENTITY);
$this->assertSame($event['target_id'], NULL);
$this->assertSame($event['target_type'], NULL);
$this->assertSame($event['source_id'], $this->testEntities[0]->id());
$this->assertSame($event['source_type'], $this->testEntities[0]->getEntityTypeId());
$this->assertSame($event['source_langcode'], NULL);
$this->assertSame($event['source_vid'], NULL);
$this->assertSame($event['method'], NULL);
$this->assertSame($event['field_name'], NULL);
$this->assertSame($event['count'], NULL);
// The non-affected record is still there.
$real_target_list = $entity_usage->listTargets($this->testEntities[1]);
$expected_target_list = [
'fake_type_2' => [
'2' => [
0 => [
'method' => 'entity_reference',
'field_name' => 'body',
'count' => '1',
],
],
],
];
$this->assertEquals($expected_target_list, $real_target_list);
// The affected record is gone.
$real_target_list = $entity_usage->listSources($this->testEntities[0]);
$this->assertEquals([], $real_target_list);
// Clean back the environment.
$this->injectedDatabase->truncate($this->tableName);
} | [
"public function testDeleteSource()\n {\n }",
"public function testV1SourceSourceIdDelete()\n {\n }",
"public function deleted(Source $source)\n {\n //\n }",
"public function testDeleteWithFrom(): void\n {\n $query = new DeleteQuery($this->connection);\n\n $query->delete()\n ->from('authors')\n ->where('1 = 1');\n\n $result = $query->sql();\n $this->assertQuotedQuery('DELETE FROM <authors>', $result, !$this->autoQuote);\n\n $result = $query->execute();\n $this->assertInstanceOf(StatementInterface::class, $result);\n $this->assertSame(self::AUTHOR_COUNT, $result->rowCount());\n $result->closeCursor();\n }",
"public function testDelete() {\n $entity = new SimpleEntity();\n $entity->setName('Entity');\n $entity->setValue('EntityValue');\n $id = $this->persister->create($entity);\n $this->assertNotNull($id);\n\n $this->persister->delete($entity);\n $retrieved = $this->persister->getById($id);\n $this->assertNull($retrieved);\n\n // Use a new persister to ensure that the delete was actually done in the\n // database\n $this->persister->clearCache();\n\n $retrieved = $this->persister->getById($id);\n $this->assertNull($retrieved);\n }",
"public function delete($entity);",
"public function testTeamMembersIdTeamBillingSourceDelete()\n {\n\n }",
"public function testDeleteSuppliersUsingDELETE()\n {\n }",
"public function testDataSourceMsSqlsIdDynamicDatasFkDelete()\n {\n\n }",
"abstract public function delete(array $source_key);",
"public function deleting($entity)\n {\n //\n }",
"public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/person/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Person', 'personId', self::$objectId);\n }",
"public function testDeleteProductUsingDELETE()\n {\n }",
"public function delete(Entity $entity);",
"public function testDeleteItemUsingDELETE()\n {\n }",
"public function testTagsIdProductsRelFkDelete()\n {\n\n }",
"public function deleted($entity)\n {\n //\n }",
"public function testDeleteOrderUsingDelete()\n {\n }",
"public function testDataSourceMsSqlsIdDynamicDatasDelete()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ / Get Map Detail from id_section / | function get_map_detail($id_section)
{
$this->load->model('map_model');
print_array($this->map_model->get_map_detail($id_section));
} | [
"public function getMapInfoById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t= $GLOBALS['db'];\n\t\t\t// Query set up\n\t\t\t$return\t= ($id) ? $db->getRow('tb_areamap', 'id, boo_encounter, id_areatype, vc_name', \"id = '{$id}'\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"public function getSectionById($id)\n\t{\n\t\t$client = new GuzzleHttp\\Client(['base_uri' => env('MATRIX_BASE_URL') . \"v1/\" ]);\n \t$response = $client->get('sections/'.$id);\n\t\t$body = $response->getBody();\n\t\t$data = json_decode($body, true);\n\n\t\treturn $data['data'];\n\t}",
"public function section_details(){\n\t\tglobal $db;\n\t\t$sQl = \"SELECT * FROM cms_tbl_section WHERE section_id = '\".$this->sectionId.\"'\";\n\t\t$result = $db->get_row($sQl);\n\t\tif($result){\n\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\t$this->error = \"Cannot find section details. Try again\";\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"public function getDetail($id);",
"public function getAreaInfoByMapId($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db'];\n\t\t\t// Query set up\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_area', '*', 'id_areamap = '.$id) : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"public function getParentMapInfoIdByMapId($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t= $GLOBALS['db'];\n\t\t\t// Query\n\t\t\t$return\t= ($id) ? $db->getRow('tb_map_link_icon AS mli JOIN tb_areamap AS am ON mli.id_map_orign = am.id', 'am.id, am.boo_encounter', \"id_map_target = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"private function getSectionLookUpMap() {\n return $this->sectionLookUpMap;\n }",
"public function getSectionDataByCode($section)\n {\n $field = 'Ma';\n if (is_numeric($section))\n {\n $field = 'IOID';\n }\n $sql = sprintf('select mc.Ma as Section\n , mc.KhoangCachLe as Distance\n , mc.CaoDoZ as ZIndex\n , mc.Ngay as SDate\n ,ifnull(mc.KhoangCachCongDon,0) as XDistance\n from MatCat as mc\n where mc.%2$s = %1$s\n order by mc.Ngay, ifnull(mc.KhoangCachCongDon,0) \n ', $this->_o_DB->quote($section), $field);\n return $this->_o_DB->fetchAll($sql);\n }",
"public function getSectionId();",
"function wmt_get_section_meta( $id ) {\n\t$post = get_post( $id );\n\tif ( get_post_status( $post ) === 'publish' ) {\n\t\treturn array(\n\t\t\t'slug' => $post->post_name,\n\t\t\t'numeral' => get_field( 'numeral', $id ) ?: null,\n\t\t\t'title' => $post->post_title,\n\t\t\t'author' => get_field( 'author', $id ) ?: null,\n\t\t\t'citedAuthor' => get_field( 'cited_author', $id ) ?: null,\n\t\t\t'explorer_link' => get_field( 'explorer_link', $id ) ?: false,\n\t\t);\n\t}\n\n\treturn null;\n}",
"function civicrm_entity_salesforce_mapping_view_page($id) {\n $mapping = entity_load_single('civicrm_entity_salesforce_mapping', $id);\n\n $content = '';\n if (!empty($mapping)) {\n $content = theme('civicrm_entity_salesforce_mapping_data_view', [\n 'mapping' => $mapping,\n ]);\n\n drupal_set_title('CiviCRM Entity Salesforce Mapping ' . $mapping->label());\n }\n else {\n $content .= 'No mapping with ID: ' . $id;\n }\n\n return $content;\n}",
"function getSection($key);",
"function unh_d1_client_getsectionObjectId($section = NULL) {\n $ret = '';\n \n if (!empty($section) && array_key_exists('objectId', $section)) {\n $ret = $section['objectId'];\n }\n return $ret;\n}",
"public function get_section_by_id($id) {\n return $this->db->get_record('course_sections', ['id' => $id]);\n }",
"function individualGetDetail($individualId) {\n\t\t\n\t}",
"function get_map_zone($id, &$sqlm)\r\n{\r\n\t$map_zone = $sqlm->fetch_assoc($sqlm->query('\r\n\t\tSELECT area_id\r\n\t\tFROM dbc_map\r\n\t\tWHERE id='.$id.' LIMIT 1'));\r\n\treturn get_zone_name($map_zone['area_id'], $sqlm);\r\n}",
"public function getFieldIdByMapId($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db'];\n\t\t\t// Query set up\n\t\t\t$return\t\t\t= (($id) && ($return = $db->getRow('tb_area', 'id_field', 'id_areamap = '.$id))) ? $return['id_field'] : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"public function loadMapInfoByFertilityMapId($fertilityMapId)\r\n {\r\n return MapInfo::where('fertility_id', $fertilityMapId)->limit(1);\r\n }",
"function map_select_data_id($id){\n $table = 'saimap';\n\t$alias = 's';\n\ttry {\n $selected = db_select($table,$alias)\n\t ->fields($alias)\n\t\t\t ->condition('id',$id)\n\t\t\t ->execute()\n\t\t\t ->fetchAssoc();\n\t}\n\tcatch(Exception $e)\t{\n\t drupal_set_message(t('Issue in retrieving the location data for location id= '.$id.'. Message = %message, query=%query', \n\t array('%message' =>$e->getMessage(),'%query' => $e->query_string)), 'error');\n\t}\n\treturn $selected;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Capitalize the words in the given string. | protected function modifier_capitalize($string_input)
{
return ucwords($string_input);
} | [
"public function capitalize($string);",
"public static function upperWords($string)\n {\n return ucwords($string);\n }",
"public function capitalize(): string\n {\n $words = array_map('strtolower', $this->words());\n $new_words = array_map('ucfirst', $words);\n return implode(' ', $new_words);\n }",
"public function capitalise($str) {\n return ucwords(strtolower($str));\n }",
"function capitalize($str)\r\n\t{\r\n\t\treturn mb_convert_case($str, MB_CASE_TITLE, get_bloginfo('charset'));\r\n\t}",
"function ucfirstwords($str) {\n\treturn ucwords(strtolower($str));\n}",
"function LetterCapitalize($str) { \r\n return ucwords($str); \r\n}",
"protected function TitleCase($string) {\n if(preg_match('/[a-z]/', $string))\n return $string;\n return ucwords(strtolower($string));\n }",
"function ucwords ($str) {}",
"function camelCaseToWords($string, $uc = false)\n{\n $pattern = '/(.*?[a-z]{1})([A-Z]{1}.*?)/';\n $replace = '${1} ${2}';\n $words = preg_replace($pattern, $replace, $string);\n if ($uc) {\n $words = ucwords($words);\n }\n\n return $words ?: $string;\n}",
"function capitalize($str)\n{\n\treturn mb_strtoupper(mb_substr($str, 0, 1)) . mb_strtolower(mb_substr($str, 1));\n}",
"function fcapital($string){\n\t\treturn ucfirst(strtolower($string));\n\t}",
"public function un_camel_case( $string ){\n\t\t\tpreg_match_all('/[A-Z]/', $string, $matches);\n\t\t\tif( count($matches) > 0 ){\t\t\t\n\t\t\t\tforeach( $matches[0] as $match ){\n\t\t\t\t\t$string = str_replace($match, ' ' . strtolower($match), $string );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ucwords($string);\n\t\t}",
"public function converToStudlyCaps($str){\n return str_replace(' ', '', ucwords(str_replace('-', ' ', $str)));\n }",
"protected function convertToStudlyCaps($string){\n return str_replace(' ', '', ucwords(str_replace('-', ' ', $string)));\n }",
"function upper($mystring){\n\n for ($i=0; $i<strlen($mystring); $i++){\n $c = $mystring[$i];\n\n if($i %2 == 0){\n $mystring[$i] = ucwords($c);\n }}\n return $mystring;\n }",
"static function capitalize(string $s): string {\r\n\t\treturn strtoupper(substr($s, 0, 1)) . substr($s, 1);\r\n\t}",
"protected function convertToStudlyCaps($string) {\n return str_replace(' ', '', ucwords(str_replace('-', ' ', $string)));\n }",
"public function capitalizeFirstLetters(string $str) {\n /**\n * Write your code here.\n */\n $arr_tmp = explode(\" \", $str);\n $newStr = \"\";\n foreach ($arr_tmp as $value){\n $newStr .= ucfirst($value) . \" \";\n }\n return $newStr;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter the query on the devechargers2 column Example usage: $query>filterByDevechargers2(1234); // WHERE devechargers2 = 1234 $query>filterByDevechargers2(array(12, 34)); // WHERE devechargers2 IN (12, 34) $query>filterByDevechargers2(array('min' => 12)); // WHERE devechargers2 >= 12 $query>filterByDevechargers2(array('max' => 12)); // WHERE devechargers2 | public function filterByDevechargers2($devechargers2 = null, $comparison = null)
{
if (is_array($devechargers2)) {
$useMinMax = false;
if (isset($devechargers2['min'])) {
$this->addUsingAlias(PaymentplanPeer::DEVECHARGERS2, $devechargers2['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($devechargers2['max'])) {
$this->addUsingAlias(PaymentplanPeer::DEVECHARGERS2, $devechargers2['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(PaymentplanPeer::DEVECHARGERS2, $devechargers2, $comparison);
} | [
"public function filterByDevechargers1($devechargers1 = null, $comparison = null)\n {\n if (is_array($devechargers1)) {\n $useMinMax = false;\n if (isset($devechargers1['min'])) {\n $this->addUsingAlias(PaymentplanPeer::DEVECHARGERS1, $devechargers1['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($devechargers1['max'])) {\n $this->addUsingAlias(PaymentplanPeer::DEVECHARGERS1, $devechargers1['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PaymentplanPeer::DEVECHARGERS1, $devechargers1, $comparison);\n }",
"public function filterByResultadoequipo2($resultadoequipo2 = null, $comparison = null)\n\t{\n\t\tif (is_array($resultadoequipo2)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($resultadoequipo2['min'])) {\n\t\t\t\t$this->addUsingAlias(PartidoPeer::RESULTADOEQUIPO2, $resultadoequipo2['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($resultadoequipo2['max'])) {\n\t\t\t\t$this->addUsingAlias(PartidoPeer::RESULTADOEQUIPO2, $resultadoequipo2['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(PartidoPeer::RESULTADOEQUIPO2, $resultadoequipo2, $comparison);\n\t}",
"public function filterByIdequipo2($idequipo2 = null, $comparison = null)\n\t{\n\t\tif (is_array($idequipo2)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idequipo2['min'])) {\n\t\t\t\t$this->addUsingAlias(PartidoPeer::IDEQUIPO2, $idequipo2['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($idequipo2['max'])) {\n\t\t\t\t$this->addUsingAlias(PartidoPeer::IDEQUIPO2, $idequipo2['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(PartidoPeer::IDEQUIPO2, $idequipo2, $comparison);\n\t}",
"public function filterById2($id2 = null, $comparison = null)\n\t{\n\t\tif (is_array($id2)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($id2['min'])) {\n\t\t\t\t$this->addUsingAlias(FriendPeer::ID_2, $id2['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($id2['max'])) {\n\t\t\t\t$this->addUsingAlias(FriendPeer::ID_2, $id2['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(FriendPeer::ID_2, $id2, $comparison);\n\t}",
"public function filterByPercer($percer = null, $comparison = null)\n {\n if (is_array($percer)) {\n $useMinMax = false;\n if (isset($percer['min'])) {\n $this->addUsingAlias(AliFcTableMap::COL_PERCER, $percer['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($percer['max'])) {\n $this->addUsingAlias(AliFcTableMap::COL_PERCER, $percer['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliFcTableMap::COL_PERCER, $percer, $comparison);\n }",
"public function filterByIdproveedor($idproveedor = null, $comparison = null)\n {\n if (is_array($idproveedor)) {\n $useMinMax = false;\n if (isset($idproveedor['min'])) {\n $this->addUsingAlias(DevolucionPeer::IDPROVEEDOR, $idproveedor['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idproveedor['max'])) {\n $this->addUsingAlias(DevolucionPeer::IDPROVEEDOR, $idproveedor['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(DevolucionPeer::IDPROVEEDOR, $idproveedor, $comparison);\n }",
"public function filterByDataFechamento($dataFechamento = null, $comparison = null)\n\t{\n\t\tif (is_array($dataFechamento)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($dataFechamento['min'])) {\n\t\t\t\t$this->addUsingAlias(ComunicadoPeer::DATA_FECHAMENTO, $dataFechamento['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($dataFechamento['max'])) {\n\t\t\t\t$this->addUsingAlias(ComunicadoPeer::DATA_FECHAMENTO, $dataFechamento['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ComunicadoPeer::DATA_FECHAMENTO, $dataFechamento, $comparison);\n\t}",
"public function filterByAbility2($ability2 = null, $comparison = null)\n {\n if (is_array($ability2)) {\n $useMinMax = false;\n if (isset($ability2['min'])) {\n $this->addUsingAlias(CharacterTableMap::COL_ABILITY_2, $ability2['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($ability2['max'])) {\n $this->addUsingAlias(CharacterTableMap::COL_ABILITY_2, $ability2['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CharacterTableMap::COL_ABILITY_2, $ability2, $comparison);\n }",
"public function filterByIdproveedor($idproveedor = null, $comparison = null)\n {\n if (is_array($idproveedor)) {\n $useMinMax = false;\n if (isset($idproveedor['min'])) {\n $this->addUsingAlias(CompraPeer::IDPROVEEDOR, $idproveedor['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idproveedor['max'])) {\n $this->addUsingAlias(CompraPeer::IDPROVEEDOR, $idproveedor['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CompraPeer::IDPROVEEDOR, $idproveedor, $comparison);\n }",
"public function filterByDataFechamento($dataFechamento = null, $comparison = null)\n\t{\n\t\tif (is_array($dataFechamento)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($dataFechamento['min'])) {\n\t\t\t\t$this->addUsingAlias(ProcessoPeer::DATA_FECHAMENTO, $dataFechamento['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($dataFechamento['max'])) {\n\t\t\t\t$this->addUsingAlias(ProcessoPeer::DATA_FECHAMENTO, $dataFechamento['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ProcessoPeer::DATA_FECHAMENTO, $dataFechamento, $comparison);\n\t}",
"public function filterByClienteFecharegistro($clienteFecharegistro = null, $comparison = null)\n {\n if (is_array($clienteFecharegistro)) {\n $useMinMax = false;\n if (isset($clienteFecharegistro['min'])) {\n $this->addUsingAlias(ClientePeer::CLIENTE_FECHAREGISTRO, $clienteFecharegistro['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($clienteFecharegistro['max'])) {\n $this->addUsingAlias(ClientePeer::CLIENTE_FECHAREGISTRO, $clienteFecharegistro['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientePeer::CLIENTE_FECHAREGISTRO, $clienteFecharegistro, $comparison);\n }",
"public function filterByHulpmiddelHoeveelheid2($hulpmiddelHoeveelheid2 = null, $comparison = null)\n {\n if (is_array($hulpmiddelHoeveelheid2)) {\n $useMinMax = false;\n if (isset($hulpmiddelHoeveelheid2['min'])) {\n $this->addUsingAlias(GsVoorschrijfprGeneesmiddelIdentificPeer::HULPMIDDEL_HOEVEELHEID_2, $hulpmiddelHoeveelheid2['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($hulpmiddelHoeveelheid2['max'])) {\n $this->addUsingAlias(GsVoorschrijfprGeneesmiddelIdentificPeer::HULPMIDDEL_HOEVEELHEID_2, $hulpmiddelHoeveelheid2['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(GsVoorschrijfprGeneesmiddelIdentificPeer::HULPMIDDEL_HOEVEELHEID_2, $hulpmiddelHoeveelheid2, $comparison);\n }",
"public function filterByPercer($percer = null, $comparison = null)\n {\n if (is_array($percer)) {\n $useMinMax = false;\n if (isset($percer['min'])) {\n $this->addUsingAlias(AliAcTableMap::COL_PERCER, $percer['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($percer['max'])) {\n $this->addUsingAlias(AliAcTableMap::COL_PERCER, $percer['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AliAcTableMap::COL_PERCER, $percer, $comparison);\n }",
"public function filterByCopper($copper = null, $comparison = null)\n {\n if (is_array($copper)) {\n $useMinMax = false;\n if (isset($copper['min'])) {\n $this->addUsingAlias(CastlePeer::COPPER, $copper['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($copper['max'])) {\n $this->addUsingAlias(CastlePeer::COPPER, $copper['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CastlePeer::COPPER, $copper, $comparison);\n }",
"public function filterByAptbconfover2($aptbconfover2 = null, $comparison = null)\n {\n if (is_array($aptbconfover2)) {\n $useMinMax = false;\n if (isset($aptbconfover2['min'])) {\n $this->addUsingAlias(ConfigApTableMap::COL_APTBCONFOVER2, $aptbconfover2['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($aptbconfover2['max'])) {\n $this->addUsingAlias(ConfigApTableMap::COL_APTBCONFOVER2, $aptbconfover2['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ConfigApTableMap::COL_APTBCONFOVER2, $aptbconfover2, $comparison);\n }",
"public function filterByIdproveedor($idproveedor = null, $comparison = null)\n {\n if (is_array($idproveedor)) {\n $useMinMax = false;\n if (isset($idproveedor['min'])) {\n $this->addUsingAlias(ProductoPeer::IDPROVEEDOR, $idproveedor['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idproveedor['max'])) {\n $this->addUsingAlias(ProductoPeer::IDPROVEEDOR, $idproveedor['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ProductoPeer::IDPROVEEDOR, $idproveedor, $comparison);\n }",
"public function filterByIdproveedor($idproveedor = null, $comparison = null)\n {\n if (is_array($idproveedor)) {\n $useMinMax = false;\n if (isset($idproveedor['min'])) {\n $this->addUsingAlias(ProveedormarcaPeer::IDPROVEEDOR, $idproveedor['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idproveedor['max'])) {\n $this->addUsingAlias(ProveedormarcaPeer::IDPROVEEDOR, $idproveedor['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ProveedormarcaPeer::IDPROVEEDOR, $idproveedor, $comparison);\n }",
"public function filterByOehhdueamt2($oehhdueamt2 = null, $comparison = null)\n {\n if (is_array($oehhdueamt2)) {\n $useMinMax = false;\n if (isset($oehhdueamt2['min'])) {\n $this->addUsingAlias(SalesHistoryTableMap::COL_OEHHDUEAMT2, $oehhdueamt2['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($oehhdueamt2['max'])) {\n $this->addUsingAlias(SalesHistoryTableMap::COL_OEHHDUEAMT2, $oehhdueamt2['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SalesHistoryTableMap::COL_OEHHDUEAMT2, $oehhdueamt2, $comparison);\n }",
"public function filterByContact2($contact2 = null, $comparison = null)\n {\n if (is_array($contact2)) {\n $useMinMax = false;\n if (isset($contact2['min'])) {\n $this->addUsingAlias(ClubinfoTableMap::COL_CONTACT2, $contact2['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($contact2['max'])) {\n $this->addUsingAlias(ClubinfoTableMap::COL_CONTACT2, $contact2['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClubinfoTableMap::COL_CONTACT2, $contact2, $comparison);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get template placeholders with strings. | protected function get_placeholders() {
$name = $this->get_class_name( $this->get_slug_input() );
return array(
'DummyClass' => $name,
);
} | [
"private function getMustacheTagPlaceholders()\n {\n static $placeholders = null;\n\n if (null === $placeholders) {\n $placeholders = [];\n\n // Note: The order of these tokens is important, as it determines the order of the replacements.\n $tokens = [\n '{{{',\n '}}}',\n '{{#',\n '{{^',\n '{{/',\n '{{',\n '}}',\n ];\n\n foreach ($tokens as $token) {\n $placeholders[$token] = '_amp_mustache_' . md5(uniqid($token));\n }\n }\n\n return $placeholders;\n }",
"public function getPlaceHoldersAndReplacements();",
"public function getPlaceholdersInfo();",
"protected function preparedPlaceholders(): array\n {\n $placeholders = [];\n foreach ($this->placeholders() as $placeholder => $var) {\n $placeholders['{{' . $placeholder . '}}'] = strpos($var, '--') !== 0 \n ? $this->arg($var) \n : $this->opt(substr($var, 0, 2));\n }\n\n return $placeholders;\n }",
"private static function getPlaceholderPattern(): string\n {\n return sprintf(\n '/%s([^%s]+)%s/',\n static::PLACEHOLDER_TAG,\n static::PLACEHOLDER_TAG,\n static::PLACEHOLDER_TAG\n );\n }",
"public abstract function genericPlaceholders();",
"public function getPlaceholders()\n\t{\n\t\t$this->parsed();\n\n\t\treturn array_keys($this->placeholders);\n\t}",
"public function genericPlaceholders() {\n $lookup= [];\n foreach ($this->class->genericComponents() as $i => $name) {\n $lookup[$name]= $i;\n }\n return $lookup;\n }",
"public function getSpecificPlaceholders()\n\t{\n\t\t/**\n\t\t * @var $lng ilLanguage\n\t\t */\n\t\tglobal $lng;\n\n\t\t$lng->loadLanguageModule('crs');\n\n\t\t$placeholders = array();\n\t\t\n\t\t$placeholders['crs_title'] = array(\n\t\t\t'placeholder'\t=> 'COURSE_TITLE',\n\t\t\t'label'\t\t\t=> $lng->txt('crs_title')\n\t\t);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$placeholders['crs_link'] = array(\n\t\t\t'placeholder'\t=> 'COURSE_LINK',\n\t\t\t'label'\t\t\t=> $lng->txt('crs_mail_permanent_link')\n\t\t);\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\treturn $placeholders;\n\t}",
"function createBoundPlaceholders(array $xs)\n{\n return str_repeat(\"(?),\", count($xs) - 1) . \"(?)\";\n}",
"function GetReplacement($placeholder);",
"public function providerTestUnexpectedPlaceholder() {\n return [\n ['Non alpha starting character: ~placeholder', ['~placeholder' => 'replaced'], E_USER_WARNING, 'Invalid placeholder (~placeholder) with string: \"Non alpha starting character: ~placeholder\"'],\n ['Alpha starting character: placeholder', ['placeholder' => 'replaced'], E_USER_WARNING, 'Invalid placeholder (placeholder) with string: \"Alpha starting character: placeholder\"'],\n // Ensure that where the placeholder is located in the string is\n // irrelevant.\n ['placeholder', ['placeholder' => 'replaced'], E_USER_WARNING, 'Invalid placeholder (placeholder) with string: \"placeholder\"'],\n ];\n }",
"public function genericPlaceholders() {\n return $this->generics;\n }",
"public static function addPlaceholders($text) {\n foreach (array_keys(self::$replacements) as $replacement) {\n\n $text = preg_replace(\"/\\s(\" . preg_quote($replacement) . \")([^a-zA-Z])(s*)/\", \" {{ $1(person) }}$2$3\", $text);\n $text = preg_replace(\"/\\s(\" . ucfirst(preg_quote($replacement)) . \")([^a-zA-Z])(s*)/\", \" {{ $1(person) }}$2$3\", $text);\n }\n return $text;\n }",
"public function getPlaceholders(): array\n {\n $placeholders = [];\n foreach ($this->lines as $line) {\n if (preg_match(static::PLACEHOLDER_REGEX, $line, $matches)) {\n $placeholders[] = $matches[1];\n }\n }\n\n return $placeholders;\n }",
"function parseCustomPlaceholders($placeholders)\n {\n foreach ($placeholders as $name => $value) {\n $this->addField($name, 'display', 'custom');\n $this->removeField($name, 'display', 'unknown');\n $source = $value[0];\n $qe = $value[2];\n\n if (is_array($source)) {\n if (strpos($source[0], ',') !== false) {\n $fields = explode(',', $source[0]);\n foreach ($fields as $field) {\n if (!empty($field)) {\n $this->addField($field, $source[1]);\n $this->customPlaceholdersMap[$name] = $field;\n }\n }\n } else {\n $this->addField($source[0], $source[1]);\n $this->customPlaceholdersMap[$name] = $source[0];\n }\n } else if (is_array($value)) {\n $fields = explode(',', $source);\n foreach ($fields as $field) {\n if (!empty($field)) {\n $field = trim($field);\n $this->addField($field, 'display');\n $this->customPlaceholdersMap[$name] = $field;\n }\n }\n }\n\n if ($qe === null) {\n return;\n }\n $this->customPlaceholdersMap[$name] = array('qe', $qe);\n }\n }",
"public function getPlaceholders() : array\n {\n $this->parse();\n\n return $this->placeholders;\n }",
"public function listPlaceHolders(): array\n {\n $find = !!preg_match_all('/\\{(\\w+?)\\}/', $this->pattern, $matches);\n if (!$find) {\n return [];\n }\n return $matches[1];\n }",
"function the_admin_notifications_selected_template_placeholders($template_slug) {\n\n // Get email's templates\n $email_templates = the_admin_notifications_email_templates();\n\n // Placeholders\n $placeholders = '';\n\n // Verify if email's templates exists\n if ( $email_templates ) {\n\n // List email's templates\n foreach ( $email_templates as $email_template ) {\n\n // Get key\n $key = key($email_template);\n\n // Verify if this is the selected template\n if ( $template_slug !== $key ) {\n continue;\n }\n \n // Verify if placeholders exists\n if ( !empty($email_template[$key]['template_placeholders']) ) {\n\n // List placeholders\n foreach ( $email_template[$key]['template_placeholders'] as $placeholder ) {\n\n // Set placeholder\n $placeholders .= '<li>'\n . '<p>'\n . '<span class=\"notifications-emails-template-placeholder\">'\n . $placeholder['code']\n . '</span>'\n . $placeholder['description']\n . '</p>'\n . '</li>';\n\n }\n\n }\n\n }\n\n }\n\n // Verify if $placeholders is empty\n if ( empty($placeholders) ) {\n\n // Set no placeholders message\n $placeholders = '<li>'\n . '<p>'\n . get_instance()->lang->line('notifications_no_placeholders_found')\n . '</p>'\n . '</li>';\n\n }\n\n // Return the placeholders\n return $placeholders;\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cdx_prev_next ; Creates a pager | function cdx_prev_next($num_elements, $init, $limit, $url) {
global $config;
if (!isset($config["margin"])){
// Set default value for number of pages at each side of the current one
$margin = 5;
} else {
$margin = $config["margin"];
}
// Only print the pager if the total numer of items is larger than the limit
if ($num_elements > $limit) {
$string = ""; // Initialize the string
$page_count = 0;
// See how many pages there are
$num_pages = floor($num_elements / $limit);
$resting = $num_elements % $limit;
// If it's not an integer, round up
if ($resting > 0) {
$num_pages++;
}
// If it's not the first page, show the backward links
if ($init > 0) {
$string .= '<a href="'.$url.'&init=0" class="pager">|<</a> <a href="'.$url.'&init='.($init-$limit).'" class="pager"><<</a>';
}
$init_count = 0;
// Put a number on each page
// Current one is $init/$limit
$current = $init/$limit;
$bottom_margin = ($current-$margin);
$top_margin = ($current+$margin);
while ($page_count < $num_pages) {
// Do nothing while not in the current action radius
if ($page_count >= $bottom_margin && $page_count <= $top_margin) {
if ($page_count != $current) {
$the_class = "pg_no";
} else {
$the_class = "pg_yes";
}
$string .= '<a href="'.$url.'&init='.$init_count.'" class="'.$the_class.'">'.($page_count+1).'</a>';
}
$init_count += $limit;
$page_count++;
}
$last_init = ($num_pages*$limit)-$limit;
// If it's the las page, and the next one is smaller than the max, don't show more
$next_init = $init+$limit;
if ($init < ($num_pages*$limit) && $next_init < ($num_pages*$limit)) {
$string .= '<a href="'.$url.'&init='.$next_init.'" class="pager">>></a>';
}
// If the current is not the last, show forward links
if ($init < $last_init) {
$string .= ' <a href="'.$url.'&init='.$last_init.'" class="pager">>|</a>';
}
return $string;
}
} | [
"protected function buildNextPrevPager()\n\t{\n\t\t$buttonType=$this->getButtonType();\n\t\t$controls=$this->getControls();\n\t\tif($this->getIsFirstPage())\n\t\t{\n\t\t\tif(($text=$this->getFirstPageText())!=='')\n\t\t\t{\n\t\t\t\t$label=$this->createPagerButton($buttonType,false,$text,self::CMD_PAGE_FIRST,'');\n\t\t\t\t$controls->add($label);\n\t\t\t\t$controls->add(\"\\n\");\n\t\t\t}\n\t\t\t$label=$this->createPagerButton($buttonType,false,$this->getPrevPageText(),self::CMD_PAGE_PREV,'');\n\t\t\t$controls->add($label);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(($text=$this->getFirstPageText())!=='')\n\t\t\t{\n\t\t\t\t$button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_FIRST,'');\n\t\t\t\t$controls->add($button);\n\t\t\t\t$controls->add(\"\\n\");\n\t\t\t}\n\t\t\t$button=$this->createPagerButton($buttonType,true,$this->getPrevPageText(),self::CMD_PAGE_PREV,'');\n\t\t\t$controls->add($button);\n\t\t}\n\t\t$controls->add(\"\\n\");\n\t\tif($this->getIsLastPage())\n\t\t{\n\t\t\t$label=$this->createPagerButton($buttonType,false,$this->getNextPageText(),self::CMD_PAGE_NEXT,'');\n\t\t\t$controls->add($label);\n\t\t\tif(($text=$this->getLastPageText())!=='')\n\t\t\t{\n\t\t\t\t$controls->add(\"\\n\");\n\t\t\t\t$label=$this->createPagerButton($buttonType,false,$text,self::CMD_PAGE_LAST,'');\n\t\t\t\t$controls->add($label);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$button=$this->createPagerButton($buttonType,true,$this->getNextPageText(),self::CMD_PAGE_NEXT,'');\n\t\t\t$controls->add($button);\n\t\t\tif(($text=$this->getLastPageText())!=='')\n\t\t\t{\n\t\t\t\t$controls->add(\"\\n\");\n\t\t\t\t$button=$this->createPagerButton($buttonType,true,$text,self::CMD_PAGE_LAST,'');\n\t\t\t\t$controls->add($button);\n\t\t\t}\n\t\t}\n\t}",
"function previousNext()\n\t\t\t\t{\n\t\t\t\t\tif($this->getPrevious())\n\t\t \t{\n\t\t\t echo \"<a href=\\\"\" . $this->getPageName() . \"?page=\" . $this->getPrevious() . \"\\\">Previous</a> \";\n\t\t\t }\n\t\t\t\t\t\t$links = $this->getLinkArr();\n\t\t\t foreach($links as $link)\n\t \t{\n\t\t \tif($link == $this->getCurrent())\n\t\t\t\t\t {\n\t\t\t\t\t echo \" $link \";\n\t\t\t\t\t } else { echo \"<a href=\\\"\" . $this->getPageName() . \"?page=$link\\\">\" . $link . \"</a> \";\n\t\t\t\t\t }\n\t\t\t } \n\t\t\t\tif($this->getNext())\n\t\t\t {\n\t\t \t echo \"<a href=\\\"\" . $this->getPageName() . \"?page=\" . $this->getNext() . \"\\\">Next</a> \";\n\t\t \t}\n\t\t }",
"function previousNext()\r\n\t{\r\n\t\tif($this->getPrevious())\r\n\t\t{\r\n\t\t\techo \"<a href=\\\"\" . $this->getPageName() . \"?\".$this->request.\"page=\" . $this->getPrevious() . \"\\\">Previous</a> \";\r\n\t\t}\r\n\t\t\r\n\t\t$links = $this->getLinkArr();\r\n\t\tforeach($links as $link)\r\n\t\t{\r\n\t\t\tif($link == $this->getCurrent()) {\r\n\t\t\t\techo \" $link \";\r\n\t\t\t} \r\n\t\t\telse { \r\n\t\t\t\techo \"<a href=\\\"\" . $this->getPageName() . \"?\".$this->request.\"page=$link\\\">\" . $link . \"</a> \";\r\n\t\t\t}\r\n\t\t} \r\n\t\t\r\n\t\tif($this->getNext())\r\n\t \t{\r\n\t \t\techo \"<a href=\\\"\" . $this->getPageName() . \"?\".$this->request.\"page=\" . $this->getNext() . \"\\\">Next</a> \";\r\n\t \t}\r\n\t}",
"function kickstart_single_next_prev() {\n\t// Only show on single pages\n\tif( !is_single() ) {\n\t\treturn;\n\t}\n\n\t$previouspost_text = __( 'Previous Post', 'lean-kickstart' );\n\t$nextpost_text = __( 'Next Post', 'lean-kickstart' );\n\n\techo '<div class=\"archive-pagination pagination\">';\n\t\tprevious_post_link( '<div class=\"pagination-previous alignleft\">%link</div>', $previouspost_text );\n\t\tnext_post_link( '<div class=\"pagination-next alignright\">%link</div>', $nextpost_text );\n\techo '</div>';\n}",
"private function prev() {\n if ($this->currentPage > 1) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage - 1) . '\"><</a></li>';\n }\n }",
"function nextPrev($curpage, $pages) { //Pagination\r\n $next_prev = \"\";\r\n\r\n if (($curpage - 1) <= 0) {\r\n $next_prev .= \"Previous\";\r\n } else {\r\n $next_prev .= \"<a href=\\\"\" . $_SERVER['PHP_SELF'] . \"&pages=\" . ($curpage - 1) . \"\\\">Previous</a>\";\r\n }\r\n\r\n $next_prev .= \" | \";\r\n\r\n if (($curpage + 1) > $pages) {\r\n $next_prev .= \"Next\";\r\n } else {\r\n $next_prev .= \"<a href=\\\"\" . $_SERVER['PHP_SELF'] . \"&pages=\" . ($curpage + 1) . \"\\\">Next</a>\";\r\n }\r\n return $next_prev;\r\n }",
"function nextPrev($curpage, $pages) \n { \n $next_prev = \"\"; \n\n if (($curpage-1) <= 0) \n { \n $next_prev .= \"Previous\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage-1).\"\\\" alt=\\\"Halaman sebelumnya ...\\\">Previous</a>\"; \n } \n\n $next_prev .= \" | \"; \n\n if (($curpage+1) > $pages) \n { \n $next_prev .= \"Next\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage+1).\"\\\" alt=\\\"Halaman berikut ...\\\">Next</a>\"; \n } \n\n return $next_prev; \n }",
"function nextPrev($curpage, $pages) { //Pagination\r\n $next_prev = \"\";\r\n\r\n if (($curpage - 1) <= 0) {\r\n $next_prev .= \"Previous\";\r\n } else {\r\n $next_prev .= \"<a href=\\\"\" . $_SERVER['PHP_SELF'] . \"&pages=\" . ($curpage - 1) . \"\\\">Previous</a>\";\r\n }\r\n\r\n $next_prev .= \" | \";\r\n\r\n if (($curpage + 1) > $pages) {\r\n $next_prev .= \"Next\";\r\n } else {\r\n $next_prev .= \"<a href=\\\"\" . $_SERVER['PHP_SELF'] . \"&pages=\" . ($curpage + 1) . \"\\\">Next</a>\";\r\n }\r\n return $next_prev;\r\n }",
"function nextPrev($curpage, $pages) {\r\n\t $next_prev = \"\"; \r\n\r\n\t\tif (($curpage-1) <= 0) {\r\n\t \t\t$next_prev .= \"Previous\";\r\n\t\t} else {\r\n\t \t\t$next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?\".$_SERVER['QUERY_STRING'].\"&p=\".($curpage-1).\"\\\" class='page-numbers'>Previous</a>\";\r\n\t\t} \r\n\r\n\t \t\t$next_prev .= \" | \"; \r\n\r\n\t \tif (($curpage+1) > $pages) {\r\n\t \t\t$next_prev .= \"Next\";\r\n\t } else {\r\n\t \t$next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?\".$_SERVER['QUERY_STRING'].\"&p=\".($curpage+1).\"\\\" class='page-numbers'>Next</a>\";\r\n\t }\r\n\t\treturn $next_prev;\r\n\t}",
"function nextprev($url, $from, $view, $total, $td, $qs=\"\"){\r\n\r\n\r\n\t\t//\talternative next_prev, uncomment to use -------------------------------------------------------------------------------------------------\r\n\t\t\r\n\r\n\t\tif($total > $view){\r\n\t\t\t$a = $total/$view;\r\n\t\t\t$r = explode(\".\", $a);\r\n\t\t\tif($r[1] != 0 ? $pages = ($r[0]+1) : $pages = $r[0]);\r\n\t\t}else{\r\n\t\t\t$pages = FALSE;\r\n\t\t}\r\n\r\n\t\tif($pages){\r\n\t\t\t$nppage= NP_3.\" \";\r\n\t\t\tif($pages > 10){\r\n\t\t\t\t$current = ($from/$view)+1;\r\n\r\n\t\t\t\tfor($c=0; $c<=2; $c++){\r\n\t\t\t\t\t$nppage .= ($view*$c == $from ? \"[<span style='text-decoration:underline'>\".($c+1).\"</span>] \" : \"<a href='$url?\".($view*$c).($qs ? \".\".$qs : \"\").\"'>\".($c+1).\"</a> \");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif($current >=3 && $current <= 5){\r\n\t\t\t\t\tfor($c=3; $c<=$current; $c++){\r\n\t\t\t\t\t\t$nppage .= ($view*$c == $from ? \"[<span style='text-decoration:underline'>\".($c+1).\"</span>] \" : \"<a href='$url?\".($view*$c).($qs ? \".\".$qs : \"\").\"'>\".($c+1).\"</a> \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if($current >= 6 && $current <= ($pages-5)){\r\n\t\t\t\t\t$nppage .= \" ... \";\r\n\t\t\t\t\tfor($c=($current-2); $c<=$current; $c++){\r\n\t\t\t\t\t\t$nppage .= ($view*$c == $from ? \"[<span style='text-decoration:underline'>\".($c+1).\"</span>] \" : \"<a href='$url?\".($view*$c).($qs ? \".\".$qs : \"\").\"'>\".($c+1).\"</a> \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$nppage .= \" ... \";\r\n\t\t\t\t\r\n\r\n\t\t\t\tif(($current+5) > $pages && $current != $pages){\r\n\t\t\t\t\t$tmp = ($current-2);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$tmp = $pages-3;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor($c=$tmp; $c<=($pages-1); $c++){\r\n\t\t\t\t\t$nppage .= ($view*$c == $from ? \"[<span style='text-decoration:underline'>\".($c+1).\"</span>] \" : \"<a href='$url?\".($view*$c).($qs ? \".\".$qs : \"\").\"'>\".($c+1).\"</a> \");\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tfor($c=0; $c < $pages; $c++){\r\n\t\t\t\t\tif($view*$c == $from ? $nppage .= \"[<span style='text-decoration:underline'>\".($c+1).\"</span>] \" : $nppage .= \"<a href='$url?\".($view*$c).($qs ? \".\".$qs : \"\").\"'>\".($c+1).\"</a> \");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$text = \"<div style='text-align:right'><div class='nextprev'><span class='smalltext'>\".$nppage.\"</span></div></div><br /><br />\";\r\n\t\t\techo $text;\r\n\t\t}\r\n\t\t\r\n\t}",
"function nextPrev($curpage, $pages) { //Pagination\r\n\t\t$next_prev = \"\";\r\n\r\n\t\tif (($curpage - 1) <= 0) {\r\n\t\t\t$next_prev .= \"Previous\";\r\n\t\t} else {\r\n\t\t\t$next_prev .= \"<a href=\\\"\" . $_SERVER['PHP_SELF'] . \"&pages=\" . ($curpage - 1) . \"\\\">Previous</a>\";\r\n\t\t}\r\n\r\n\t\t$next_prev .= \" | \";\r\n\r\n\t\tif (($curpage + 1) > $pages) {\r\n\t\t\t$next_prev .= \"Next\";\r\n\t\t} else {\r\n\t\t\t$next_prev .= \"<a href=\\\"\" . $_SERVER['PHP_SELF'] . \"&pages=\" . ($curpage + 1) . \"\\\">Next</a>\";\r\n\t\t}\r\n\t\treturn $next_prev;\r\n\t}",
"function kickstart_single_next_prev() {\n // Only show on single pages\n if( !is_single() ) {\n return;\n }\n\n $previouspost_text = __( 'Previous Post', 'lean-kickstart' );\n $nextpost_text = __( 'Next Post', 'lean-kickstart' );\n\n echo '<div class=\"archive-pagination pagination\">';\n previous_post_link( '<div class=\"pagination-previous alignleft\">%link</div>', $previouspost_text );\n next_post_link( '<div class=\"pagination-next alignright\">%link</div>', $nextpost_text );\n echo '</div>';\n}",
"function nextPrev($curpage, $pages) \n { \n $next_prev = \"\"; \n $page_list = \"\";\n\t $str = \"\";\n\t foreach( $_GET as $key=>$value)\n\t {\n\t if ($key==\"message\" || $key==\"page\"){}\n\t\telse\n\t\t $str = $str.\"&\".$key.\"=\".$value;\n\t }\n\t foreach( $_POST as $key=>$value)\n\t {\n\t if ($key==\"message\" || $key==\"page\"){}\n\t\telse\n\t\t $str = $str.\"&\".$key.\"=\".$value;\n\t }\t \t \n if (($curpage-1) <= 0) \n { \n $next_prev .= \"<span class=normaltextnotbold>\"._PREVIOUS_.\"</span>\"; \n } \n else \n { \n $next_prev .= \"<li><a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage-1).$str.\"\\\" class=smalla1>\"._PREVIOUS_.\"</a></li>\"; \n } \n $next_prev .= \" <font color=#000000>|</font> \"; \n if (($curpage+1) > $pages) \n { \n $next_prev .= \"<span class=smalla1>\"._NEXT_.\"</span>\"; \n } \n else \n { \n $next_prev .= \"<li><a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage+1).$str.\"\\\" class=smalla1>\"._NEXT_.\"</a></li>\"; \n } \n $next_prev .= \"\\n\";\n return $next_prev; \n }",
"function nextPrev($curpage, $pages) {\n\t\t$next_prev = \"\";\n\t\tif(($curpage-1) <= 0) \t{\n\t\t\t$next_prev .= \"Previous\";\n\t\t} else {\n\t\t\t$next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage-1).\"$str\\\">Previous</a> \";\n\t\t}\n\t\t$next_prev .= \" | \";\n\n\t\tif(($curpage+1) > $pages) {\n\t\t\t$next_prev .= \"Next\";\n\t\t} else {\n\t\t\t$next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage+1).\"$str\\\">Next</a> \";\n\t\t}\n\t\treturn $next_prev;\n\t}",
"function nextPrev($curpage, $pages,$parameter) \n { \n $next_prev = \"\"; \n\n if (($curpage-1) <= 0) \n { \n $next_prev .= \"Previous\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?\".$parameter.\"&page=\".($curpage-1).\"\\\" class=\\\"rightnavlinks\\\">Previous</a>\"; \n } \n\n $next_prev .= \" | \"; \n\n if (($curpage+1) > $pages) \n { \n $next_prev .= \"Next\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?\".$parameter.\"&page=\".($curpage+1).\"\\\" class=\\\"rightnavlinks\\\">Next</a>\"; \n } \n\n return $next_prev; \n }",
"function wash_nextprev_post_nav() {\n\n}",
"function printnextprev($atfirstrow, $numrows) {\r\n\tif (!$atfirstrow || $numrows == NUMRECORDSPERPAGE) {\r\n\t\techo \"<form method='post' action='ac_adm_utilizadores.php'><div>\";\r\n\tif (!$atfirstrow)\r\n\t\techo \"<input type='submit' value='< Previous' name='prevemps'>\";\r\n\tif ($numrows == NUMRECORDSPERPAGE)\r\n\t\techo \"<input type='submit' value='Next >' name='nextemps'>\";\r\n\techo \"</div></form>\\n\";\r\n\t}\r\n }",
"function weavr_wp_link_pages_args_prevnext_add($args)\n{\n global $page, $numpages, $more, $pagenow;\n \n if (!$args['next_or_number'] == 'next_and_number') \n return $args; # exit early\n \n $args['next_or_number'] = 'number'; # keep numbering for the main part\n if (!$more)\n return $args; # exit early\n \n if($page-1) # there is a previous page\n $args['before'] .= _wp_link_page($page-1)\n . $args['link_before']. $args['previouspagelink'] . $args['link_after'] . '</a>'\n ;\n \n if ($page<$numpages) # there is a next page\n $args['after'] = _wp_link_page($page+1)\n . $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . '</a>'\n . $args['after']\n ;\n \n return $args;\n}",
"protected function prepareNextPrevButtons() \n\t{\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns only one; but collections don't neccisarily have unique titles so beware. | public static function loadByTitle($title) {
$db = getDB();
$stat = $db->prepare('SELECT * FROM collection WHERE title=:title');
$stat->bindValue('title', $title);
$stat->execute();
if($stat->rowCount() == 1) {
return new Collection($stat->fetch(PDO::FETCH_ASSOC));
}
} | [
"public function getFirst ( ) { return reset( $this->collections ); }",
"public function first()\n {\n return $this->collection->first();\n }",
"public function getFirst() {\n $varReturn = null;\n if (count($this->collection) > 0) {\n $varReturn = $this->collection[0];\n }\n\n return $varReturn;\n }",
"public function first()\n {\n return (empty($this->collection) ? null : $this->collection[0]);\n }",
"function getSingleItem()\n {\n if ($this->count() === 1) {\n return $this->getFirst();\n }\n\n return $this->emptyItem();\n }",
"protected function _getCollectionByTitle($name)\n {\n $db = get_db();\n \n $elementTable = $db->getTable('Element');\n $element = $elementTable->findByElementSetNameAndElementName('Dublin Core', 'Title');\n \n $collectionTable = $db->getTable('Collection');\n $select = $collectionTable->getSelect();\n $select->joinInner(array('s' => $db->ElementText), \n 's.record_id = collections.id', array());\n $select->where(\"s.record_type = 'Collection'\");\n $select->where(\"s.element_id = ?\", $element->id);\n $select->where(\"s.text = ?\", $name);\n \n $collection = $collectionTable->fetchObject($select);\n if (!$collection) {\n _log(\"Collection not found. Collections must be created with identical names prior to import\", Zend_Log::NOTICE);\n return false;\n }\n return $collection;\n }",
"public static function first()\n {\n return self::find()->one();\n }",
"protected function getSingleName()\n {\n return str_singular($this->getCollectionName());\n }",
"public function first() \n { \n $stories = $this->getStories();\n return $stories[0];\n }",
"public static function getUnique()\r\n {\r\n $q = Doctrine_Query::create()\r\n ->from('Association a')\r\n ->limit('1');\r\n\r\n return $q->fetchOne();\r\n }",
"public function retrieveTitle() {\n $prepare = $this->database->prepare(\"\n SELECT title\n FROM manuscripts\n WHERE collection = :collection\n AND pointer = :pointer\n LIMIT 1\n \");\n\n $prepare->execute(array(\n \":collection\" => $this->collection,\n \":pointer\" => $this->pointer\n ));\n\n return $prepare->fetchColumn();\n }",
"public function first()\n {\n return $this->_results[0];\n }",
"public function firstItem()\n {\n return $this->getIdentifier($this->items->first());\n }",
"public function getFirstItem();",
"public function first()\n {\n if (!$this->_arrayObject()->offsetExists(0)) {\n throw new Relax_Client_Error(\n \"No resources in collection $this->_path\");\n }\n\n return $this->_arrayObject()->offsetGet(0);\n }",
"public function first(): DocumentItem\n {\n return $this->get(0);\n }",
"public function getFirst()\n {\n return $this->dao->select('*')->from(TABLE_COMPANY)->orderBy('id')->limit(1)->fetch();\n }",
"function find_one(string $collectionName, array $filter = [], array $options = [])\n{\n return collection(__get_dbname_or_throw(), $collectionName)->findOne($filter, $options);\n}",
"public function findOne()\n {\n $this->criteria->setLimit(1);\n $ret = $this->doFind();\n $this->cleanup();\n \n return isset($ret[0]) ? $ret[0] : null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the callable targeting the resolver function if the resolver function is part of a service. This should not be used in the context of a field middleware. Use getResolver/setResolver if you want to wrap the resolver in another method. | public function setCallable(callable $callable): void
{
if ($this->originalResolver !== null) {
throw new GraphQLRuntimeException('You cannot modify the callable via setCallable because it was already used. You can still wrap the callable using getResolver/setResolver');
}
$this->callable = $callable;
$this->targetMethodOnSource = null;
$this->targetPropertyOnSource = null;
$this->magicProperty = null;
} | [
"public function setCallableResolver(CallableResolverInterface $resolver)\n {\n $this->callableResolver = $resolver;\n }",
"public function set_resolver(Resolver $resolver);",
"public static function setQueueResolver(callable $resolver)\n {\n }",
"public function blueprintResolver(Closure $resolver)\n {\n $this->resolver = $resolver;\n }",
"public function set_route_resolver( Closure $callback ) {\n\t\t$this->route_resolver = $callback;\n\n\t\treturn $this;\n\t}",
"public function dataprintResolver(Closure $resolver): void\n {\n $this->resolver = $resolver;\n }",
"public function set_callable( $callable );",
"public function setRoutesResolver(callable $routesResolver = null)\n {\n $this->routesResolver = $routesResolver;\n }",
"public function setRouteResolver(Closure $callback)\n {\n $this->routeResolver = $callback;\n return $this;\n }",
"public function setRouteResolver(Closure $callback)\n {\n $this->routeResolver = $callback;\n\n return $this;\n }",
"public function setUserResolver(Closure $callback): self\n {\n $this->userResolver = $callback;\n\n return $this;\n }",
"public static function setFactory(?callable $callable);",
"public static function setFactory($callable){\n\t\t//Method inherited from \\Symfony\\Component\\HttpFoundation\\Request\n\t\treturn \\Illuminate\\Http\\Request::setFactory($callable);\n\t}",
"public static function setFactory($callable)\n { //Method inherited from \\Symfony\\Component\\HttpFoundation\\Request\n return \\Illuminate\\Http\\Request::setFactory($callable);\n }",
"public function setResolver(Resolver $resolver)\n {\n Provider::getServices()->set('ViewResolver', $resolver);\n }",
"public function setQueueResolver(callable $resolver)\n {\n $this->queueResolver = $resolver;\n\n return $this;\n }",
"public function setFactory($id, callable $resolver)\n {\n $this->factories[$id] = $resolver;\n }",
"public function setUserResolver(Closure $callback)\n {\n $this->userResolver = $callback;\n\n return $this;\n }",
"public static function filterResolver(Closure $resolver)\n {\n static::$filterResolver = $resolver;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field meta_name | public function getMetaName()
{
return $this->meta_name;
} | [
"function getMetaValue($postid,$name) {\n $custom = get_post_custom($postid);\n return (isset($custom[QUOTEPRESS_PREFIX.'-'.$name])?$custom[QUOTEPRESS_PREFIX.'-'.$name][0]:'');\n }",
"public function get_field_name();",
"public function get_item_meta_value( $meta_name ) {\n\n\t\t// no item set\n\t\tif ( ! $this->item ) return '';\n\n\t\t// use the raw item_meta field thanks to this change https://github.com/woothemes/woocommerce/commit/913cc42c06cbd321ae2e2a5f439b4cefd6c1385e#diff-9b4164165828b26c4b7aec01c7b17884R1078\n\t\tforeach ( $this->item['item_meta'] as $name => $value ) {\n\t\t\tif ( __( $meta_name, WC_PDF_Product_Vouchers::TEXT_DOMAIN ) == $name ) {\n\t\t\t\treturn $value[0];\n\t\t\t}\n\t\t}\n\n\t\t// not found\n\t\treturn '';\n\t}",
"function fieldName($x){\n global $pdo, $table;\n $sql = 'SELECT * FROM '.$table.' LIMIT 1';\n $sth = $pdo->query($sql);\n $meta = $sth->getColumnMeta($x);\n $field = $meta['name'];\n return $field;\n }",
"function custom_field($meta_key='') {\n return groups_get_groupmeta( bp_get_group_id(), $meta_key) ;\n }",
"public function getFieldName()\n {\n return $this->field->getAttribute('field_name');\n }",
"public static function meta_field_name( $field_name ){\n\t\t\treturn self::META_PREFIX . $field_name;\n\t\t}",
"protected function get_metafield_name($label) {\n\t\t\tif(!$options = $this->options) {\n\t\t\t\t$options = $this->pro_class->options;\n\t\t\t}\n\n\t\t\tforeach($options['metafields'] as $metafield => $value) {\n\t\t\t\tif($value['label'] == $label) {\n\t\t\t\t\treturn $metafield;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $label; // if no match found, try to use the label\n\t\t}",
"public function getFieldName()\n {\n return $this->field_name;\n }",
"public function getMetaValue()\n {\n $rtn = $this->data['meta_value'];\n\n return $rtn;\n }",
"public function getMetaValue( string $metaFieldName, bool $single = true ) {\n\t\treturn get_post_meta( $this->post->ID, $metaFieldName, $single );\n\t}",
"public function getFieldValue($name) {\n return $this->__get($name);\n }",
"function author_name_get_meta( $value ) {\r\n\tglobal $post;\r\n\r\n\t$field = get_post_meta( $post->ID, $value, true );\r\n\tif ( ! empty( $field ) ) {\r\n\t\treturn is_array( $field ) ? stripslashes_deep( $field ) : stripslashes( wp_kses_decode_entities( $field ) );\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}",
"public static function getStringValueFieldName()\n {\n return self::FIELD_STRING_VALUE;\n }",
"function types_get_field_meta_value( $field, $post_id = null, $raw = false ) {\n return wpcf_api_field_meta_value( $field, $post_id, $raw );\n}",
"public function getFieldValue($name){\n foreach($this->_fields as $f){\n if($f->getName()==$name)return $f->getValue();\n }\n return NULL;\n }",
"public function field($name)\n {\n return $this->fields->get($name);\n }",
"function api_get_meta_value($object, $field_name, $request)\n{\n return get_post_meta($object[ 'id' ], $field_name, true);\n}",
"public function getValueName()\n {\n if (array_key_exists(\"valueName\", $this->_propDict)) {\n return $this->_propDict[\"valueName\"];\n } else {\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'foldersRenameOld' | protected function foldersRenameOldRequest($name, $id)
{
// verify the required parameter 'name' is set
if ($name === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $name when calling foldersRenameOld'
);
}
// verify the required parameter 'id' is set
if ($id === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $id when calling foldersRenameOld'
);
}
$resourcePath = '/api/Folders/rename/{id}/{name}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($name !== null) {
$resourcePath = str_replace(
'{' . 'name' . '}',
ObjectSerializer::toPathValue($name),
$resourcePath
);
}
// path params
if ($id !== null) {
$resourcePath = str_replace(
'{' . 'id' . '}',
ObjectSerializer::toPathValue($id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
[]
);
} else {
$headers = $this->headerSelector->selectHeaders(
[],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'PUT',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function renameFolder(string $old, string $new): Response;",
"private function renameFolder($old, $new)\n {\n if ($old === $new) {\n return;\n }\n\n $bucket = Auth::user()->getBucket();\n Storage::disk('buckets')->move($bucket.'/'.$old, $bucket.'/'.$new);\n }",
"public function updateAfterRenameFolder($old, $new);",
"private function folderRename($inputArray){\r\n\t\t\treturn $this->host.'/file/renamefolder?'.$this->queryBuilder($inputArray);\r\n\t\t}",
"protected function foldersV2RenameRequest($name, $id)\n {\n // verify the required parameter 'name' is set\n if ($name === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $name when calling foldersV2Rename'\n );\n }\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling foldersV2Rename'\n );\n }\n\n $resourcePath = '/api/v2/Folders/rename/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($name !== null) {\n $queryParams['name'] = ObjectSerializer::toQueryValue($name);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function renameFolder($newname,$oldname){\n return rename ( WWW_ROOT .'files' . DS . $oldname , WWW_ROOT .'files' . DS . $newname );\n }",
"protected function foldersRenameRequest($name, $id)\n {\n // verify the required parameter 'name' is set\n if ($name === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $name when calling foldersRename'\n );\n }\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling foldersRename'\n );\n }\n\n $resourcePath = '/api/Folders/rename/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($name !== null) {\n $queryParams['name'] = ObjectSerializer::toQueryValue($name);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function renameFolderByPostRequest(Request $request)\n {\n if ( !$request->request->has(FileUploadController::KEY_SUBDIRECTORY_CURRENT_PATH_IN_MODULE_UPLOAD_DIR) ) {\n $message = $this->app->translator->translate('responses.general.missingRequiredParameter') . FileUploadController::KEY_SUBDIRECTORY_CURRENT_PATH_IN_MODULE_UPLOAD_DIR;\n return AjaxResponse::buildJsonResponseForAjaxCall($message, Response::HTTP_BAD_REQUEST);\n }\n\n if ( !$request->request->has(FileUploadController::KEY_UPLOAD_MODULE_DIR) ) {\n $message = $this->app->translator->translate('responses.general.missingRequiredParameter') . FileUploadController::KEY_UPLOAD_MODULE_DIR;\n return AjaxResponse::buildJsonResponseForAjaxCall($message, Response::HTTP_BAD_REQUEST);\n }\n\n if ( !$request->request->has(FileUploadController::KEY_SUBDIRECTORY_NEW_NAME) ) {\n $message = $this->app->translator->translate('responses.general.missingRequiredParameter') . FileUploadController::KEY_SUBDIRECTORY_NEW_NAME;\n return AjaxResponse::buildJsonResponseForAjaxCall($message, Response::HTTP_BAD_REQUEST);\n }\n\n $new_name = $request->request->get(FileUploadController::KEY_SUBDIRECTORY_NEW_NAME);\n $upload_module_dir = $request->request->get(FileUploadController::KEY_UPLOAD_MODULE_DIR);\n $current_directory_path_in_module_upload_dir = $request->request->get(FileUploadController::KEY_SUBDIRECTORY_CURRENT_PATH_IN_MODULE_UPLOAD_DIR);\n\n $response = $this->controllers->getFilesUploadSettingsController()->renameSubdirectory($upload_module_dir, $current_directory_path_in_module_upload_dir, $new_name);\n return AjaxResponse::initializeFromResponse($response)->buildJsonResponse();\n }",
"public function testFoldersRenameOld()\n {\n }",
"function RenameFolder($path, $new_name) {\n\t\ttry{\n\t\t\tif(!$this->CheckPath($path))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\techo \"<br>rename<br>\";\n\t\t\t\t$this->soap_folder->rename(array('token' => $this->token,'fldPath' => $path,'newName' => $new_name));//($this->token, $path, $new_path);\n\t\t\t\t//(array('token' => $this->token, 'fldPath' => $this->folder->path))\n\t\t\t\techo \"error?\";\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}catch (Exception $e){\n\t\t\techo format_exception($e);\n\t\t}\n\t}",
"function rename_folder()\n\t{\n\t\t$this->db->set('name', $this->input->post('edit_folder_name'));\n\t\t$this->db->where('id_folder', $this->input->post('id_folder'));\n\t\t$this->db->update('user_folders');\n\t}",
"public function testRenameFolder() {\n $this->objFromFixture('Member', 'apiuser')->login();\n \n\n //Test renaming a folder\n $response=$this->getAMFResponse('Snippets.renameFolder', array(\n 'id'=>$this->objFromFixture('SnippetFolder', 'folder1')->ID,\n 'name'=>'Lorem Ipsum'\n ));\n \n \n //Validate the response\n $this->assertEquals('HELO', $response['status'], 'Response status should have been HELO');\n \n\n //Test renaming a folder to a duplicate\n $response=$this->getAMFResponse('Snippets.renameFolder', array(\n 'id'=>$this->objFromFixture('SnippetFolder', 'folder1')->ID,\n 'name'=>'Test Folder 2'\n ));\n \n \n //Validate the response\n $this->assertEquals('EROR', $response['status'], 'Response status should have been EROR');\n $this->assertEquals(_t('CodeBank.FOLDER_EXISTS', '_A folder already exists with that name'), $response['message'], 'Response message should have been that there is a duplicate');\n }",
"function renameFolder($oldName,$newName){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\r\n\t\t\t}",
"public function testRename()\n {\n $definitions = [\n 'file' => ['old' => self::FILE_NAME, 'new' => self::FILE_NAME_2],\n 'folder' => ['old' => self::FOLDER_NAME, 'new' => self::FOLDER_NAME_2],\n ];\n foreach ($definitions as $object => $data) {\n $this->createObject($object, $data['old']);\n\n // Rename the object\n $response = $this->renameObject($object, $data['old'], $data['new']);\n\n $this->assertInstanceOf(JsonResponse::class, $response);\n $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());\n\n $this->assertFalse($this->getService('filesystem')->has(self::FILESYSTEM . '://' . $data['old']));\n $this->assertTrue($this->getService('filesystem')->has(self::FILESYSTEM . '://' . $data['new']));\n }\n }",
"function folders_rename_getname ($imapConnection, $delimiter, $old) {\n global $color, $default_folder_prefix, $oTemplate;\n\n if ( $old == '' ) {\n plain_error_message(_(\"You have not selected a folder to rename. Please do so.\").\n '<br /><a href=\"../src/folders.php\">'._(\"Click here to go back\").'</a>.', $color);\n sqimap_logout($imapConnection);\n $oTemplate->display('footer.tpl');\n exit;\n }\n\n if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) {\n $isfolder = TRUE;\n $old = substr($old, 0, strlen($old) - 1);\n } else {\n $isfolder = FALSE;\n }\n\n $old = imap_utf7_decode_local($old);\n\n if (strpos($old, $delimiter)) {\n $old_name = substr($old, strrpos($old, $delimiter)+1);\n // hide default prefix (INBOX., mail/ or other)\n $quoted_prefix=preg_quote($default_folder_prefix,'/');\n $prefix_length=(preg_match(\"/^$quoted_prefix/\",$old) ? strlen($default_folder_prefix) : 0);\n if ($prefix_length>strrpos($old, $delimiter)) {\n $old_parent = '';\n } else {\n $old_parent = substr($old, $prefix_length, (strrpos($old, $delimiter)-$prefix_length))\n . ' ' . $delimiter;\n }\n } else {\n $old_name = $old;\n $old_parent = '';\n }\n \n sqimap_logout($imapConnection);\n\n $oTemplate->assign('dialog_type', 'rename');\n $oTemplate->assign('parent_folder', sm_encode_html_special_chars($old_parent));\n $oTemplate->assign('current_full_name', sm_encode_html_special_chars($old));\n $oTemplate->assign('current_folder_name', sm_encode_html_special_chars($old_name));\n $oTemplate->assign('is_folder', $isfolder);\n \n $oTemplate->display('folder_manip_dialog.tpl');\n $oTemplate->display('footer.tpl');\n\n exit;\n}",
"public function renameFolderAction($id) {\r\n\t\t$em = $this -> getDoctrine() -> getManager();\r\n\t\t$securityContext = $this -> get('security.context');\r\n\t\t$parameters = $_GET['acsilserver_appbundle_renamefiletype'];\r\n\t\t$name = $parameters['name'];\r\n\r\n\t\t$folderToRename = $em -> getRepository('AcsilServerAppBundle:Folder') -> findOneBy(array('id' => $id));\r\n\t\t\t\r\n\t\tif (!$folderToRename) {\r\n\t\t\tthrow $this -> createNotFoundException('No folder found for id ' . $id);\r\n\t\t}\r\n\t\t\r\n\t\t$folderId = $folderToRename->getParentFolder();\r\n\r\n\t\tif (false === $securityContext -> isGranted('EDIT', $folderToRename)) {\r\n\t\t\tthrow new AccessDeniedException();\r\n\t\t}\r\n\t\t$folderToRename->setName($name);\r\n\t\t$folderToRename->setLastModifDate(new \\DateTime());\r\n\t\t$em -> persist($folderToRename);\r\n\t\t$em -> flush();\r\n\t\treturn $this -> redirect($this -> generateUrl('_managefile', array(\r\n 'folderId' => $folderId,\r\n )));\r\n\t}",
"public function renameFolder(\\TYPO3\\CMS\\Core\\Resource\\Folder $folder, $newName) {\n\t}",
"public function ChangeFolder($folderid, $oldid, $displayname, $type){\n ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'START ChangeFolder { folderid = '.$folderid.'; oldid = '.$oldid.'; displayname = '.$displayname.'; type = '.$type.' }');\n\n if ($folderid == \"0\") {\n $zimbraParentFolderId = \"1\";\nZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . \"ROOT PARENT\" );\n } else {\n\t\t\t$index = $this->GetFolderIndex($folderid);\n\t\t\t$zimbraParentFolderId = $this->_folders[$index]->id;\nZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'Parent ['.$zimbraParentFolderId.']' );\n }\n\n if ($oldid) {\nZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'OldID is set - Want to RENAME/Trash/Move' );\n\n\t\t\t$index = $this->GetFolderIndex($oldid);\n\t\t\t$zimbraFolderId = $this->_folders[$index]->id;\n $deviceParentId = $this->_folders[$index]->parentid;\n\t\t\t$view = $this->_folders[$index]->view;\n\t\t\t$foldername = $this->_folders[$index]->name;\n\n if ($deviceParentId == $folderid) {\n $soap ='<FolderActionRequest xmlns=\"urn:zimbraMail\">\n <action id=\"'.$zimbraFolderId.'\" op=\"rename\" l=\"'.$zimbraParentFolderId.'\" name=\"'.$displayname.'\" ></action> \n </FolderActionRequest>';\n//\tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'SOAP ['.$soap.']' );\n $returnJSON = true;\n\t \t\t$response = $this->SoapRequest($soap, false, false, $returnJSON);\n\t\t \tif($response) {\n $array = json_decode($response, true);\n//\tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'ARRAY ['.print_r($array, true).']' );\n\n\t\t\t\t// Unset here - as the function can be called recursively below. Best not to carry multiple copies of $response\n \t\t\t\tunset($response);\n\t\t\t\t\n\t \t\t\tif (isset($array['Body']['FolderActionResponse']['action']['id'])) {\n\t\t \t\t\t$postId = $array['Body']['FolderActionResponse']['action']['id'];\n\t\t\t \t\t$postOp = $array['Body']['FolderActionResponse']['action']['op'];\n\t\t\t\t \tif (($postId == $zimbraFolderId) && ($postOp == \"rename\")) {\n\t\t\t\t\t \tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . \"END ChangeFolder { Folder '\".$foldername.\"' renamed to '\".$displayname.\"' }\");\n $this->_folders[$index]->name = $displayname;\n// return $this->StatFolder( $oldid );\n $this->ClearCache();\n $this->_cacheChangeToken = \"ForceRefresh\";\n $this->_saveCacheOnLogoff = true;\n \t\t\t\t\t\treturn true;\n// \t\t\t\t\t\treturn $this->StatFolder( $zimbraFolderId );\n\t \t\t\t\t}\n\t\t \t\t}\n\t\t\t }\n } elseif ($this->GetWasteBasket() == $folderid) {\n $soap ='<FolderActionRequest xmlns=\"urn:zimbraMail\">\n <action id=\"'.$zimbraFolderId.'\" op=\"trash\" ></action> \n </FolderActionRequest>';\n//\tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'SOAP ['.$soap.']' );\n $returnJSON = true;\n\t \t\t$response = $this->SoapRequest($soap, false, false, $returnJSON);\n\t\t \tif($response) {\n $array = json_decode($response, true);\n//\tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'ARRAY ['.print_r($array, true).']' );\n\n\t\t\t\t// Unset here - as the function can be called recursively below. Best not to carry multiple copies of $response\n \t\t\t\tunset($response);\n\t\t\t\t\n\t \t\t\tif (isset($array['Body']['FolderActionResponse']['action']['id'])) {\n\t\t \t\t\t$postId = $array['Body']['FolderActionResponse']['action']['id'];\n\t\t\t \t\t$postOp = $array['Body']['FolderActionResponse']['action']['op'];\n\t\t\t\t \tif (($postId == $zimbraFolderId) && ($postOp == \"trash\")) {\n\t\t\t\t\t \tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . \"END ChangeFolder { Folder '\".$foldername.\"' moved to 'Trash' }\");\n $this->_folders[$index]->name = $displayname;\n// return $this->StatFolder( $oldid );\n $this->ClearCache();\n $this->_cacheChangeToken = \"ForceRefresh\";\n $this->_saveCacheOnLogoff = true;\n \t\t\t\t\t\treturn true;\n// \t\t\t\t\t\treturn $this->StatFolder( $zimbraFolderId );\n\t \t\t\t\t}\n\t\t \t\t}\n\t\t\t } \n } else {\n $soap ='<FolderActionRequest xmlns=\"urn:zimbraMail\">\n <action id=\"'.$zimbraFolderId.'\" op=\"move\" l=\"'.$zimbraParentFolderId.'\" ></action> \n </FolderActionRequest>';\n//\tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'SOAP ['.$soap.']' );\n $returnJSON = true;\n\t \t\t$response = $this->SoapRequest($soap, false, false, $returnJSON);\n\t\t \tif($response) {\n $array = json_decode($response, true);\n//\tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'ARRAY ['.print_r($array, true).']' );\n\n\t\t\t\t// Unset here - as the function can be called recursively below. Best not to carry multiple copies of $response\n \t\t\t\tunset($response);\n\t\t\t\t\n\t \t\t\tif (isset($array['Body']['FolderActionResponse']['action']['id'])) {\n\t\t \t\t\t$postId = $array['Body']['FolderActionResponse']['action']['id'];\n\t\t\t \t\t$postOp = $array['Body']['FolderActionResponse']['action']['op'];\n\t\t\t\t \tif (($postId == $zimbraFolderId) && ($postOp == \"move\")) {\n\t\t\t\t\t \tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . \"END ChangeFolder { Folder '\".$foldername.\"' moved to '\".$zimbraParentFolderId.\"' }\");\n $this->_folders[$index]->name = $displayname;\n// return $this->StatFolder( $oldid );\n $this->ClearCache();\n $this->_cacheChangeToken = \"ForceRefresh\";\n $this->_saveCacheOnLogoff = true;\n \t\t\t\t\t\treturn true;\n// \t\t\t\t\t\treturn $this->StatFolder( $zimbraFolderId );\n\t \t\t\t\t}\n\t\t \t\t}\n\t\t\t } \n\t\t\t}\n } else {\n\t\t\tswitch ($type) {\n\t\t\t\tcase SYNC_FOLDER_TYPE_TASK:\n\t\t\t\tcase SYNC_FOLDER_TYPE_USER_TASK:\n\t\t\t\t\t$view = 'task';\n\t\t\t\t\tbreak;\n\t\t\t\tcase SYNC_FOLDER_TYPE_APPOINTMENT:\n\t\t\t\tcase SYNC_FOLDER_TYPE_USER_APPOINTMENT:\n\t\t\t\t\t$view = 'appointment';\n\t\t\t\t\tbreak;\n\t\t\t\tcase SYNC_FOLDER_TYPE_CONTACT:\n\t\t\t\tcase SYNC_FOLDER_TYPE_USER_CONTACT:\n\t\t\t\t\t$view = 'contact';\n\t\t\t\t\tbreak;\n\t\t\t\tcase SYNC_FOLDER_TYPE_USER_MAIL:\n\t\t\t\t\t$view = 'message';\n\t\t\t\t\tbreak;\n\t\t\t\tcase SYNC_FOLDER_TYPE_JOURNAL:\n\t\t\t\tcase SYNC_FOLDER_TYPE_USER_JOURNAL:\n\t\t\t\tcase SYNC_FOLDER_TYPE_NOTE:\n\t\t\t\tcase SYNC_FOLDER_TYPE_USER_NOTE:\n\t\t\t\tdefault:\n\t\t\t\t\tZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . \"END ChangeFolder { FAILED - Unsupported Type for Create (\".$type.\") }\");\n\t\t\t\t\treturn false;\n\t\t\t}\n\n $soap ='<CreateFolderRequest xmlns=\"urn:zimbraMail\">\n <folder name=\"'.$displayname.'\" l=\"'.$zimbraParentFolderId.'\" view=\"'.$view.'\" ></folder> \n </CreateFolderRequest>';\n\n//ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'SOAP ['.$soap.']' );\n $returnJSON = true;\n\t\t\t$response = $this->SoapRequest($soap, false, false, $returnJSON);\n if($response) {\n $array = json_decode($response, true);\n//ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . 'ARRAY ['.print_r($array, true).']' );\n\n // Unset here - as the function can be called recursively below. Best not to carry multiple copies of $response\n unset($response);\n\t\t\t\n \t\tif (isset($array['Body']['CreateFolderResponse']['folder'][0]['id'])) {\n\t\t\t\t\t\n $noteFlag = ($view == \"note\" ? 'N' : '' );\n\t\t\t\t\t\n $newId = $array['Body']['CreateFolderResponse']['folder'][0]['id'];\n $folder_count = count($this->_folders);\n $this->_folders[$folder_count] = new stdClass();\n $this->_folders[$folder_count]->id = $newId;\n if (strrpos($newId,':') !== false) {\n $parts = explode(\":\",$newId);\n $zid = $parts[0];\n $rid = $parts[1];\n if (isset($this->_linkOwners[$zid])) {\n $owner = $this->_linkOwners[$zid];\n } else {\n // First Owner - Count will be zero, second owner - count will be one, etc.\n $this->_linkOwners[$zid] = count($this->_linkOwners);\n $owner = $this->_linkOwners[$zid];\n }\n\n $this->_folders[$folder_count]->devid = 'FL'.$noteFlag.$owner.'-'.$rid;\n $this->_folders[$folder_count]->linkid = $zid.\":\".$rid;\n if (isset($this->_shareOwners[$zid])) {\n $this->_folders[$folder_count]->owner = $this->_shareOwners[$zid];\n } else {\n $this->_folders[$folder_count]->owner = \"\";\n }\n\t\t\t\n } else {\n $this->_folders[$folder_count]->devid = 'f'.$noteFlag.$newId;\n $this->_folders[$folder_count]->linkid = \"\";\n $this->_folders[$folder_count]->owner = \"\";\n }\n $this->_folders[$folder_count]->name = $displayname;\n $this->_folders[$folder_count]->parentid = $folderid;\n $this->_folders[$folder_count]->view = $view;\n\t\t\t\t\t\n $this->ClearCache();\n $this->_cacheChangeToken = \"ForceRefresh\";\n $this->_saveCacheOnLogoff = true;\n\n ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . \"END ChangeFolder { New folder '\".$displayname.\"' created - id = \".$this->_folders[$folder_count]->devid.\" }\");\n return $this->StatFolder( $this->_folders[$folder_count]->devid );\n }\n\t\t\t}\n } \n ZLog::Write(LOGLEVEL_DEBUG, 'Zimbra->ChangeFolder(): ' . \"END ChangeFolder { FALSE }\");\n return false;\n }",
"public function foldersFindByNameOldWithHttpInfo($name)\n {\n $returnType = '\\Swagger\\Client\\Model\\FolderDTO[]';\n $request = $this->foldersFindByNameOldRequest($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\\FolderDTO[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the cvss2Summary property value. The cvss2Summary property | public function getCvss2Summary(): ?CvssSummary {
$val = $this->getBackingStore()->get('cvss2Summary');
if (is_null($val) || $val instanceof CvssSummary) {
return $val;
}
throw new \UnexpectedValueException("Invalid type found in backing store for 'cvss2Summary'");
} | [
"public function getCvss2Summary()\n {\n if (array_key_exists(\"cvss2Summary\", $this->_propDict)) {\n if (is_a($this->_propDict[\"cvss2Summary\"], \"\\Beta\\Microsoft\\Graph\\SecurityNamespace\\Model\\CvssSummary\") || is_null($this->_propDict[\"cvss2Summary\"])) {\n return $this->_propDict[\"cvss2Summary\"];\n } else {\n $this->_propDict[\"cvss2Summary\"] = new CvssSummary($this->_propDict[\"cvss2Summary\"]);\n return $this->_propDict[\"cvss2Summary\"];\n }\n }\n return null;\n }",
"public function getVcSummary()\n {\n return $this->vcSummary;\n }",
"public function getCvssV2()\n {\n return $this->cvss_v2;\n }",
"public function getSummary()\n {\n return $this->summary;\n }",
"function getSummary() {\n\t\treturn $this->_Summary;\n\t}",
"public function getSummaryDescription()\n {\n return $this->summaryDescription;\n }",
"public function getSummary()\n {\n return $this->data['fields']['summary'];\n }",
"public function getPublishSummaryToCscc()\n {\n return $this->readOneof(3);\n }",
"public function getCumPlafondSs2() {\n return $this->cumPlafondSs2;\n }",
"public function &getSummary(): array {\n return $this->summary;\n }",
"public function getSummary() {\n\t\treturn $this->entry->summary;\n\t}",
"public function getCvss3Summary(): ?CvssSummary {\n $val = $this->getBackingStore()->get('cvss3Summary');\n if (is_null($val) || $val instanceof CvssSummary) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'cvss3Summary'\");\n }",
"public function getSummarySpec()\n {\n return $this->summary_spec;\n }",
"public function getSummary();",
"public function getSummaryCount()\n {\n return $this->count(self::_SUMMARY);\n }",
"public function getSummaryText()\n {\n return $this->summary_text;\n }",
"public function getSummary()\n {\n return $this->readOneof(11);\n }",
"public function getProjectSummary()\r\n {\r\n return $this->project_summary;\r\n }",
"function getSummary()\n {\n return $this->page != null ? $this->page['summary'] : '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches the annotation from a folder. | public function getAnnotation($folder, $annotation)
{
list($entry, $key) = $this->_getAnnotateMoreEntry($annotation);
$result = imap_getannotation(
$this->getBackend(), $this->encodePath($folder), $entry, $key
);
if (!$result) {
throw new Horde_Kolab_Storage_Exception(
sprintf(
Horde_Kolab_Storage_Translation::t(
"Retrieving annotation %s[%s] on folder %s%s failed. Error: %s"
),
$entry,
$key,
$this->_getBaseMbox(),
$folder,
imap_last_error()
)
);
}
return $result[$key];
} | [
"public function getAnnotation($folder, $annotation)\n {\n list($attr, $type) = $this->_getAnnotateMoreEntry($annotation);\n $result = $this->getBackend()->getAnnotation(\n $this->encodePath($folder), $attr, $type\n );\n if ($this->getBackend()->errornum != 0) {\n throw new Horde_Kolab_Storage_Exception(\n sprintf(\n Horde_Kolab_Storage_Translation::t(\n \"Setting annotation %s[%s] on folder %s failed. Error: %s\"\n ),\n $attr,\n $type,\n $folder,\n $this->getBackend()->error\n )\n );\n }\n return $result[$folder][$annotation];\n }",
"public function getAnnotation($folder, $annotation)\n {\n $folder = $this->_convertToInternal($folder);\n $this->_failOnMissingFolder($folder);\n if ($this->_data->hasAnnotation($folder, $annotation)) {\n return $this->_data->getAnnotation($folder, $annotation);\n }\n return '';\n }",
"public function getAnnotationFilePath();",
"public static function getAnnotation($path, $matches, $params, $format){\n if(count($matches) < 2){\n error(\"Must include the id of the annotation in URI.\");\n }\n\n $annotation = lookupAnnotation($matches[1]);\n\n // Verify this annotation exists.\n if(!$annotation){\n error(\"We could not find an annotation with id ${matches[1]}.\");\n }\n\n // Verify the user has permission to view this annotation.\n if(!canViewAnnotation($annotation[\"annotation_id\"])){\n error(\"You do not have permission to view this annotation.\");\n }\n\n if($format == \"json\"){\n return [\n \"success\" => true,\n \"annotation_data\" => $annotation\n ];\n } else {\n $text = getTextMetadata($annotation[\"text_id\"]);\n $text[\"content_file\"] = getTextContentFilename($annotation[\"text_id\"]);\n Controllers::render(\"Annotations\", \"views/annotation.php\", \n [\n \"annotation\" => $annotation,\n \"text\" => $text,\n \"is_study\" => false\n ],\n [], [], \"annotation-page\", \"views/annotation-header.php\"\n );\n }\n}",
"protected function annotateFolder()\n {\n $classMap = ClassMapGenerator::createMap($this->searchDirectory());\n \n /** @var \\ReflectionClass[] $classes */\n $classes = array_map(function ($class) {\n return new ReflectionClass($class);\n }, array_keys($classMap));\n\n foreach ($classes as $reflection) {\n if ($reflection->isSubclassOf(static::PARENT_CLASS)) {\n $this->annotate($reflection);\n }\n }\n }",
"public function getAnnotation(string $annotationClass);",
"public function getAnnotations($annotation_name = null);",
"protected function _loadFolder()\n {\n $db = JFactory::getDbo();\n\n $query = $db->getQuery(true);\n $query->select('*');\n $query->from('#__eventgallery_folder');\n $query->where('folder=' . $db->quote($this->_foldername));\n\n $db->setQuery($query);\n $folderObject = $db->loadObject();\n\n $this->_folder = $folderObject;\n\n\n\n }",
"public function findByFolderID($folder);",
"public function fetch_all_folder_files()\n {\n $entries = scandir(public_path());\n\n $root = public_path();\n \n foreach (File::allFiles($root) as $file) {\n $data[] = $file->getFilename();\n }\n echo \"<pre>\"; print_r($data);die;\n \n }",
"function getAnnotation($annotation, $attribute = NULL);",
"public function getAnnotations($annotationName);",
"public function getAnnotation($annotation_name)\n\t{\n\t\treturn $this->getCachedAnnotation($annotation_name, false);\n\t}",
"public function find_folder($folder)\n {\n }",
"public function getByFolderId($folderId);",
"protected function getAnnotation($id)\n {\n $annotation = $this->getDoctrine()->getManager()->getRepository('VMBPresentationBundle:Annotation')->find($id);\n\n\t\tif ($annotation == null) {\n\t\t\tthrow $this->createNotFoundException('Unable to find Annotation entity.');\n\t\t}\n\n\t\treturn $annotation;\n }",
"public function getAssets($folder, $locale = null);",
"private static function getAllFilesFromMapFolder()\n {\n $resultSet = array();\n if (is_dir(self::mapFolder)) {\n if ($dh = opendir(self::mapFolder)) {\n while (($file = readdir($dh)) !== false) {\n if (strpos($file, \".kml\") > 0) {\n array_push($resultSet, $file);\n }\n }\n closedir($dh);\n }\n }\n return $resultSet;\n }",
"abstract function folder_info($folder);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
H5 fonts and style section | private function fonts_and_style_section_h5( $wp_customize ) {
$wp_customize->add_setting( 'cit_fonts_and_style_h5_text_color', array(
'default' => '#333333',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_active_color', array(
'default' => '#557cbf',
'sanitize_callback' => 'sanitize_hex_color',
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_font_family', array(
'default' => 'Playfair Display',
'sanitize_callback' => array( $this, 'sanitize_select_google_fonts' ),
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_subsets', array(
'default' => 'all',
'sanitize_callback' => array( $this, 'sanitize_select' ),
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_font_size', array(
'default' => '18px',
'sanitize_callback' => 'wp_strip_all_tags',
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_letter_spacing', array(
'default' => '0.01rem',
'sanitize_callback' => 'wp_strip_all_tags',
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_line_height', array(
'default' => '1.1',
'sanitize_callback' => 'wp_strip_all_tags',
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_weight', array(
'default' => '400',
'sanitize_callback' => array( $this, 'sanitize_select' ),
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_font_style', array(
'default' => 'normal',
'sanitize_callback' => array( $this, 'sanitize_select' ),
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_margin_top', array(
'default' => '0',
'sanitize_callback' => 'wp_strip_all_tags',
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_margin_bottom', array(
'default' => '0.625rem',
'sanitize_callback' => 'wp_strip_all_tags',
) );
$wp_customize->add_setting( 'cit_fonts_and_style_h5_capitalization', array(
'default' => 'none',
'sanitize_callback' => array( $this, 'sanitize_select' ),
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'cit_fonts_and_style_h5_text_color',
array(
'label' => esc_html__( 'Color', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_text_color',
)
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'cit_fonts_and_style_h5_active_color',
array(
'label' => esc_html__( 'Active Color', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_active_color',
)
)
);
$wp_customize->add_control( 'cit_fonts_and_style_h5_font_family', array(
'label' => esc_html__( 'Font-family', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_font_family',
'type' => 'select',
'choices' => citthemestarter_Fonts::vct_theme_font_choices(),
) );
$wp_customize->add_control( 'cit_fonts_and_style_h5_subsets', array(
'label' => esc_html__( 'Google Fonts Subsets', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_subsets',
'type' => 'select',
'choices' => citthemestarter_Fonts::vct_theme_font_subsets(),
) );
$wp_customize->add_control( 'cit_fonts_and_style_h5_weight', array(
'label' => esc_html__( 'Font Weight', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_weight',
'type' => 'select',
'choices' => array(
'300' => esc_html__( 'Light', 'cit' ),
'400' => esc_html__( 'Normal (default)', 'cit' ),
'600' => esc_html__( 'Semi-Bold', 'cit' ),
'700' => esc_html__( 'Bold', 'cit' ),
),
) );
$wp_customize->add_control( 'cit_fonts_and_style_h5_font_style', array(
'label' => esc_html__( 'Font Style', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_font_style',
'type' => 'select',
'choices' => array(
'normal' => esc_html__( 'Normal (default)', 'cit' ),
'italic' => esc_html__( 'Italic', 'cit' ),
'oblique' => esc_html__( 'Oblique', 'cit' ),
'inherit' => esc_html__( 'Inherit', 'cit' ),
),
) );
$wp_customize->add_control( 'cit_fonts_and_style_h5_font_size', array(
'label' => esc_html__( 'Size', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_font_size',
'type' => 'text',
) );
$wp_customize->add_control( 'cit_fonts_and_style_h5_line_height', array(
'label' => esc_html__( 'Line Height', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_line_height',
'type' => 'text',
) );
$wp_customize->add_control( 'cit_fonts_and_style_h5_letter_spacing', array(
'label' => esc_html__( 'Letter Spacing', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_letter_spacing',
'type' => 'text',
) );
$wp_customize->add_control( 'cit_fonts_and_style_h5_margin_top', array(
'label' => esc_html__( 'Margin Top', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_margin_top',
'type' => 'text',
) );
$wp_customize->add_control( 'cit_fonts_and_style_h5_margin_bottom', array(
'label' => esc_html__( 'Margin Bottom', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_margin_bottom',
'type' => 'text',
) );
$wp_customize->add_control( 'cit_fonts_and_style_h5_capitalization', array(
'label' => esc_html__( 'Capitalization', 'cit' ),
'section' => 'cit_fonts_and_style_h5',
'settings' => 'cit_fonts_and_style_h5_capitalization',
'type' => 'select',
'choices' => array(
'none' => esc_html__( 'None (default)', 'cit' ),
'uppercase' => esc_html__( 'Uppercase', 'cit' ),
'lowercase' => esc_html__( 'Lowercase', 'cit' ),
'capitalize' => esc_html__( 'Capitalize', 'cit' ),
),
) );
} | [
"function AddBig5hwFont($family='Big5-hw', $name='MSungStd-Light-Acro')\n{\n\tfor($i=32;$i<=126;$i++)\n\t\t$cw[chr($i)] = 500;\n\t$CMap = 'ETen-B5-H';\n\t$registry = array('ordering'=>'CNS1', 'supplement'=>0);\n\t$this->AddCIDFonts($family,$name,$cw,$CMap,$registry);\n}",
"private function fonts_and_style_section_h1( $wp_customize ) {\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_text_color', array(\n\t\t\t'default' => '#333333',\n\t\t\t'sanitize_callback' => 'sanitize_hex_color',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_active_color', array(\n\t\t\t'default' => '#557cbf',\n\t\t\t'sanitize_callback' => 'sanitize_hex_color',\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_font_family', array(\n\t\t\t'default' => 'Playfair Display',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select_google_fonts' ),\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_subsets', array(\n\t\t\t'default' => 'all',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_font_size', array(\n\t\t\t'default' => '42px',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_letter_spacing', array(\n\t\t\t'default' => '0.01rem',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_line_height', array(\n\t\t\t'default' => '1.1',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_weight', array(\n\t\t\t'default' => '400',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_font_style', array(\n\t\t\t'default' => 'normal',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_margin_top', array(\n\t\t\t'default' => '0',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_margin_bottom', array(\n\t\t\t'default' => '2.125rem',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h1_capitalization', array(\n\t\t\t'default' => 'none',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\n\t\t$wp_customize->add_control(\n\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t$wp_customize,\n\t\t\t\t'cit_fonts_and_style_h1_text_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Color', 'cit' ),\n\t\t\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t\t\t'settings' => 'cit_fonts_and_style_h1_text_color',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$wp_customize->add_control(\n\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t$wp_customize,\n\t\t\t\t'cit_fonts_and_style_h1_active_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Active Color', 'cit' ),\n\t\t\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t\t\t'settings' => 'cit_fonts_and_style_h1_active_color',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_font_family', array(\n\t\t\t'label' => esc_html__( 'Font-family', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_font_family',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => citthemestarter_Fonts::vct_theme_font_choices(),\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_subsets', array(\n\t\t\t'label' => esc_html__( 'Google Fonts Subsets', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_subsets',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => citthemestarter_Fonts::vct_theme_font_subsets(),\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_weight', array(\n\t\t\t'label' => esc_html__( 'Font Weight', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_weight',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'300' => esc_html__( 'Light', 'cit' ),\n\t\t\t\t'400' => esc_html__( 'Normal (default)', 'cit' ),\n\t\t\t\t'600' => esc_html__( 'Semi-Bold', 'cit' ),\n\t\t\t\t'700' => esc_html__( 'Bold', 'cit' ),\n\t\t\t),\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_font_style', array(\n\t\t\t'label' => esc_html__( 'Font Style', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_font_style',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'normal' => esc_html__( 'Normal (default)', 'cit' ),\n\t\t\t\t'italic' => esc_html__( 'Italic', 'cit' ),\n\t\t\t\t'oblique' => esc_html__( 'Oblique', 'cit' ),\n\t\t\t\t'inherit' => esc_html__( 'Inherit', 'cit' ),\n\t\t\t),\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_font_size', array(\n\t\t\t'label' => esc_html__( 'Size', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_font_size',\n\t\t\t'type' => 'text',\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_line_height', array(\n\t\t\t'label' => esc_html__( 'Line Height', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_line_height',\n\t\t\t'type' => 'text',\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_letter_spacing', array(\n\t\t\t'label' => esc_html__( 'Letter Spacing', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_letter_spacing',\n\t\t\t'type' => 'text',\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_margin_top', array(\n\t\t\t'label' => esc_html__( 'Margin Top', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_margin_top',\n\t\t\t'type' => 'text',\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_margin_bottom', array(\n\t\t\t'label' => esc_html__( 'Margin Bottom', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_margin_bottom',\n\t\t\t'type' => 'text',\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h1_capitalization', array(\n\t\t\t'label' => esc_html__( 'Capitalization', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h1',\n\t\t\t'settings' => 'cit_fonts_and_style_h1_capitalization',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'none' => esc_html__( 'None (default)', 'cit' ),\n\t\t\t\t'uppercase' => esc_html__( 'Uppercase', 'cit' ),\n\t\t\t\t'lowercase' => esc_html__( 'Lowercase', 'cit' ),\n\t\t\t\t'capitalize' => esc_html__( 'Capitalize', 'cit' ),\n\t\t\t),\n\t\t) );\n\t}",
"private function fonts_and_style_section_h4( $wp_customize ) {\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_text_color', array(\n\t\t\t'default' => '#333333',\n\t\t\t'sanitize_callback' => 'sanitize_hex_color',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_active_color', array(\n\t\t\t'default' => '#557cbf',\n\t\t\t'sanitize_callback' => 'sanitize_hex_color',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_font_family', array(\n\t\t\t'default' => 'Playfair Display',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select_google_fonts' ),\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_subsets', array(\n\t\t\t'default' => 'all',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_font_size', array(\n\t\t\t'default' => '22px',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_letter_spacing', array(\n\t\t\t'default' => '0.01rem',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_line_height', array(\n\t\t\t'default' => '1.1',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_weight', array(\n\t\t\t'default' => '400',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_font_style', array(\n\t\t\t'default' => 'normal',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_margin_top', array(\n\t\t\t'default' => '0',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_margin_bottom', array(\n\t\t\t'default' => '0.625rem',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h4_capitalization', array(\n\t\t\t'default' => 'none',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\n\t\t$wp_customize->add_control(\n\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t$wp_customize,\n\t\t\t\t'cit_fonts_and_style_h4_text_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Color', 'cit' ),\n\t\t\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t\t\t'settings' => 'cit_fonts_and_style_h4_text_color',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$wp_customize->add_control(\n\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t$wp_customize,\n\t\t\t\t'cit_fonts_and_style_h4_active_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Active Color', 'cit' ),\n\t\t\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t\t\t'settings' => 'cit_fonts_and_style_h4_active_color',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_font_family', array(\n\t\t\t'label' => esc_html__( 'Font-family', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_font_family',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => citthemestarter_Fonts::vct_theme_font_choices(),\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_subsets', array(\n\t\t\t'label' => esc_html__( 'Google Fonts Subsets', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_subsets',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => citthemestarter_Fonts::vct_theme_font_subsets(),\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_weight', array(\n\t\t\t'label' => esc_html__( 'Font Weight', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_weight',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'300' => esc_html__( 'Light', 'cit' ),\n\t\t\t\t'400' => esc_html__( 'Normal (default)', 'cit' ),\n\t\t\t\t'600' => esc_html__( 'Semi-Bold', 'cit' ),\n\t\t\t\t'700' => esc_html__( 'Bold', 'cit' ),\n\t\t\t),\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_font_style', array(\n\t\t\t'label' => esc_html__( 'Font Style', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_font_style',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'normal' => esc_html__( 'Normal (default)', 'cit' ),\n\t\t\t\t'italic' => esc_html__( 'Italic', 'cit' ),\n\t\t\t\t'oblique' => esc_html__( 'Oblique', 'cit' ),\n\t\t\t\t'inherit' => esc_html__( 'Inherit', 'cit' ),\n\t\t\t),\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_font_size', array(\n\t\t\t'label' => esc_html__( 'Size', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_font_size',\n\t\t\t'type' => 'text',\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_line_height', array(\n\t\t\t'label' => esc_html__( 'Line Height', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_line_height',\n\t\t\t'type' => 'text',\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_letter_spacing', array(\n\t\t\t'label' => esc_html__( 'Letter Spacing', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_letter_spacing',\n\t\t\t'type' => 'text',\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_margin_top', array(\n\t\t\t'label' => esc_html__( 'Margin Top', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_margin_top',\n\t\t\t'type' => 'text',\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_margin_bottom', array(\n\t\t\t'label' => esc_html__( 'Margin Bottom', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_margin_bottom',\n\t\t\t'type' => 'text',\n\t\t) );\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h4_capitalization', array(\n\t\t\t'label' => esc_html__( 'Capitalization', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h4',\n\t\t\t'settings' => 'cit_fonts_and_style_h4_capitalization',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'none' => esc_html__( 'None (default)', 'cit' ),\n\t\t\t\t'uppercase' => esc_html__( 'Uppercase', 'cit' ),\n\t\t\t\t'lowercase' => esc_html__( 'Lowercase', 'cit' ),\n\t\t\t\t'capitalize' => esc_html__( 'Capitalize', 'cit' ),\n\t\t\t),\n\t\t) );\n\t}",
"public function getFont () {}",
"function AddBig5Font($family='Big5', $name='MSungStd-Light-Acro')\n{\n\t$cw = $GLOBALS['Big5_widths'];\n\t$CMap = 'ETenms-B5-H';\n\t$registry = array('ordering'=>'CNS1', 'supplement'=>0);\n\t$this->AddCIDFonts($family,$name,$cw,$CMap,$registry);\n}",
"private function fonts_and_style_section_h6( $wp_customize ) {\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_text_color', array(\n\t\t\t'default' => '#333333',\n\t\t\t'sanitize_callback' => 'sanitize_hex_color',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_active_color', array(\n\t\t\t'default' => '#557cbf',\n\t\t\t'sanitize_callback' => 'sanitize_hex_color',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_font_family', array(\n\t\t\t'default' => 'Playfair Display',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select_google_fonts' ),\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_subsets', array(\n\t\t\t'default' => 'all',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_font_size', array(\n\t\t\t'default' => '16px',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_letter_spacing', array(\n\t\t\t'default' => '0.01rem',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_line_height', array(\n\t\t\t'default' => '1.1',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_weight', array(\n\t\t\t'default' => '400',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_font_style', array(\n\t\t\t'default' => 'normal',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_margin_top', array(\n\t\t\t'default' => '0',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_margin_bottom', array(\n\t\t\t'default' => '0.625rem',\n\t\t\t'sanitize_callback' => 'wp_strip_all_tags',\n\t\t) );\n\t\t$wp_customize->add_setting( 'cit_fonts_and_style_h6_capitalization', array(\n\t\t\t'default' => 'none',\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_select' ),\n\t\t) );\n\n\t\t$wp_customize->add_control(\n\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t$wp_customize,\n\t\t\t\t'cit_fonts_and_style_h6_text_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Color', 'cit' ),\n\t\t\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t\t\t'settings' => 'cit_fonts_and_style_h6_text_color',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$wp_customize->add_control(\n\t\t\tnew WP_Customize_Color_Control(\n\t\t\t\t$wp_customize,\n\t\t\t\t'cit_fonts_and_style_h6_active_color',\n\t\t\t\tarray(\n\t\t\t\t\t'label' => esc_html__( 'Active Color', 'cit' ),\n\t\t\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t\t\t'settings' => 'cit_fonts_and_style_h6_active_color',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_font_family', array(\n\t\t\t'label' => esc_html__( 'Font-family', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_font_family',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => citthemestarter_Fonts::vct_theme_font_choices(),\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_subsets', array(\n\t\t\t'label' => esc_html__( 'Google Fonts Subsets', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_subsets',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => citthemestarter_Fonts::vct_theme_font_subsets(),\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_weight', array(\n\t\t\t'label' => esc_html__( 'Font Weight', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_weight',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'300' => esc_html__( 'Light', 'cit' ),\n\t\t\t\t'400' => esc_html__( 'Normal (default)', 'cit' ),\n\t\t\t\t'600' => esc_html__( 'Semi-Bold', 'cit' ),\n\t\t\t\t'700' => esc_html__( 'Bold', 'cit' ),\n\t\t\t),\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_font_style', array(\n\t\t\t'label' => esc_html__( 'Font Style', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_font_style',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'normal' => esc_html__( 'Normal (default)', 'cit' ),\n\t\t\t\t'italic' => esc_html__( 'Italic', 'cit' ),\n\t\t\t\t'oblique' => esc_html__( 'Oblique', 'cit' ),\n\t\t\t\t'inherit' => esc_html__( 'Inherit', 'cit' ),\n\t\t\t),\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_font_size', array(\n\t\t\t'label' => esc_html__( 'Size', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_font_size',\n\t\t\t'type' => 'text',\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_line_height', array(\n\t\t\t'label' => esc_html__( 'Line Height', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_line_height',\n\t\t\t'type' => 'text',\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_letter_spacing', array(\n\t\t\t'label' => esc_html__( 'Letter Spacing', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_letter_spacing',\n\t\t\t'type' => 'text',\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_margin_top', array(\n\t\t\t'label' => esc_html__( 'Margin Top', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_margin_top',\n\t\t\t'type' => 'text',\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_margin_bottom', array(\n\t\t\t'label' => esc_html__( 'Margin Bottom', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_margin_bottom',\n\t\t\t'type' => 'text',\n\t\t) );\n\n\t\t$wp_customize->add_control( 'cit_fonts_and_style_h6_capitalization', array(\n\t\t\t'label' => esc_html__( 'Capitalization', 'cit' ),\n\t\t\t'section' => 'cit_fonts_and_style_h6',\n\t\t\t'settings' => 'cit_fonts_and_style_h6_capitalization',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'none' => esc_html__( 'None (default)', 'cit' ),\n\t\t\t\t'uppercase' => esc_html__( 'Uppercase', 'cit' ),\n\t\t\t\t'lowercase' => esc_html__( 'Lowercase', 'cit' ),\n\t\t\t\t'capitalize' => esc_html__( 'Capitalize', 'cit' ),\n\t\t\t),\n\t\t) );\n\t}",
"function awesome_heading_font_styles( $option, $selectors ) {\n\t$output = $selectors . ' {';\n\t$output .= ' color:' . $option['color'] .'; ';\n\t$output .= 'font-family:' . $option['face'] . '; ';\n\t$output .= 'font-weight:' . $option['style'] . '; ';\n\t$output .= '}';\n\t$output .= \"\\n\";\n\n\treturn $output;\n}",
"function twentysixteen_header_style() {}",
"public function getFontFamily () {}",
"public function getFonte()\r\n {\r\n }",
"public function getFontFamily() {}",
"abstract public function prepareFonts();",
"function AddGBhwFont($family='GB-hw',$name='STSongStd-Light-Acro')\n{\n\tfor($i=32;$i<=126;$i++)\n\t\t$cw[chr($i)]=500;\n\t$CMap='GBK-EUC-H';\n\t$registry=array('ordering'=>'GB1','supplement'=>2);\n\t$this->AddCIDFonts($family,$name,$cw,$CMap,$registry);\n}",
"function lapindos_body_font_family($config=array()){\r\n\r\n $font_family= isset($config['body-font']['font-family']) ? $config['body-font']['font-family'] : \"\";\r\n $font_size= isset($config['body-font']['font-size']) ? intval($config['body-font']['font-size']) : \"\";\r\n $line_height= isset($config['body-font']['line-height']) ? trim($config['body-font']['line-height']) : \"\";\r\n $letter_spacing= isset($config['body-font']['letter-spacing']) ? trim($config['body-font']['letter-spacing']) : \"\";\r\n $font_weight= isset($config['body-font']['font-weight']) ? trim($config['body-font']['font-weight']) : \"\";\r\n\r\n $style = \"\";\r\n\r\n if(!empty($font_family) && !preg_match('/poppins/i', $font_family ) ) {\r\n print 'html, body,body.single,.body-font,.section-main-title.body-font,.sub-title.body-font,.sub-heading.body-font{font-family: '.$font_family.';}';\r\n }\r\n if($font_size!='') {\r\n $style .= 'font-size: '.absint($font_size).'px;';\r\n }\r\n if(!empty($letter_spacing) && $letter_spacing!='px' && $letter_spacing!='pt') {\r\n $style .= 'letter-spacing: '.absint($letter_spacing).'px;';\r\n }\r\n\r\n if($font_weight!='') {\r\n $style .= 'font-weight: '.absint($font_weight).';';\r\n }\r\n\r\n if($line_height!=''):\r\n\r\n $font_size = $font_size!='' ? $font_size : 15;\r\n $line_height= absint($line_height) / $font_size;\r\n\r\n $style .= 'line-height: '.$line_height.';';\r\n\r\n endif;\r\n\r\n if($style !=''){\r\n print 'body,body.single{'.esc_js($style).'}';\r\n }\r\n\r\n}",
"function useKRFonts(){}",
"function AddUHChwFont($family='UHC-hw', $name='HYSMyeongJoStd-Medium-Acro'){\n\t\tfor($i=32;$i<=126;$i++)\n\t\t$cw[chr($i)]=500;\n\t\t$CMap='KSCms-UHC-HW-H';\n\t\t$registry=array('ordering'=>'Korea1','supplement'=>1);\n\t\t$this->AddCIDFonts($family,$name,$cw,$CMap,$registry);\n\t}",
"function AddGBhwFont($family='GB-hw', $name='STSongStd-Light-Acro')\n{\n\tfor($i=32;$i<=126;$i++)\n\t\t$cw[chr($i)] = 500;\n\t$CMap = 'GBK-EUC-H';\n\t$registry = array('ordering'=>'GB1', 'supplement'=>2);\n\t$this->AddCIDFonts($family,$name,$cw,$CMap,$registry);\n}",
"function useCNTFonts(){}",
"public function getFontStyle () {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set VocabularyUri for PolicyMarker element. | protected function setVocabularyUri($key, $value, $index)
{
if (!isset($this->data['policy_marker'][$index]['vocabulary_uri'])) {
$this->data['policy_marker'][$index]['vocabulary_uri'] = '';
}
if (array_key_exists('vocabulary', $this->data['policy_marker'][$index])) {
$this->data['policy_marker'][$index]['vocabulary_uri'] = '';
}
} | [
"public function setPolicyUri($var)\n {\n GPBUtil::checkString($var, True);\n $this->policy_uri = $var;\n\n return $this;\n }",
"public function setCallbackUri($val)\n {\n $this->_propDict[\"callbackUri\"] = $val;\n return $this;\n }",
"public function setURI(string $uri);",
"public function setNamespaceUrl($val)\n {\n $this->_propDict[\"namespaceUrl\"] = $val;\n return $this;\n }",
"public function setURI($uri);",
"protected function setVocabularyUri($index)\n {\n $this->data['sector'][$index]['vocabulary_uri'] = '';\n }",
"protected function setVocabularyUri($index)\n {\n $this->data['recipient_region'][$index]['vocabulary_uri'] = '';\n }",
"function setUri($uri);",
"function set_uri($uri) {\n $this->uri = $uri;\n }",
"public function setPublicUrl($val)\n {\n $this->_propDict[\"publicUrl\"] = $val;\n return $this;\n }",
"public function setIdentifierUris($val)\n {\n $this->_propDict[\"identifierUris\"] = $val;\n return $this;\n }",
"public function setPolicy($val)\n {\n $this->_propDict[\"policy\"] = $val;\n return $this;\n }",
"public function setRedirectUri(?string $uri) : void;",
"public function setPolicyId($val)\n {\n $this->_propDict[\"policyId\"] = $val;\n return $this;\n }",
"public function setIssuerUri(?string $value): void {\n $this->getBackingStore()->set('issuerUri', $value);\n }",
"public function setPatents($val)\n {\n $this->_propDict[\"patents\"] = $val;\n return $this;\n }",
"public function setPolicy( $policy )\n {\n if ( !is_string( $policy ) || strlen( $policy ) < 1 ) {\n throw new InvalidArgumentException( __METHOD__ . ' expects parameter 1 to be a non-empty string' );\n }\n \n $this->_creationParams[self::PARAM_POLICY] = $policy;\n }",
"public function setFeedUri($uri);",
"public function setUriParameter(string $key, $value);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addHeader($errorCode,$errorMessage,$responseType) Add the header element. in: int $errorCode: error status identifuer (mandatory) string $errorMessage: error message (mandatory) string $responseType: type of response (optional) out: $this: apiXmlWriter instance, for chaining purposes. | public function addHeader() {
$this->startElement(self::HEADER_ELEMENT_NAME);
$arg_list = func_get_args();
if (func_num_args()==3) {
$this->writeElement(self::ERROR_CODE_ELEMENT_NAME, $arg_list[0]);
$this->writeElement(self::ERROR_MESSAGE_ELEMENT_NAME, $arg_list[1]);
$this->writeElement(self::RESPONSE_ELEMENT_NAME, $arg_list[2]);
}
else if (func_num_args()==2) {
$this->writeElement(self::ERROR_CODE_ELEMENT_NAME, $arg_list[0]);
$this->writeElement(self::ERROR_MESSAGE_ELEMENT_NAME, $arg_list[1]);
}
$this->endElement();
return $this;
} | [
"public function writeResponseHeader();",
"public function writeHeader();",
"protected abstract function writeHeader();",
"public function addHeaders(Response $response);",
"public function writeHeader()\n {\n }",
"function addHeader($name, $value);",
"private function writeHeader() {\n $this->write($this->header);\n }",
"public function add_header($header){\n $this->headers[] = $header;\n }",
"public function addHeader(string $name, string $value): Response;",
"abstract protected function setApiHeader($response);",
"protected function outputTypeHeader($type){\r\n if(in_array($type,self::$output_header_types)){\r\n switch($type){\r\n case 'json':\r\n header('Content-type: application/json');\r\n break;\r\n case 'image/gif':\r\n \theader(\"content-type: image/gif\");\r\n \tbreak;\r\n case 'image/png':\r\n \theader(\"content-type: image/png\");\r\n \tbreak;\r\n case 'image/jpeg':\r\n case 'image/jpg':\r\n \theader(\"content-type: image/jpeg\");\r\n \tbreak;\r\n case 'html':\r\n break;\r\n }\r\n }else{\r\n throw new ErrorException(\"$type is not a supported header type\");\r\n }\r\n }",
"function addHeader($header) {\n if(!empty($header)) {\n $this->headers[] = $header.$this->newline;\n }\n }",
"private function addHeaders()\n {\n $this->curl->addHeader('Content-Type', 'application/json');\n $this->curl->addHeader('Accept', 'application/json');\n }",
"public function addHeader($key, $value);",
"public function addHeader($name, $value);",
"function setResponse(){\n\t// Set the response message header\n\t// This example just sets a basic header response but you may need to \n\t// add some more checks, authentication, etc \n\t$header = array(\n\t\t'status'\t=> 'ok',\n\t\t'message'\t=> 'Service call was successful'\n\t);\n\t\n\treturn $header; \n}",
"function addHeader(&$manifestWriter,$parentPrefix,$id,$name)\n{\n $manifestWriter->addItem($parentPrefix.$id,$name);\n $manifestWriter->setTitle($name); \n}",
"function create_header($identifier,$timestamp,$ands_class, $add_to_node=null) {\n\t\tif(is_null($add_to_node)) {\n\t\t\t$header_node = $this->add2_verbNode(\"header\");\n\t\t} else {\n\t\t\t$header_node = $this->addChild($add_to_node,\"header\");\n\t\t}\n\t\t$this->addChild($header_node,\"identifier\",$identifier);\n\t\t$this->addChild($header_node,\"datestamp\",$timestamp);\n\t\tif (is_array($ands_class)) {\n\t\t\tforeach ($ands_class as $setspec) {\n\t\t\t\t$this->addChild($header_node,\"setSpec\",$setspec); \n\t\t\t}\n\t\t} else { $this->addChild($header_node,\"setSpec\",$ands_class); }\n\t\treturn $header_node;\n\t}",
"function extraHeaders()\n {\n $status_string = @self::$status[$this->code];\n header('HTTP/1.1 '.$this->code.' '.$status_string);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.