query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Get all of the Storefront theme mods.
public function get_storefront_theme_mods() { $storefront_theme_mods = array( 'background_color' => storefront_get_content_background_color(), ); return apply_filters( 'storefront_theme_mods', $storefront_theme_mods ); }
[ "public static function get_storefront_theme_mods() {\n\t\t$storefront_theme_mods = array(\n\t\t\t'background_color' => storefront_get_content_background_color(),\n\t\t\t'accent_color' => get_theme_mod( 'storefront_accent_color' ),\n\t\t\t'hero_heading_color' => get_theme_mod( 'storefront_hero_heading_color' ),\n\t\t\t'hero_text_color' => get_theme_mod( 'storefront_hero_text_color' ),\n\t\t\t'header_background_color' => get_theme_mod( 'storefront_header_background_color' ),\n\t\t\t'header_link_color' => get_theme_mod( 'storefront_header_link_color' ),\n\t\t\t'header_text_color' => get_theme_mod( 'storefront_header_text_color' ),\n\t\t\t'footer_background_color' => get_theme_mod( 'storefront_footer_background_color' ),\n\t\t\t'footer_link_color' => get_theme_mod( 'storefront_footer_link_color' ),\n\t\t\t'footer_heading_color' => get_theme_mod( 'storefront_footer_heading_color' ),\n\t\t\t'footer_text_color' => get_theme_mod( 'storefront_footer_text_color' ),\n\t\t\t'text_color' => get_theme_mod( 'storefront_text_color' ),\n\t\t\t'heading_color' => get_theme_mod( 'storefront_heading_color' ),\n\t\t\t'button_background_color' => get_theme_mod( 'storefront_button_background_color' ),\n\t\t\t'button_text_color' => get_theme_mod( 'storefront_button_text_color' ),\n\t\t\t'button_alt_background_color' => get_theme_mod( 'storefront_button_alt_background_color' ),\n\t\t\t'button_alt_text_color' => get_theme_mod( 'storefront_button_alt_text_color' ),\n\t\t);\n\n\t\treturn apply_filters( 'storefront_theme_mods', $storefront_theme_mods );\n\t}", "public function getThemes();", "public function all()\n {\n return $this->themes;\n }", "public function all()\n {\n return Theme::all();\n }", "public function retrieveThemes()\n {\n return $this->start()->uri(\"/api/theme\")\n ->get()\n ->go();\n }", "function themes() { return array(); }", "protected abstract function getListOfThemes();", "public function getThemes(){\r\n return array('theme1'=>\"Theme 1\", \r\n\t\t\t'theme2'=>\"Theme 2\", \r\n\t\t\t'theme3'=>\"Theme 3\" \r\n\t\t\t);\r\n }", "function getThemesList()\r\n {\r\n return XoopsLists::getDirListAsArray(XOOPS_THEME_PATH . '/');\r\n }", "public function getThemes() {\r\n\t$themes = array();\r\n $themelist = array_merge((array)glob('modules/' . $this->name . '/themes/*', GLOB_ONLYDIR), glob(PROFILE_PATH . $this->name . '/themes/*', GLOB_ONLYDIR));\r\n\tforeach ($themelist as $filename) {\r\n\t $themeName = basename($filename);\r\n\t $themes[$themeName] = $themeName;\r\n\t}\r\n\treturn $themes;\r\n }", "public function allThemes() {\n $self = $this;\n return array_map(function ($theme) use ($self) {\n return $self->getTheme($theme->name);\n }, $this->themes);\n }", "function getThemes()\r\n\t{\r\n\t\tforeach($this->themes as $thema){\r\n\t\t $out[$thema->name] = $thema->prefix;\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "public static function getAllThemes()\n {\n $themes = self::get('sf_plop_loaded_themes');\n $all_themes = array();\n\n foreach ($themes as $theme => $theme_infos)\n {\n $name = isset($theme_infos['name'])\n ? $theme_infos['name']\n : $theme;\n $label = isset($theme_infos['description'])\n ? $theme_infos['description']\n : $name;\n if (!isset($theme_infos['subthemes']))\n $all_themes [$theme] = $label;\n else\n $all_themes [$theme] = array($theme => $label) + $theme_infos['subthemes'];\n }\n\n return $all_themes;\n }", "public function get_all_themes() {\r\n\t\tMainWP_Child_Stats::get_instance()->get_all_themes();\r\n\t}", "function getRetiredThemes() {\n\t\tif ( !isset( $this->retiredThemes ) ) {\n\t\t\t$cache = $this->repo->getCache();\n\t\t\tif ( $retiredThemes = $cache->read( 'retired.json' ) ) {\n\t\t\t\t$retiredThemes = json_decode( $retiredThemes );\n\t\t\t\tif ( json_last_error() !== \\JSON_ERROR_NONE ) {\n\t\t\t\t\tif ( $this->io->isVerbose() ) {\n\t\t\t\t\t\t$this->io->writeError( 'JSON decoding error from cached retired themes ' . json_last_error_msg() );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$url = 'https://theme.wordpress.com/all-retired/?slugs';\n\t\t\t\tif ( $this->io->isVerbose() ) {\n\t\t\t\t\t$this->io->write( \"Fetching retired WP.com themes from $url\" );\n\t\t\t\t}\n\t\t\t\t$html = file_get_contents( $url );\n\t\t\t\tif ( $html === false ) {\n\t\t\t\t\tif ( $this->io->isVerbose() ) {\n\t\t\t\t\t\t$this->io->writeError( \"Could not retrieve $url\" );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// pluck out the slugs for public themes\n\t\t\t\t\tif ( preg_match_all( '/^pub\\\\/([\\\\w-]+)$/m', $html, $matches ) ) {\n\t\t\t\t\t\t$retiredThemes = $matches[1];\n\t\t\t\t\t}\n\t\t\t\t\t// update cache, if we have a TTL\n\t\t\t\t\tif ( $this->get( 'cache-ttl' ) ) {\n\t\t\t\t\t\t$cache->write( 'retired.json', json_encode( $retiredThemes ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->retiredThemes = $retiredThemes ?: [];\n\t\t}\n\t\treturn $this->retiredThemes;\n\t}", "private function getMagThemes() {\n\t\t\t//PDO\n\t\t\t$query = $this->pdo->prepare(\"SELECT id, url, idtheme, titre, minititre, stats, color FROM 2emag_themesdetails ORDER BY ordre ASC\");\n\t\t\t$query->execute();\n\t\t\t//Création array\n\t\t\t$themes = array();\n\t\t\t//Boucle\n\t\t\twhile ($data = $query->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t$themes[] = array(\n\t\t\t\t\t'id' => $data['id'],\n\t\t\t\t\t'url' => $data['url'],\n\t\t\t\t\t'idtheme' => $data['idtheme'],\n\t\t\t\t\t'titre' => $data['titre'],\n\t\t\t\t\t'minititre' => $data['minititre'],\n\t\t\t\t\t'stats' => $data['stats'],\n\t\t\t\t\t'color' => $data['color'],\n\t\t\t\t);\n\t\t\t}\n\t\t\t//Smarty\n\t\t\t$this->smarty->assign('themes', $themes);\n\t\t}", "function getThemes() {\n\t\tif (empty($this->themes)) {\n\t\t\t$themedir = SERVERPATH . \"/themes\";\n\t\t\t$themes = array();\n\t\t\tif ($dp = @opendir($themedir)) {\n\t\t\t\twhile (false !== ($dir = readdir($dp))) {\n\t\t\t\t\tif (substr($dir, 0, 1) != \".\" && is_dir(\"$themedir/$dir\")) {\n\t\t\t\t\t\t$themefile = $themedir . \"/$dir/theme_description.php\";\n\t\t\t\t\t\t$dir8 = filesystemToInternal($dir);\n\t\t\t\t\t\tif (file_exists($themefile)) {\n\t\t\t\t\t\t\t$theme_description = array();\n\t\t\t\t\t\t\trequire($themefile);\n\t\t\t\t\t\t\t$themes[$dir8] = sanitize($theme_description, 1);\n\t\t\t\t\t\t} else if (file_exists($themedir . \"/$dir/theme.txt\")) {\n\t\t\t\t\t\t\t$themes[$dir8] = parseThemeDef($themedir . \"/$dir/theme.txt\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$themes[$dir8] = array('name'=>gettext('Unknown'), 'author'=>gettext('Unknown'), 'version'=>gettext('Unknown'), 'desc'=>gettext('<strong>Missing theme info file!</strong>'), 'date'=>gettext('Unknown'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tksort($themes,SORT_LOCALE_STRING);\n\t\t\t}\n\t\t\t$this->themes = $themes;\n\t\t}\n\t\treturn $this->themes;\n\t}", "public static function get_local_woo_themes()\n {\n }", "public function all()\n {\n $list = [];\n\n /** @var UniformResourceLocator $locator */\n $locator = $this->grav['locator'];\n\n $iterator = $locator->getIterator('themes://');\n\n /** @var DirectoryIterator $directory */\n foreach ($iterator as $directory) {\n if (!$directory->isDir() || $directory->isDot()) {\n continue;\n }\n\n $theme = $directory->getFilename();\n\n try {\n $result = $this->get($theme);\n } catch (Exception $e) {\n $exception = new RuntimeException(sprintf('Theme %s: %s', $theme, $e->getMessage()), $e->getCode(), $e);\n\n /** @var Debugger $debugger */\n $debugger = $this->grav['debugger'];\n $debugger->addMessage(\"Theme {$theme} cannot be loaded, please check Exceptions tab\", 'error');\n $debugger->addException($exception);\n\n continue;\n }\n\n if ($result) {\n $list[$theme] = $result;\n }\n }\n ksort($list, SORT_NATURAL | SORT_FLAG_CASE);\n\n return $list;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete recurring event in attendee calendar deletes this attendee from all events. Steps: 1. Create recurring calendar event with 2 attendees. 2. Create exception event with updated title. 3. Create exception event with one more attendee. 4. Create exception event with no attendees. 5. Create cancelled exception. 6. Delete recurring event in nonorganizer attendee calendar with flag "notifyAttendees"="all" and "isCancelInsteadDelete"=true. 7. Check recurring events in owner calendar. Attendee should be removed in all events. 8. Check recurring events in nonorganizer attendee calendar. No events should be in the calendar. 9. Check recurring events in extra attendee calendar. One event should be in the calendar.
public function testDeleteRecurringEventInAttendeeCalendarDeletesThisAttendeeFromAllEventsWithExceptions() { // Step 1. Create recurring calendar event with 2 attendees. // Recurring event with occurrences: 2016-04-01, 2016-04-02, 2016-04-03, 2016-04-04, 2016-04-05 $eventData = [ 'title' => 'Test Recurring Event', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-01T01:00:00+00:00', 'end' => '2016-04-01T02:00:00+00:00', 'updateExceptions' => true, 'backgroundColor' => '#FF0000', 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY, 'attendees' => [ [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(), 'email' => 'foo_user_1@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_ORGANIZER, ], [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(), 'email' => 'foo_user_2@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_REQUIRED, ] ], 'recurrence' => [ 'timeZone' => 'UTC', 'recurrenceType' => Model\Recurrence::TYPE_DAILY, 'interval' => 1, 'startTime' => '2016-04-01T01:00:00+00:00', 'occurrences' => 5, ] ]; $this->restRequest( [ 'method' => 'POST', 'url' => $this->getUrl('oro_api_post_calendarevent'), 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'), 'content' => json_encode($eventData, JSON_THROW_ON_ERROR) ] ); $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']); /** @var CalendarEvent $recurringEvent */ $recurringEvent = $this->getEntity(CalendarEvent::class, $response['id']); // Step 2. Create exception event with updated title. $exceptionData = [ 'title' => 'Test Recurring Event Changed', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-02T01:00:00+00:00', 'end' => '2016-04-02T02:00:00+00:00', 'backgroundColor' => '#FF0000', 'recurringEventId' => $recurringEvent->getId(), 'originalStart' => '2016-04-02T01:00:00+00:00', 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY, 'attendees' => [ [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(), 'email' => 'foo_user_1@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_ORGANIZER, ], [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(), 'email' => 'foo_user_2@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_REQUIRED, ], ], ]; $this->restRequest( [ 'method' => 'POST', 'url' => $this->getUrl('oro_api_post_calendarevent'), 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'), 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR) ] ); $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']); /** @var CalendarEvent $exceptionEventWithUpdatedTitle */ $exceptionEventWithUpdatedTitle = $this->getEntity(CalendarEvent::class, $response['id']); // Step 3. Create exception event with one more attendee. $exceptionData = [ 'title' => 'Test Recurring Event', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-03T01:00:00+00:00', 'end' => '2016-04-03T02:00:00+00:00', 'backgroundColor' => '#FF0000', 'recurringEventId' => $recurringEvent->getId(), 'originalStart' => '2016-04-03T01:00:00+00:00', 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY, 'attendees' => [ [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(), 'email' => 'foo_user_1@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_ORGANIZER, ], [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(), 'email' => 'foo_user_2@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_REQUIRED, ], [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(), 'email' => 'foo_user_3@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_REQUIRED, ] ], ]; $this->restRequest( [ 'method' => 'POST', 'url' => $this->getUrl('oro_api_post_calendarevent'), 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'), 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR) ] ); $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']); /** @var CalendarEvent $exceptionEventWithOneMoreAttendee */ $exceptionEventWithOneMoreAttendee = $this->getEntity(CalendarEvent::class, $response['id']); // Step 4. Create exception event with no attendees. $exceptionData = [ 'title' => 'Test Recurring Event', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-04T01:00:00+00:00', 'end' => '2016-04-04T02:00:00+00:00', 'backgroundColor' => '#FF0000', 'recurringEventId' => $recurringEvent->getId(), 'originalStart' => '2016-04-04T01:00:00+00:00', 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY, 'attendees' => [], ]; $this->restRequest( [ 'method' => 'POST', 'url' => $this->getUrl('oro_api_post_calendarevent'), 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'), 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR) ] ); $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']); /** @var CalendarEvent $exceptionEventWithNoOAttendees */ $exceptionEventWithNoOAttendees = $this->getEntity(CalendarEvent::class, $response['id']); // Step 5. Create cancelled exception. $exceptionData = [ 'isCancelled' => true, 'title' => 'Test Recurring Event', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-05T01:00:00+00:00', 'end' => '2016-04-05T02:00:00+00:00', 'backgroundColor' => '#FF0000', 'recurringEventId' => $recurringEvent->getId(), 'originalStart' => '2016-04-05T01:00:00+00:00', 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY, 'attendees' => [ [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(), 'email' => 'foo_user_1@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_ORGANIZER, ], [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(), 'email' => 'foo_user_2@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_REQUIRED, ] ], ]; $this->restRequest( [ 'method' => 'POST', 'url' => $this->getUrl('oro_api_post_calendarevent'), 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'), 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR) ] ); $this->assertJsonResponseStatusCodeEquals($this->client->getResponse(), 201); // Step 6. Delete recurring event in non-organizer attendee calendar // with flag "notifyAttendees"="all" and "isCancelInsteadDelete"=true. /** @var CalendarEvent $attendeeExceptionEvent */ $attendeeRecurringEvent = $recurringEvent->getChildEventByCalendar( $this->getReference('oro_calendar:calendar:foo_user_2') ); $this->restRequest( [ 'method' => 'DELETE', 'url' => $this->getUrl( 'oro_api_delete_calendarevent', [ 'id' => $attendeeRecurringEvent->getId(), 'isCancelInsteadDelete' => true, 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY, ] ), 'server' => $this->generateWsseAuthHeader('foo_user_2', 'foo_user_2_api_key'), ] ); $this->assertEmptyResponseStatusCodeEquals($this->client->getResponse(), 204); // Step 7. Check recurring events in owner calendar. Attendee should be removed in all events. $this->restRequest( [ 'method' => 'GET', 'url' => $this->getUrl( 'oro_api_get_calendarevents', [ 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-01T01:00:00+00:00', 'end' => '2016-04-30T01:00:00+00:00', 'subordinate' => true, ] ), 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key') ] ); $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']); $expectedResponse = [ [ 'id' => $recurringEvent->getId(), 'title' => 'Test Recurring Event', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-01T01:00:00+00:00', 'end' => '2016-04-01T02:00:00+00:00', 'attendees' => [ [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(), 'email' => 'foo_user_1@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_ORGANIZER, ], ], ], [ 'id' => $exceptionEventWithUpdatedTitle->getId(), 'title' => 'Test Recurring Event Changed', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-02T01:00:00+00:00', 'end' => '2016-04-02T02:00:00+00:00', 'attendees' => [ [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(), 'email' => 'foo_user_1@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_ORGANIZER, ], ], ], [ 'id' => $exceptionEventWithOneMoreAttendee->getId(), 'title' => 'Test Recurring Event', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-03T01:00:00+00:00', 'end' => '2016-04-03T02:00:00+00:00', 'attendees' => [ [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(), 'email' => 'foo_user_1@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_ORGANIZER, ], [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(), 'email' => 'foo_user_3@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_REQUIRED, ], ], ], [ 'id' => $exceptionEventWithNoOAttendees->getId(), 'title' => 'Test Recurring Event', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(), 'start' => '2016-04-04T01:00:00+00:00', 'end' => '2016-04-04T02:00:00+00:00', 'originalStart' => '2016-04-04T01:00:00+00:00', 'attendees' => [], ], ]; $this->assertResponseEquals($expectedResponse, $response, false); // Step 8. Check recurring events in non-organizer attendee calendar. No events should be in the calendar. $this->restRequest( [ 'method' => 'GET', 'url' => $this->getUrl( 'oro_api_get_calendarevents', [ 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(), 'start' => '2016-04-01T01:00:00+00:00', 'end' => '2016-04-30T01:00:00+00:00', 'subordinate' => true, ] ), 'server' => $this->generateWsseAuthHeader('foo_user_2', 'foo_user_2_api_key') ] ); $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']); $expectedResponse = []; $this->assertResponseEquals($expectedResponse, $response, false); // Step 9. Check recurring events in extra attendee calendar. One event should be in the calendar. $this->restRequest( [ 'method' => 'GET', 'url' => $this->getUrl( 'oro_api_get_calendarevents', [ 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(), 'start' => '2016-04-01T01:00:00+00:00', 'end' => '2016-04-30T01:00:00+00:00', 'subordinate' => true, ] ), 'server' => $this->generateWsseAuthHeader('foo_user_3', 'foo_user_3_api_key') ] ); $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']); $extraAttendeeEvent = $exceptionEventWithOneMoreAttendee->getChildEventByCalendar( $this->getReference('oro_calendar:calendar:foo_user_3') ); $expectedResponse = [ [ 'id' => $extraAttendeeEvent->getId(), 'title' => 'Test Recurring Event', 'description' => 'Test Recurring Event Description', 'allDay' => false, 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(), 'start' => '2016-04-03T01:00:00+00:00', 'end' => '2016-04-03T02:00:00+00:00', 'attendees' => [ [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(), 'email' => 'foo_user_1@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_ORGANIZER, ], [ 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(), 'email' => 'foo_user_3@example.com', 'status' => Attendee::STATUS_ACCEPTED, 'type' => Attendee::TYPE_REQUIRED, ], ], ] ]; $this->assertResponseEquals($expectedResponse, $response, false); }
[ "public function testDeleteRecurringEventInAttendeeCalendarDeletesThisAttendeeFromAllEvents()\n {\n // Step 1. Create recurring calendar event with 2 attendees.\n // Recurring event with occurrences: 2016-04-01, 2016-04-02, 2016-04-03, 2016-04-04\n $eventData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'updateExceptions' => true,\n 'backgroundColor' => '#FF0000',\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY,\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n 'recurrence' => [\n 'timeZone' => 'UTC',\n 'recurrenceType' => Model\\Recurrence::TYPE_DAILY,\n 'interval' => 1,\n 'startTime' => '2016-04-01T01:00:00+00:00',\n 'occurrences' => 4,\n ]\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $recurringEvent */\n $recurringEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 2. Create exception event with updated title.\n $exceptionData = [\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T01:00:00+00:00',\n 'end' => '2016-04-04T02:00:00+00:00',\n 'backgroundColor' => '#FF0000',\n 'recurringEventId' => $recurringEvent->getId(),\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY,\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ],\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $exceptionEvent */\n $exceptionEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 3. Delete recurring event in non-organizer attendee calendar\n // with flag \"notifyAttendees\"=\"all\" and \"isCancelInsteadDelete\"=true.\n\n /** @var CalendarEvent $attendeeExceptionEvent */\n $attendeeRecurringEvent = $recurringEvent->getChildEventByCalendar(\n $this->getReference('oro_calendar:calendar:foo_user_2')\n );\n\n $this->restRequest(\n [\n 'method' => 'DELETE',\n 'url' => $this->getUrl(\n 'oro_api_delete_calendarevent',\n [\n 'id' => $attendeeRecurringEvent->getId(),\n 'isCancelInsteadDelete' => true,\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_2', 'foo_user_2_api_key'),\n ]\n );\n $this->assertEmptyResponseStatusCodeEquals($this->client->getResponse(), 204);\n\n // Step 4. Check recurring events in owner calendar. Attendee should be removed in all events.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-30T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ]\n ];\n\n $expectedExceptionAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ],\n ];\n\n $expectedResponse = [\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-03T01:00:00+00:00',\n 'end' => '2016-04-03T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $exceptionEvent->getId(),\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T01:00:00+00:00',\n 'end' => '2016-04-04T02:00:00+00:00',\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'attendees' => $expectedExceptionAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n\n // Step 5. Check recurring events in 2nd non-organizer attendee calendar.\n // No events should not be in the calendar.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-30T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_2', 'foo_user_2_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedResponse = [];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n }", "public function testUserAttendeeRemovedFromRecurringEventRemovedFromExceptionEvent()\n {\n // Step 1. Create recurring calendar event with 2 attendees.\n // Recurring event with occurrences: 2016-04-01, 2016-04-02, 2016-04-03, 2016-04-04\n $eventData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'updateExceptions' => true,\n 'backgroundColor' => '#FF0000',\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n 'recurrence' => [\n 'timeZone' => 'UTC',\n 'recurrenceType' => Recurrence::TYPE_DAILY,\n 'interval' => 1,\n 'startTime' => '2016-04-01T01:00:00+00:00',\n 'occurrences' => 4,\n ],\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $recurringEvent */\n $recurringEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 2. Create exception event with updated title.\n $exceptionData = [\n 'title' => 'Updated Title',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T01:00:00+00:00',\n 'end' => '2016-04-04T02:00:00+00:00',\n 'backgroundColor' => '#FF0000',\n 'recurringEventId' => $recurringEvent->getId(),\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $exceptionEvent */\n $exceptionEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 3. Change recurring event and remove second attendee.\n $eventData['attendees'] = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ]\n ];\n\n $this->restRequest(\n [\n 'method' => 'PUT',\n 'url' => $this->getUrl('oro_api_put_calendarevent', ['id' => $recurringEvent->getId()]),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n $this->assertResponseEquals(\n $this->getAcceptedResponseArray($response),\n $response\n );\n\n // Step 4. Check new attendee event titles was updated.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-30T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_1')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ],\n ];\n\n $expectedResponse = [\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-03T01:00:00+00:00',\n 'end' => '2016-04-03T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $exceptionEvent->getId(),\n 'title' => 'Updated Title',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T01:00:00+00:00',\n 'end' => '2016-04-04T02:00:00+00:00',\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n\n // Step 5. Check number of calendar events and attendees in the system after all manipulations.\n $this->getEntityManager()->clear();\n\n $this->assertCount(\n 2,\n $this->getEntityRepository(CalendarEvent::class)->findAll(),\n 'Failed asserting 2 events exist in the application: ' . PHP_EOL .\n '1 - recurring event' . PHP_EOL .\n '2 - exception of event 1'\n );\n\n $this->assertCount(\n 2,\n $this->getEntityRepository(Attendee::class)->findAll(),\n 'Failed asserting 3 attendees exist in the application: ' . PHP_EOL .\n '1 - attendee of event 1' . PHP_EOL .\n '2 - attendee of event 2'\n );\n }", "public function testUserAttendeeRemovedFromExceptionEvent()\n {\n // Step 1. Create recurring calendar event with 2 non-organizer attendees.\n // Recurring event with occurrences: 2016-04-01, 2016-04-02, 2016-04-03, 2016-04-04\n $eventData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'updateExceptions' => true,\n 'backgroundColor' => '#FF0000',\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n 'recurrence' => [\n 'timeZone' => 'UTC',\n 'recurrenceType' => Recurrence::TYPE_DAILY,\n 'interval' => 1,\n 'startTime' => '2016-04-01T01:00:00+00:00',\n 'occurrences' => 4,\n ],\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $recurringEvent */\n $recurringEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 2. Create exception event and remove first attendee.\n $exceptionData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T01:00:00+00:00',\n 'end' => '2016-04-04T02:00:00+00:00',\n 'backgroundColor' => '#FF0000',\n 'recurringEventId' => $recurringEvent->getId(),\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $exceptionEvent */\n $exceptionEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 3. Check recurring events in owner user calendar.\n // There should be 1 attendee in exception event of owner user calendar.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-30T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_3')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_2')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n\n $expectedExceptionAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_3')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n\n $expectedResponse = [\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-03T01:00:00+00:00',\n 'end' => '2016-04-03T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $exceptionEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T01:00:00+00:00',\n 'end' => '2016-04-04T02:00:00+00:00',\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'attendees' => $expectedExceptionAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n\n // Step 4. Check recurring events in 1st attendee user calendar. There should be no exception event.\n $attendeeRecurringEvent1 = $recurringEvent->getChildEventByCalendar(\n $this->getReference('oro_calendar:calendar:foo_user_2')\n );\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-30T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_2', 'foo_user_2_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_3')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_2')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n\n $expectedResponse = [\n [\n 'id' => $attendeeRecurringEvent1->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeRecurringEvent1->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeRecurringEvent1->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-04-03T01:00:00+00:00',\n 'end' => '2016-04-03T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n\n // Step 5. Check recurring events in 2nd attendee user calendar.\n // There should be 1 attendee in exception event of owner user calendar.\n $attendeeRecurringEvent2 = $recurringEvent->getChildEventByCalendar(\n $this->getReference('oro_calendar:calendar:foo_user_3')\n );\n\n $attendeeExceptionEvent2 = $exceptionEvent->getChildEventByCalendar(\n $this->getReference('oro_calendar:calendar:foo_user_3')\n );\n\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-30T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_3', 'foo_user_3_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_3')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_2')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n\n $expectedExceptionAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_3')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n\n $expectedResponse = [\n [\n 'id' => $attendeeRecurringEvent2->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeRecurringEvent2->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeRecurringEvent2->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-03T01:00:00+00:00',\n 'end' => '2016-04-03T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeExceptionEvent2->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-04T01:00:00+00:00',\n 'end' => '2016-04-04T02:00:00+00:00',\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'attendees' => $expectedExceptionAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n }", "public function testMassDeleteActionDeletesRegularEventAndCancelsExceptionEvent()\n {\n // Step 1. Create new recurring event without attendees.\n // Recurring event with occurrences: 2016-04-25, 2016-05-08, 2016-05-09, 2016-05-22\n $eventData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-25T01:00:00+00:00',\n 'end' => '2016-04-25T02:00:00+00:00',\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY,\n 'recurrence' => [\n 'timeZone' => 'UTC',\n 'recurrenceType' => Model\\Recurrence::TYPE_WEEKLY,\n 'interval' => 2,\n 'dayOfWeek' => [Model\\Recurrence::DAY_SUNDAY, Model\\Recurrence::DAY_MONDAY],\n 'startTime' => '2016-04-25T01:00:00+00:00',\n 'occurrences' => 4,\n 'endTime' => '2016-06-10T01:00:00+00:00',\n ],\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ]\n ];\n\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(\n [\n 'statusCode' => 201,\n 'contentType' => 'application/json'\n ]\n );\n /** @var CalendarEvent $recurringEvent */\n $recurringEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 2. Create exception for the recurring event with updated title and time.\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode(\n [\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-05-22T03:00:00+00:00',\n 'end' => '2016-05-22T05:00:00+00:00',\n 'recurringEventId' => $recurringEvent->getId(),\n 'originalStart' => '2016-05-22T01:00:00+00:00',\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY,\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ]\n ],\n JSON_THROW_ON_ERROR\n )\n ]\n );\n $response = $this->getRestResponseContent(\n [\n 'statusCode' => 201,\n 'contentType' => 'application/json'\n ]\n );\n /** @var CalendarEvent $newEvent */\n $exceptionEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 3. Create new regular calendar event with same attendees.\n $eventData = [\n 'title' => 'Test Simple Event',\n 'description' => 'Test Simple Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-27T01:00:00+00:00',\n 'end' => '2016-04-27T02:00:00+00:00',\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY,\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ]\n ];\n\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(\n [\n 'statusCode' => 201,\n 'contentType' => 'application/json'\n ]\n );\n /** @var CalendarEvent $recurringEvent */\n $regularEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 4. Execute delete mass action for regular event.\n $this->client->disableReboot();\n $url = $this->getUrl(\n 'oro_datagrid_mass_action',\n [\n 'gridName' => 'calendar-event-grid',\n 'actionName' => 'delete',\n 'inset' => 1,\n 'values' => implode(',', [$regularEvent->getId()])\n ]\n );\n $this->ajaxRequest(\n 'DELETE',\n $url,\n [],\n [],\n $this->generateBasicAuthHeader(\n 'foo_user_1',\n 'password',\n $this->getReference('oro_calendar:user:foo_user_1')->getOrganization()->getId()\n )\n );\n $result = $this->client->getResponse();\n $data = json_decode($result->getContent(), true, 512, JSON_THROW_ON_ERROR);\n $this->assertTrue($data['successful'] === true);\n $this->assertTrue($data['count'] === 1);\n\n // Step 5. Get events via API and check the removed events are not exist.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-06-01T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(\n [\n 'statusCode' => 200,\n 'contentType' => 'application/json'\n ]\n );\n\n $expectedAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ];\n\n $expectedResponse = [\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'start' => '2016-04-25T01:00:00+00:00',\n 'end' => '2016-04-25T02:00:00+00:00',\n 'allDay' => false,\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'start' => '2016-05-08T01:00:00+00:00',\n 'end' => '2016-05-08T02:00:00+00:00',\n 'allDay' => false,\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'start' => '2016-05-09T01:00:00+00:00',\n 'end' => '2016-05-09T02:00:00+00:00',\n 'allDay' => false,\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $exceptionEvent->getId(),\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'start' => '2016-05-22T03:00:00+00:00',\n 'end' => '2016-05-22T05:00:00+00:00',\n 'allDay' => false,\n 'attendees' => $expectedAttendees,\n ]\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n\n // Step 6. Check number of calendar events and attendees in the system after all manipulations.\n $this->getEntityManager()->clear();\n\n $this->assertCount(\n 4,\n $this->getEntityRepository(CalendarEvent::class)->findAll(),\n 'Failed asserting 2 events exist in the persistence: ' . PHP_EOL .\n '1 - recurring event' . PHP_EOL .\n '2 - child of event 1' . PHP_EOL .\n '3 - cancelled exception event of 1' . PHP_EOL .\n '4 - child of event 3' . PHP_EOL\n );\n\n $this->assertCount(\n 1,\n $this->getEntityRepository(Entity\\Recurrence::class)->findAll(),\n 'Failed asserting 1 recurrence entity exist in the persistence: ' . PHP_EOL .\n '1 - recurrence of event 1' . PHP_EOL\n );\n\n $this->assertCount(\n 4,\n $this->getEntityRepository(Attendee::class)->findAll(),\n 'Failed asserting 3 attendees exist in the persistence: ' . PHP_EOL .\n '1 - 1st attendee of event 1' . PHP_EOL .\n '2 - 2nd attendee of event 1' . PHP_EOL .\n '3 - 1nd attendee of event 3' . PHP_EOL .\n '4 - 2nd attendee of event 3' . PHP_EOL\n );\n }", "public function testUserAttendeeRemovedFromRecurringEventDoesNotRemovedFromExceptionEventWithCustomAttendees()\n {\n // Step 1. Create recurring calendar event with 2 attendees.\n // Recurring event with occurrences: 2016-04-01, 2016-04-02, 2016-04-03, 2016-04-04\n $eventData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'updateExceptions' => true,\n 'backgroundColor' => '#FF0000',\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n 'recurrence' => [\n 'timeZone' => 'UTC',\n 'recurrenceType' => Recurrence::TYPE_DAILY,\n 'interval' => 1,\n 'startTime' => '2016-04-01T01:00:00+00:00',\n 'occurrences' => 4,\n ],\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $recurringEvent */\n $recurringEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 2. Create exception event and remove organizer attendee.\n $exceptionData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T01:00:00+00:00',\n 'end' => '2016-04-04T02:00:00+00:00',\n 'backgroundColor' => '#FF0000',\n 'recurringEventId' => $recurringEvent->getId(),\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $exceptionEvent */\n $exceptionEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 3. Change recurring event and remove non-organizer attendee.\n $eventData['attendees'] = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ]\n ];\n\n $this->restRequest(\n [\n 'method' => 'PUT',\n 'url' => $this->getUrl('oro_api_put_calendarevent', ['id' => $recurringEvent->getId()]),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n $this->assertResponseEquals(\n $this->getAcceptedResponseArray($response),\n $response\n );\n\n // Step 4. Check recurring event has organizer attendee in all occurrences\n // except exception with second attendee.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-30T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_1')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_ORGANIZER,\n ],\n ];\n\n $expectedExceptionAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_2')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n\n $expectedResponse = [\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-03T01:00:00+00:00',\n 'end' => '2016-04-03T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $exceptionEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T01:00:00+00:00',\n 'end' => '2016-04-04T02:00:00+00:00',\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'attendees' => $expectedExceptionAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n\n // Step 5. Check number of calendar events and attendees in the system after all manipulations.\n $this->getEntityManager()->clear();\n\n $this->assertCount(\n 3,\n $this->getEntityRepository(CalendarEvent::class)->findAll(),\n 'Failed asserting 3 events exist in the application: ' . PHP_EOL .\n '1 - recurring event' . PHP_EOL .\n '2 - exception of event 1' . PHP_EOL .\n '3 - child event of 2'\n );\n\n $this->assertCount(\n 2,\n $this->getEntityRepository(Attendee::class)->findAll(),\n 'Failed asserting 3 attendees exist in the application: ' . PHP_EOL .\n '1 - 1st attendee of event 1' . PHP_EOL .\n '2 - 2nd attendee of event 2'\n );\n }", "public function testAddExceptionWithoutAttendeesInRecurringEventWithAttendees()\n {\n // Step 1. Create new recurring event with attendees.\n // Recurring event with occurrences: 2016-11-14, 2016-11-15, 2016-11-16\n $eventData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-11-14T01:00:00+00:00',\n 'end' => '2016-11-14T02:00:00+00:00',\n 'updateExceptions' => true,\n 'backgroundColor' => '#FF0000',\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ],\n 'recurrence' => [\n 'timeZone' => 'UTC',\n 'recurrenceType' => Recurrence::TYPE_DAILY,\n 'interval' => 1,\n 'startTime' => '2016-11-14T01:00:00+00:00',\n 'occurrences' => 3\n ],\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $recurringEvent */\n $recurringEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 2. Create exception for the recurring event without attendees.\n $exceptionData = [\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-11-15T03:00:00+00:00',\n 'end' => '2016-11-15T05:00:00+00:00',\n 'backgroundColor' => '#FF0000',\n 'recurringEventId' => $recurringEvent->getId(),\n 'originalStart' => '2016-11-15T01:00:00+00:00',\n 'attendees' => [],\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $exceptionEvent */\n $exceptionEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 3. Check all events shown in the calendar of owner user.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-11-13T01:00:00+00:00',\n 'end' => '2016-11-19T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_1')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_2')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n\n $expectedResponse = [\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-11-14T01:00:00+00:00',\n 'end' => '2016-11-14T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $exceptionEvent->getId(),\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-11-15T03:00:00+00:00',\n 'end' => '2016-11-15T05:00:00+00:00',\n 'attendees' => [],\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-11-16T01:00:00+00:00',\n 'end' => '2016-11-16T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n\n // Step 4. Check all events except exception shown in the calendar of attendee user.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-11-13T01:00:00+00:00',\n 'end' => '2016-11-19T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_2', 'foo_user_2_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $attendeeRecurringEvent */\n $attendeeRecurringEvent = $this->getEntity(CalendarEvent::class, $recurringEvent->getId())\n ->getChildEvents()\n ->first();\n\n $expectedResponse = [\n [\n 'id' => $attendeeRecurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-11-14T01:00:00+00:00',\n 'end' => '2016-11-14T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeRecurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-11-16T01:00:00+00:00',\n 'end' => '2016-11-16T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n }", "public function testReplaceNonUserAttendeeInRecurringEventReplacesTheAttendeeInExceptionEvent()\n {\n // Step 1. Create new recurring event with 2 attendees.\n // Recurring event with occurrences: 2016-04-01, 2016-04-02, 2016-04-03, 2016-04-04\n $eventData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'updateExceptions' => true,\n 'backgroundColor' => '#FF0000',\n 'attendees' => [\n [\n 'displayName' => 'External Attendee',\n 'email' => 'ext@example.com',\n 'status' => Attendee::STATUS_NONE,\n 'type' => Attendee::TYPE_OPTIONAL,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n 'recurrence' => [\n 'timeZone' => 'UTC',\n 'recurrenceType' => Recurrence::TYPE_DAILY,\n 'interval' => 1,\n 'startTime' => '2016-04-01T01:00:00+00:00',\n 'occurrences' => 4,\n ],\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $recurringEvent */\n $recurringEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 2. Add exception with updated title, description and time.\n $exceptionData = [\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T03:00:00+00:00',\n 'end' => '2016-04-04T04:00:00+00:00',\n 'backgroundColor' => '#FF0000',\n 'recurringEventId' => $recurringEvent->getId(),\n 'originalStart' => '2016-04-04T01:00:00+00:00',\n 'attendees' => [\n [\n 'displayName' => 'External Attendee',\n 'email' => 'ext@example.com',\n 'status' => Attendee::STATUS_NONE,\n 'type' => Attendee::TYPE_OPTIONAL,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $exceptionEvent */\n $exceptionEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 3. Update recurring event, remove one of the attendees and add another attendee instead.\n $eventData['attendees'] = [\n [\n 'displayName' => 'Another External Attendee',\n 'email' => 'aext@example.com',\n 'status' => Attendee::STATUS_NONE,\n 'type' => Attendee::TYPE_OPTIONAL,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'status' => Attendee::STATUS_DECLINED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n $this->restRequest(\n [\n 'method' => 'PUT',\n 'url' => $this->getUrl('oro_api_put_calendarevent', ['id' => $recurringEvent->getId()]),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n $this->assertResponseEquals(\n $this->getResponseArray($response),\n $response\n );\n\n // Step 4. Check the list of attendees is the same in each occurrence of recurring event including the exception\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-30T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedAttendees = [\n [\n 'displayName' => 'Another External Attendee',\n 'email' => 'aext@example.com',\n 'userId' => null,\n 'status' => Attendee::STATUS_NONE,\n 'type' => Attendee::TYPE_OPTIONAL,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_3')->getFullName(),\n 'email' => 'foo_user_3@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_3')->getId(),\n 'status' => Attendee::STATUS_DECLINED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n $expectedResponse = [\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-03T01:00:00+00:00',\n 'end' => '2016-04-03T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $exceptionEvent->getId(),\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-04T03:00:00+00:00',\n 'end' => '2016-04-04T04:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n\n // Step 5. Check events in calendar of attendee user matches events in calendar of owner user.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-30T01:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_3', 'foo_user_3_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $attendeeRecurringEvent */\n $attendeeRecurringEvent = $this->getEntity(CalendarEvent::class, $recurringEvent->getId())\n ->getChildEvents()\n ->first();\n\n /** @var CalendarEvent $attendeeExceptionEvent */\n $attendeeExceptionEvent = $this->getEntity(CalendarEvent::class, $exceptionEvent->getId())\n ->getChildEvents()\n ->first();\n\n $expectedResponse = [\n [\n 'id' => $attendeeRecurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeRecurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeRecurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-03T01:00:00+00:00',\n 'end' => '2016-04-03T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeExceptionEvent->getId(),\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_3')->getId(),\n 'start' => '2016-04-04T03:00:00+00:00',\n 'end' => '2016-04-04T04:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n }", "public function testDeleteRecurringEvent()\n {\n $recurringEventParameters = $this->getRecurringEventParameters();\n $this->client->request('POST', $this->getUrl('oro_api_post_calendarevent'), $recurringEventParameters);\n $result = $this->getJsonResponseContent($this->client->getResponse(), 201);\n $event = $this->getContainer()->get('doctrine')->getRepository(CalendarEvent::class)\n ->find($result['id']);\n $data['id'] = $event->getId();\n $data['recurrenceId'] = $event->getRecurrence()->getId();\n $this->client->request(\n 'DELETE',\n $this->getUrl('oro_api_delete_calendarevent', ['id' => $data['id']])\n );\n\n $this->assertEmptyResponseStatusCodeEquals($this->client->getResponse(), 204);\n $event = $this->getContainer()->get('doctrine')->getRepository(CalendarEvent::class)\n ->findOneBy(['id' => $data['id']]); // do not use 'load' method to avoid proxy object loading.\n $this->assertNull($event);\n $recurrence = $this->getContainer()->get('doctrine')->getRepository(Recurrence::class)\n ->findOneBy(['id' => $data['recurrenceId']]);\n $this->assertNull($recurrence);\n }", "public function testAddSameUserAttendeesToRecurringEventAsAttendeesInException()\n {\n // Step 1. Create new recurring event without attendees.\n // Recurring event with occurrences: 2016-04-01, 2016-04-02, 2016-04-03\n $eventData = [\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'updateExceptions' => true,\n 'backgroundColor' => '#FF0000',\n 'notifyAttendees' => NotificationManager::ALL_NOTIFICATIONS_STRATEGY,\n 'attendees' => [],\n 'recurrence' => [\n 'timeZone' => 'UTC',\n 'recurrenceType' => Recurrence::TYPE_DAILY,\n 'interval' => 1,\n 'startTime' => '2016-04-01T01:00:00+00:00',\n 'occurrences' => 3\n ]\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $recurringEvent */\n $recurringEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 2. Create exception for the recurring event with changed title, description and start time.\n $exceptionData = [\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-03T03:00:00+00:00',\n 'end' => '2016-04-03T05:00:00+00:00',\n 'backgroundColor' => '#FF0000',\n 'recurringEventId' => $recurringEvent->getId(),\n 'originalStart' => '2016-04-03T01:00:00+00:00',\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ]\n ],\n ];\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($exceptionData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 201, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $exceptionEvent */\n $exceptionEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n\n // Step 3. Change recurring event with the same attendees as in exception.\n $eventData['attendees'] = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n $this->restRequest(\n [\n 'method' => 'PUT',\n 'url' => $this->getUrl('oro_api_put_calendarevent', ['id' => $recurringEvent->getId()]),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode($eventData, JSON_THROW_ON_ERROR)\n ]\n );\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n $this->assertResponseEquals(\n $this->getAcceptedResponseArray($response),\n $response\n );\n\n // Step 4. Check the attendees list is the same in all events of recurring event including the exception.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T00:00:00+00:00',\n 'end' => '2016-04-30T00:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n $expectedAttendees = [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_1')->getFullName(),\n 'email' => 'foo_user_1@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_1')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_2')->getId(),\n 'status' => Attendee::STATUS_ACCEPTED,\n 'type' => Attendee::TYPE_REQUIRED,\n ],\n ];\n\n $expectedResponse = [\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $recurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $exceptionEvent->getId(),\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'start' => '2016-04-03T03:00:00+00:00',\n 'end' => '2016-04-03T05:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n\n // Step 5. Check events in attendee's calendar match events in owner calendar.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl(\n 'oro_api_get_calendarevents',\n [\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-04-01T00:00:00+00:00',\n 'end' => '2016-04-30T00:00:00+00:00',\n 'subordinate' => true,\n ]\n ),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(['statusCode' => 200, 'contentType' => 'application/json']);\n\n /** @var CalendarEvent $attendeeRecurringEvent */\n $attendeeRecurringEvent = $this->getEntity(CalendarEvent::class, $recurringEvent->getId())\n ->getChildEvents()\n ->first();\n\n /** @var CalendarEvent $attendeeExceptionEvent */\n $attendeeExceptionEvent = $this->getEntity(CalendarEvent::class, $exceptionEvent->getId())\n ->getChildEvents()\n ->first();\n\n $expectedResponse = [\n [\n 'id' => $attendeeRecurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-04-01T01:00:00+00:00',\n 'end' => '2016-04-01T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeRecurringEvent->getId(),\n 'title' => 'Test Recurring Event',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-04-02T01:00:00+00:00',\n 'end' => '2016-04-02T02:00:00+00:00',\n 'attendees' => $expectedAttendees,\n ],\n [\n 'id' => $attendeeExceptionEvent->getId(),\n 'title' => 'Test Recurring Event Changed',\n 'description' => 'Test Recurring Event Description',\n 'allDay' => false,\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_2')->getId(),\n 'start' => '2016-04-03T03:00:00+00:00',\n 'end' => '2016-04-03T05:00:00+00:00',\n 'attendees' => $expectedAttendees\n ],\n ];\n\n $this->assertResponseEquals($expectedResponse, $response, false);\n }", "function meetups_attendees_delete( int $attendee_id ) : mixed\n{\n // Check if the required files have been included\n require_included_file('users.inc.php');\n\n // Only moderators can run this action\n user_restrict_to_moderators();\n\n // Sanitize the attendee id\n $attendee_id = sanitize($attendee_id, 'int', 0);\n\n // Error: Attendee does not exist\n if(!database_row_exists('meetups_people', $attendee_id))\n return __('meetups_attendees_edit_error_id');\n\n // Fetch data on the attendee and the meetup they are attending\n $dattendee = mysqli_fetch_array(query(\" SELECT meetups.id AS 'm_id' ,\n meetups.is_deleted AS 'm_deleted' ,\n meetups.event_date AS 'm_date' ,\n meetups.languages AS 'm_lang' ,\n users.id AS 'u_id' ,\n users.username AS 'u_account' ,\n meetups_people.username AS 'p_nickname' ,\n meetups_people.attendance_confirmed AS 'p_lock' ,\n meetups_people.extra_information_en AS 'p_extra_en' ,\n meetups_people.extra_information_fr AS 'p_extra_fr'\n FROM meetups_people\n LEFT JOIN users ON meetups_people.fk_users = users.id\n LEFT JOIN meetups ON meetups_people.fk_meetups = meetups.id\n WHERE meetups_people.id = '$attendee_id' \"));\n\n // Sanitize and prepare the data\n $meetup_id = sanitize($dattendee['m_id'], 'int', 0);\n $meetup_deleted = $dattendee['m_deleted'];\n $meetup_date = $dattendee['m_date'];\n $meetup_date_en = date_to_text($dattendee['m_date'], lang: 'EN');\n $meetup_date_fr = date_to_text($dattendee['m_date'], lang: 'FR');\n $meetup_lang = $dattendee['m_lang'];\n $account = sanitize($dattendee['u_account'], 'string');\n $account_id = sanitize($dattendee['u_id'], 'int', 0);\n $nickname = sanitize($dattendee['p_nickname'], 'string');\n $username = ($nickname) ? $nickname : $account;\n $username_raw = ($dattendee['p_nickname']) ? $dattendee['p_nickname'] : $dattendee['u_account'];\n $extra_en = sanitize($dattendee['p_extra_en'], 'string');\n $extra_fr = sanitize($dattendee['p_extra_fr'], 'string');\n $lock = $dattendee['p_lock'];\n\n // Error: Meetup does not exist or has been deleted\n if(!$meetup_id)\n return __('meetups_attendees_edit_error_meetup');\n\n // Remove the attendee\n query(\" DELETE FROM meetups_people\n WHERE meetups_people.id = '$attendee_id' \");\n\n // Recount the meetup's attendees\n meetup_attendees_update_count($meetup_id);\n\n // Fetch the username of the moderator deleting the attendee\n $mod_username = user_get_username();\n\n // Activity log, for future meetups only\n if(!$meetup_deleted && strtotime($meetup_date) > strtotime(date('Y-m-d')))\n log_activity( 'meetups_people_delete' ,\n language: $meetup_lang ,\n activity_id: $meetup_id ,\n activity_summary_en: $meetup_date ,\n activity_summary_fr: $meetup_date ,\n username: $username_raw );\n\n // Moderation log\n $modlog = log_activity( 'meetups_people_delete' ,\n is_moderators_only: true ,\n activity_id: $meetup_id ,\n activity_summary_en: $meetup_date ,\n activity_summary_fr: $meetup_date ,\n username: $username_raw ,\n moderator_username: $mod_username );\n\n // Detailed moderation log\n if($account)\n log_activity_details($modlog, 'Account name', 'Nom du compte', $account, do_not_sanitize: true);\n if($nickname)\n log_activity_details($modlog, 'Nickname or name', 'Pseudonyme ou nom', $nickname, do_not_sanitize: true);\n if($extra_en)\n log_activity_details($modlog, 'Extra details (EN)', 'Détails supplémentaires (EN)', $extra_en, do_not_sanitize: true);\n if($extra_fr)\n log_activity_details($modlog, 'Extra details (FR)', 'Détails supplémentaires (FR)', $extra_fr, do_not_sanitize: true);\n if($lock)\n log_activity_details($modlog, 'Confirmed attendance', 'Présence confirmée', $lock, do_not_sanitize: true);\n\n // IRC bot message\n if(str_contains($meetup_lang, 'EN') && !$meetup_deleted && strtotime($meetup_date) > strtotime(date('Y-m-d')))\n irc_bot_send_message(\"$username_raw has left the $meetup_date_en real life meetup - \".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id, 'english');\n if(str_contains($meetup_lang, 'FR') && !$meetup_deleted && strtotime($meetup_date) > strtotime(date('Y-m-d')))\n irc_bot_send_message(\"$username_raw a quitté la rencontre IRL du $meetup_date_fr - \".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id, 'french');\n if(strtotime($meetup_date) === strtotime(date('Y-m-d')))\n irc_bot_send_message(\"$mod_username has removed $username_raw from the currently ongoing $meetup_date_en real life meetup - \".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id, 'mod');\n if(strtotime($meetup_date) < strtotime(date('Y-m-d')))\n irc_bot_send_message(\"$mod_username has removed $username_raw from the already finished $meetup_date_en real life meetup - \".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id, 'mod');\n\n // Discord message\n if(!$meetup_deleted && strtotime($meetup_date) > strtotime(date('Y-m-d')))\n {\n $discord_message = \"$username_raw has left the $meetup_date_en real life meetup\";\n $discord_message .= PHP_EOL.\"$username_raw a quitté la rencontre IRL du $meetup_date_fr\";\n $discord_message .= PHP_EOL.\"<\".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id.\">\";\n discord_send_message($discord_message, 'main');\n }\n\n // Recalculate the user's meetup stats if they have an account\n if($account_id)\n meetups_stats_recalculate_user($account_id);\n\n // All went well\n return NULL;\n}", "function attendeeDeleted($cal_id, $event_id, $user_id){\n\t\t// noop\n\t}", "function delete(){\r\n\t\tglobal $wpdb;\r\n\t\tif( $this->is_recurring() ){\r\n\t\t\t//Delete the recurrences then this recurrence event\r\n\t\t\t$this->delete_events();\r\n\t\t}\r\n\t\t$result = $wpdb->query ( $wpdb->prepare(\"DELETE FROM \". $wpdb->prefix . EM_EVENTS_TABLE .\" WHERE event_id=%d\", $this->id) );\r\n\t\tif($result !== false){\r\n\t\t\t$bookings_result = $this->get_bookings()->delete();\r\n\t\t}\r\n\t}", "public function deleteAndClearRecurringEventExceptions(CalendarEvent $event)\n {\n foreach ($event->getRecurringEventExceptions() as $exception) {\n $this->doctrine->getManager()->remove($exception);\n }\n $event->getRecurringEventExceptions()->clear();\n\n foreach ($event->getChildEvents() as $childEvent) {\n $this->deleteAndClearRecurringEventExceptions($childEvent);\n }\n }", "public function delete()\n {\n if ($this->id != null) {\n $facebook = new UNL_UCBCN_FacebookInstance($this->id);\n $facebook->deleteEvent();\n }\n //delete the actual event.\n $r = parent::delete();\n if ($r) {\n UNL_UCBCN::cleanCache();\n $this->factory('recurringdate')->updateRecurringEvents();\n }\n return $r;\n }", "public function testCreateRegularCalendarEventWithAttendeeNotRelatedToAnyUser()\n {\n // Step 1. Create regular calendar event with attendee not related to any user.\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('system_user_1', 'system_user_1_api_key'),\n 'content' => json_encode(\n [\n 'title' => 'Regular event',\n 'start' => '2016-10-14T22:00:00+00:00',\n 'end' => '2016-10-14T23:00:00+00:00',\n 'calendar' => $this->getReference('oro_calendar:calendar:system_user_1')->getId(),\n 'attendees' => [\n [\n 'displayName' => 'External Attendee',\n 'email' => 'ext@example.com',\n 'status' => Attendee::STATUS_TENTATIVE,\n 'type' => Attendee::TYPE_ORGANIZER,\n ]\n ],\n ],\n JSON_THROW_ON_ERROR\n )\n ]\n );\n $response = $this->getRestResponseContent(\n [\n 'statusCode' => 201,\n 'contentType' => 'application/json'\n ]\n );\n /** @var CalendarEvent $newEvent */\n $newEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n $this->assertResponseEquals(\n [\n 'id' => $response['id'],\n 'uid' => $response['uid'],\n 'invitationStatus' => Attendee::STATUS_NONE,\n 'editableInvitationStatus' => false,\n 'organizerDisplayName' => 'Elley Towards',\n 'organizerEmail' => 'system_user_1@example.com',\n 'organizerUserId' => $response['organizerUserId']\n ],\n $response\n );\n\n // Step 2. Get created event and verify all properties in the response.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl('oro_api_get_calendarevent', ['id' => $newEvent->getId()]),\n 'server' => $this->generateWsseAuthHeader('system_user_1', 'system_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(\n [\n 'statusCode' => 200,\n 'contentType' => 'application/json'\n ]\n );\n\n $this->assertResponseEquals(\n [\n 'id' => $newEvent->getId(),\n 'uid' => $newEvent->getUid(),\n 'calendar' => $this->getReference('oro_calendar:calendar:system_user_1')->getId(),\n 'parentEventId' => null,\n 'title' => 'Regular event',\n 'description' => null,\n 'start' => '2016-10-14T22:00:00+00:00',\n 'end' => '2016-10-14T23:00:00+00:00',\n 'allDay' => false,\n 'attendees' => [\n [\n 'displayName' => 'External Attendee',\n 'email' => 'ext@example.com',\n 'userId' => null,\n 'status' => Attendee::STATUS_TENTATIVE,\n 'type' => Attendee::TYPE_ORGANIZER,\n 'createdAt' => $newEvent->getAttendeeByEmail('ext@example.com')\n ->getCreatedAt()->format(DATE_RFC3339),\n 'updatedAt' => $newEvent->getAttendeeByEmail('ext@example.com')\n ->getUpdatedAt()->format(DATE_RFC3339),\n ]\n ],\n 'editable' => true,\n 'editableInvitationStatus' => false,\n 'removable' => true,\n 'backgroundColor' => null,\n 'invitationStatus' => Attendee::STATUS_NONE,\n 'recurringEventId' => null,\n 'originalStart' => null,\n 'isCancelled' => false,\n 'createdAt' => $newEvent->getCreatedAt()->format(DATE_RFC3339),\n 'updatedAt' => $newEvent->getUpdatedAt()->format(DATE_RFC3339),\n 'isOrganizer' => $newEvent->isOrganizer(),\n 'organizerDisplayName' => $newEvent->getOrganizerDisplayName(),\n 'organizerEmail' => $newEvent->getOrganizerEmail(),\n 'organizerUserId' => $newEvent->getOrganizerUser() ? $newEvent->getOrganizerUser()->getId() : null\n ],\n $response\n );\n }", "public function testDeleteRecurring() {\n $order_order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'product_variation',\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_order_item],\n ]);\n $recurring_order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'product_variation',\n ]);\n /** @var \\Drupal\\commerce_recurring\\Entity\\RecurringInterface $recurring */\n $recurring = $this->createEntity('commerce_recurring', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$recurring_order_item],\n 'recurring_orders' => [$order],\n ]);\n $recurring->delete();\n\n $recurring_exists = (bool) Order::load($recurring->id());\n $this->assertFalse($recurring_exists, 'The new recurring has been deleted from the database.');\n\n $recurring_order_item_exists = (bool) OrderItem::load($recurring_order_item->id());\n $this->assertFalse($recurring_order_item_exists, 'The matching recurring order item has been deleted from the database.');\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertFalse($order_exists, 'The new order has been deleted from the database.');\n\n $order_order_item_exists = (bool) OrderItem::load($order_order_item->id());\n $this->assertFalse($order_order_item_exists, 'The matching order order item has been deleted from the database.');\n }", "public function testDeleteRecurring() {\n $order_line_item = $this->createEntity('commerce_line_item', [\n 'type' => 'product_variation',\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'line_items' => [$order_line_item],\n ]);\n $recurring_line_item = $this->createEntity('commerce_line_item', [\n 'type' => 'product_variation',\n ]);\n /** @var \\Drupal\\commerce_recurring\\Entity\\RecurringInterface $recurring */\n $recurring = $this->createEntity('commerce_recurring', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'line_items' => [$recurring_line_item],\n 'recurring_orders' => [$order],\n ]);\n $recurring->delete();\n\n $recurring_exists = (bool) Order::load($recurring->id());\n $this->assertFalse($recurring_exists, 'The new recurring has been deleted from the database.');\n\n $recurring_line_item_exists = (bool) LineItem::load($recurring_line_item->id());\n $this->assertFalse($recurring_line_item_exists, 'The matching recurring line item has been deleted from the database.');\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertFalse($order_exists, 'The new order has been deleted from the database.');\n\n $order_line_item_exists = (bool) LineItem::load($order_line_item->id());\n $this->assertFalse($order_line_item_exists, 'The matching order line item has been deleted from the database.');\n }", "public function testCreateRegularCalendarEventWithAttendeeRelatedToUser()\n {\n // Step 1. Create new calendar event with attendees related to user.\n $this->restRequest(\n [\n 'method' => 'POST',\n 'url' => $this->getUrl('oro_api_post_calendarevent'),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key'),\n 'content' => json_encode(\n [\n 'title' => 'Regular event',\n 'start' => '2016-10-14T22:00:00+00:00',\n 'end' => '2016-10-14T23:00:00+00:00',\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n ]\n ],\n ],\n JSON_THROW_ON_ERROR\n )\n ]\n );\n $response = $this->getRestResponseContent(\n [\n 'statusCode' => 201,\n 'contentType' => 'application/json'\n ]\n );\n /** @var CalendarEvent $newEvent */\n $newEvent = $this->getEntity(CalendarEvent::class, $response['id']);\n $this->assertResponseEquals(\n $this->getResponseArray($response),\n $response\n );\n // Step 2. Get created event and verify all properties in the response.\n $this->restRequest(\n [\n 'method' => 'GET',\n 'url' => $this->getUrl('oro_api_get_calendarevent', ['id' => $newEvent->getId()]),\n 'server' => $this->generateWsseAuthHeader('foo_user_1', 'foo_user_1_api_key')\n ]\n );\n\n $response = $this->getRestResponseContent(\n [\n 'statusCode' => 200,\n 'contentType' => 'application/json'\n ]\n );\n\n $this->assertResponseEquals(\n [\n 'id' => $newEvent->getId(),\n 'uid' => $newEvent->getUid(),\n 'calendar' => $this->getReference('oro_calendar:calendar:foo_user_1')->getId(),\n 'parentEventId' => null,\n 'title' => 'Regular event',\n 'description' => null,\n 'start' => '2016-10-14T22:00:00+00:00',\n 'end' => '2016-10-14T23:00:00+00:00',\n 'allDay' => false,\n 'attendees' => [\n [\n 'displayName' => $this->getReference('oro_calendar:user:foo_user_2')->getFullName(),\n 'email' => 'foo_user_2@example.com',\n 'userId' => $this->getReference('oro_calendar:user:foo_user_2')->getId(),\n 'status' => Attendee::STATUS_NONE,\n 'type' => Attendee::TYPE_REQUIRED,\n 'createdAt' => $newEvent->getAttendeeByEmail('foo_user_2@example.com')\n ->getCreatedAt()->format(DATE_RFC3339),\n 'updatedAt' => $newEvent->getAttendeeByEmail('foo_user_2@example.com')\n ->getUpdatedAt()->format(DATE_RFC3339),\n ]\n ],\n 'editable' => true,\n 'editableInvitationStatus' => false,\n 'removable' => true,\n 'backgroundColor' => null,\n 'invitationStatus' => Attendee::STATUS_NONE,\n 'recurringEventId' => null,\n 'originalStart' => null,\n 'isCancelled' => false,\n 'createdAt' => $newEvent->getCreatedAt()->format(DATE_RFC3339),\n 'updatedAt' => $newEvent->getUpdatedAt()->format(DATE_RFC3339),\n 'isOrganizer' => $newEvent->isOrganizer(),\n 'organizerDisplayName' => $newEvent->getOrganizerDisplayName(),\n 'organizerEmail' => $newEvent->getOrganizerEmail(),\n 'organizerUserId' => $newEvent->getOrganizerUser() ? $newEvent->getOrganizerUser()->getId() : null\n ],\n $response\n );\n }", "public function testDeletingACalendarCascadesDeletingAssociatedEvents(){\n $calendarID = $this->calendarObj->getID();\n\n $this->calendarObj->delete();\n\n // Count rows in SchedulizerCalendar table with ID of one just deleted\n $calendarRowCount = $this->getRawConnection()\n ->query(\"SELECT * FROM \".self::TABLE_NAME_CALENDAR.\" WHERE id = {$calendarID}\")\n ->rowCount();\n\n // Count rows in SchedulizerEvent table with calendarID of one just deleted\n $eventRowCount = $this->getRawConnection()\n ->query(\"SELECT * FROM \".self::TABLE_NAME_EVENT.\" WHERE calendarID = {$calendarID}\")\n ->rowCount();\n\n $this->assertEquals(0, $calendarRowCount);\n $this->assertEquals(0, $eventRowCount);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete and recreate the tables from the models
public static function recreate(): void{ echo "[*] === Recreating Databases ===".PHP_EOL; echo "[*] Reading models...".PHP_EOL; $modelList = classHelper::getClassNamesFromDir(__DIR__."/../../models"); echo PHP_EOL; foreach($modelList as $model){ echo $model.PHP_EOL; } cliHelper::confirmation("Recreating the database will wipe all data.", false); echo "[*] Starting migration".PHP_EOL; foreach($modelList as $model){ $modelObj = new $model(); $modelObj->drop(); $modelObj->create(); unset($modelObj); // Destroy finished object } echo cliColour::GREEN."[*] Completed without error".cliColour::RESET.PHP_EOL; }
[ "function recreateDatabase() {\n $this->dropAllTables();\n $this->setUpEmptyUsersTable();\n $this->setUpEmptyExamProtocolsTable();\n $this->setUpEmptyLecturesTable();\n $this->setUpEmptyLogEventsTable();\n $this->setUpEmptyBorrowRecordsTable();\n $this->setUpEmptyExamProtocolAssignedToLecturesTable();\n $this->setUpEmptyRecurringTasksTable();\n }", "protected function removeTablesForModels() {\n\t\t$tablesToDelete = file_get_contents($this->models);\n\t\tDoctrine_Manager::getInstance()->getCurrentConnection()->getDbh()->query(\n\t\t//\t\"SET FOREIGN_KEY_CHECKS=0;\n\t\t\t \"DROP TABLE \".$tablesToDelete.\";\n\t\t\t \");\n\t\techo \"\\n Dropping tables $tablesToDelete \\n\";\n\t}", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }", "public function deleteTables () {\n $this->usersDB->deleteTables();\n $this->categoriesDB->deleteTables();\n $this->itemsDB->deleteTables();\n }", "public static function deleteTables() {\n if (static::getTableEntity()->exists() == true) {\n static::getTableEntity()->drop();\n }\n if (static::getTableAttribute()->exists() == true) {\n static::getTableAttribute()->drop();\n }\n }", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach ($this->tables as $table)\n {\n DB::table($table)->truncate();\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n }", "private function cleanDatabase()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n $tableNames = Schema::getConnection()->getDoctrineSchemaManager()->listTableNames();\n foreach ($tableNames as $name) {\n //if you don't want to truncate migrations\n if ($name == 'migrations') {\n continue;\n }\n DB::table($name)->truncate();\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function cleanRoleAndPermissionTables() : void\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('roles')->truncate();\n DB::table('permissions')->truncate();\n DB::table('role_has_permissions')->truncate();\n DB::table('model_has_roles')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function emptyAllTables()\n {\n if (!$this->appDb)\n $this->connect();\n\n $this->appDb->exec('SET FOREIGN_KEY_CHECKS=0');\n\n foreach ($this->appDb->getSchemaManager()->listTableNames() as $tableName)\n $this->appDb->exec('TRUNCATE TABLE `'.$tableName.'`');\n\n $this->appDb->exec('SET FOREIGN_KEY_CHECKS=1');\n }", "public function delete_tables() {\r\n\t\t$this->wpdb->query(\"DROP TABLE IF EXISTS {$this->layers}\");\r\n\t\t$this->wpdb->query(\"DROP TABLE IF EXISTS {$this->maps}\");\r\n\t\t$this->wpdb->query(\"DROP TABLE IF EXISTS {$this->markers}\");\r\n\t\t$this->wpdb->query(\"DROP TABLE IF EXISTS {$this->rels}\");\r\n\t}", "private function cleanDatabase()\n {\n // sets foreign key checks to zero\n // TODO: needs to removed before going live\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach ($this->tables as $table)\n {\n DB::table($table)->truncate();\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function cleanDatabase()\n {\n foreach ($this->getTemplates() as $template) {\n $template->cleanDatabase();\n }\n }", "public function clearTables()\n\t{\n\t\t$this->orderTable->reset();\n\t\t$this->orderUserinfoTable->reset();\n\t\t$this->orderHistoryTable->reset();\n\t}", "public function clean_tables()\n\t{\n\t\t$this->db->query('SET FOREIGN_KEY_CHECKS = 0;');\n\t\t$this->db->query('truncate table cm_users_courses');\n\t\t$this->db->query('truncate table cm_users_departments');\n\t\t$this->db->query('truncate table cm_users_majors');\n\t\t$this->db->query('truncate table cm_users_collect_courschemas');\n\t\t$this->db->query('truncate table cm_courschemas');\n\t\t$this->db->query('truncate table cm_majors');\n\t\t$this->db->query('truncate table cm_prerequisites');\n\t\t$this->db->query('truncate table cm_courses');\n\t\t$this->db->query('truncate table cm_departments');\n\t\t$this->db->query('SET FOREIGN_KEY_CHECKS = 1;');\n\t}", "protected function tearDown(): void\n {\n $this->schema()->dropTable('users', true);\n $this->schema()->dropTable('articles', true);\n $this->schema()->dropTable('article_user', true);\n }", "private function __removeTables() {\n $db = get_db();\n $db->query(\"DROP TABLE IF EXISTS `{$db->prefix}iiif_items_job_statuses`;\");\n $db->query(\"DROP TABLE IF EXISTS `{$db->prefix}iiif_items_cached_json_data`;\");\n }", "private function dropExistingTables()\n\t{\n\t\t$tableNames = array_keys($this->loadTableClosures());\n\n\t\tforeach ($tableNames as $table) {\n\t\t\tSchema::dropIfExists($table);\n\t\t}\n\n\t\tSchema::dropIfExists('messages');\n\t\tSchema::dropIfExists('warnings');\n\t}", "protected function removeTables()\n {\n $connection = $this->connection();\n\n // Get all existing tables\n $tables = $connection->query('show tables')->fetchAllAssociative();\n $tables = array_map(function($tableSet) {\n return array_shift($tableSet);\n }, $tables);\n\n // Turn off foreign key checks\n $connection->query('SET FOREIGN_KEY_CHECKS = 0');\n\n foreach ($tables as $table) {\n // Drop tables\n $connection->query(\"DROP TABLE `{$table}`\");\n }\n\n // Reset foreign key checks on\n $connection->query('SET FOREIGN_KEY_CHECKS = 1');\n\n // Clear exists cache\n static::$existingTables = [];\n static::$existingEntites = [];\n }", "public static function delete_tables() {\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query( 'DROP TABLE IF EXISTS ' . self::$table_main );\n\t\t$wpdb->query( 'DROP TABLE IF EXISTS ' . self::$table_actor );\n\t\t$wpdb->query( 'DROP TABLE IF EXISTS ' . self::$table_verb );\n\t\t$wpdb->query( 'DROP TABLE IF EXISTS ' . self::$table_object );\n\t\t$wpdb->query( 'DROP TABLE IF EXISTS ' . self::$table_result );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get all logistics dynamic
public function getAll(){ $Dynamic = new LogisticsDynamic(); $Dynamics = $Dynamic->select('nickName','shop_name','weight','delivery_address','shipping_address','updated_at')->where('status','=',2)->orderBy("id", "desc")->limit(20)->get(); return $Dynamics; }
[ "public function getLogics() : array\n {\n\n return $this->logics;\n }", "public function get_statistics();", "public function allCharacteristics()\n {\n $id = $this->id;\n if (empty($id)) {\n $id = 0;\n }\n $b = DB::raw('SELECT * FROM product_characteristics LEFT JOIN ( SELECT product_product_characteristic.`product_id`, product_product_characteristic.`attr_value`, product_product_characteristic.`product_characteristic_id` FROM product_product_characteristic LEFT JOIN products ON product_product_characteristic.`product_id` = products.id WHERE `product_id` = ' . $id . ') as a ON a.`product_characteristic_id` = product_characteristics.id ORDER BY id');\n return DB::select($b);\n //TODO переделать в норм запрос\n }", "public function get() : array\n {\n\n return $this->logics;\n }", "public function getAllchemical(){\n\t\t\t$db = Zend_Db_Table::getDefaultAdapter();\n\t\t\t$query = \"SELECT * from logi_chemical_type order by chemical_type asc\"; \n\t\t\treturn $result = $db->fetchAll($query, array());\n\t\t\t}", "function get_stats()\r\n {\r\n\t\tif($this->debug>0){error_log('New LP - In learnpath::get_stats()',0);}\r\n \t//TODO\r\n }", "function viewAllmedical()\n\t\t{\n\t\t\t$medical = new medical();\n\t\t\treturn $medical-> allmedicaldata();\n\t\t}", "public function getFeatures () { }", "public static function getAll(){\n global $conn;\n $result_logs = array();\n $logs = $conn->query(\"SELECT * FROM log\")->fetchAll(PDO::FETCH_ASSOC);\n\n foreach($logs as $log_){\n $log = new Log();\n $data = json_decode($log_['atividade'], true);\n $log->atividade = $data['atividade'];\n if(isset($data['dados']))\n $log->dados = $data['dados'];\n if(isset($data['data']))\n $log->dados = $data['data'];\n $log->tempo = new DateTime($log_['tempo']);\n $log->dados_sessao = json_decode($log_['dados_sessao'], true);\n array_push($result_logs, $log);\n }\n\n return $result_logs;\n }", "abstract public function getWptLogTypes();", "function fn_get_log_types()\n{\n $types = array();\n $section = Settings::instance()->getSectionByName('Logging');\n\n $settings = Settings::instance()->getList($section['section_id']);\n\n foreach ($settings['main'] as $setting_id => $setting_data) {\n $types[$setting_data['name']]['type'] = str_replace('log_type_', '', $setting_data['name']);\n $types[$setting_data['name']]['description'] = $setting_data['description'];\n $types[$setting_data['name']]['actions'] = $setting_data['variants'];\n }\n\n return $types;\n}", "private function build_features() {\r\n\t\t\treturn array();\r\n\t\t}", "function getDescriptors();", "function getAllLoggers();", "protected function consultarObservaciones()\n {\n $modelosObservacion = array();\n\n foreach ($this->categorias as $categoria) {\n\n foreach ($categoria->variablesMedicion as $variable){\n $modelo = Observaciones::find()->where(['idAsignacion' => $this->asignacion->idAsignacion, 'idVariable' => $variable->idVariable])->one();\n if ($modelo !== null) {\n array_push($modelosObservacion, $modelo);\n }else{\n array_push($modelosObservacion, new Observaciones);\n }\n }\n }\n\n return $modelosObservacion;\n }", "public function retrieveLogs(Criticity $criticity):array\n {\n // first check our log entries\n $logRepository = $this->em->getRepository('\\Gedmo\\Loggable\\Entity\\LogEntry'); // we use default log entry class\n $logs = $logRepository->getLogEntries($criticity);\n\n return LogFactory::createCriticityLogs($logs);\n }", "public function get_performance_data()\n\t{\n\t\t$this->performance_data(1);\t# generate active check performance data\n\t\t$this->performance_data(0);\t# generate passive check performance data\n\t}", "public function getExpertises();", "private function getAllLoggInfo() {\n $loggModel = $GLOBALS[\"loggModel\"]; // get logg model\n\n if (isset($_POST['givenLogSearchWord'])) {\n // if search word is POSTed, get result containing this word\n $givenLogSearchWord = \"%{$_REQUEST[\"givenLogSearchWord\"]}%\";\n $LoggInfo = $loggModel->getAllLoggInfo($givenLogSearchWord);\n } else {\n // else get all logg result\n $givenLogSearchWord = \"%%\";\n $LoggInfo = $loggModel->getAllLoggInfo($givenLogSearchWord);\n }\n // echo result as an array to view\n $data = json_encode(array(\"allLoggInfo\" => $LoggInfo));\n echo $data;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Captures an exception for later processing
public function captureException($ex) { $this->exceptions[] = $ex; }
[ "public abstract function handleException();", "protected function _handleException(){ }", "public function apply(Exception $ex);", "final public function getError(): \\Exception {}", "protected function onExceptionInPipeline(Exception $e)\n {\n }", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "function onException($e)\n {\n }", "public function testExceptionFromContext()\n {\n $processor = new BacktraceProcessor();\n $record = ['level' => Logger::ERROR, 'context' => ['exception' => new \\Exception('foo')]];\n $record = $processor->__invoke($record);\n static::assertArrayHasKey('backtrace', $record['extra']);\n static::assertContains('testExceptionFromContext', $record['extra']['backtrace']);\n }", "protected abstract function registerFailureExceptions();", "public function testCatchThrowable()\n {\n $renderer = new TestExceptionRenderer();\n $responder = new DebugResponder($renderer);\n\n $responder->catchThrowable(new \\Exception('Testing'));\n\n $this->assertTrue($renderer->isRendered(), 'Renderer invoked');\n }", "public function report(Throwable $e){}", "public function onUnhandledException(\\Exception $e);", "public function getException(): Exception;", "public function testLoadFailesInServiceCreationWithCustomException()\n {\n $di = new DI();\n $service = 'failsWithException';\n\n $di->set($service, function () {\n throw new \\Exception(\"Failed creating service.\");\n });\n\n $di->get($service);\n }", "public function unpackRuntimeException() {\n\t\t$exception = new Exception();\n\t\t$actual = $this->handler->handleRenderingException('path', new RuntimeException('', 23, $exception, 'path2'));\n\n\t\t$this->assertEquals($this->handler->getMessage(), $actual, 'incorrect message received');\n\t\t$this->assertSame($exception, $this->handler->getException(), 'incorrect exception passed to stub');\n\t\t$this->assertEquals($exception->getReferenceCode(), $this->handler->getReferenceCode(), 'incorrect reference code passed to stub');\n\t\t$this->assertEquals('path2', $this->handler->getTypoScriptPath(), 'incorrect typo script path passed to stub');\n\t}", "public function testCustomExceptionHandler(){\n $this->expectException('Exception');\n $this->sandbox->whitelistType('Exception');\n $this->sandbox->setExceptionHandler(function($exception){\n throw $exception;\n });\n $this->sandbox->execute(function(){ throw new \\Exception; });\n }", "public function onException(Exception $exception);", "public function testIterationException(): void\n {\n $this->variant->setException(new \\Exception('foo'));\n $this->logger->variantEnd($this->variant);\n $this->assertStringContainsString('ERROR', $this->output->fetch());\n }", "public function report(Exception $e);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move Belt Belt will be limited to a maximum of 3 items
function moveBelt($belt, $random, $i) { // Increment Element for ($x = 0; $x < count($belt); $x++) { if (!empty($belt[$x])) { $belt[$x]->step = $belt[$x]->step + 1; } } // Handle Removal of Old array_unshift($belt, createObject($i, $random)); // store the item to drop off the belt $getDeletedItem = $belt[array_key_last($belt)]; array_pop($belt); // We have to tell what items are removed return (object) [ 'belt' => $belt, 'removed' => $getDeletedItem ]; }
[ "private function _limit()\r\n {\r\n list($a, $b, $c) = $this->_stack->splice(-3, 3);\r\n \r\n $this->_validate($a);\r\n $this->_validate($b);\r\n $this->_validate($c);\r\n \r\n if ($a >= $b && $a <= $c) {\r\n $this->_stack->push($a);\r\n } else {\r\n $this->_stack->push(null);\r\n }\r\n }", "function limitItemNB()\n{\n\tglobal $currShopcart;\n\t$incartitems = getFromIDs(array_keys($currShopcart));\n\n\tforeach ($incartitems as $i)\n\t{\n\t\tif ($currShopcart[$i['ID']] > $i['quantite'])\n\t\t{\n\t\t\t$currShopcart[$i['ID']] = $i['quantite'];\n\t\t}\n\t}\n}", "public function testUnlimitedSupplyBox(): void\n {\n $packer = new Packer();\n $packer->addBox(new TestBox('Light box', 100, 100, 100, 1, 100, 100, 100, 100));\n $packer->addBox(new TestBox('Heavy box', 100, 100, 100, 100, 100, 100, 100, 10000));\n\n $packer->addItem(new TestItem('Item', 100, 100, 100, 75, Rotation::BestFit), 3);\n\n /** @var PackedBox[] $packedBoxes */\n $packedBoxes = iterator_to_array($packer->pack(), false);\n\n self::assertCount(3, $packedBoxes);\n self::assertEquals('Light box', $packedBoxes[0]->box->getReference());\n self::assertEquals('Light box', $packedBoxes[1]->box->getReference());\n self::assertEquals('Light box', $packedBoxes[2]->box->getReference());\n }", "public function testLimitedSupplyBox(): void\n {\n // as above, but limit light box to quantity 2\n $packer = new Packer();\n $packer->addBox(new LimitedSupplyTestBox('Light box', 100, 100, 100, 1, 100, 100, 100, 100, 2));\n $packer->addBox(new TestBox('Heavy box', 100, 100, 100, 100, 100, 100, 100, 10000));\n\n $packer->addItem(new TestItem('Item', 100, 100, 100, 75, TestItem::ROTATION_BEST_FIT), 3);\n\n /** @var PackedBox[] $packedBoxes */\n $packedBoxes = iterator_to_array($packer->pack(), false);\n\n self::assertCount(3, $packedBoxes);\n self::assertEquals('Light box', $packedBoxes[0]->getBox()->getReference());\n self::assertEquals('Light box', $packedBoxes[1]->getBox()->getReference());\n self::assertEquals('Heavy box', $packedBoxes[2]->getBox()->getReference());\n }", "public function testUnlimitedSupplyBox(): void\n {\n $packer = new Packer();\n $packer->addBox(new TestBox('Light box', 100, 100, 100, 1, 100, 100, 100, 100));\n $packer->addBox(new TestBox('Heavy box', 100, 100, 100, 100, 100, 100, 100, 10000));\n\n $packer->addItem(new TestItem('Item', 100, 100, 100, 75, TestItem::ROTATION_BEST_FIT), 3);\n\n /** @var PackedBox[] $packedBoxes */\n $packedBoxes = iterator_to_array($packer->pack(), false);\n\n self::assertCount(3, $packedBoxes);\n self::assertEquals('Light box', $packedBoxes[0]->getBox()->getReference());\n self::assertEquals('Light box', $packedBoxes[1]->getBox()->getReference());\n self::assertEquals('Light box', $packedBoxes[2]->getBox()->getReference());\n }", "public function move_up($item_id);", "private static function func_pack_items(&$pending_items, $package_limits, $max_number_of_packs)\n {\n $packages = array();\n\n $stop_packing = false;\n\n $current_item_number = 0;\n $package_level = 1;\n\n // Scan a pending items array until it's empty or $stop_packing flag occured\n while (!empty($pending_items) && !$stop_packing) \n {\n // Get current package\n $current_package_id = 0;\n $current_package = self::func_get_current_package($packages, $current_package_id);\n\n // Get current item from pending items list\n $current_item = $pending_items[$current_item_number];\n\n // Always pack one item\n $current_item['amount'] = 1;\n\n $item_is_placed = false;\n\n // Check if item box weight do not exceeds package weight limit\n if (self::func_check_item_weight($current_item['weight'] + $current_package['box']['weight'], $package_limits) && self::func_check_item_price($current_item['price'] + $current_package['box']['price'], $package_limits)) \n {\n // Try to place item box into the package according to package dimensions limits\n $box = self::func_place_item_by_dimensions($current_item, $current_package, $package_limits, $package_level);\n if ($box)\n {\n $item_is_placed = true;\n }\n }\n\n // If item has been placed successfully...\n if ($item_is_placed) \n {\n // Add item box variant into the package\n $current_package = self::func_add_item_to_package($current_package, $box, $current_item, $package_level);\n // Add current item to the current package\n $packages[$current_package_id] = $current_package; // Save current package in the packages list\n // Update $pending_items\n self::func_update_pending_items_array($pending_items, $current_item_number);\n }\n // If item has not been placed...\n else \n {\n // Go to next item in pending items list\n $current_item_number++;\n\n // If next item is not available...\n if (!isset($pending_items[$current_item_number])) \n {\n $current_item_number = 0;\n // If current package level contains any items...\n if (!empty($current_package['level_'.$package_level]['items'])) \n {\n $package_level++; // Go to next package level\n }\n // If entire package contains any items...\n elseif (!empty($current_package['level_1']['items'])) \n {\n $duplicates = 0;\n while(self::func_check_duplicate_package($current_package, $pending_items)) \n {\n $packages[] = $current_package;\n $duplicates++;\n }\n\n if ($duplicates>0) \n {\n if(!empty($pending_items)) \n {\n $packages[] = self::func_create_new_package(); // Add new package...\n $package_level = 1; // ...and try to fill it out with first level\n }\n } \n else \n {\n $packages[] = self::func_create_new_package(); // Add new package...\n $package_level = 1; // ...and try to fill it out with first level\n }\n\n // check if the max number of packages is not exceeded\n if (count($packages) > $max_number_of_packs) \n {\n $stop_packing = true;\n break;\n }\n }\n // Stop packing if item could not be placed into package and package is empty\n else \n {\n $stop_packing = true;\n }\n }\n }\n } // while\n\n // Return error code if packing has been stopped\n if ($stop_packing) \n {\n $packages = null;\n return -1;\n }\n\n return $packages;\n }", "public function moveHigher() {\n\t\t$position = $this->_position_col();\n\t\t$prev \t = $this->prevItem();\n\t\t$prev->{$position} = $this->{$position};\n\t\t$this->{$position} = $this->{$position} - 1;\n\t\t$prev->save();\n\t\t$this->save();\n\t}", "function videoresource_item_move_up($item) {\n return move_item($item, 'up');\n}", "public function move_item_in_bag_with_different_category_to_the_backpack()\n {\n\n $user = new User('Durance');\n\n // Add gold bag\n $gold_category = new Category('Gold');\n $gold_bag = new Bag($gold_category);\n $user->addBag($gold_bag);\n\n // Add gold items to backpack\n for ($i = 0; $i < $user->backpack->size() + 1; $i++) {\n $name = \"Item\" . $i;\n $item = new Item($name, $gold_category);\n $user->addItem($item);\n }\n\n // Add ramdon item\n $random_item = new Item('Random', new Category());\n $user->addItem($random_item);\n\n // Organize user storages\n new Organize($user);\n\n $this->assertContains($random_item, $user->backpack->items);\n }", "protected function increaseCapacity()\n {\n $size = count($this);\n\n if ($size > $this->capacity) {\n $this->capacity = max(intval($this->capacity * 1.5), $size);\n }\n }", "public function moveDown()\n {\n // Moves previous lower ranked item above\n $curOrder = $this->order;\n if ($curOrder == 0) return; // This is already the lowest item, so cancel\n if ($prevItem = Group::where('order', '<', $curOrder)->first())\n {\n $this->order = $prevItem->order;\n $prevItem->order = $curOrder;\n $prevItem->save();\n $this->save();\n }\n }", "public function pack()\n {\n //$this->logger->debug(\"[EVALUATING BOX] {$this->box->getReference()}\");\n\n $packedItems = new ItemList;\n\n $layerWidth = $layerLength = $layerDepth = 0;\n\n $prevItem = null;\n\n while (!$this->items->isEmpty()) {\n\n $itemToPack = $this->items->extract();\n\n //skip items that are simply too heavy\n if ($itemToPack->getWeight() > $this->remainingWeight) {\n continue;\n }\n\n //$this->logger->debug(\"evaluating item {$itemToPack->getDescription()}\");\n //$this->logger->debug(\"remaining width: {$this->widthLeft}, length: {$this->lengthLeft}, depth: {$this->depthLeft}\");\n //$this->logger->debug(\"layerWidth: {$layerWidth}, layerLength: {$layerLength}, layerDepth: {$layerDepth}\");\n\n $nextItem = !$this->items->isEmpty() ? $this->items->top() : null;\n $orientatedItem = $this->findBestOrientation($itemToPack, $prevItem, $nextItem, $this->widthLeft, $this->lengthLeft, $this->depthLeft);\n\n if ($orientatedItem) {\n\n $packedItems->insert($orientatedItem->getItem());\n $this->remainingWeight -= $itemToPack->getWeight();\n\n $this->lengthLeft -= $orientatedItem->getLength();\n $layerLength += $orientatedItem->getLength();\n $layerWidth = max($orientatedItem->getWidth(), $layerWidth);\n\n $layerDepth = max($layerDepth, $orientatedItem->getDepth()); //greater than 0, items will always be less deep\n\n //allow items to be stacked in place within the same footprint up to current layerdepth\n $stackableDepth = $layerDepth - $orientatedItem->getDepth();\n $this->tryAndStackItemsIntoSpace($packedItems, $orientatedItem->getWidth(), $orientatedItem->getLength(), $stackableDepth);\n\n $prevItem = $orientatedItem;\n } else {\n\n $prevItem = null;\n\n if ($this->widthLeft >= min($itemToPack->getWidth(), $itemToPack->getLength()) && $this->isLayerStarted($layerWidth, $layerLength, $layerDepth)) {\n //$this->logger->debug(\"No more fit in lengthwise, resetting for new row\");\n $this->lengthLeft += $layerLength;\n $this->widthLeft -= $layerWidth;\n $layerWidth = $layerLength = 0;\n $this->items->insert($itemToPack);\n continue;\n } elseif ($this->lengthLeft < min($itemToPack->getWidth(), $itemToPack->getLength()) || $layerDepth == 0) {\n //$this->logger->debug(\"doesn't fit on layer even when empty\");\n continue;\n }\n\n $this->widthLeft = $layerWidth ? min(floor($layerWidth * 1.1), $this->box->getInnerWidth()) : $this->box->getInnerWidth();\n $this->lengthLeft = $layerLength ? min(floor($layerLength * 1.1), $this->box->getInnerLength()) : $this->box->getInnerLength();\n $this->depthLeft -= $layerDepth;\n\n $layerWidth = $layerLength = $layerDepth = 0;\n //$this->logger->debug(\"doesn't fit, so starting next vertical layer\");\n $this->items->insert($itemToPack);\n }\n }\n //$this->logger->debug(\"done with this box\");\n return new PackedBox($this->box, $packedItems, $this->widthLeft, $this->lengthLeft, $this->depthLeft, $this->remainingWeight);\n }", "function move_item($itemid, $to){\n\tglobal $inventory;\n\tif (!isset($inventory)){\n\t\tload_inventory();\n\t}\n\tset_item_pref(\"inventorylocation\",$to,$itemid);\n\tclear_weights();\n\tcalculate_weights();\n}", "function decrement_position_on_lower_items() {\n\t\tif ($this->in_list()) {\n\t\t\t$finder = $this->finder();\n\t\t\t\n\t\t\treturn $finder->update_all(\"$this->position_field = $this->position_field - 1\", $this->position_field.\" = \".($this->data[$this->position_field] + 1).\" AND \".$this->scope_condition());\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hr_drop() {\n\t\t$this->Move->dropItem();\n\t}", "public function packItems($item) {\n\t\tforeach ($item as $currentItem) {\n\t\t\t$packed = false;\n\n\t\t\t// Check if item will fit in any open boxes\n\t\t\tfor ($i = 0; $i < count($this->box) && !$packed; $i++) {\n\t\t\t\tif ($this->box[$i]->getFreeCapacity() >= $currentItem->getShippingWeight()) {\n\t\t\t\t\t$this->box[$i]->packItem($currentItem);\n\t\t\t\t\t$packed = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If a new box needs to be opened\t\n\t\t\tif (!$packed) {\n\t\t\t\t$this->box[$i] = new Box(($i + 1), 10);\n\t\t\t\t$this->box[$i]->packItem($currentItem);\n\t\t\t}\n\t\t}\n\t}", "function moveItemUp()\n\t{\n\t\t$li =& $this->getNode();\n\t\t$prev =& $li->previous_sibling();\n\t\t$li_copy = $li->clone_node(true);\n\t\t$li_copy =& $prev->insert_before($li_copy, $prev);\n\t\t$li->unlink($li);\n\t}", "private function adjustCapacity()\n {\n $size = count($this);\n\n // Automatically truncate the allocated buffer when the size of the\n // structure drops low enough.\n if ($size < $this->capacity / 4) {\n $this->capacity = max(self::MIN_CAPACITY, $this->capacity / 2);\n } else {\n\n // Also check if we should increase capacity when the size changes.\n if ($size >= $this->capacity) {\n $this->increaseCapacity();\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check to see if date is a future date
function is_future_date($val) { return is_after_date($val, date("Y-m-d 00:00:00")); }
[ "public function isFuture()\n {\n $today = mktime(23, 59, 59, date('m'), date('d'), date('Y'));\n if ($this->from->format('U') > $today) {\n return true;\n }\n\n return false;\n }", "function in_future( $dt = null ) {\n\n\treturn !in_past( $dt );\n\n}", "function isFuture()\r\n {\r\n $agora = new Date();\r\n if($this->after($agora)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function testIsNotFuture()\n {\n //if not set, throw error\n date_default_timezone_set('Europe/Paris');\n $date = new \\DateTime('12/14/2010 00:00:00');\n $bool = DateTimeValidator::isFuture($date);\n $this->assertFalse($bool);\n }", "function is_future(): bool {\r\n\t\treturn $this->dt > JKNTime::dt_now();\r\n }", "function isUpcoming() {\n $now = DateTimeValue::now();\n \n $due_on = $this->getDueOn();\n if(instance_of($due_on, 'DateTimeValue')) {\n return ($due_on->getTimestamp() > $now->getTimestamp()) && !$this->isToday();\n } // if\n return false;\n }", "public function checkFutureDate($check) {\n\t\t$value = array_values($check);\n\t\treturn CakeTime::fromString($value['0']) >= CakeTime::fromString(date('Y-m-d'));\n\t}", "public function future(): bool\n {\n $now = new Date();\n $condition1 = intval($now->format(\"Y\")) < $this->month->getYear();\n $condition2 = $this->month->is()->currentYear()\n && intval($now->format(\"m\")) < $this->month->getMonthNum();\n\n return $condition1 || $condition2;\n }", "public function isfuture($d) {\n\t\treturn floor(\n\t\t\t(strtotime($d) - strtotime(date($this->dateformat)))\n\t\t\t/ (60 * 60 * 24)\n\t\t) > 1;\n\t}", "public function isFuture()\n {\n return $this->gt(static::now($this->tz));\n }", "public function isInFuture(): bool\n {\n if ($this->date_start > Carbon::now())\n {\n return true;\n }\n\n return false;\n }", "public function InFuture()\n {\n return strtotime($this->value ?? '') > DBDatetime::now()->getTimestamp();\n }", "public function isFuture()\n {\n return !$this->isPast();\n }", "function checkIfInThePast($date) {\n // set today date\n $today = date('Ymd');\n // if date is less than today\n if (strtotime($date) < strtotime($today)) {\n // return true\n // i.e. yes date is in the past\n return true;\n } // if\n }", "public function timeFutureChecker()\n {\n $now = app_now();\n if (date_greater_than($this->entry->entry_time,$now)) {\n $this->build_error([\n 'message' => 'Please the last entry time can not be a future time'\n ]);\n }\n }", "public function check_is_upcoming()\n\t{\n\t\t$event_date = (!empty($this->event_details['to_date']))?$this->event_details['to_date']:$this->event_details['from_date'];\n\t\tif(strtotime($event_date) >= strtotime(date('d-m-Y')))\n\t\t{\n\t\t\t$this->is_upcoming = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->is_upcoming = false;\n\t\t}\n\t}", "public function testDateCannotBeFuture()\r\n {\r\n $this->collectionHistory->setDateCollected(new DateTime('2020-1-1'));\r\n $error = $this->validator->validate($this->collectionHistory);\r\n $this->assertEquals(1, count($error));\r\n }", "private function checkDate()\n {\n return (strtotime('now') <= $this->coupon->getEndDate());\n\n }", "function isPast()\r\n {\r\n $agora = new Date();\r\n if($this->before($agora)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests company car use deduction
public function testCarUseDeduction(): void { $employees = $this->getEmployeesFixtures(); $this->calculator->setOperation(new CarUseDeduction()); foreach ($employees as $employee) { $employeeEntity = (new Employee()) ->setName($employee['name']) ->setAge($employee['age']) ->setKids($employee['kids']) ->setSalary($employee['salary']) ->setUseCompanyCar($employee['useCompanyCar']); $this->calculator->setEmployee($employeeEntity); $this->calculator->calculateSalary(); self::assertEquals($employee['useCompanyCar'] ? $employee['salary'] - CarUseDeduction::COMPANY_USE_CAR_DEDUCTION : $employee['salary'], $this->calculator->getSalary()); } }
[ "public function testPriceTarget()\n {\n }", "public function testRecognizeDetectVehicleLicensePlates()\n {\n }", "public function testAutoCharge()\n {\n }", "public function testMortgageCalculatorHomePrice()\n {\n }", "public function testTermOverBeforeBaseWarrantySuccess(){\n $coverage = array(\"name\" => \"120 Months/120,000 Miles\", \"terms\" => 120, \"miles\" => 120000);\n $test_car = CarFactory::create('Audi', 24, 10000, 700, 2019, 42);\n $test_car->setVehicleAgeMonths();\n $test_car->testTermOverBeforeBaseWarranty($coverage);\n $this->assertEquals($test_car->coverage_granted, 'SUCCESS');\n\n }", "public function testCompanyRevenueEstimates()\n {\n }", "public function testCompanyBasicFinancials()\n {\n }", "public function testCadastresBuyAndSave()\n {\n }", "public function usingCompanyCar()\r\n {\r\n if ($this->usingCar) {\r\n\r\n $this->salary = $this->salary - static::$carLeasePrice;\r\n\r\n }\r\n\r\n }", "public function testRetirementCalculatorExpenses()\n {\n }", "public function testMortgageCalculatorDownPayment()\n {\n }", "public function testOrderEightWheelCar()\n {\n $car = new Car('black', 8, 3);\n\n $order = new Order($car);\n\n $order->getOrderDetails();\n }", "public function testManualSettle()\n {\n }", "public function testCompanyExecutive()\n {\n }", "public function testOrderBlueCar()\n {\n $car = new Car('blue', 4, 3);\n\n $order = new Order($car);\n\n $order->getOrderDetails();\n }", "public function testCrceTariffGetAvailablePlansCustomer()\n {\n\n }", "public function testCrceTariffActivatePlan()\n {\n\n }", "public function testGetProductByOcpc()\n {\n }", "public function testForexRates()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show Devices by Site ID
public function showDeviceBySiteId(Request $request,$id) { if ($request->ajax()) { $results = DeviceSite::where('site_id',$id)->get(); return view('admin::sites.device-sites',compact('results')); } }
[ "function show($id = null) {\n\t\treturn $this->getDevice($id);\n\t}", "public function view($id){\n return $this->get('inventory/devices/'.rawurlencode($id));\n }", "public function view_detail_host($id)\n\t{\n\t\t$data['title'] = 'Detail Host';\n\t\t$data['warning'] = '';\n\n\t\t$this->load->model('m_device');\n\t\t$data['host'] = $this->m_device->get_detail_device($id);\n\t\t$data['username'] = $this->session->userdata('username');\n\n\n\t\t$this->load->view('subadmin/detail_host', $data);\n\t}", "protected function indexDevices() {\n $this->devices = [];\n $devices = $this->config->get('devices');\n foreach ($devices as $device) {\n $type = val('type', $device, 'unknown');\n $id = val('id', $device, 'unknown');\n $deviceKey = sprintf(self::DEVICE_KEY_FORMAT, $type, $id);\n\n $this->devices[$deviceKey] = $device;\n }\n }", "public function getDevices_by_id($id='1') {\n\t\tif(!empty($_POST)) {\n\t\t\t$id = $_POST['id'];\n\t\t}\n\t\treturn $this->db->getDevice_by_id($id);\n\t}", "public function displaySiteSessions() {\n\t\t$query = \"select sessionID from {$GLOBALS[\"database\"]}.session where site = '{$this->site}'\";\n\t\t$sessions = $this->connection->query($query);\n\t\twhile ($row = $sessions->fetch_assoc()) {\n\t\t\t$session = new Session($row['sessionID']);\n\t\t\t$session->display();\n\t\t}\n\t}", "public function secondary() {\n $params = array('email'=> $this->session->userdata('email'), 'level'=> 1);\n $respond = json_decode($this->curl->simple_get($this->API.'/memberdeviceman', $params));\n $data['device'] = $respond->result;\n $this->load->view('member/v_device_list_sc', $data);\n }", "public function getWebSitesData($websitesid=0)\r\n {\r\n $websitesid=0;\r\n if(isset($_SESSION['user']['webSites']) and $_SESSION['user']['webSites']!=NULL)\r\n {\r\n $websitesid=$_SESSION['user']['webSites'];\r\n }\r\n \r\n \r\n\r\n \r\n /*$serial=$_POST['serial'];\r\n if ($_POST['action'] != 'getDeviceData') {\r\n return \"Invalid action supplied for retrive Device Data.\";\r\n }*/\r\n $sql = 'SELECT `WebSites_URL`, `WebSites_Name`, `logo`, `icon` FROM `websites` WHERE `WebSites_Id` in ('.$websitesid.')';\r\n$msg='';\r\n try {\r\n \r\n $result = $this->query($sql);\r\n $webarr[]='';\r\n if ($result > 0) {\r\n\r\n \r\n return $result;\r\n }\r\n else { \r\n return FALSE;\r\n \r\n }\r\n \r\n \r\n } catch (PDOException $e) {\r\n \r\n return( 'error pdo ' . $e->getMessage());\r\n }\r\n //echo json_encode(array(\"phone\"=>'123-12313',\"email\"=>'test@test.com','city'=>'Medicine Hat','address'=>'556 19th Street NE'));\r\n \r\n //return;\r\n }", "public function getDevice($id){\n return $this->getOfType(\n \"https://platform.vin.li/api/v1/devices/\".$id,\n \"Device\"\n );\n }", "public function get_devices(){\n $settingsObj = DPSFolioAuthor_Settings::getInstance();\n\t\t $settings = $settingsObj->get_settings();\n return isset($settings[\"devices\"]) ? $settings[\"devices\"] : $this->initial_devices();\n\t\t}", "static function load_snips_devices()\n {\n // fetch the device that runs hotword detector\n $devices = Toml::parseFile(\n dirname(__FILE__) .'/../../config_running/snips.toml'\n )->{'snips-hotword'}->{'audio'};\n\n // fetch the site id of the master device\n $master = Toml::parseFile(\n dirname(__FILE__) . '/../../config_running/snips.toml'\n )->{'snips-audio-server'}->{'bind'};\n\n if (isset($master)) {\n $master = substr($master,0,strpos($master, '@'));\n } else {\n $master = 'default';\n }\n\n // add master device site id in to plugin config\n $res = config::save('masterSite', $master, 'snips');\n\n $lang = snips::get_assistant_language();\n if (count($devices) == 0) {\n self::create_snips_device('default', $lang);\n }else{\n foreach ($devices as $key => $device) {\n $site_id = str_replace('@mqtt', '', $device);\n self::create_snips_device($site_id, $lang);\n }\n }\n }", "abstract public function listDevices();", "function findById($_id) {\n\t\treturn $this->Store->read(\"Device_{$_id}\");\n\t}", "function widgetopts_tabcontent_devices( $args ){\n $desktop = '';\n $tablet = '';\n $mobile = '';\n $options_role = '';\n if( isset( $args['params'] ) && isset( $args['params']['devices'] ) ){\n if( isset( $args['params']['devices']['options'] ) ){\n $options_role = $args['params']['devices']['options'];\n }\n if( isset( $args['params']['devices']['desktop'] ) ){\n $desktop = $args['params']['devices']['desktop'];\n }\n if( isset( $args['params']['devices']['tablet'] ) ){\n $tablet = $args['params']['devices']['tablet'];\n }\n if( isset( $args['params']['devices']['mobile'] ) ){\n $mobile = $args['params']['devices']['mobile'];\n }\n }\n ?>\n <div id=\"extended-widget-opts-tab-<?php echo $args['id'];?>-devices\" class=\"extended-widget-opts-tabcontent extended-widget-opts-tabcontent-devices\">\n <p>\n <strong><?php _e( 'Hide/Show', 'widget-options' );?></strong>\n <select class=\"widefat\" name=\"<?php echo $args['namespace'];?>[extended_widget_opts][devices][options]\">\n <option value=\"hide\" <?php if( $options_role == 'hide' ){ echo 'selected=\"selected\"'; }?> ><?php _e( 'Hide on checked devices', 'widget-options' );?></option>\n <option value=\"show\" <?php if( $options_role == 'show' ){ echo 'selected=\"selected\"'; }?>><?php _e( 'Show on checked devices', 'widget-options' );?></option>\n </select>\n </p>\n <table class=\"form-table\">\n <tbody>\n <tr valign=\"top\">\n <td scope=\"row\"><strong><?php _e( 'Devices', 'widget-options' );?></strong></td>\n <td>&nbsp;</td>\n </tr>\n <tr valign=\"top\">\n <td scope=\"row\"><span class=\"dashicons dashicons-desktop\"></span> <label for=\"extended_widget_opts-<?php echo $args['id'];?>-devices-desktop\"><?php _e( 'Desktop', 'widget-options' );?></label></td>\n <td>\n <input type=\"checkbox\" name=\"<?php echo $args['namespace'];?>[extended_widget_opts][devices][desktop]\" value=\"1\" id=\"extended_widget_opts-<?php echo $args['id'];?>-devices-desktop\" <?php if( !empty( $desktop ) ){ echo 'checked=\"checked\"'; }?> />\n </td>\n </tr>\n <tr valign=\"top\">\n <td scope=\"row\"><span class=\"dashicons dashicons-tablet\"></span> <label for=\"extended_widget_opts-<?php echo $args['id'];?>-devices-table\"><?php _e( 'Tablet', 'widget-options' );?></label></td>\n <td>\n <input type=\"checkbox\" name=\"<?php echo $args['namespace'];?>[extended_widget_opts][devices][tablet]\" value=\"1\" id=\"extended_widget_opts-<?php echo $args['id'];?>-devices-table\" <?php if( !empty( $tablet ) ){ echo 'checked=\"checked\"'; }?> />\n </td>\n </tr>\n <tr valign=\"top\">\n <td scope=\"row\"><span class=\"dashicons dashicons-smartphone\"></span> <label for=\"extended_widget_opts-<?php echo $args['id'];?>-devices-mobile\"><?php _e( 'Mobile', 'widget-options' );?></label></td>\n <td>\n <input type=\"checkbox\" name=\"<?php echo $args['namespace'];?>[extended_widget_opts][devices][mobile]\" value=\"1\" id=\"extended_widget_opts-<?php echo $args['id'];?>-devices-mobile\" <?php if( !empty( $mobile ) ){ echo 'checked=\"checked\"'; }?> />\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n<?php\n}", "function get_device($id) {\r\n\t\t$sql = \"SELECT * FROM oa_device WHERE device_id = ? LIMIT 1\";\r\n\t\t$data = array(\"$id\");\r\n\t\t$query = $this->db->query($sql, $data);\r\n\t\t$result = $query->result();\r\n\t\treturn ($result);\r\n\t}", "function process_devs_disp($host_data)\n{\n global $id;\n\n $i = 0;\n $table = \"\";\n\n $arr = array ('command'=>'devs','parameter'=>'');\n $devs_arr = send_request_to_host($arr, $host_data);\n\n if ($devs_arr != null)\n {\n $id = $host_data['id'];\n while (isset($devs_arr['DEVS'][$i]))\n {\n $table .= process_dev_disp($devs_arr['DEVS'][$i]);\n $i++;\n }\n }\n\n return $table;\n}", "function devindavid_site_info() {\n\t\tdo_action( 'devindavid_site_info' );\n\t}", "function device(){\r\n\t$devices = [\r\n\t\t\"computer\"=>\"Computer\",\r\n\t\t\"desktop\"=>\"Desktop\",\r\n\t\t\"laptop\"=>\"Laptop\",\r\n\t\t\"tablet\"=>\"Tablet\"\r\n\t];\r\n\tif(isset($_GET['device'])){\r\n\t\t$default_device = $_GET['device'];\r\n\t\tif(isset($devices[$default_device])){\r\n\t\t\treturn $devices[$default_device];\r\n\t\t}else{\r\n\t\t\tthrow new Exception('Unknown device');\r\n\t\t}\r\n\t}else{\r\n\t\tthrow new Exception('Unknown device');\r\n\t}\r\n}", "public function display_app_id() {\n\t\t// Now grab the options based on what we're looking for\n\t\t$opts = get_option( 'emcl_settings' );\n\t\t$emc_client_id = isset( $opts['emc_client_id'] ) ? $opts['emc_client_id'] : '';\n\t\t// And display the view\n\t\tinclude_once $this->views . 'settings-app-client-id-field.php';\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a new column to thehidden column property
protected function hideColumn($column) { $this->hidden[] = $column; }
[ "public function addColumn($column)\r\n {\r\n if(is_array($column)) {\r\n $column = new Columns\\Column($column);\r\n }\r\n\r\n if(is_scalar($column)) {\r\n $column = new Columns\\Column(array('name'=>$column));\r\n }\r\n\r\n $column->setTable($this);\r\n\r\n $this->javascript .= $column->getJavaScript();\r\n\r\n // if column is not meant to be visible, like for admin reasons, take it out of the visible columns\r\n if( !$column->isVisible() && is_array( $this->visibleColumns ) ) {\r\n $flip = array_flip( $this->visibleColumns );\r\n unset( $flip[$column->name] );\r\n $this->visibleColumns = $flip;\r\n }\r\n\r\n if( ! $this->noFilters && $this->visibleColumns != false && ! in_array($column->name, $this->visibleColumns)) {\r\n $column->visible = false;\r\n }\r\n\r\n if( $column->isVisible() ) {\r\n $this->headers[] = 1;\r\n }\r\n\r\n $this->columns[] = $column;\r\n\r\n $this->setTableFooter($column);\r\n return $this;\r\n }", "abstract protected function addColumns();", "public function addColumns()\n {\n $this->addColumn([\n 'index' => 'id',\n 'label' => 'ردیف',\n 'type' => 'number',\n 'searchable' => false,\n 'sortable' => true,\n 'filterable' => false\n ]);\n\n $this->addColumn([\n 'index' => 'category_name',\n 'label' => 'نام دسته بندی',\n 'type' => 'string',\n 'searchable' => false,\n 'sortable' => false,\n 'filterable' => false\n ]);\n $this->addColumn([\n 'index' => 'description',\n 'label' => 'توضیحات',\n 'type' => 'string',\n 'searchable' => false,\n 'sortable' => false,\n 'filterable' => false\n ]);\n }", "public static function addColumns();", "public function HideColumn()\n {\n $this->hiddenColumns = array_unique(func_get_args());\n }", "public function addViewColumn(CodeGeneratorColumn $column){\n\t\t$column->setReadOnly(true);\n//\t\tif($column->getKey() == CodeGeneratorColumn::KEY_PRIMARY){\n//\t\t\t$this->setPrimaryKey($column);\n//\t\t}\n\t\treturn $this->columns[$column->getName()] = $column;\n\t}", "public function addColumn() {\n\t\t\tif ($this->strQueryType == self::SELECT_QUERY) {\n\t\t\t\t$strColumnMethod = 'addSelectColumn';\n\t\t\t} else {\n\t\t\t\t$strColumnMethod = 'addAlterColumn';\n\t\t\t}\n\t\t\t\n\t\t\t$arrFunctionArgs = func_get_args();\n\t\t\tcall_user_func_array(array($this, $strColumnMethod), $arrFunctionArgs);\n\t\t}", "function add_column( $columns ) {\n\t$columns['has_blocks'] = __( 'Has blocks', 'shiro' );\n\n\treturn $columns;\n}", "public function hidden(): Column\n {\n return $this->booleanAttribute('visible', false);\n }", "public function addNewColumn($columnName);", "public function newColumn() {\n $this->column = new \\WBW\\Bundle\\HighchartsBundle\\API\\Chart\\PlotOptions\\HighchartsColumn();\n return $this->column;\n }", "protected function addColumns()\r\n {\r\n $content = '';\r\n\r\n foreach( $this->model->getProperties() as $field => $type ) {\r\n\r\n if(!$this->tableHasColumn($field)) {\r\n $this->columnsChanged = true;\r\n $rule = \"\\t\\t\\t\";\r\n\r\n // Primary key check\r\n if ( $field === 'id' and $type === 'integer' )\r\n $rule .= $this->increment();\r\n else {\r\n $rule .= $this->setColumn($this->model->validTypes[$type], $field);\r\n\r\n if ( !empty($setting) )\r\n $rule .= $this->addColumnOption($setting);\r\n }\r\n\r\n array_push($this->columnsAdded, $field);\r\n\r\n $content .= $rule . \";\\n\";\r\n }\r\n }\r\n\r\n return $content;\r\n }", "private function _generateColumns()\n\t\t{\n\t\t\tif( $this->dataSource )\n\t\t\t{\n\t\t\t\t$this->columns = new GridViewColumnCollection($this);\n\n\t\t\t\tforeach( $this->dataSource->fieldMeta as $field )\n\t\t\t\t{\n\t\t\t\t\tif( !$field->primaryKey )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( $field->boolean )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->addColumn( new GridViewColumn( $field->name, ucwords( str_replace( '_', ' ', $field->name )), \"%{$field->name}%?'Yes':'No'\" ));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif( $field->blob )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->addColumn( new GridViewColumn( $field->name, ucwords( str_replace( '_', ' ', $field->name ))));\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}", "function addColumn($columnName, $dataType, $extraStuff = \"\", $primaryKey = false) {\n $this->columns[] = new DbColumn($columnName, $dataType, $extraStuff, $primaryKey);\n }", "public function columnPreview()\n {\n }", "public function addHiddenColumns(array $columns) {\n\t\t$this->select_columns = array_merge($this->select_columns, $columns);\n\t\t$this->hidden_columns = array_merge($this->hidden_columns, $columns);\n\t}", "public function setHiddenColumns ($c)\n {\n $this->hiddenColumns = $c;\n }", "abstract protected function buildAddColumns();", "function post2home_add_column( $columns ) {\n global $post_type;\n \n if ( $post_type == 'post' )\n $columns['post2home-feature'] = __( 'Feature', 'post2home' );\n \n return $columns;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get mangerid from login userid
public static function getloginMgr($userId = NULL){ $loginmgr = ''; if($userId){ $loginmgr = DB::select( DB::raw("SELECT manager_id FROM users WHERE id=".$userId) ); return $loginmgr[0]->manager_id; } return $loginmgr; }
[ "public function getMangerId($userId){\n $user = new User;\n return $user->getMangerId($userId);\n }", "public function getManagerID() {\n\t\tif ($this->userType == \"Team\") {\n\t\t\t$userManger = $this->manager;\n\t\t}\n\t\telse {\n\t\t\t$userManger = $this->id;\n\t\t}\n\n\t\treturn $userManger;\n\t}", "function get_id_user($login)\n{\n return (get_user_id($login));\n}", "public function get_user_id();", "public function get_login_user_id()\n\t{\n\t\n\t\treturn 1;\n\t}", "public function getMUserId()\n {\n return $this->m_user_id;\n }", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "function cm_get_moodleuserid($userid) {\n global $CFG, $DB;\n require_once elispm::lib('data/user.class.php');\n\n $select = 'SELECT mu.id ';\n $from = 'FROM {'. user::TABLE .'} cu ';\n $join = 'INNER JOIN {user} mu ON mu.idnumber = cu.idnumber AND mu.mnethostid = ? AND mu.deleted = 0 ';\n $where = 'WHERE cu.id = ? ';\n return $DB->get_field_sql($select.$from.$join.$where, array($CFG->mnet_localhost_id, $userid));\n}", "public function get_uid();", "private function get_uid() {\n\t\t$user = wp_get_current_user();\n\t\t$uid = $user->user_login;\n\t\treturn $uid;\n\t}", "public function getid(){\r\n\t\tif($this::isLoggedIn()){\r\n\t\t\t$id2=$this->id;\r\n\t\t\treturn $id2;}\r\n\t\telse {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\t//throw new Exception('Nessun utente loggato!');}\r\n\t}", "function GetMyUserid() {\n if(IsLoggedIn()) {\n return $_SESSION[\"userid\"];\n }\n }", "public function get_login_user_id() {\n\t\treturn $this->login_user_id;\n\t}", "public function getLoginIdentifier(): string\n {\n return $this->getUserId() ?? $this->data['sub'];\n }", "function user_id()\n{\n global $userquery;\n if ($userquery->userid != '' && $userquery->is_login)\n return $userquery->userid; else\n false;\n}", "public function getUserid()\n {\n return $this->userid;\n }", "function get_user_id(){\n\t\tif($this->is_user_loggedin())\n\t\t\treturn $this->session->userdata('sb_auth')['user_id'];\n\t\t\n\t\treturn 0;\n\t}", "public function getLoginUserId(){\n $auth = Zend_Auth::getInstance();\n if($auth->hasIdentity())\n {\n return $loginUserId = $auth->getStorage()->read()->id;\n }else{\n\t\t\treturn 1;\n\t\t}\n }", "public function getUserId(){\n\t\t\t$loginId = $this->loginId;\n\t\t\t$userId = '';\n\t\t\t$query = \"SELECT user_id FROM \" . USERS . \" WHERE email='$loginId' OR mobile='$loginId'\";\n\t\t\t$db = $this->db;\n\t\t\t$resultMap = $db->selectOperation($query);\n\t\t\t// file_put_contents(\"testlog.log\", \"\\n\".print_r($resultMap, true), FILE_APPEND | LOCK_EX);\n\t\t\t$userId = $resultMap['result_data'][0]['user_id'];\n\t\t\treturn $userId;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Total Age of Athletes property
function getTotalAgeOfAthletes() { return $this->_total_age_of_athletes ; }
[ "function setTotalAgeOfAthletes($txt)\n {\n $this->_total_age_of_athletes = $txt ;\n }", "public function getage()\n {\n return $this->age;\n }", "function getAge()\n\t{\n\t\treturn $this->age * 365;\n\t}", "public function getAge()\r\n {\r\n return $this->_age;\r\n }", "public function getAthleteCount() \n {\n return Athlete::count();\n }", "public function get_age()\n {\n return $this->_age;\n }", "public function getAge(){\n\t\treturn $this->age;\n\t}", "public function getAge()\n\t{\n\t}", "private function getAgeLoad(): int\n {\n return $this->formula(self::collectAges($this->data->get('age')))->sum();\n }", "public function getAge()\n\t{\n\t\treturn $this->age;\n\t}", "public function calcAgeDataProvider() {}", "public function getAge(): int\n {\n return $this->_age;\n }", "public function getAges()\n {\n $ageResponse = app(Analytics::class)->performQuery(\n Period::days(365),\n 'ga:users,ga:sessions',\n [\n 'dimensions' => 'ga:userAgeBracket',\n 'filters' => $this->filter,\n ]\n );\n if (isset($ageResponse['rows'])) {\n foreach ($ageResponse['rows'] as $row) {\n $this->age[] = [\n 'value' => $row[0],\n 'visitors_number' => $row[1],\n ];\n };\n }\n\n return ($this->age);\n }", "function getAgeGroupAge()\n {\n return ($this->__agegroupage) ;\n }", "public function getAgeInfo()\n {\n return $this->ageInfo;\n }", "public function getAge()\n {\n $now = (int)(new \\DateTime())->format('Y');\n return $now - $this->getYearOfBirth();\n }", "public function get_average_age_engineers()\n { \n echo $this->get_average_age('engineers'); \n }", "public function calcAge()\n {\n $now = new DateTime();\n $dob = new DateTime($this->dob);\n $this->age = $now->diff($dob)->y;\n }", "public function getPatientAgeAttribute()\n {\n return $this->patient_age();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ this function is used for material records / this function is used to show available tube from raw materials
public function showAvailable_Tube($material_id, $Material_ID, $Material_OD, $Material_LENGTH){ $criteriaForAvailableTube = ManageEnquiry_model::CheckCriteriaForAvailableTube($material_id, $Material_ID, $Material_OD, $Material_LENGTH); return ($criteriaForAvailableTube); }
[ "public static function availableSurfaces(){}", "public function listTubeUsed(){ }", "public function view_rawmaterials() {\n $data[\"get_rawmaterials\"] = $this->rawmaterial_model->get_rawmaterials();\n $data[\"get_packmaterials\"] = $this->rawmaterial_model->get_packingmaterials();\n $this->load->view('system/rawmaterial_management/manage_rawmaterials/view_rawmaterials', $data);\n }", "abstract protected function get_surfaces();", "public function kmMediaKitList(){\n $km_render = (int)$_REQUEST['km_render'];\n $type = $_REQUEST['type'];\n $uid = \\Drupal::currentUser()->id();\n $data = array();\n if($km_render !== 0){\n $media = Media::load($km_render);\n $media_data = [];\n $media_data['name'] = $media->name->value;\n $media_data['achived'] = $media->field_archived->value;\n $media_data['copyright'] = $media->field_copyright_number->value;\n $media_data['favorite'] = $media->field_favorite->value;\n $media_data['description'] = $media->field_description_plain_text->value;\n $tags_name = '';\n foreach ($media->get('field_keywords')->getValue() as $term_id){ \n if($term_id['target_id']){\n $tags_name .= \\Drupal\\taxonomy\\Entity\\Term::load($term_id['target_id'])->label() . ', ';\n }\t\t\t\t\t \n }\n $media_data['tags'] = $tags_name;\n\t\t //current used in mkit\n\t\t\t$md = new MediaDetailController();\n\t\t\tif($type == 'pdf'){\n $mediaList = $md->getallMediaByfile($media, 'text');\n }\n else {\n $mediaList = $md->getallMediaByfile($media, 'image');\n }\n\t\t\t$media_data['used_mkit'] = $mediaList;\n $data['media_data'] = $media_data;\n // get default media kit\n $data['default_kit'] = $this->getDefaultMediaKit($uid);\n // get media kits\n $query_media_kit = \\Drupal::database()->select('node_field_data', 'n')\n ->fields('n', ['nid', 'title'])\n ->condition('n.uid', $media->getOwnerId(), '=')->condition('n.type', 'media_kit', '=');\n $nids_media_kit = $query_media_kit->execute()\n ->fetchAll();\n $data['media_kit'] = $nids_media_kit;\n }\n else {\n // get default media kit\n $data['default_kit'] = $this->getDefaultMediaKit($uid);\n // get media kits\n $query_media_kit = \\Drupal::database()->select('node_field_data', 'n')\n ->fields('n', ['nid', 'title'])\n ->condition('n.uid', $uid, '=')->condition('n.type', 'media_kit', '=');\n $nids_media_kit = $query_media_kit->execute()\n ->fetchAll();\n $data['media_kit'] = $nids_media_kit;\n }\n\t\treturn new JsonResponse($data);\n }", "public function fetch_raw_material_data(){\n\t\t\t$this->load->model('add_product_m');\n\t\t\t$raw_id = $this->input->post('raw_id');\n\t\t\t$fetch_raw_data = $this->add_product_m->get_raw_materials($raw_id);\n\t\t\techo json_encode($fetch_raw_data);\n\t\t\t\n\t\t}", "protected function _getMaterials()\n\t{\n\t\t$this->materials = $this->_dbr->getAssoc(\"select id, (select value from translation \n\t\t\twhere table_name='sa_material' and field_name='name' and language='english' and id=sa_material.id)\n\t\t\tfrom sa_material order by ordering\");\n\t}", "public function listing_material()\n {\n $this->auto_render = FALSE;\n\n if (!request::is_ajax())\n return FALSE;\n\n $v = new View('mapping/material');\n $v->material = file::listing_dir(DOCROOT . '../images/background/');\n $v->render(TRUE);\n }", "function wear($eid, $vid, $type, $powertype) \n{\n global $player;\n global $db;\n if ($type != 'ring1' && $type != 'ring2')\n {\n\t$item1 = $db -> Execute(\"SELECT `id`, `name`, `power`, `amount`, `wt` FROM `equipment` WHERE `id`=\".$eid.\" AND `owner`=\".$player->id.\" AND `status`='U'\");\n }\n else\n {\n\t$item1 = $db -> Execute(\"SELECT `id`, `name`, `power`, `amount` FROM `equipment` WHERE `id`=\".$eid.\" AND `owner`=\".$player->id.\" AND `status`='U' AND (`name` LIKE '%siły' OR `name` LIKE '%zręczności' OR `name` LIKE '%wytrzymałości' OR `name` LIKE '%szybkości')\");\n }\n if (!$item1->fields['id'])\n {\n\terror(ERROR);\n }\n $item = array($item1 -> fields['name'], ceil($item1 -> fields['power'] / 10));\n $info = $item[0].I_POWER.$item[1].\") \";\n if ($type != 'arrows')\n {\n\tif ($item1 -> fields['amount'] == 1) \n\t {\n\t $db -> Execute(\"DELETE FROM `equipment` WHERE `id`=\".$eid.\" AND `owner`=\".$player -> id);\n\t } \n\telse \n\t {\n\t $db -> Execute(\"UPDATE `equipment` SET `amount`=`amount`-1 WHERE `id`=\".$eid.\" AND `owner`=\".$player -> id);\n\t }\n }\n else\n {\n\tif ($item1->fields['wt'] < 20)\n\t {\n\t error(\"Nie masz tylu strzał.\");\n\t }\n\tif ($item1->fields['wt'] == 20)\n\t {\n\t $db -> Execute(\"DELETE FROM `equipment` WHERE `id`=\".$eid.\" AND `owner`=\".$player -> id);\n\t } \n\telse \n\t {\n\t $db -> Execute(\"UPDATE `equipment` SET `wt`=`wt`-20 WHERE `id`=\".$eid.\" AND `owner`=\".$player -> id);\n\t }\n }\n $item1 -> Close();\n $db -> Execute(\"UPDATE `outpost_veterans` SET `\".$type.\"`='\".$item[0].\"', `\".$powertype.\"`=\".$item[1].\" WHERE `id`=\".$vid);\n return $info;\n}", "function TubeView(&$pxl, $src, $radius, $turbulence, $fade1, $fade2, $center, $bgColor) {}", "function voer_api_get_materials_by_types($types = array()){\n $voer = new VoerApi();\n $url = VOER_API_COMMAND_MATERIAL . \"?material_type=\" . implode(\",\", $types);\n $response = $voer->auth_request($url);\n // $client = voer_api_client();\n // $response = $client->doGet(VOER_API_COMMAND_MATERIAL . \"?material_type=\" . implode(\",\", $types));\n return json_decode($response);\n}", "public function tubes();", "function getShows($quantity) {\n $shows_url = \"https://api.artsy.net/api/shows?status=current&size=\".$quantity.\"&xapp_token=\".$this->token;\n $shows_json = file_get_contents($shows_url);\n $shows_array = json_decode($shows_json, true)['_embedded']['shows'];\n\n return $shows_array;\n }", "function showAvailableEpisodes($seriesname,$agent,$accesslevel,$videoServer,$fullSeriesName,$seoname,$canDownload,$type){\n\t\t\t$query = mysqli_query($conn, \"SELECT id FROM episode WHERE seriesname='$seriesname' AND Movie='0' AND ova='0'\");\n\t\t\t$total_episodes = mysqli_num_rows($query);\n\t\t\tif($total_episodes == 0){}\n\t\t\telse {\n\t\t\t\t$query = \"SELECT id, sid, epnumber, epname, epprefix, videotype, image FROM episode WHERE seriesname='$seriesname' AND Movie='0' AND ova='0' ORDER BY epnumber\";\n\t\t\t\t$result = mysqli_query($conn, $query);\n\t\t\t\techo '<div><b>Episodes:</b></div>';\n\t\t\t\t//echo '<div id=\"tooltipdiv\">';\n\t\t\t\twhile(list($id,$sid,$epnumber,$epname,$epPrefix,$videotype,$image) = mysqli_fetch_array($result))\n\t\t\t\t{\n\t\t\t\t\tif($image == 0){\n\t\t\t\t\t\t$imgUrl = '' . $CDNHost . '/video-images/noimage.png';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$imgUrl = \"{$CDNHost}/video-images/{$sid}/{$id}_screen.jpeg\";\n\t\t\t\t\t}\n\t\t\t\t\t$epname = stripslashes($epname);\n\t\t\t\t\tif ($accesslevel == 7 || $canDownload == 1){\n\t\t\t\t\t\tif($type == 1 && ($accesslevel == 7 || $canDownload == 1)){\n\t\t\t\t\t\t\t$imgurl = '<a href=\"http://'.$videoServer.'.animeftw.tv/'.$seriesname.'/'.$epPrefix.'_' . $epnumber . '_ns.'.$videotype.'\"><img src=\"//animeftw.tv/images/disk.png\" alt=\"Advanced Download\" title=\"Click To download '.$fullSeriesName.' Episode ' . $epnumber . '\" style=\"float:left;padding-top:2px;padding-right:3px;\" border=\"0\" /></a>';\n\t\t\t\t\t\t\t//$imgurl = '<a href=\"http://'.$videoServer.'.animeftw.tv/'.$seriesname.'/'.$epPrefix.'_' . $epnumber . '_ns.'.$videotype.'\"><img src=\"//animeftw.tv/images/disk.png\" alt=\"Advanced Download\" title=\"Click To download '.$fullSeriesName.' Episode ' . $epnumber . '\" style=\"float:right;padding-top:8px;\" border=\"0\" /></a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {$imgurl = '';}\n\n\t\t\t\t\t}\n\t\t\t\t\telse {$imgurl = '';}\n\t\t\t\t\tif($accesslevel == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<div style=\\\"padding-top:5px;\\\">Episode #\".$epnumber.\": \".$epname.\"</div>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif($type == 0){\n\t\t\t\t\t\t\techo \"<a class=\\\"feature01\\\" href=\\\"/anime/\".$seoname.\"/ep-\".$epnumber.\"\\\" title=\\\"Titled: \".$epname.\"\\\">\";\n\t\t\t\t\t\t\techo \"\t<span class=\\\"overlay01\\\">\";\n\t\t\t\t\t\t\techo \"\t\t<span class=\\\"caption01\\\">Episode: \".$epnumber.\"<br />Titled: \".$epname.\"</span>\";\n\t\t\t\t\t\t\techo \"\t</span>\";\n\t\t\t\t\t\t\techo \"\t<img src=\\\"$imgUrl\\\" alt=\\\"Episode: \".$epnumber.\"\\\" height=\\\"90\\\" />\";\n\t\t\t\t\t\t\techo \"</a>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\techo $imgurl.\"<div style=\\\"padding-top:5px;\\\">Episode #\".$epnumber.\": <a href=\\\"/anime/\".$seoname.\"/ep-\".$epnumber.\"\\\" onmouseover=\\\"ajax_showTooltip(window.event,'/scripts.php?view=profiles&amp;show=eptips&amp;id=\".$id.\"',this);return false;\\\" onmouseout=\\\"ajax_hideTooltip()\\\">\".$epname.\"</a></div>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//echo '</div>';\n\t\t\t}\n\t\t}", "function QTIMaterialToString($a_material)\n\t{\n\t\t$result = \"\";\n\t\tfor ($i = 0; $i < $a_material->getMaterialCount(); $i++)\n\t\t{\n\t\t\t$material = $a_material->getMaterial($i);\n\t\t\tif (strcmp($material[\"type\"], \"mattext\") == 0)\n\t\t\t{\n\t\t\t\t$result .= $material[\"material\"]->getContent();\n\t\t\t}\n\t\t\tif (strcmp($material[\"type\"], \"matimage\") == 0)\n\t\t\t{\n\t\t\t\t$matimage = $material[\"material\"];\n\t\t\t\tif (preg_match(\"/(il_([0-9]+)_mob_([0-9]+))/\", $matimage->getLabel(), $matches))\n\t\t\t\t{\n\t\t\t\t\t// import an mediaobject which was inserted using tiny mce\n\t\t\t\t\tif (!is_array($_SESSION[\"import_mob_xhtml\"])) $_SESSION[\"import_mob_xhtml\"] = array();\n\t\t\t\t\tarray_push($_SESSION[\"import_mob_xhtml\"], array(\"mob\" => $matimage->getLabel(), \"uri\" => $matimage->getUri()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "private function Episode_Display($SeriesArray,$EpisodeArray,$SpriteArray,$moevar)\n\t{\n\t\tfunction getUrl()\n\t\t{\n if(isset($_SERVER['HTTP_CF_VISITOR'])){\n $decoded = json_decode($_SERVER['HTTP_CF_VISITOR'], true);\n if($decoded['scheme'] == 'http'){\n // http requests\n $port = 80;\n } else {\n $port = 443;\n }\n } else {\n $port = $_SERVER['SERVER_PORT'];\n }\n\t\t\t$url = @( $port != '443' ) ? 'http://'.$_SERVER[\"SERVER_NAME\"] : 'https://'.$_SERVER[\"SERVER_NAME\"];\n\t\t\t$url .= ( $port !== 80 ) ? \":\".$port : \"\";\n\t\t\t$url .= $_SERVER[\"REQUEST_URI\"];\n\t\t\treturn $url;\n\t\t}\n\n\t\t$FinalSerisName = $SeriesArray[1];\n\n\t\t// ADDED 08/31/14 - Robotman321\n\t\t// The following will enable us to directly allow for selective links to a video.\n\t\t// This will allow members to link directly to good parts of a video.\n\t\t$parsedURL = parse_url(getUrl());\n\n\t\tif(isset($parsedURL['query']) && stristr($parsedURL['query'], 't='))\n\t\t{\n\t\t\t// The Anchor tag is set\n\t\t\t$timed = explode('=', $parsedURL['query']);\n\t\t\t$vidPosition = '#t=' . gmdate(\"H:i:s\", $timed[1]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// we first check to see if the user has watched this, to be in the timer array.\n\t\t\tif(@array_key_exists($EpisodeArray[15],$this->RecentEps))\n\t\t\t{\n\t\t\t\techo '<!-- key exists -->';\n\t\t\t\t// success. However, we need to check the timestamp against our current time, if its > 4 weeks or is more than 95% of the way through the video, let's just let it go.\n\t\t\t\tif($this->RecentEps[$EpisodeArray[15]]['updated'] < (time()-2419200) || ((is_numeric($this->RecentEps[$EpisodeArray[15]]['max']) && $this->RecentEps[$EpisodeArray[15]]['max'] > 0) && ($this->RecentEps[$EpisodeArray[15]]['time']/$this->RecentEps[$EpisodeArray[15]]['max'])*100 > 95))\n\t\t\t\t{\n\t\t\t\t\t// sorry.. your time was too far off, or you already watched through this video before.. so we will just let it ride out without a stamp.\n\t\t\t\t\t$vidPosition = '';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$vidPosition = '#t=' . $this->RecentEps[$EpisodeArray[15]]['time'];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$vidPosition = '';\n\t\t\t}\n\t\t}\n\t\tif($this->UserArray[2] == 3)\n\t\t{\n\t\t\t$randomValue = rand(0,3);\n\t\t\tif($randomValue == 0 || $randomValue == 1 || $randomValue == 2){\n\t\t\t\t$ad = '\n\t\t\t\t\t\t<!-- Start J-List Affiliate Code -->\n\t\t\t\t\t\t<a href=\"https://anime.jlist.com/click/3638/129\" target=\"_blank\" onmouseover=\"window.status=\\'Click for Japanese study aids and more\\'; return true;\" onmouseout=\"window.status=\\'\\'; return true;\" title=\"Click for Japanese study aids and more\">\n\t\t\t\t\t\t\t<img src=\"https://affiliates.jlist.com/media/3638/129\" width=\"300\" height=\"250\" alt=\"Click for Japanese study aids and more\" border=\"0\"><br />\n\t\t\t\t\t\t\tJapanese study aids and more at J-List\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<!-- End J-List Affiliate Code -->';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ad = '\n\t\t\t\t\t\t<!-- Start J-List Affiliate Code -->\n\t\t\t\t\t\t<a href=\"https://anime.jlist.com/click/3638/129\" target=\"_blank\" onmouseover=\"window.status=\\'Click for Japanese study aids and more\\'; return true;\" onmouseout=\"window.status=\\'\\'; return true;\" title=\"Click for Japanese study aids and more\">\n\t\t\t\t\t\t\t<img src=\"https://affiliates.jlist.com/media/3638/129\" width=\"300\" height=\"250\" alt=\"Click for Japanese study aids and more\" border=\"0\"><br />\n\t\t\t\t\t\t\tJapanese study aids and more at J-List\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<!-- End J-List Affiliate Code -->';\n\t\t\t}\n\t\t\techo '\n\t\t\t<div id=\"am-container\">\n\t\t\t\t<div align=\"center\" style=\"padding:5px;\">Please note, AnimeFTW.tv only streams using a custom build HTML5 Video player, all other players are NOT Supported.</div>\n\t\t\t\t<div align=\"center\"><form name=\"counter\"><span>Your video will start in:<input type=\"text\" name=\"d2\" style=\"background:#F7F7F7;border:none;width:16px;\"> seconds</span></form></div>\n\t\t\t\t<div align=\"center\">\n\t\t\t\t\t<div style=\"text-align: center; font-size: 12px;\" align=\"center\">\n\t\t\t\t\t\t' . $ad . '\n\t\t\t\t\t</div>\n\t\t\t\t\t<br />And now a Word from one of our Partners.\n\t\t\t\t\t<br />\n\t\t\t\t\t<a href=\"/advanced-signup\">Sick of waiting for episodes to start? Signup for advanced membership <br />and help out the site with server costs while having no ads at all!</a>\n\t\t\t\t\t<br /><br />\n\t\t\t\t</div>\n\t\t\t</div>';\n\t\t\t$hiddenstyle = ' style=\"display:none;\"';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$hiddenstyle = '';\n\t\t}\n\n\t\t// check the image.\n\t\tif($EpisodeArray[15] == 0)\n\t\t{\n\t\t\t$epimage = $this->Host . '/video-images/noimage.png';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$epimage = \"{$this->Host}/video-images/{$EpisodeArray[14]}/{$EpisodeArray[10]}_screen.jpeg\";\n\t\t}\n\t\t// Autoplay functionality.\n\t\t$autoplay = \"\";\n\t\tif((isset($this->SettingsArray[16]) && $this->SettingsArray[16]['disabled'] != 1) && $this->UserArray[2] != 3)\n\t\t{\n\t\t\tif($this->SettingsArray[16]['value'] == 33)\n\t\t\t{\n\t\t\t\t$autoplay = \" autoplay\";\n\t\t\t}\n\t\t}\n\n $sdVideoServer = 'videos';\n $hdVideoServer = 'videos2';\n // CDN Override\n if (isset($this->SettingsArray[19]) && $this->SettingArray[19]['disabled'] != 1) {\n if ($this->SettingsArray[19]['value'] == 38 && $this->UserArray[2] != 3) {\n $sdVideoServer = 'video-cdn';\n $hdVideoServer = 'video-cdn';\n }\n }\n\n\t\t// All of the code for the HTML5 player is here.\n\t\techo '\n\t\t\t<div id=\"aftw-video-wrapper\"' . $hiddenstyle . ' align=\"center\">\n\t\t\t\t<video id=\"aftw-player\" class=\"video-js vjs-fluid vsg-player\" controls preload=\"none\" width=\"' . $EpisodeArray[3] . '\" height=\"' . $EpisodeArray[2] . '\" poster=\"' . $epimage . '\"' . $autoplay . ' data-setup=\"{}\">';\n\n\t\t// ADDED 08/31/14 - Robotman321\n\t\t// With native support in the HTML5 player for different resolutions, we can support higher resolutions inline.\n\t\tif($EpisodeArray[12] == 1 && $this->UserArray[2] != 3)\n\t\t{\n\t\t\t// it's equal to 1, which means its just 720p\n\t\t\techo '\t\t\t\t\t<source src=\"//' . $sdVideoServer . '.animeftw.tv/' . $FinalSerisName . '/' . $EpisodeArray[4] . '_' . $EpisodeArray[0] . '_ns.mp4' . $vidPosition . '\" type=\"video/mp4\" label=\"480p\" res=\"480p\" />';\n\t\t\techo '\t\t\t\t\t<source src=\"//' . $hdVideoServer . '.animeftw.tv/' . $FinalSerisName . '/' . $EpisodeArray[4] . '_720p_' . $EpisodeArray[0] . '_ns.mp4' . $vidPosition . '\" type=\"video/mp4\" label=\"720p\" res=\"720p\" />';\n\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // swordartonline_720p_10_ns.mkv\n\t\telse if($EpisodeArray[12] == 2 && $this->UserArray[2] != 3)\n\t\t{\n\t\t\t// its equal to 2, which means its 1080p\n\t\t\techo '\t\t\t\t\t<source src=\"//' . $sdVideoServer . '.animeftw.tv/' . $FinalSerisName . '/' . $EpisodeArray[4] . '_' . $EpisodeArray[0] . '_ns.mp4' . $vidPosition . '\" type=\"video/mp4\" label=\"480p\" res=\"480p\" />';\n\t\t\techo '\t\t\t\t\t<source src=\"//' . $hdVideoServer . '.animeftw.tv/' . $FinalSerisName . '/' . $EpisodeArray[4] . '_720p_' . $EpisodeArray[0] . '_ns.mp4' . $vidPosition . '\" type=\"video/mp4\" label=\"720p\" res=\"720p\" />';\n\t\t\techo '\t\t\t\t\t<source src=\"//' . $hdVideoServer . '.animeftw.tv/' . $FinalSerisName . '/' . $EpisodeArray[4] . '_1080p_' . $EpisodeArray[0] . '_ns.mp4' . $vidPosition . '\" type=\"video/mp4\" label=\"1080p\" res=\"1080p\" />';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// nothing else to see here.\n\t\t\techo '\t\t\t\t\t<source src=\"//' . $sdVideoServer . '.animeftw.tv/' . $FinalSerisName . '/' . $EpisodeArray[4] . '_' . $EpisodeArray[0] . '_ns.mp4' . $vidPosition . '\" type=\"video/mp4\" label=\"480p\" res=\"480p\" />';\n\t\t}\n\t\techo '\n\t\t\t</video>\n\t\t</div>';\n\t\t// ADDED 09/19/14 - Robotman321\n\t\t// The following will automagically add an entry to the toplist based on watching 65% of the video\n\t\t// or getting past the 65% point..\n\t\techo '\n\t\t<script>\n\t\t\tvar int_val = 0;\n\t\t\tvar submit_check = \"FALSE\";\n\t\t\tvar timerCheck = setInterval(function(){\n\t\t\t\tvar current_time = $(\\'#aftw-player\\').find(\\'video\\').get(0).currentTime;\n\t\t\t\tvar durration = $(\\'#aftw-player\\').find(\\'video\\').get(0).duration;\n\n\t\t\t\tif((Math.round(current_time) % 60 == 0 && Math.round(current_time) != 0 && int_val != Math.round(current_time)) || Math.round(current_time) == Math.round(durration-1))\n\t\t\t\t{\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"/scripts.php?view=check-episode&id=' . $EpisodeArray[15] . '&time=\" + Math.round(current_time) + \"&max=\" + Math.round(durration),\n\t\t\t\t\t\tcache: false\n\t\t\t\t\t});\n\t\t\t\t\tint_val = Math.round(current_time);\n\t\t\t\t}\n\n\t\t\t\tif(((current_time/durration)*100) >= 65 && submit_check == \"FALSE\")\n\t\t\t\t{\n\t\t\t\t\tsubmit_check = \"TRUE\";\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"/scripts.php?view=toplist&action=record&epid=' . $EpisodeArray[15] . '\",\n\t\t\t\t\t\tcache: false\n\t\t\t\t\t});';\n\t\tif(isset($this->SettingsArray[9]) && $this->SettingsArray[9]['disabled'] != 1)\n\t\t{\n\t\t\tif($this->SettingsArray[9]['value'] == 17)\n\t\t\t{\n\t\t\t\techo '\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"/scripts.php?view=tracker&subview=add-entry&id=' . $EpisodeArray[15] . '\",\n\t\t\t\t\t\tcache: false,\n\t\t\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\t\tif(response.indexOf(\"Success\") >= 0){\n\t\t\t\t\t\t\t\t$(\".tracker-button\").html(\\'<img src=\"' . $this->Host . '/added_tracker.png\" alt=\"\" title=\"Auto Addition was Successful!\" style=\"float:left;padding-top:1px;padding-right:3px;\" />&nbsp;<span>Auto-Added!</span>\\');\n\t\t\t\t\t\t\t\t$(\".tracker-added-date\").html(response);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\talert(\"There was an error trying to process that request.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t';\n\t\t\t}\n\t\t}\n\t\techo '\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t';\n\t\t// Auto Play feature\n\t\t// Will auto move to the next page at the completion of video. We will want to\n\t\t// add some sort of pause option down the line, technically pausing a video would\n\t\t// do what we need, but it could be useful.\n\t\tif(isset($this->SettingsArray[16]) && $this->SettingsArray[16]['disabled'] != 1)\n\t\t{\n\t\t\tif($this->SettingsArray[16]['value'] == 33)\n\t\t\t{\n\t\t\t\t$query = \"SELECT `id` FROM `episode` WHERE `sid` = \" . $SeriesArray[0] . \" AND `epnumber` > \" . $EpisodeArray[0] . \" LIMIT 0, 1\";\n\t\t\t\t$result = mysqli_query($conn, $query);\n\t\t\t\t$count = mysqli_num_rows($result);\n\t\t\t\tif($count > 0)\n\t\t\t\t{\n\t\t\t\t\tif($EpisodeArray[17] == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Episode\n\t\t\t\t\t\t$mov = \"ep\";\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// movie\n\t\t\t\t\t\t$mov = \"movie\";\n\t\t\t\t\t}\n\t\t\t\t\t// we make sure that the current time equals the durration, then we redirect them.\n\t\t\t\t\techo '\n\t\t\t\tif(current_time == durration)\n\t\t\t\t{\n\t\t\t\t\twindow.location.href = \"/anime/' . $SeriesArray[2] . '/' . $mov . '-' . ($EpisodeArray[0]+1) . '\";\n\t\t\t\t}\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '\n\t\t\t},1000);\n\t\t</script>';\n /*echo '\n\t\t<script>\n\t\t$(document).ready(function(){\n\t\t\t$(\\'.vjs-loading-spinner\\').html(\\'<img src=\"' . $this->Host . '/fay-loading-image.gif\" alt=\"Loading...\">\\');\n\t\t});\n\t\t</script>';*/\n\t\tif($this->UserArray[2] == 3)\n\t\t{\n\t\t\techo '\n\t\t\t<script>\n\t\t\t<!--\n\t\t\t//\n\t\t\tvar milisec=0\n\t\t\tvar seconds=31\n\t\t\tdocument.counter.d2.value=\\'31\\'\n\t\t\tfunction display(){\n\t\t\t\tif (milisec<=0){\n\t\t\t\t\tmilisec=9\n\t\t\t\t\tseconds-=1\n\t\t\t\t}\n\t\t\t\tif (seconds<=-1){\n\t\t\t\t\tmilisec=0\n\t\t\t\t\tseconds+=1\n\t\t\t\t\t$(\"#am-container\").hide();\n\t\t\t\t\t$(\"#aftw-video-wrapper\").show();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmilisec-=1\n\t\t\t\t\tdocument.counter.d2.value=seconds\n\t\t\t\t\tsetTimeout(\"display()\",100)\n\t\t\t\t}\n\t\t\t}\n\t\t\tdisplay()\n\t\t\t-->\n\t\t\t</script>';\n\t\t}\n\t\t$videoJsFunction = \"\";\n\t\tif (!$SpriteArray) {\n\t\t\techo '\n\t\t\t<link href=\"/css/videojs.progressTips.css\" rel=\"stylesheet\" />\n\t\t\t<script src=\"/scripts/videojs.progressTips.js\" type=\"text/javascript\"></script>';\n\t\t\t$videoJsFunction = \"video.progressTips({});\";\n\t\t}\n\n\t\t// ADDED 08/31/14 - Robotman321\n\t\t// With native support in the HTML5 player for different resolutions, we can support higher resolutions inline.\n\t\tif($EpisodeArray[12] > 0)\n\t\t{\n\t\t\tif(isset($this->SettingsArray[15]) && $this->SettingsArray[15]['disabled'] != 1)\n\t\t\t{\n\t\t\t\tif($this->SettingsArray[15]['value'] == '31' && $EpisodeArray[12] == 2)\n\t\t\t\t{\n\t\t\t\t\t// 1080p by default\n\t\t\t\t\t$defaultrez = '1080p';\n\t\t\t\t}\n\t\t\t\telse if($this->SettingsArray[15]['value'] == '30' || ($this->SettingsArray[15]['value'] == '31' && $EpisodeArray[12] == 1))\n\t\t\t\t{\n\t\t\t\t\t// 720p by default\n\t\t\t\t\t$defaultrez = '720p';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// 480p by default\n\t\t\t\t\t$defaultrez = '480p';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$defaultrez = '480p';\n\t\t\t}\n\t\t\techo '\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t// Initialize video.js and activate the resolution selector plugin\n var video = videojs(\\'#aftw-player\\');\n video.videoJsResolutionSwitcher({default: \\'' . $defaultrez . '\\'});\n video.hotkeys({volumeStep: 0.1, seekStep: 5, enableMute: true, enableFullscreen: true});\n\t\t\t\t' . $videoJsFunction . '\n\t\t\t</script>';\n\t\t}\n\t\telse {\n\t\t\techo '\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t// Initialize video.js and activate the resolution selector plugin\n var video = videojs(\\'#aftw-player\\');\n video.hotkeys({volumeStep: 0.1, seekStep: 5, enableMute: true, enableFullscreen: true});\n\t\t\t\t' . $videoJsFunction . '\n\t\t\t</script>';\n\t\t}\n\n\t\t// Open a style tag for late style modifications\n\t\techo '\n\t\t\t<style>';\n\n\t\t// If user !AdvancedMember || episode.hd = 0...I hope\n\t\tif ($this->UserArray[3] === 3 || $EpisodeArray[12] === 0) {\n\t\t\t// Extend the progress bar so that the Resolution Selectors gap is filled\n\t\t\techo '\n\t\t\t\t.vjs-sublime-skin .vjs-progress-control {\n\t\t\t\t\tright: 90px !important;\n\t\t\t\t}' . \"\\n\";\n\t\t}\n\n\t\t// Fix the JavaScript demon child.\n\t\techo '\n\t\t\t\t.vjs-volume-level {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\tposition: absolute;\n\t\t\t\t}\n\t\t\t</style>';\n\n\t\t// Added 9/22/15 by Nikey646, Output for sprite sheets if they exist.\n\t\tif ($SpriteArray) {\n\t\t\t// Sprite exists. Lets load the Sprite Data\n\t\t\t// This is soooo messy ;(\n\t\t\t// 5 Tab spaces to help w/ indenting source code in the output.\n\t\t\t$tab5 = \"\t\t\t\t\t\";\n\n\t\t\techo <<<HDOC\n\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tvideo.thumbnails({\\n\nHDOC;\n\n\t\t\tfor($i = 0; $i < $SpriteArray['count']; $i++) {\n\t\t\t\techo $tab5 . $i * $SpriteArray['rate'] . \": {\\n\";\n\t\t\t\tif ($i === 0)\n\t\t\t\t\techo $tab5 . \"\tsrc: \\\"{$this->Host}/video-images/{$EpisodeArray[14]}/{$EpisodeArray[10]}_sprite.jpeg\\\",\\n\";\n\t\t\t\t\techo $tab5 . \"\tstyle: {\\n\";\n\t\t\t\t\techo $tab5 . \"\t\tleft: '-\" . (($SpriteArray['width'] / 2) + ($SpriteArray['width'] * $i)) . \"px',\\n\";\n\t\t\t\tif ($i === 0) {\n\t\t\t\t\techo $tab5 . \"\t\twidth: '{$SpriteArray['totalWidth']}px',\\n\";\n\t\t\t\t\techo $tab5 . \"\t\theight: '{$SpriteArray['height']}px', \\n\";\n\t\t\t\t}\n\t\t\t\techo $tab5 . \"\t\tclip: 'rect(0, \" . ($SpriteArray['width'] * ($i + 1)) . \"px, {$SpriteArray['height']}px, \" . ($SpriteArray['width'] * $i) . \"px)'\\n\";\n\n\t\t\t\techo $tab5 . \"\t}\\n\";\n\n\t\t\t\techo $tab5 . \"},\\n\";\n\t\t\t}\n\n\t\t\techo <<<HDOC\n\t\t\t\t});\n\t\t\t</script>\nHDOC;\n\t\t}\n\t}", "public function vehicle_show(){\n\t\t$query=$this->conn->query(\"SELECT id, make,series FROM vehicles where personalId = '3'\");\n\t\twhile($row=$query->fetch_array(MYSQLI_ASSOC)){\n\t\t\t$this->vehicle_show[]=$row;\n\t\t}\n\t\treturn $this->vehicle_show;\n\t}", "function printSampleInfo()\n\t{\n\t\t$g = \"\\n\\t\\t\\t\";\n\t\t$str = $g.\"<table border='0'>\";\n\t\t//print \"<tr><td align=right>filename</td>\t\t<td>&nbsp;$this->wave_filename</td></tr>\";\n\t\t$str .= $g.\" <tr><td align=right>\".t('id').\":</td><td>$this->wave_id</td></tr>\";\n\t\t$str .= $g.\" <tr><td align=right>\".t('type').\":</td><td>$this->wave_type</td></tr>\";\n\t\t$str .= $g.\" <tr><td align=right>\".t('size').\":</td><td>$this->wave_size</td></tr>\";\n\t\t$str .= $g.\" <tr><td align=right>\".t('compression').\":</td><td>\".$this->getCompression ($this->wave_compression).\"</td></tr>\";\n\t\t$str .= $g.\" <tr><td align=right>\".t('channels').\":</td><td>$this->wave_channels</td></tr>\";\n\t\t$str .= $g.\" <tr><td align=right>\".t('framerate').\":</td><td>$this->wave_framerate</td></tr>\";\n\t\t$str .= $g.\" <tr><td align=right>\".t('byterate').\":</td><td>$this->wave_byterate</td></tr>\";\n\t\t$str .= $g.\" <tr><td align=right>\".t('bits').\":</td><td>$this->wave_bits</td></tr>\";\n\t\t$str .= $g.\" <tr><td align=right>\".t('length').\":</td><td>\".number_format ($this->wave_length,\"2\").\" sec.<br>&nbsp;\".date(\"i:s\", mktime(0,0,round($this->wave_length))).\"</td></tr>\";\n\n\t\t// ID3V1\n\t\tif ($this->id3_tag)\n\t\t{\n\t\t\t$id3v1 = $g.\" <tr>\";\n\t\t\t$id3v1 .= $g.\" <td align=right>id3v1-tags</td>\";\n\t\t\t$id3v1 .= $g.\" <td>\";\n\t\t\t$id3v1 .= $g.\" <table border='0'>\";\n\t\t\t$id3v1 .= $g.\" <tr><td align=right>\".t('title').\":</td><td>\" . $this->id3_title. \"</td></tr>\";\n\t\t\t$id3v1 .= $g.\" <tr><td align=right>\".t('artist').\":</td><td>\". $this->id3_artist. \"</td></tr>\";\n\t\t\t$id3v1 .= $g.\" <tr><td align=right>\".t('album').\":</td><td>\" . $this->id3_album. \"</td></tr>\";\n\t\t\t$id3v1 .= $g.\" <tr><td align=right>\".t('year').\":</td><td>\" . $this->id3_year. \"</td></tr>\";\n\t\t\t$id3v1 .= $g.\" <tr><td align=right>\".t('comment').\":</td><td>\".$this->id3_comment.\"</td></tr>\";\n\t\t\t$id3v1 .= $g.\" <tr><td align=right>\".t('genre').\":</td><td>\" . $this->id3_genre. \"</td></tr>\";\n\t\t\t$id3v1 .= $g.\" </table>\";\n\t\t\t$id3v1 .= $g.\" </td>\";\n\t\t\t$id3v1 .= $g.\" </tr>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$id3v1 = $g.\" <tr><td align=right>id3v1-tags: </td><td>Not found</td></tr>\";\n\t\t}\n\n\t\t// ID3V2\n\t\tif ( isset($this->id3v2) && $this->id3v2)\n\t\t{\n\t\t\t$id3v2 = $g.\" <tr>\";\n\t\t\t$id3v2 .= $g.\" <td align=right>\".t('id3v2-tags').\"</td>\";\n\t\t\t$id3v2 .= $g.\" <td>\";\n\t\t\t$id3v2 .= $g.\" <table border='0'>\";\n\t\t\tif(isset($this->id3v2->TIT2))$id3v2 .= $g.\" <tr><td align=right>\".t('title').\":</td><td>\" . __decode($this->id3v2->TIT2).\"</td></tr>\";\n\t\t\tif(isset($this->id3v2->TPE1))$id3v2 .= $g.\" <tr><td align=right>\".t('artist').\":</td><td>\" . __decode($this->id3v2->TPE1).\"</td></tr>\";\n\t\t\tif(isset($this->id3v2->TOPE))$id3v2 .= $g.\" <tr><td align=right>\".t('original artist').\":</td><td>\".__decode($this->id3v2->TOPE).\"</td></tr>\";\n\t\t\tif(isset($this->id3v2->TALB))$id3v2 .= $g.\" <tr><td align=right>\".t('album').\":</td><td>\" . __decode($this->id3v2->TALB).\"</td></tr>\";\n\t\t\tif(isset($this->id3v2->TYER))$id3v2 .= $g.\" <tr><td align=right>\".t('year').\":</td><td>\" . __decode($this->id3v2->TYER).\"</td></tr>\";\n\t\t\tif(isset($this->id3v2->COMM))$id3v2 .= $g.\" <tr><td align=right>\".t('comment').\":</td><td>\". __decode($this->id3v2->COMM).\"</td></tr>\";\n\t\t\tif(isset($this->id3v2->TCOM))$id3v2 .= $g.\" <tr><td align=right>\".t('composer').\":</td><td>\".__decode($this->id3v2->TCOM).\"</td></tr>\";\n\t\t\tif(isset($this->id3v2->TCON))$id3v2 .= $g.\" <tr><td align=right>\".t('genre').\":</td><td>\" . __decode($this->id3v2->TCON).\"</td></tr>\";\n\t\t\tif(isset($this->id3v2->TENC))$id3v2 .= $g.\" <tr><td align=right>\".t('encoder').\":</td><td>\". __decode($this->id3v2->TENC).\"</td></tr>\";\n\t\t\tif(isset($this->id3v2->WXXX))$id3v2 .= $g.\" <tr><td align=right>\".t('website').\":</td><td>\". __decode($this->id3v2->WXXX).\"</td></tr>\";\n\t\t\t$id3v2 .= $g.\" </table>\";\n\t\t\t$id3v2 .= $g.\" </td>\";\n\t\t\t$id3v2 .= $g.\" </tr>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$id3v2 = $g.\" <tr><td align=right>id3v2 tags: </td><td>Not found</td></tr>\";\n\t\t}\n\n\t\t// VORBIS\n\t\tif ($this->wave_id==\"OGG\" && isset($this->vorbis_comment))\n\t\t{\n\t\t\t$ogg = $g.\" <tr>\";\n\t\t\t$ogg .= $g.\" <td align=right>ogg-tags</td>\";\n\t\t\t$ogg .= $g.\" <td>\";\n\t\t\t$ogg .= $g.\" <table border='0'>\";\n\t\t\t$ogg .= $g.\" <tr><td width=70 align=right>\".t('title').\":</td><td>\".$this->vorbis_comment->TITLE.\"</td></tr>\";\n\t\t\t$ogg .= $g.\" <tr><td align=right>\".t('artist').\":</td><td>\".$this->vorbis_comment->ARTIST.\"</td></tr>\";\n\t\t\t$ogg .= $g.\" <tr><td align=right>\".t('album').\":</td><td>\".$this->vorbis_comment->ALBUM.\"</td></tr>\";\n\t\t\t$ogg .= $g.\" <tr><td align=right>\".t('date').\":</td><td>\".$this->vorbis_comment->DATE.\"</td></tr>\";\n\t\t\t$ogg .= $g.\" <tr><td align=right>\".t('genre').\":</td><td>\".$this->vorbis_comment->GENRE.\"</td></tr>\";\n\t\t\t$ogg .= $g.\" <tr><td align=right>\".t('comment').\":</td><td>\".$this->vorbis_comment->COMMENT.\"</td></tr>\";\n\t\t\t$ogg .= $g.\" </table>\";\n\t\t\t$ogg .= $g.\" </td>\";\n\t\t\t$ogg .= $g.\" </tr>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ogg = $g.\" <tr><td align=right>ogg vorbis info: </td><td>Not found</td></tr>\";\n\t\t}\n\n\t\t$str .= $id3v1 . $id3v2 .$ogg;\n\t\t$str .= $g.\"</table>\\n\";\n\t\treturn $str;\n\t}", "public function articulomultimediaAction(){\t\n\t\t$this->view->doctype('XHTML1_RDFA');\t\t\n\t\t$validador = new My_Validador_AztecaValidador();\n\t\t$BoJson\t\t= new My_Model_ProcesaJsonTraderBOMultimedia();\n\t\t$url \t= $validador->urlValida($this->getRequest()->getUserParam('url',''));\n\t\t$item \t= $validador->intValido($this->getRequest()->getUserParam('item',''));\t\t\n\t\n\t\t$dataJson \t= file_get_contents(\"http://uat.tv-azteca.psdops.com/appnoticias/json-fundacion-azteca-2020\");\n\t\t\n\t\t$data \t\t= json_decode($dataJson, true);\n\t\t\n\t\t$datosAutor\t\t= $BoJson->organizarDatosJson($data['items'], 2);//Traer el json organizado por autor\n\t\t$datosArticulos = $BoJson->consultaDatosArticulo($data['items']);//Traer el json original si organizar para buscar el articulo\n\t\t\n\t\t$articulo\t\t= \t\"\";\n\t\t$otrosArticulos =\t\"\";\n\t\t\n\t\tif(!empty($url)){//Busca los datos del articulo actual\n\t\t\t$resultado\t= array_search($url, array_column($datosArticulos, 'idBusqueda'));\n\t\t\tif(strlen($resultado) > 0){\n\t\t\t\tif(array_key_exists($resultado, $datosArticulos)){\n\t\t\t\t\t$articulo\t=\t$datosArticulos[$resultado];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Sino encontró el articulo es probable que la url esté mal y venga de alguna red social,le quito los últimos digitos...\n\t\tif (empty($articulo) ){\n\t\t\t$urlPartida = explode(\"-\", $url);\n\t\t\tarray_pop($urlPartida);//Le quito el ultimo elemento\n\t\t\t$urlNueva = implode(\"-\", $urlPartida);// El arreglo lo convierto de nuevo a texto sin el último elemento\n\t\t\t\t\n\t\t\tif(!empty($url)){//Busca los datos del articulo actual, con la nueva estructura de URL\n\t\t\t\t$resultado\t= array_search($urlNueva, array_column($datosArticulos, 'idBusqueda'));\n\t\t\t\tif(strlen($resultado) > 0){\n\t\t\t\t\tif(array_key_exists($resultado, $datosArticulos)){\n\t\t\t\t\t\t$articulo\t=\t$datosArticulos[$resultado];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t// Busca los contenidos relacionados...\n\t\t\n\t\t$datosRelacionados\t\t\t\t= $datosAutor[$articulo['autorC']];\n\t\tif (count($datosRelacionados) != 0){\n\t\t\t$otrosArticulos\t\t\t\t= $BoJson->eliminarElementoActual($datosRelacionados,$url);\n\t\t}\n\t\t//$aleatorio\t\t\t\t\t= array_rand($data);//array_rand($datos,10);\n\t\t//$this->view->otrosArticulos\t= $this->obtieneDatosAleatorios($aleatorio, $datosRelacionados,$item);\n\t\t$bandera = 0;\n\t\tif (count($articulo) != 0){\n\t\t\t\n\t\t\tif(count($otrosArticulos) == 0){//No tiene ningun contenido relacionado le traigo contenido de cualquier otro autor\n\t\t\t\t$otrosArticulos\t= $BoJson->consultaDatosArticulo($data['items'],1,12);\n\t\t\t\t$otrosArticulos\t= $BoJson->eliminarElementoActual($otrosArticulos,$url);\n\t\t\t\t$bandera \t\t= 1;\n\t\t\t}\n\t\t\t\n\t\t\tif($bandera == 0){//En caso que no requieran esta funcionalidad igualarlo a 2, $bandera == 2, muchas diran mejor quita el fragmento de codigo, pero como ya sabras luego dicen: Dice mi mamá que siempre SI....xD\n\t\t\t\t\n\t\t\t\tif(count($otrosArticulos) <= 2){//Tiene menos de 2 contenido, le anexo mas contenido de otros autores para que no se vea muy vacio...\n\t\t\t\t\t$nuevosArticulos\t= $BoJson->consultaDatosArticulo($data['items'],1,12);\n\t\t\t\t\t$nuevosArticulos\t= $BoJson->eliminarElementoActual($nuevosArticulos,$url);\n\t\t\t\t\t\n\t\t\t\t\tforeach ($otrosArticulos as $key => $valor){//Eliminar los repetidos de nuevos articulos, que coincidan con los relacionados\n\t\t\t\t\t\t\t$nuevosArticulos\t= $BoJson->eliminarElementoActual($nuevosArticulos,$valor['idBusqueda']);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$uneArreglo\t\t\t= array_merge($otrosArticulos,$nuevosArticulos);\n\t\t\t\t\t$otrosArticulos\t\t= $uneArreglo;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->view->articulo\t\t= $articulo;\n\t\t$this->view->otrosArticulos\t= $otrosArticulos;\n\t\t$this->view->metadatos = \"\";\n\t\t$this->view->site\t\t= $BoJson->obtenerUrl();\n\t\t\t\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate map's icon in world map
function _gen_map_icon($status = 'enable', $type = 'all') { $this->load->model('map_model'); $_rows = $this->map_model->get_map($status, $type); $_html = ''; foreach($_rows as $_row) { $_class = ($_row->type == 0) ? 'map_icon_map' : 'map_icon_city'; $_html .= '<div id="map_icon_'.$_row->id_map.'" class="'.$_class.'" rel="'.$_row->id_map.'" title="'.$_row->name.'"></div>'; } return $_html; }
[ "public function getIconMap() {\n return $this->icon_map;\n }", "function WPBikeRent_Theme_map_icon(){ \n\t\t$testlogo2 = 'img_map_logo';\n\t\techo $this->WPBikeRent_Theme_image_uploader_field( $testlogo2, get_option('img_map_logo') );\n\t}", "public function populateMapIconDirectory() {\n\t\t$iconPath = 'fileadmin/ext/mymap/Resources/Public/Icons/';\n \t\tif (!is_dir(Environment::getPublicPath() . '/' . $iconPath)) {\n $fileSystem = new FileSystem();\n if (Environment::getPublicPath() != Environment::getProjectPath()) {\n // we are in composerMode\n \t\t\t$sourceDir = Environment::getProjectPath() . '/vendor/wsr/mymap/Resources/Public/';\n } else {\n $sourceDir = Environment::getPublicPath() .'/typo3conf/ext/mymap/Resources/Public/';\n }\n $fileSystem->mirror($sourceDir, 'fileadmin/ext/mymap/Resources/Public/');\n\t\t\t$this->addFlashMessage('Directory ' . $iconPath . ' created for use with own mapIcons!', '', \\TYPO3\\CMS\\Core\\Messaging\\AbstractMessage::INFO);\n }\n\t}", "function ca_elements_icon_map( $icon_map ) {\n\t\t$icon_map['si_custom_elements'] = CA_EXTENSION_URL . '/assets/svg/icons.svg';\n\t\treturn $icon_map;\n\t}", "public function createIcon();", "function ut_icon_map( $atts, $content = null ) {\n return '<i class=\"fa fa-map-marker\">' . do_shortcode($content) . '</i> ';\n}", "public function mapIcons() {\n\n // page level styles\n $this->css['pages'][] = 'global/plugins/bower_components/map-icons/css/map-icons.css';\n\n // theme styles\n $this->css['themes'] = [\n 'admin/css/reset.css',\n 'admin/css/layout.css',\n 'admin/css/components.css',\n 'admin/css/plugins.css',\n 'admin/css/themes/laravel.theme.css' => ['id' => 'theme'],\n 'admin/css/custom.css',\n ];\n\n // page level plugins\n $this->js['additionalScripts'] = [\n 'http://maps.googleapis.com/maps/api/js?sensor=false'\n ];\n\n $this->js['plugins'] = [\n 'global/plugins/bower_components/map-icons/js/map-icons.min.js'\n ];\n\n // page level scripts\n $this->js['scripts'] = [\n 'admin/js/apps.js',\n 'admin/js/pages/blankon.maps.icon.js',\n 'admin/js/demo.js'\n ];\n\n // pass variable to view\n View::share('css', $this->css);\n View::share('js', $this->js);\n View::share('title', 'MAP ICONS | BLANKON - Fullpack Admin Theme');\n\n return view('component/map-icons');\n }", "public function get_map_icon () {\n if ($this->type == Location::TYPE_CAPITAL) return 'capital';\n\n $keywords = $this->get_keywords();\n\n switch ($this->type) {\n default:\n // Take the last keyword, split by space and take the first word of the group.\n $pieces = explode(' ', array_pop($keywords));\n return strtolower(array_shift($pieces));\n }\n }", "function gmw_ps_pt_map_icon( $map_icon, $post, $gmw ) {\r\n\r\n\t$pt_settings = gmw_get_options_group( 'post_types_settings' );\r\n\t$icons_data = gmw_get_icons();\r\n\t$icons_url = $icons_data['pt_map_icons']['url'];\r\n\t$form_field = ! empty( $gmw['map_markers'] ) ? $gmw['map_markers'] : array();\r\n\t$new_map_icon = $map_icon;\r\n\t$usage \t\t = isset( $form_field['usage'] ) ? $form_field['usage'] : 'global';\r\n\t$default_icon = isset( $form_field['default_marker'] ) ? $form_field['default_marker'] : '_default.png';\r\n\t\r\n\t// if showing same global map icon\r\n\tif ( $usage == 'global' ) {\r\n\t\t$new_map_icon = $default_icon;\r\n\t// per post map icon\r\n\t} elseif ( $usage == 'per_post' ) {\r\n\t\t$new_map_icon = ! empty( $post->map_icon ) ?$post->map_icon : $default_icon;\r\n\t// per post type map icons\r\n\t} elseif ( $usage == 'per_post_type' && ! empty( $pt_settings['post_types_icons'][$post->post_type] ) ) {\r\n\t\t$new_map_icon = $pt_settings['post_types_icons'][$post->post_type];\r\n\t// per category map icons\r\n\t} elseif ( $usage == 'per_category' && ! empty( $pt_settings['per_category_icons']['taxonomies'] ) ) {\t\r\n\r\n\t\treturn gmw_ps_pt_get_category_map_icon( $post->ID );\r\n\r\n\t//map icon as featured image\r\n\t} elseif ( $usage == 'image' ) {\r\n\r\n\t\tif ( has_post_thumbnail( $post->ID ) ) {\r\n\r\n\t\t\t$thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( 30, 30 ) );\r\n\t\t\t$new_map_icon = $thumb[0];\r\n\r\n\t\t} else {\r\n\t\t\t$new_map_icon = GMW_PS_URL.'/posts/assets/map-icons/_no_image.png';\r\n\t\t}\r\n\t} else {\r\n\t\t$new_map_icon = '_default.png';\r\n\t}\r\n\r\n\tif ( $usage != 'image' ) {\r\n\t\t$map_icon = ( empty( $new_map_icon ) || $new_map_icon == '_default.png' ) ? $map_icon : $icons_url.$new_map_icon;\r\n\t} else {\r\n\t\t$map_icon = $new_map_icon;\r\n\t}\r\n\r\n\treturn $map_icon;\r\n}", "function gmw_ps_modify_group_map_icon( $args, $group, $gmw ) {\n\n $map_icon = '_default.png';\n\n //set default map icon usage if not exist\n if ( ! isset( $gmw['map_markers']['usage'] ) ) {\n $usage = $gmw['map_markers']['usage'] = 'global';\n } else {\n $usage = $gmw['map_markers']['usage'];\n }\n\n $global_icon = isset( $gmw['map_markers']['default_marker'] ) ? $gmw['map_markers']['default_marker'] : '_default.png';\n \n //if same global map icon\n if ( $usage == 'global' ) {\n $map_icon = $gmw['map_markers']['default_marker'];\n //per group map icon \n } elseif ( $usage == 'per_group' && isset( $group->map_icon ) ) {\n $map_icon = $group->map_icon;\n //avatar map icon\n } elseif ( $usage == 'avatar' ) {\n $avatar = bp_core_fetch_avatar( array( \n 'item_id' => $group->id,\n 'object' => 'group', \n 'type' => 'thumb', \n 'width' => 30, \n 'height' => 30, \n 'html' => false \n ) );\n\n $map_icon = array(\n 'url' => ( $avatar ) ? $avatar : GMW_PS_URL . '/friends/assets/ map-icons/_no_avatar.png',\n 'scaledSize' => array(\n 'height' => 30,\n 'width' => 30\n )\n );\n\n //oterwise, default map icon \n } else {\n $map_icon = '_default.png';\n }\n \n //generate the map icon\n if ( $usage != 'avatar' ) {\n\n if ( $map_icon == '_default.png' ) {\n $map_icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld='. $group->location_count.'|FF776B|000000';\n } else {\n $icons = gmw_get_icons();\n $map_icon = $icons['gl_map_icons']['url'].$map_icon;\n }\n }\n\n $args['map_icon'] = $map_icon;\n\n return $args;\n}", "function buildMainMap()\n{\n\n // Add an image first for debug and change asap\n //$final_map = \"\n//<img class=\\\"main_map\\\" src=\\\"images/heatmapapi.png\\\" />\" ;\n\n $final_map = \"\n<div id=\\\"map\\\"></div>\" ;\n\n return $final_map ;\n}", "public function get_icon() {\n\t\treturn 'eicon-google-maps';\n\t}", "function gmw_ps_pt_get_map_icon_via_loop( $map_icon, $post, $gmw ) {\r\n\r\n\tif ( ! isset( $gmw['map_markers']['usage'] ) ) {\r\n\t\treturn $map_icon;\r\n\t}\r\n\r\n\t$usage = $gmw['map_markers']['usage'];\r\n\r\n\t// featured image map icon\r\n\tif ( 'per_category' === $usage ) {\r\n\t\treturn gmw_ps_pt_get_category_map_icon( $post->ID );\r\n\t}\r\n\r\n\tif ( 'image' === $usage ) {\r\n\t\tif ( has_post_thumbnail( $post->ID ) ) {\r\n\t\t\t$thumb \t = wp_get_attachment_image_url( get_post_thumbnail_id( $post->ID ), array( 30, 30 ) );\r\n\t\t\t$map_icon = $thumb;\r\n\t\t} else {\r\n\t\t\t$map_icon = GMW_PS_URL. '/assets/map-icons/_no_image.png';\r\n\t\t}\r\n\t}\r\n\r\n\treturn $map_icon;\r\n}", "static function get_map_marker_icon( $args ) {\n $plugin = Hardcore_Map_Plugin::this();\n $icon = get_post_meta( $args[ 'post_ID' ], $plugin->marker_icon_meta_key, true );\n return $icon;\n }", "public function setIconMap($icon_map) {\n $this->icon_map = $icon_map;\n return $this;\n }", "function buildMainMap()\r\n{\r\n\r\n // Add an image first for debug and change asap\r\n //$final_map = \"\r\n//<img class=\\\"main_map\\\" src=\\\"images/heatmapapi.png\\\" />\" ;\r\n\r\n $final_map = \"\r\n<div id=\\\"map\\\"></div>\" ;\r\n\r\n return $final_map ;\r\n}", "public function getMapLink(){\n\t\t$url = $this->urls->mapUrl();\n\t\treturn \"<a href=\\\"\" . $url .\"?image=\" . $this->getId() .\" \\\">Se i kart</a>\";\n\t}", "function GetIcon(){}", "function renderPNG($image) {\n if ($image['map']) {\n $usemap = ' usemap=\"#'.$image['mapid'].'\"';\n } else {\n $usemap = '';\n }\n return \"<img class=\\\"plantuml\\\" src=\\\"{$image['src']}\\\"$usemap>{$image['map']}\";\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Request geo data from provider
private function get_json_geo_data() { $response = false; if ($this->ipaddress != 'UNKNOWN') { foreach (self::$geo_service_url as $key => $url) { $response = wp_remote_get($url . $this->ipaddress); if (is_array($response) && array_key_exists('region_code', json_decode($response['body']))) { continue; } } } if (is_array($response)) { $this->body = json_decode($response['body']); } else { $this->body = false; } }
[ "public function fetchGeoData()\n {\n\n $destinationArray = array();\n\n // if an address is given\n if ($this->getAddress()) {\n $destinationArray[] = $this->getAddress();\n $destinationArray[] = $this->getCountry();\n\n // if only a postal code is given\n } elseif ($this->getPostalCode()) {\n $destinationArray[] = $this->getPostalCode();\n $destinationArray[] = $this->getCountry();\n\n // else long AND lat is given (only one of these doesn't work)\n } elseif ($this->getLongitude() && $this->getLatitude()) {\n $destinationArray[] = $this->getLongitude();\n $destinationArray[] = $this->getLatitude();\n\n } else {\n\n $this->getLogger()->log(\n \\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR,\n 'No valid location given. You must specify an address or a zip-code or longitude and latitude.'\n );\n\n return false;\n }\n\n\n $settings = $this->getSettings();\n\n // is URL not defined, key is interpreted also as not defined\n if ($settings['googleApiUrl']) {\n $apiUrl = $settings['googleApiUrl'];\n $apiKey = $settings['googleApiKey'];\n } else {\n $apiUrl = self::GOOGLE_API_URL;\n $apiKey = self::GOOGLE_API_KEY;\n }\n\n $completeUrlSave = $completeUrl = $apiUrl . '?sensor=false&address={' . urlencode(implode(', ', $destinationArray)) . '}';\n\n // check for additional api key (not mandatory)\n if ($apiKey) {\n $completeUrl .= \"&key=\" . $apiKey;\n }\n\n try {\n\n // set up context if proxy is used\n $aContext = array();\n if ($settings['proxy']) {\n\n $aContext = array(\n 'http' => array(\n 'proxy' => $settings['proxy'],\n 'request_fulluri' => true,\n ),\n );\n\n if ($settings['proxyUsername']) {\n $auth = base64_encode($settings['proxyUsername'] . ':' . $settings['proxyPassword']);\n $aContext['http']['header'] = 'Proxy-Authorization: Basic ' . $auth;\n }\n }\n\n // get data from Google\n $cxContext = stream_context_create($aContext);\n if (ini_get('allow_url_fopen')) {\n $responseJson = file_get_contents($completeUrl, false, $cxContext);\n } else {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable SSL verification\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL,$completeUrl);\n $responseJson=curl_exec($ch);\n curl_close($ch);\n }\n $response = json_decode($responseJson, true);\n\n // if response is \"OK\", than set retrieved data\n if ($response['status'] == 'OK') {\n\n /** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n $objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(ObjectManager::class);\n\n /** @var \\RKW\\RkwGeolocation\\Domain\\Model\\Geolocation $geoLocation */\n $geoLocation = $objectManager->get(\\RKW\\RkwGeolocation\\Domain\\Model\\Geolocation::class);\n\n $geoLocation->setLatitude(\n filter_var(\n $response['results'][0]['geometry']['location']['lat'],\n FILTER_VALIDATE_FLOAT\n )\n );\n $geoLocation->setLongitude(\n filter_var(\n $response['results'][0]['geometry']['location']['lng'],\n FILTER_VALIDATE_FLOAT\n )\n );\n $geoLocation->setFormattedAddress(\n filter_var(\n $response['results'][0]['formatted_address'],\n FILTER_SANITIZE_STRING\n )\n );\n\n $addressComponents = $response['results'][0]['address_components'];\n\n // additional get postalCode\n if (is_array($addressComponents)) {\n foreach ($addressComponents as $component) {\n\n if ($component['types'][0] == 'postal_code') {\n $geoLocation->setPostalCode($component['long_name']);\n break;\n }\n }\n }\n\n $this->getLogger()->log(\n \\TYPO3\\CMS\\Core\\Log\\LogLevel::INFO,\n sprintf(\n 'Successfully received data from Google API for location \"%s\"',\n implode(',', $destinationArray)\n )\n );\n\n return $geoLocation;\n\n }\n\n $this->getLogger()->log(\n \\TYPO3\\CMS\\Core\\Log\\LogLevel::WARNING,\n sprintf(\n 'Google API call for location \"%s\" failed (%s). Reason: %s. %s',\n implode(',', $destinationArray),\n $completeUrlSave,\n $response['status'],\n $response['error_message'])\n );\n\n } catch (\\Exception $e) {\n $this->getLogger()->log(\n \\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR,\n sprintf('Google API for location \"%s\" call failed (%s). Reason: %s.',\n implode(',', $destinationArray),\n $completeUrlSave,\n $e->getMessage()\n )\n );\n }\n\n return false;\n }", "public function geo_location_get() {\n $google_maps_api_key = getenv('GOOGLE_MAPS_API_KEY');// 'AIzaSyCVuJds4Xvapt_X90V6RYp1nxEmlYWdeFY';\n\n $lat = $this->input->get('lat');\n $long = $this->input->get('long');\n\n if(empty($lat) || empty($long)) {\n $this->response([\n 'message' => lang('text_rest_maps_latlong_missing')\n ], 400);\n }\n\n $geo_params = [\n 'latlng' => \"{$lat},{$long}\",\n 'key' => $google_maps_api_key,\n ];\n $maps_api_url = \"https://maps.googleapis.com/maps/api/geocode/json?\";\n\n $maps_api_url .= urldecode(http_build_query($geo_params));\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $maps_api_url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 60); // Seconds\n $content = trim(curl_exec($ch));\n curl_close($ch);\n $geo_result = json_decode($content, true);\n\n if(empty($geo_result) || (!empty($geo_result) && $geo_result['status'] !== 'OK')) {\n $this->response([\n 'data' => $geo_result,\n 'message' => lang('text_rest_maps_failed')\n ], 400);\n }\n\n $this->response([\n 'data' => $geo_result,\n ], 200);\n }", "function findPointGpsGapi($e){\n\n $address = $e['Name_Est'].','.' '.$e['Address'].' '.$e['Postcode'].' '.$e['City'].' '.',France';\n\n // Penser a encoder votre adresse\n $address = urlencode($address);\n\n // On prépare l'URL du géocodeur\n $geocoder = \"http://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false\";\n\n // On prépare notre requête\n $query = sprintf($geocoder,$address);\n\n // On interroge le serveur\n // Et on renvoie un tableau\n $results = json_decode(file_get_contents($query), true);\n\n\n $latitude = null;\n $longitude = null;\n $error = null;\n\n // on test si la requete a fonctionner\n if($results['status']=='OK'){\n\n $latitude = $results['results'][0]['geometry']['location']['lat'];\n $longitude = $results['results'][0]['geometry']['location']['lng'];\n\n return array(\n 'latitude' => $latitude,\n 'longitude' => $longitude,\n );\n\n }else{\n\n return false;\n\n }\n\n}", "public function geo() {\n $req = $this->curl_req(\"{$this->shodan_stream}/geo?key={$this->apikey}\");\n return json_decode($req, RETURN_TYPE);\n }", "function get_visitor_geodata()\n{\n\t// Get the geodata based on ip address\n\t$api_url = 'http://ip-api.com/php/';\n\t\n\t$geo = file_get_contents($api_url);\n\t$geo = unserialize($geo);\n\treturn $geo;\n}", "private function getCoordinates()\n\t{\n\t\t// Check if we are overriding the default client's IP \n\t\t$ipSetting = \"\";\n\t\tif($this->ip != null) {\n\t\t\t$ipSetting = \"&IpAddress=\" . $this->ip;\n\t\t}\n\t\telse {\n\t\t\t$ipSetting = \"&IpAddress=\" . $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\t\t\n\t\t$url = self::geobytesUrl . $ipSetting;\n\t\t$result = $this->getUrl($url);\n\t\t$arr = json_decode($result, true);\n\t\tif($arr[\"geobytes\"][\"latitude\"] == null || $arr[\"geobytes\"][\"longitude\"] == null) {\n\t\t\t$latitude = 0;\n\t\t\t$longitude = 0;\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$latitude = $arr[\"geobytes\"][\"latitude\"];\n\t\t\t$longitude = $arr[\"geobytes\"][\"longitude\"];\n\t\t}\n\t\treturn array(\"latitude\"=>$latitude, \"longitude\"=>$longitude);\n\t}", "public function provideAll(string $clientAddress): GeoData;", "private function getCoordinates() {\n if (\n array_key_exists('point', $this->rawData) &&\n $this->rawData['point'] != '' &&\n $this->rawData['point'] != 'POINT(0 0)'\n ) {\n $this->point = \\geoPHP::load($this->rawData['point'],'wkt');\n }\n }", "function makeGeoFromRequestParam(){\n\t$requestParams = $this->requestParams;\n\tif(isset($requestParams[\"geotile\"])){\n\t $geoPath = $requestParams[\"geotile\"];\n\t if(is_numeric($geoPath)){\n\t\t$this->makeGeoTileParameters($geoPath);\n\t }\n\t}\n }", "function grabUserLocation($input){\n $user_city = $input;\n $request_url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".$user_city.\"%20Canada&sensor=false\";\n $USERJSON = file_get_contents($request_url);\n $result = json_decode($USERJSON);\n $lat=$result->results[0]->geometry->location->lat;\n $long=$result->results[0]->geometry->location->lng;\n return compact('lat','long');\n}", "function getGeoInfo()\n{\n\trequire_once FRAMEWORK_ROOT.'/helper/CCurlHelper.php';\n\t$curl = new CCurlHelper(\"http://ip.taobao.com/service/getIpInfo.php?ip=\".get_client_ip());\n\t$rs = $curl->curlGet();\n\t$arr = json_decode($rs, true);\n\tif ($arr['code'] != 0){\n\t\treturn false;\n\t}\n\treturn $arr['data'];\n}", "function springnet_get_geonetwork_ajax($geonet) {\n\t$response = drupal_http_request(\"https://resolve.spring-dvs.org/geosubs/$geonet\");\n\techo $response->data;\n}", "public function getGeo() {\n return $this->get(self::GEO);\n }", "public function callbackCoordinates()\n {\n $strAction = $GLOBALS['dlh_geocode']['address']['fieldformat']['action'];\n $strIdParam = $GLOBALS['dlh_geocode']['address']['fieldformat']['name'];\n\n $arrAddress = [];\n\n foreach ($GLOBALS['dlh_geocode']['address']['fields_address'] as $strField) {\n if ($strIdParam) {\n if (!\\Input::$strAction($strIdParam)) {\n // how Metamodels do it on creation, otherwise save twice to get coords\n $arrAddress[] = 'create' === \\Input::get('act') ? \\Input::post(sprintf($strField, 'b')) : '';\n } else {\n $arrAddress[] = \\Input::post(sprintf($strField, \\Input::$strAction($strIdParam)));\n }\n } else {\n $arrAddress[] = \\Input::post($strField);\n }\n }\n\n if (!trim(implode('', $arrAddress))) {\n $geocode = \\Input::post(sprintf($GLOBALS['dlh_geocode']['address']['field_geocode'], \\Input::$strAction($strIdParam)));\n\n return $geocode;\n }\n\n $strAddress = vsprintf($GLOBALS['dlh_geocode']['address']['format'], $arrAddress);\n $strCountry = $GLOBALS['dlh_geocode']['address']['field_country'];\n $strLang = $GLOBALS['dlh_geocode']['address']['field_language'];\n\n return self::getCoordinates($strAddress, $strCountry, $strLang);\n }", "public function getGoogleGeocodeData(){\r\n\t\treturn Place::getGoogleGeocodeData($this->getAsGoogleQuery());\r\n\t}", "private function fetchGeoCoordinates()\r\n {\r\n $geoCoordinatesNode = $this->findFirstGrandchild('geo', 'geokoordinaten');\r\n $attributes = $this->fetchLowercasedDomAttributes($geoCoordinatesNode);\r\n \r\n if (\r\n $this->isElementSetAndNonEmpty('laengengrad', $attributes)\r\n && $this->isElementSetAndNonEmpty('breitengrad', $attributes)\r\n ) {\r\n $this->addImportedData('has_coordinates', true);\r\n $this->addImportedData('coordinates_problem', false);\r\n $this->addImportedData('longitude', (float)$attributes['laengengrad']);\r\n $this->addImportedData('latitude', (float)$attributes['breitengrad']);\r\n }\r\n }", "private function geocode() {\r\n \r\n if (!empty($this->region) && !empty($this->country) && !empty($this->locality)) {\r\n #return;\r\n }\r\n \r\n $woe = PlaceUtility::LatLonWoELookup($this->lat, $this->lon);\r\n $woe = PlaceUtility::formatWoE($woe);\r\n \r\n $this->country = $woe['country_code'];\r\n $this->region = $woe['region_code'];\r\n $this->locality = $woe['neighbourhood'];\r\n $this->neighbourhood = null; // $this->neighbourhood is ignored\r\n \r\n if (empty($this->region)) {\r\n $this->region = $woe['region']; \r\n }\r\n \r\n /**\r\n * Shit's a little bit broken, it's ok\r\n */\r\n \r\n if (empty($this->region) || empty($this->country)) {\r\n $woe = PlaceUtility::LatLonWoELookup($this->lat, $this->lon, true); // force lookup, ignore any cached data\r\n $woe = PlaceUtility::formatWoE($woe);\r\n \r\n $this->region = $woe['region_code'];\r\n $this->country = $woe['country_code'];\r\n }\r\n \r\n if (empty($this->region)) {\r\n $this->region = strtoupper($woe['region_name']); \r\n }\r\n \r\n #printArray($this->region);die;\r\n \r\n return;\r\n \r\n /*\r\n \r\n // Fetch geodata and populate the vars\r\n //$url = \"http://maps.google.com/maps/geo?q=\".$this->lat.\",\".$this->lon.\"&output=json&sensor=false\";\r\n $url = \"http://maps.googleapis.com/maps/api/geocode/json?latlng=\" . $this->lat . \",\" . $this->lon . \"&sensor=false\";\r\n $ch = curl_init();\r\n \r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n \r\n $data = curl_exec($ch);\r\n $jsondata = json_decode($data, true); \r\n curl_close($ch);\r\n \r\n if (isset($jsondata['results'][0]['address_components'])) {\r\n $row = $jsondata['results'][0]['address_components']; \r\n }\r\n \r\n if (isset($jsondata['Placemark']) && $area = $jsondata['Placemark'][0]['AddressDetails']['Country']) {\r\n $this->country = $area['CountryNameCode']; \r\n $this->region = isset($area['AdministrativeArea']['AdministrativeAreaName']) ? $area['AdministrativeArea']['AdministrativeAreaName'] : NULL; \r\n $this->locality = isset($area['AdministrativeArea']['Locality']['LocalityName']) ? $area['AdministrativeArea']['Locality']['LocalityName'] : NULL; \r\n $this->neighbourhood = isset($area['CountryNameCode']['someotherarea']) ? $area['CountryNameCode']['someotherarea'] : NULL; \r\n } elseif (isset($row)) {\r\n // Loop through the results and try to populate the object\r\n foreach ($row as $area) {\r\n if ($area['types'][0] == \"country\") {\r\n $this->country = $area['short_name']; \r\n }\r\n \r\n if ($area['types'][0] == \"administrative_area_level_2\") {\r\n $this->region = $area['long_name']; \r\n }\r\n \r\n if ($area['types'][0] == \"administrative_area_level_3\") {\r\n $this->neighbourhood = $area['long_name']; \r\n }\r\n \r\n if ($area['types'][0] == \"locality\") {\r\n $this->locality = $area['long_name']; \r\n }\r\n }\r\n }\r\n \r\n if (empty($this->country) || empty($this->region) || empty($this->locality)) {\r\n // Google doesn't give data in a consistent bloody format - go here instead\r\n $url = sprintf(\"http://www.geoplugin.net/extras/location.gp?lat=%s&long=%s&format=php\", $this->lat, $this->lon);\r\n $ch = curl_init();\r\n \r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n \r\n $geodata = curl_exec($ch);\r\n $geodata = unserialize($geodata); \r\n curl_close($ch);\r\n \r\n $this->country = $geodata['geoplugin_countryCode']; \r\n $this->region = $geodata['geoplugin_region']; \r\n $this->locality = $geodata['geoplugin_place']; \r\n $this->neighbourhood = NULL;\r\n }\r\n \r\n return;\r\n */\r\n \r\n }", "private function executeRequest()\n {\n $response = \\GoogleMaps\\GoogleMaps::load('geocoding')\n ->setParam([\n 'address' => $this->place->complete_address\n ])\n ->get();\n\n // sometimes, Google's not entirely sure and will send multiple, but first = best\n return collect(json_decode($response)->results)->first();\n }", "public function actionGeoSearch()\n {\n $request = Yii::app()->request;\n \n $searchType = $request->getParam('searchType', 'byName');\n \n switch ($searchType) {\n case 'byName':\n $where = $request->getParam('q', 'Новосибирск');\n $searchParams = array('q' => $where);\n break;\n case 'byPoint':\n $lat = $request->getParam('lat', '54.991984');\n $lon = $request->getParam('lon', '82.901886');\n $searchParams = array('q' => $lon . ',' . $lat);\n break;\n }\n $searchParams['format'] = 'full';\n //$searchParams['limit'] = 10;\n\n $jst = microtime(true);\n \n try {\n $json = Yii::app()->apiClient->geoSearch($searchParams);\n } catch (Exception $e) {\n $json = '{}';\n }\n\n $jet = microtime(true);\n Yii::trace(print_r($json, true), 'demo.geoSearch.result');\n $xst = microtime(true);\n \n try {\n $xml = Yii::app()->apiClient->geoSearch($searchParams, 'xml');\n } catch (Exception $e) {\n $xml = '';\n }\n \n $xet = microtime(true);\n\n $geoms = json_decode($json);\n switch ($searchType) {\n case 'byName':\n $center = null;\n if (isset($geoms->result) && isset($geoms->result[count($geoms->result) - 1]->centroid)) {\n $center = $geoms->result[count($geoms->result) - 1]->centroid;\n }\n break;\n case 'byPoint':\n $center = 'POINT(' . $lon . ' ' . $lat . ')';\n break;\n }\n\n $this->render('geom_list', array(\n 'geoms' => $geoms,\n 'where' => isset($where) ? $where : null,\n 'lat' => isset($lat) ? $lat : null,\n 'lon' => isset($lon) ? $lon : null,\n 'workingNow' => false,\n 'searchType' => $searchType,\n 'center' => $center,\n 'rawJson' => Helper::jsonPrettify($json),\n 'rawXml' => $xml,\n 'rawRe' => Yii::app()->apiClient->lastRequest,\n 'jsonRespTime' => $jet - $jst,\n 'xmlRespTime' => $xet - $xst,\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
List of reseller Sales Pricing
public function resellerPricing($id = '') { if ($id != '') { $data['id'] = DashboardService::fetchDataFromTable($id, 'reseller_profile', 'user_id', 'reseller_ID'); } else { $data['id'] = ''; } $data['resellerProfileId'] = $id; $data['resellerList'] = DB::table('reseller_user') ->select(array('reseller_user.*', 'reseller_profile.reseller_ID as ri')) ->leftJoin('reseller_profile', 'reseller_user.id', '=', 'reseller_profile.user_id') ->where('reseller_user.user_type', '=', 1) ->get(); return view('reseller.resellerPricing', $data); }
[ "public function listReseller();", "public function getSaleList();", "public function getPricing()\n {\n return $this->api->submit('resellers/prices', [], 'GET');\n }", "public function getSalePrices()\n {\n return $this->postRequest('GetSalePrices');\n }", "public function reseller_pricing(){\n\t $page_data['page'] = 'data';\n $page_data['data'] = $this->site->get_result('services', 'id, title, message', \"(product_id = 1)\");\n\t $this->load->view('landing/pricing', $page_data);\n }", "public function getGetSalesReps($param);", "public function sellers()\n {\n SellerResource::withoutWrapping();\n return SellerResource::collection($this->sellerService->getSellers());\n }", "public function get_sale_products(){\n\t\treturn $this->get_products(\"SELECT * FROM products WHERE SalePrice > 0 ORDER BY Name\");\n\t}", "public function repaymentSales(){\n return $this->repayments()->where('data_type', 'sales');\n }", "public static function seller(){\n\n return DBHelper::getArrayRow('*', self::$table_seller);\n\n }", "public function get_all_prices() {\n\t\treturn $this->run( 'pricing/all' );\n\t}", "public function choose_resellers(){\n\t\t$this->layout = '';\n\t\t$currPage = 1;\n\t\t$pageSize = 100;\n\t\t$search = null;\n\t\t\n\t\tif (! empty ( $_REQUEST ['page'] ))$currPage = $_REQUEST ['page'];\n\t\t\n\t\tif (! empty ( $_REQUEST ['size'] ))$pageSize = $_REQUEST ['size'];\n\t\t\n\t\tif (!empty($_REQUEST['search'])) {\n\t\t\t$search = $_REQUEST['search'];\n\t\t\t$this->set('search',$search);\n\t\t}\n\t\t\n\t\t$reseller_id = $this->Session->read('sst_reseller_id');\n\t\t$results = $this->Cdr->choose_resellers ( $currPage, $pageSize,$search,$reseller_id);\n\t\t\n\t\t$this->set ( 'p', $results );\n\t}", "public function getPrices()\n {\n }", "public function all()\n {\n // Supplier type = 2\n $resellers = $this->user->resellersByType('2');\n //dd($resellers);\n return view('resellers.all', ['resellers' => $resellers]); \n }", "function edd_sl_sales_api( $sales ) {\n\tforeach( $sales['sales'] as $id => $sale ) {\n\n\t\t$sales['sales'][ $id ]['licenses'] = array();\n\n\t\tif ( ! $sale['ID'] ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$licenses = edd_software_licensing()->get_licenses_of_purchase( $sale['ID'] );\n\n\t\tif( ! empty( $licenses ) ) {\n\t\t\t$i = 0;\n\n\t\t\tforeach( $licenses as $license ) {\n\t\t\t\t$key = edd_software_licensing()->get_license_key( $license->ID );\n\t\t\t\t$download = edd_software_licensing()->get_download_id( $license->ID );\n\t\t\t\t$price_id = edd_software_licensing()->get_price_id( $license->ID );\n\t\t\t\t$title = get_the_title( $download );\n\t\t\t\t$status = edd_software_licensing()->get_license_status( $license->ID );\n\n\t\t\t\tif( edd_has_variable_prices( $download ) ) {\n\t\t\t\t\t$title .= ' - ' . edd_get_price_option_name( $download, $price_id );\n\t\t\t\t}\n\n\t\t\t\t$sales['sales'][ $id ]['licenses'][ $i ]['id'] = $license->ID;\n\t\t\t\t$sales['sales'][ $id ]['licenses'][ $i ]['name'] = $title;\n\t\t\t\t$sales['sales'][ $id ]['licenses'][ $i ]['status'] = $status;\n\t\t\t\t$sales['sales'][ $id ]['licenses'][ $i ]['key'] = ( $license ? $key : 'none' );\n\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn $sales;\n}", "function getAllSales()\n\t{\n\t\treturn $this->db->get('tbl_sales').result();\n\t}", "public function getSellerCollection()\n {\n return $this->sellerCollection;\n }", "public function getResellers() {\n return $this->database->table('resellers');\n }", "protected function getSalePrices()\r\n\t{\r\n\t\t// try parsing the sale prices, otherwise parse as a normal if there are no sale prices nodes\r\n\t\ttry \r\n\t\t{\r\n\t\t\t// ASOS has RRP previous price for outlets, so try to handle these first\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\t$was = str_replace(',', $this->services->getCrawler()->filter('#ctl00_ContentMainPage_ctlSeparateProduct_lblRRP')->text());\r\n\t\t\t\t$was = preg_replace('/[^0-9,.]/', '', $was);\r\n\t\t\t\t$now = explode('£', $this->services->getCrawler()->filter('#ctl00_ContentMainPage_ctlSeparateProduct_lblProductPrice')->text());\r\n\t\t\t\t$now = str_replace(',', '', end($now));\t\r\n\t\t\t}\r\n\t\t\tcatch (\\Exception $e)\r\n\t\t\t{\r\n\t\t\t\t// it also has different ids for multi item pages\r\n\t\t\t\ttry \r\n\t\t\t\t{\r\n\t\t\t\t\t$was = explode('£', $this->services->getCrawler()->filter('#ctl00_ContentMainPage_ctlSeparateProduct_lblProductPreviousPrice')->text());\r\n\t\t\t\t\t$was = preg_replace('/[^0-9,.]/', '', $was);\r\n\t\t\t\t\t$now = explode('£', $this->services->getCrawler()->filter('#ctl00_ContentMainPage_ctlSeparateProduct_lblProductPrice')->text());\r\n\t\t\t\t\t$now = str_replace(',', '', end($now));\r\n\t\t\t\t}\r\n\t\t\t\tcatch (\\Exception $e)\r\n\t\t\t\t{\r\n\t\t\t\t\t// it also has different ids for multi item pages\r\n\t\t\t\t\ttry \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$was = explode('£', $this->services->getCrawler()->filter('#ctl00_ContentMainPage_ctlSeparateProduct_lblRRP')->text());\r\n\t\t\t\t\t\t$was = preg_replace('/[^0-9,.]/', '', $was);\r\n\t\t\t\t\t\t$now = explode('£', $this->services->getCrawler()->filter('#ctl00_ContentMainPage_ctlSeparateProduct_lblProductPrice')->text());\r\n\t\t\t\t\t\t$now = str_replace(',', '', end($now));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch (\\Exception $e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$was = explode('£', $this->services->getCrawler()->filter('#ctl00_ContentMainPage_ctlSeparate1_lblProductPreviousPrice')->text());\r\n\t\t\t\t\t\t$was = preg_replace('/[^0-9,.]/', '', $was);\r\n\t\t\t\t\t\t$now = explode('£', $this->services->getCrawler()->filter('#ctl00_ContentMainPage_ctlSeparate1_lblProductPrice')->text());\r\n\t\t\t\t\t\t$now = str_replace(',', '', end($now));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$this->product->setNow($now);\r\n\t\t\t$this->product->setWas($was);\r\n\t\t\t$this->product->setSale($this->timestamp);\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch (\\Exception $e)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the isMetadataUpdateAllowed property value. The isMetadataUpdateAllowed property
public function setIsMetadataUpdateAllowed(?bool $value): void { $this->getBackingStore()->set('isMetadataUpdateAllowed', $value); }
[ "protected function isUpdateAllowed()\n\t{\n\t\treturn $this->editable;\n\t}", "public function setUpdateEntityIfExists($bool) {\r\n $this->_updateEntityIfExists = $bool;\r\n }", "public function setUpdate($value);", "public function setUpdateEntityIfExists(bool $bool): void\n {\n $this->updateEntityIfExists = $bool;\n }", "public function setMicrosoftLauncherFeedAllowUserModification(?bool $value): void {\n $this->getBackingStore()->set('microsoftLauncherFeedAllowUserModification', $value);\n }", "public function setImitsUpdateFlag($injection_id) {\n $injectionsTable = TableRegistry::get('Injections');\n $inj = $injectionsTable->get($injection_id);\n $inj = $injectionsTable->patchEntity($inj,\n ['do_imits_update' => 1]\n );\n if (!$injectionsTable->save($inj)) {\n return false; //something went wrong when saving\n }\n return true; // all OK, the flag has been set\n }", "public function setWriteDoctrineMetadata(bool $writeDoctrineMetadata): void\n {\n $this->attributes['writeDoctrineMetadata'] = $writeDoctrineMetadata;\n }", "public function set_is_updating() {\n\t\tif ( ! self::$is_updating && $_GET && isset( $_GET['avada_update'] ) && '1' == $_GET['avada_update'] ) { // phpcs:ignore WordPress.Security.NonceVerification, WordPress.PHP.StrictComparisons\n\t\t\tself::$is_updating = true;\n\t\t}\n\t}", "public function isAllowedToUpdate()\n { }", "public function canUpdateOption() {\n\t}", "public function set_writemode_updateIfPossible() {\n $this->_write_new = FALSE;\n }", "public function setAllowOverwrite($overwrite = true)\n\t{\n\t\t$this->_overwrite = (bool)$overwrite;\n\t}", "public function setAllowPartnerToCollectIOSPersonalApplicationMetadata(?bool $value): void {\n $this->getBackingStore()->set('allowPartnerToCollectIOSPersonalApplicationMetadata', $value);\n }", "public function hasUpdateMetadata()\n {\n return $this->update_metadata !== null;\n }", "public function setUpdateXmlEntityIfExists($bool)\n {\n $this->updateXmlEntityIfExists = $bool;\n }", "public function markLastUpdate()\n {\n if (!$this->updatedAtOveridden) {\n $this->updatedAt = new \\DateTime();\n }\n }", "public function setAllowCreateUpdateChannels($val)\n {\n $this->_propDict[\"allowCreateUpdateChannels\"] = $val;\n return $this;\n }", "public function testUpdateContentMetadataAccess()\n {\n }", "public function isUpdateSupported() {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validateEntry Validates user entry on an instance of the field on a dynamic form. This is called when an instance of this field (like a TextboxField) receives data from the user and that value should be validated. Parameters: $value (string) input from the user
function validateEntry($value) { if (!$value && count($this->_errors)) return; # Validates a user-input into an instance of this field on a dynamic # form if ($this->get('required') && !$value && $this->hasData()) $this->_errors[] = sprintf('%s is a required field', $this->getLabel()); # Perform declared validators for the field if ($vs = $this->get('validators')) { if (is_array($vs)) { foreach ($vs as $validator) if (is_callable($validator)) $validator($this, $value); } elseif (is_callable($vs)) $vs($this, $value); } }
[ "public function processInputValue(Model $model, ModelField $field, Entry $entry, $value);", "public function validate($value);", "public function validateValue($value)\n {\n }", "abstract protected function validateValue($value);", "private function validateField($fieldName, $rule, $rule_value){\n \n switch(strtolower($rule)){\n\n case \"required\":\n if(strtolower($rule_value) == \"true\"){\n if(!Input::exists($fieldName) || !Input::entered($fieldName)){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" is required.\");\n }\n }\n break;\n \n case \"email\":\n if(strtolower($rule_value) == \"true\"){\n if( (Input::entered($fieldName)) && !filter_var(Input::get($fieldName), FILTER_VALIDATE_EMAIL)){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" is not a valid email address.\");\n }\n }\n break;\n \n case \"minlength\":\n if( (Input::entered($fieldName)) && strlen(Input::get($fieldName)) < $rule_value){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" must be at least {$rule_value} characters long.\");\n }\n break;\n \n case \"maxlength\":\n if( (Input::entered($fieldName)) && strlen(Input::get($fieldName)) > $rule_value){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" must not exceed {$rule_value} characters.\");\n }\n break;\n \n case \"rangelength\":\n list($min, $max) = explode(',', $rule_value);\n if( (Input::entered($fieldName)) && (strlen(Input::get($fieldName)) > (float)$max || strlen(Input::get($fieldName)) < (float)$min) ){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" must be between {$min} and {$max} characters.\");\n }\n break;\n \n case \"min\":\n if( (Input::entered($fieldName)) && ((float)Input::get($fieldName) < (float)$rule_value)){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" must be greater than or equal to {$rule_value}.\");\n }\n break;\n \n case \"max\":\n if( (Input::entered($fieldName)) && ((float)Input::get($fieldName) > (float)$rule_value)){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" must be lesser than or equal to {$rule_value}.\");\n }\n break;\n \n case \"range\":\n list($min, $max) = explode(',', $rule_value);\n if( (Input::entered($fieldName)) && ((float)Input::get($fieldName) > (float)$max || (float)Input::get($fieldName) < (float)$min) ){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" must be between {$min} and {$max}.\");\n }\n break;\n \n case \"equalto\":\n if( (Input::entered($fieldName)) && (Input::get($fieldName) !== Input::get($rule_value)) ){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" must match \" . $this->fieldName($rule_value) . \" field.\");\n }\n break;\n \n case \"date\":\n if(strtolower($rule_value) == \"true\"){\n if( (Input::entered($fieldName)) && !$this->validateDate(Input::get($fieldName), 'd/m/Y')){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" is not a valid URL.\");\n }\n }\n break;\n \n case \"url\":\n if(strtolower($rule_value) == \"true\"){\n if( (Input::entered($fieldName)) && !filter_var(Input::get($fieldName), FILTER_VALIDATE_URL)){\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" is not a valid date.\");\n }\n }\n break;\n \n case \"remote\": \n if( (Input::entered($fieldName)) && $this->get_data($rule_value) == \"false\"){\n //echo \"ERROR IS TRUE\";\n $this->addError($fieldName, $rule, $this->fieldName($fieldName) . \" is not valid.\");\n }\n break;\n \n } \n }", "function acf_validate_value($value, $field, $input) {}", "function validate_value($valid, $value, $field, $input)\n {\n }", "public function filter_input_value( $value, $entry, $input_id = '' ) {\n\t\t/**\n\t\t * Allows the field or input value to be overridden when populating the entry (usually on retrieval from the database).\n\t\t *\n\t\t * @since 1.5.3\n\t\t * @since 1.9.14 Added the form and field specific versions.\n\t\t *\n\t\t * @param mixed $value The field or input value to be filtered.\n\t\t * @param array $entry The entry currently being processed.\n\t\t * @param GF_Field $this The field currently being processed.\n\t\t * @param string $input_id The ID of the input being processed from a multi-input field type or an empty string.\n\t\t */\n\t\treturn gf_apply_filters(\n\t\t\tarray(\n\t\t\t\t'gform_get_input_value',\n\t\t\t\t$this->formId,\n\t\t\t\t$this->id,\n\t\t\t),\n\t\t\t$value,\n\t\t\t$entry,\n\t\t\t$this,\n\t\t\t$input_id\n\t\t);\n\t}", "function user_extended_validate_entry($val, $params)\n\t{\n\t\tglobal $tp;\n\t\t$parms = explode('^,^', $params['user_extended_struct_parms']);\n\t\t$requiredField = $params['user_extended_struct_required'] == 1;\n\t\t$regex = $tp->toText($parms[1]);\n\t\t$regexfail = $tp->toText($parms[2]);\n\t\tif (defined($regexfail)) { $regexfail = constant($regexfail); }\n\t\tif($val == '' && $requiredField) return TRUE;\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase EUF_DATE :\n\t\t\t\tif ($requiredField && ($val == '0000-00-00')) return TRUE;\n\t\t\t\tbreak;\n\t\t}\n\t\tif($regex != \"\" && $val != \"\")\n\t\t{\n\t\t\tif(!preg_match($regex, $val)) return $regexfail ? $regexfail : TRUE;\n\t\t}\n\t\treturn FALSE;\t\t\t// Pass by default here\n\t}", "public function process( $entry ) {\n\n\t\t$this->errors = array();\n\t\t$this->fields = array();\n\t\t$form_id = absint( $entry['id'] );\n\t\t$form = wpforms()->form->get( $form_id );\n\t\t$honeypot = false;\n\n\t\t// Validate form is real and active (published).\n\t\tif ( ! $form || 'publish' !== $form->post_status ) {\n\t\t\t$this->errors[ $form_id ]['header'] = esc_html__( 'Invalid form.', 'wpforms-lite' );\n\t\t\treturn;\n\t\t}\n\n\t\t// Formatted form data for hooks.\n\t\t$form_data = apply_filters( 'wpforms_process_before_form_data', wpforms_decode( $form->post_content ), $entry );\n\n\t\t// Pre-process/validate hooks and filter.\n\t\t// Data is not validated or cleaned yet so use with caution.\n\t\t$entry = apply_filters( 'wpforms_process_before_filter', $entry, $form_data );\n\n\t\tdo_action( 'wpforms_process_before', $entry, $form_data );\n\t\tdo_action( \"wpforms_process_before_{$form_id}\", $entry, $form_data );\n\n\t\t// Validate fields.\n\t\tforeach ( $form_data['fields'] as $field ) {\n\n\t\t\t$field_id = $field['id'];\n\t\t\t$field_type = $field['type'];\n\t\t\t$field_submit = isset( $entry['fields'][ $field_id ] ) ? $entry['fields'][ $field_id ] : '';\n\n\t\t\tdo_action( \"wpforms_process_validate_{$field_type}\", $field_id, $field_submit, $form_data );\n\t\t}\n\n\t\t// reCAPTCHA check.\n\t\t$site_key = wpforms_setting( 'recaptcha-site-key', '' );\n\t\t$secret_key = wpforms_setting( 'recaptcha-secret-key', '' );\n\t\tif (\n\t\t\t! empty( $site_key ) &&\n\t\t\t! empty( $secret_key ) &&\n\t\t\tisset( $form_data['settings']['recaptcha'] ) &&\n\t\t\t'1' == $form_data['settings']['recaptcha']\n\t\t) {\n\t\t\tif ( ! empty( $_POST['g-recaptcha-response'] ) ) {\n\t\t\t\t$data = wp_remote_get( 'https://www.google.com/recaptcha/api/siteverify?secret=' . $secret_key . '&response=' . $_POST['g-recaptcha-response'] );\n\t\t\t\t$data = json_decode( wp_remote_retrieve_body( $data ) );\n\t\t\t\tif ( empty( $data->success ) ) {\n\t\t\t\t\t$this->errors[ $form_id ]['recaptcha'] = esc_html__( 'Incorrect reCAPTCHA, please try again.', 'wpforms-lite' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->errors[ $form_id ]['recaptcha'] = esc_html__( 'reCAPTCHA is required.', 'wpforms-lite' );\n\t\t\t}\n\t\t}\n\n\t\t// Check if combined upload size exceeds allowed maximum.\n\t\t$upload_fields = wpforms_get_form_fields( $form, array( 'file-upload' ) );\n\t\tif ( ! empty( $upload_fields ) && ! empty( $_FILES ) ) {\n\n\t\t\t// Get $_FILES keys generated by WPForms only.\n\t\t\t$files_keys = preg_filter( '/^/', 'wpforms_' . $form_id . '_', array_keys( $upload_fields ) );\n\n\t\t\t// Filter uploads without errors. Individual errors are handled by WPForms_Field_File_Upload class.\n\t\t\t$files = wp_list_filter( wp_array_slice_assoc( $_FILES, $files_keys ), array( 'error' => 0 ) );\n\t\t\t$files_size = array_sum( wp_list_pluck( $files, 'size' ) );\n\t\t\t$files_size_max = wpforms_max_upload( true );\n\n\t\t\tif ( $files_size > $files_size_max ) {\n\n\t\t\t\t// Add new header error preserving previous ones.\n\t\t\t\t$this->errors[ $form_id ]['header'] = ! empty( $this->errors[ $form_id ]['header'] ) ? $this->errors[ $form_id ]['header'] . '<br>' : '';\n\t\t\t\t$this->errors[ $form_id ]['header'] .= esc_html__( 'Uploaded files combined size exceeds allowed maximum.', 'wpforms-lite' );\n\t\t\t}\n\t\t}\n\n\t\t// Initial error check.\n\t\t// Don't proceed if there are any errors thus far. We provide a filter\n\t\t// so that other features, such as conditional logic, have the ability\n\t\t// to adjust blocking errors.\n\t\t$errors = apply_filters( 'wpforms_process_initial_errors', $this->errors, $form_data );\n\n\t\tif ( ! empty( $errors[ $form_id ] ) ) {\n\t\t\tif ( empty( $this->errors[ $form_id ]['header'] ) ) {\n\t\t\t\t$errors[ $form_id ]['header'] = esc_html__( 'Form has not been submitted, please see the errors below.', 'wpforms-lite' );\n\t\t\t}\n\t\t\t$this->errors = $errors;\n\t\t\treturn;\n\t\t}\n\n\t\t// Validate honeypot early - before actual processing.\n\t\tif (\n\t\t\t! empty( $form_data['settings']['honeypot'] ) &&\n\t\t\t'1' == $form_data['settings']['honeypot'] &&\n\t\t\t! empty( $entry['hp'] )\n\t\t) {\n\t\t\t$honeypot = esc_html__( 'WPForms honeypot field triggered.', 'wpforms-lite' );\n\t\t}\n\n\t\t$honeypot = apply_filters( 'wpforms_process_honeypot', $honeypot, $this->fields, $entry, $form_data );\n\n\t\t// If spam - return early.\n\t\tif ( $honeypot ) {\n\t\t\t// Logs spam entry depending on log levels set.\n\t\t\twpforms_log(\n\t\t\t\t'Spam Entry ' . uniqid(),\n\t\t\t\tarray( $honeypot, $entry ),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => array( 'spam' ),\n\t\t\t\t\t'form_id' => $form_data['id'],\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Pass the form created date into the form data.\n\t\t$form_data['created'] = $form->post_date;\n\n\t\t// Format fields.\n\t\tforeach ( (array) $form_data['fields'] as $field ) {\n\n\t\t\t$field_id = $field['id'];\n\t\t\t$field_type = $field['type'];\n\t\t\t$field_submit = isset( $entry['fields'][ $field_id ] ) ? $entry['fields'][ $field_id ] : '';\n\n\t\t\tdo_action( \"wpforms_process_format_{$field_type}\", $field_id, $field_submit, $form_data );\n\t\t}\n\n\t\t// This hook is for internal purposes and should not be leveraged.\n\t\tdo_action( 'wpforms_process_format_after', $form_data );\n\n\t\t// Process hooks/filter - this is where most addons should hook\n\t\t// because at this point we have completed all field validation and\n\t\t// formatted the data.\n\t\t$this->fields = apply_filters( 'wpforms_process_filter', $this->fields, $entry, $form_data );\n\n\t\tdo_action( 'wpforms_process', $this->fields, $entry, $form_data );\n\t\tdo_action( \"wpforms_process_{$form_id}\", $this->fields, $entry, $form_data );\n\n\t\t$this->fields = apply_filters( 'wpforms_process_after_filter', $this->fields, $entry, $form_data );\n\n\t\t// One last error check - don't proceed if there are any errors.\n\t\tif ( ! empty( $this->errors[ $form_id ] ) ) {\n\t\t\tif ( empty( $this->errors[ $form_id ]['header'] ) ) {\n\t\t\t\t$this->errors[ $form_id ]['header'] = esc_html__( 'Form has not been submitted, please see the errors below.', 'wpforms-lite' );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Success - add entry to database.\n\t\t$entry_id = $this->entry_save( $this->fields, $entry, $form_data['id'], $form_data );\n\n\t\t// Success - send email notification.\n\t\t$this->entry_email( $this->fields, $entry, $form_data, $entry_id, 'entry' );\n\n\t\t// Pass completed and formatted fields in POST.\n\t\t$_POST['wpforms']['complete'] = $this->fields;\n\n\t\t// Pass entry ID in POST.\n\t\t$_POST['wpforms']['entry_id'] = $entry_id;\n\n\t\t// Logs entry depending on log levels set.\n\t\twpforms_log(\n\t\t\t$entry_id ? \"Entry {$entry_id}\" : 'Entry',\n\t\t\t$this->fields,\n\t\t\tarray(\n\t\t\t\t'type' => array( 'entry' ),\n\t\t\t\t'parent' => $entry_id,\n\t\t\t\t'form_id' => $form_data['id'],\n\t\t\t)\n\t\t);\n\n\t\t// Post-process hooks.\n\t\tdo_action( 'wpforms_process_complete', $this->fields, $entry, $form_data, $entry_id );\n\t\tdo_action( \"wpforms_process_complete_{$form_id}\", $this->fields, $entry, $form_data, $entry_id );\n\n\t\t$this->entry_confirmation_redirect( $form_data );\n\t}", "function acf_validate_value( $value, $field, $input ) {\n}", "public function setEntry($value)\n {\n return $this->set('Entry', $value);\n }", "public function validate( $value ): Learndash_DTO_Property_Validation_Result;", "private function validate($key, $value) {\n if ($this->keyValidation) {\n $cb = $this->keyValidation;\n $cb($key);\n }\n if ($this->valueValidation) {\n $cb = $this->valueValidation;\n $cb($value);\n }\n }", "public function validate($value)\n {\n return $value;\n }", "private function _validate_field( $key, $value ) {\n\t\t// Is required field?\n\t\tif ( $this->_field_prop_is( $key, 'required', 'yes' ) && empty( $value ) ) {\n\t\t\tthrow new Exception(\n\t\t\t\tsprintf(\n\t\t\t\t\t__( '%s is required field and can not be empty.', 'woocommerce-box-office' ),\n\t\t\t\t\t$this->_field_prop_val( $key, 'label' )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$type = $this->_field_prop_val( $key, 'type' );\n\t\tif ( ! empty( $value ) ) {\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'email':\n\t\t\t\t\tif ( ! is_email( $value ) ) {\n\t\t\t\t\t\tthrow new Exception( __( 'Invalid email is provided.', 'woocommerce-box-office' ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'url':\n\t\t\t\t\t$url_parts = parse_url( $value );\n\t\t\t\t\tif ( empty( $url_parts['scheme'] ) ) {\n\t\t\t\t\t\t$value = 'http://' . $value;\n\t\t\t\t\t}\n\t\t\t\t\tif ( false === filter_var( $value, FILTER_VALIDATE_URL ) ) {\n\t\t\t\t\t\tthrow new Exception( __( 'Invalid URL is provided', 'woocommerce-box-office' ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'select':\n\t\t\t\tcase 'radio':\n\t\t\t\tcase 'checkbox':\n\t\t\t\t\t$options = $this->_field_prop_val( $key, 'options', '' );\n\t\t\t\t\t$options = array_map( 'trim', explode( ',', $options ) );\n\t\t\t\t\tif ( ! is_array( $value ) ) {\n\t\t\t\t\t\t$value = array( $value );\n\t\t\t\t\t}\n\n\t\t\t\t\t$value = stripslashes_deep( $value );\n\t\t\t\t\tforeach ( $value as $val ) {\n\t\t\t\t\t\tif ( ! in_array( $val, $options ) ) {\n\t\t\t\t\t\t\tthrow new Exception( sprintf( __( 'Invalid value for field %s', 'woocommerce-box-office' ), $this->_field_prop_val( $key, 'label' ) ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "protected abstract function onValidate($key, $value);", "public function validateEntry() {\n\t\t$result = false;\n\t\ttry {\n\t\t\t$this->_validateParam( 'id' );\n\t\t\t$this->_db->query( \"SELECT * FROM $this->_dbTable WHERE id = :id;\" );\n\t\t\t$this->_db->bind( ':id', $this->_params->id );\n\t\t\t$this->_db->execute();\n\t\t\tif( $this->_db->rowCount( $this->_dbTable ) > 0 ) {\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t} catch( Exception $e ) {\n\t\t\tif( ENV == 'prod' ) throw new Exception( $e->getMessage() );\n\t\t\t\telse throw new Exception( __CLASS__ . '::' . __FUNCTION__ . ' throw ' . $e->getMessage() );\n\t\t}\n\t\treturn $result;\n\t}", "private function validate_value( $value, $rule ) {\n\n //base validation on type of rule\n switch( $rule[ 0 ] ) {\n case 'vector':\n\n //for vectors, the <req> item might contain an array of rules\n if( $rule[ 1 ] !== false ) {\n\n //not enough rules to validate what was given\n if( count( $rule[ 1 ] ) < count( $value ) ) {\n return false;\n }\n\n //check each value against each rule\n for( $i = 0; $i < count( $value ); ++$i ) {\n $this->validate_value( $value[ $i ], $rule[ 1 ][ $i ] );\n }\n }\n\n break;\n\n case 'keyword':\n ////ZIH\n break;\n case 'integer':\n ////ZIH\n break;\n case 'float':\n ////ZIH\n break;\n case 'string':\n break;\n default:\n throw new \\RuntimeException(\n \"Invalid validation rule type: {$rule[0]}.\"\n );\n break;\n }\n\n ////ZIH - left off here\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'actionAccountDomain'
protected function actionAccountDomainRequest($account_uuid, $domain_uuid, $action, $body = null) { // verify the required parameter 'account_uuid' is set if ($account_uuid === null || (is_array($account_uuid) && count($account_uuid) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $account_uuid when calling actionAccountDomain' ); } // verify the required parameter 'domain_uuid' is set if ($domain_uuid === null || (is_array($domain_uuid) && count($domain_uuid) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $domain_uuid when calling actionAccountDomain' ); } // verify the required parameter 'action' is set if ($action === null || (is_array($action) && count($action) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $action when calling actionAccountDomain' ); } $resourcePath = '/api/v1/account/{accountUuid}/domain/{domainUuid}/{action}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($account_uuid !== null) { $resourcePath = str_replace( '{' . 'accountUuid' . '}', ObjectSerializer::toPathValue($account_uuid), $resourcePath ); } // path params if ($domain_uuid !== null) { $resourcePath = str_replace( '{' . 'domainUuid' . '}', ObjectSerializer::toPathValue($domain_uuid), $resourcePath ); } // path params if ($action !== null) { $resourcePath = str_replace( '{' . 'action' . '}', ObjectSerializer::toPathValue($action), $resourcePath ); } // body params $_tempBody = null; if (isset($body)) { $_tempBody = $body; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // 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 Bearer token if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $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( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "public function domainCreate($accountID, Request $request) {\n if (DAAccount::where('id', $accountID)->where('ownerID', \\Auth::user()->id)->count() == 0) {\n $request->session()->flash('message.level', 'error');\n $request->session()->flash('message.content', 'You do not have sufficient permissions to manage this service.');\n return '-1';\n }\n if (empty($request->input('domain'))) return '-2';\n if (!filter_var($request->input('domain'), FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) return '-2';\n $current_domains = $this->domainArray($accountID);\n if (in_array($request->input('domain'), $current_domains)) return '-3';\n\n $account = DAAccount::where('id', $accountID)->first();\n $serverObject = DAServer::where('id', $account->serverID)->first();\n\n $da = new DirectAdmin();\n $da->connect(\"ssl://\" . $serverObject->hostname, 2222);\n $da->set_login($serverObject->username . \"|\" . $account->username, $serverObject->apikey);\n\n $da->query('/CMD_API_DOMAIN', http_build_query(array(\n \"action\" => \"create\",\n \"domain\" => $request->input('domain')\n )));\n parse_str(urldecode($da->fetch_body()), $res);\n if ($res[\"error\"] == \"1\") return $res[\"details\"];\n return '0';\n }", "protected function accountManagedDomainRequest($account_id)\n {\n // verify the required parameter 'account_id' is set\n if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $account_id when calling accountManagedDomain'\n );\n }\n\n $resourcePath = '/accounts/{accountId}/managed_domains';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($account_id !== null) {\n $resourcePath = str_replace(\n '{' . 'accountId' . '}',\n ObjectSerializer::toPathValue($account_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/json', 'multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createDomain($domain) {\r\n $command = $this->createCommand('SystemDomainAddRequest');\r\n if ($domain != '')\r\n $command->appendChild($this->createElementEscape('domain', $domain));\r\n return $command;\r\n }", "public function createRequestForCreateAccount(Account $account): RequestInterface\n {\n return $this->createRequest('POST', '/accounts', $account, [], [], []);\n }", "protected function getAccountRequest()\n {\n\n $resourcePath = '/account';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api-key');\n if ($apiKey !== null) {\n $headers['api-key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('partner-key');\n if ($apiKey !== null) {\n $headers['partner-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function listOptionsAccountRequest()\n {\n\n $resourcePath = '/options/accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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 (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\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 Gate APIv4 authentication\n $signHeaders = $this->config->buildSignHeaders('GET', $resourcePath, $queryParams, $httpBody);\n $headers = array_merge($headers, $signHeaders);\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 checkDomainRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $version_id = array_key_exists('version_id', $options) ? $options['version_id'] : null;\n $domain_name = array_key_exists('domain_name', $options) ? $options['domain_name'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling checkDomain'\n );\n }\n // verify the required parameter 'version_id' is set\n if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $version_id when calling checkDomain'\n );\n }\n // verify the required parameter 'domain_name' is set\n if ($domain_name === null || (is_array($domain_name) && count($domain_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $domain_name when calling checkDomain'\n );\n }\n\n $resourcePath = '/service/{service_id}/version/{version_id}/domain/{domain_name}/check';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($version_id !== null) {\n $resourcePath = str_replace(\n '{' . 'version_id' . '}',\n ObjectSerializer::toPathValue($version_id),\n $resourcePath\n );\n }\n // path params\n if ($domain_name !== null) {\n $resourcePath = str_replace(\n '{' . 'domain_name' . '}',\n ObjectSerializer::toPathValue($domain_name),\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\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 $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function setDomainAction($val)\n {\n $this->_propDict[\"domainAction\"] = $val;\n return $this;\n }", "public function registerDomain($request)\n {\n\n // Load the domain api\n $domain_api = new Api\\Domain();\n\n // Split the domain at the extension\n $domain_parts = \\App::get('domainhelper')->splitDomain($request->domain->domain);\n\n $domain_params = array(\n 'SLD' => $domain_parts[0],\n 'TLD' => $domain_parts[1],\n 'NumYears' => $request->years,\n 'IgnoreNSFail' => 'Yes',\n );\n\n // Add the nameservers to the $domain_params array\n $i = 1;\n foreach ($request->nameservers as $nameserver) {\n\n // Enom allows up to 12 nameservers to be set, so ensure no more than\n // that are submitted.\n if ($i <= 12) {\n $domain_params['NS'.$i] = $nameserver;\n $i++;\n }\n }\n\n // Build contact data\n $registrant = \\App::get('domainhelper')->getContact($request->contacts['registrant']);\n $administrative = \\App::get('domainhelper')->getContact($request->contacts['administrative']);\n $technical = \\App::get('domainhelper')->getContact($request->contacts['technical']);\n $billing = \\App::get('domainhelper')->getContact($request->contacts['billing']);\n\n\n // Registrant contact. Not all extensions require this, however we'll set\n // it anyway as it can still be used and reduces the need to do additional\n // unnecessery checks.\n $registrant_contact = array(\n 'RegistrantFirstName' => $registrant->first_name,\n 'RegistrantLastName' => $registrant->last_name,\n 'RegistrantAddress1' => $registrant->address1,\n 'RegistrantAddress2' => $registrant->address2,\n 'RegistrantCity' => $registrant->city,\n 'RegistrantStateProvince' => $registrant->state,\n 'RegistrantPostalCode' => $registrant->postcode,\n 'RegistrantCountry' => \\App::get('domainhelper')->getIsoCode($registrant->country),\n 'RegistrantEmailAddress' => $registrant->email,\n 'RegistrantPhone' => '+' . $registrant->phone_cc . '.' . $registrant->phone,\n );\n\n if ($registrant->company !='') {\n $registrant_contact['RegistrantOrganization'] = $registrant->company;\n\n if ($registrant->job_title == '') {\n $registrant->job_title = 'N/A';\n }\n\n $registrant_contact['RegistrantJobTitle'] = $registrant->job_title;\n\n if ($registrant->fax_cc == '' || $registrant->fax == '') {\n $registrant_contact['RegistrantFax'] = '+' . $registrant->phone_cc . '.' . $registrant->phone;\n } else {\n $registrant_contact['RegistrantFax'] = '+' . $registrant->fax_cc . '.' . $registrant->fax;\n }\n }\n\n // Administrative contact\n $administrative_contact = array(\n 'AdminFirstName' => $administrative->first_name,\n 'AdminLastName' => $administrative->last_name,\n 'AdminAddress1' => $administrative->address1,\n 'AdminAddress2' => $administrative->address2,\n 'AdminCity' => $administrative->city,\n 'AdminStateProvince' => $administrative->state,\n 'AdminPostalCode' => $administrative->postcode,\n 'AdminCountry' => \\App::get('domainhelper')->getIsoCode($administrative->country),\n 'AdminEmailAddress' => $administrative->email,\n 'AdminPhone' => '+' . $administrative->phone_cc . '.' . $administrative->phone\n );\n\n if ($administrative->company !='') {\n $administrative_contact['AdminOrganization'] = $administrative->company;\n\n if ($administrative->job_title == '') {\n $administrative->job_title = 'N/A';\n }\n\n $administrative_contact['AdminJobTitle'] = $administrative->job_title;\n }\n\n // Technical contact\n $technical_contact = array(\n 'TechFirstName' => $technical->first_name,\n 'TechLastName' => $technical->last_name,\n 'TechAddress1' => $technical->address1,\n 'TechAddress2' => $technical->address2,\n 'TechCity' => $technical->city,\n 'TechStateProvince' => $technical->state,\n 'TechPostalCode' => $technical->postcode,\n 'TechCountry' => \\App::get('domainhelper')->getIsoCode($technical->country),\n 'TechEmailAddress' => $technical->email,\n 'TechPhone' => '+' . $technical->phone_cc . '.' . $technical->phone\n );\n\n if ($technical->company !='') {\n $technical_contact['TechOrganization'] = $technical->company;\n\n if ($technical->job_title == '') {\n $technical->job_title = 'N/A';\n }\n\n $technical_contact['TechJobTitle'] = $technical->job_title;\n }\n\n // Billing contact\n $billing_contact = array(\n 'AuxBillingFirstName' => $billing->first_name,\n 'AuxBillingLastName' => $billing->last_name,\n 'AuxBillingAddress1' => $billing->address1,\n 'AuxBillingAddress2' => $billing->address2,\n 'AuxBillingCity' => $billing->city,\n 'AuxBillingStateProvince' => $billing->state,\n 'AuxBillingPostalCode' => $billing->postcode,\n 'AuxBillingCountry' => \\App::get('domainhelper')->getIsoCode($billing->country),\n 'AuxBillingEmailAddress' => $billing->email,\n 'AuxBillingPhone' => '+' . $billing->phone_cc . '.' . $billing->phone\n );\n\n if ($billing->company !='') {\n $billing_contact['AuxBillingOrganization'] = $billing->company;\n\n if ($billing->job_title == '') {\n $billing->job_title = 'N/A';\n }\n\n $billing_contact['AuxBillingJobTitle'] = $billing->job_title;\n }\n\n // Merge contacts into the $domain_params array\n $domain_params = array_merge($domain_params, $registrant_contact, $administrative_contact, $technical_contact, $billing_contact);\n\n if (is_array($request->custom_data)) {\n $domain_params = array_merge($domain_params, $request->custom_data);\n }\n\n $custom_registration_handler = false;\n\n $extension_class = \\App::get('domainhelper')->loadExtensionClass($request->domain);\n\n if ($extension_class && $extension_class->registration_handler) {\n // Some domains may use a custom registration handler if they use a different\n // api call. These will be handled directly in the extension handler class\n // if one exists.\n // This domain extension uses a custom registration handler.\n $result = $extension_class->registerDomain($domain_params);\n } else {\n $result = $domain_api->registerDomain($domain_params);\n }\n\n if (isset($result->actionstatus) && $result->actionstatus == 'Success') {\n $return = new \\stdClass();\n $return->status = '1';\n\n return $return;\n }\n\n $return = new \\stdClass();\n $return->status = '0';\n\n if(isset($result->actionstatusdesc)) {\n $return->response = new \\stdClass();\n $return->response->type = 'error';\n $return->response->message = $result->actionstatusdesc;\n }\n\n return $return;\n }", "private function getAllDomainIpsRequest(string $domainName): Request\n {\n $allData = [\n 'domainName' => $domainName,\n ];\n\n $validationConstraints = [];\n\n $this\n ->addParamConstraints(\n [\n 'domainName' => [\n new Assert\\NotBlank(),\n ],\n ],\n $validationConstraints\n );\n\n $this->validateParams($allData, $validationConstraints);\n\n $resourcePath = '/email/1/domain-ips';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($domainName !== null) {\n $queryParams['domainName'] = $domainName;\n }\n\n $headers = [\n 'Accept' => 'application/json',\n\n ];\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n $formParams = \\json_decode($this->objectSerializer->serialize($formParams), true);\n\n if ($headers['Content-Type'] === 'multipart/form-data') {\n $boundary = '----' . hash('sha256', uniqid('', true));\n $headers['Content-Type'] .= '; boundary=' . $boundary;\n $multipartContents = [];\n\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = (\\is_array($formParamValue)) ? $formParamValue : [$formParamValue];\n\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents, $boundary);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = $this->objectSerializer->serialize($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = Query::build($formParams);\n }\n }\n\n $apiKey = $this->config->getApiKey();\n\n if ($apiKey !== null) {\n $headers[$this->config->getApiKeyHeader()] = $apiKey;\n }\n\n $defaultHeaders = [];\n\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 foreach ($queryParams as $key => $value) {\n if (\\is_array($value)) {\n continue;\n }\n\n $queryParams[$key] = $this->objectSerializer->toString($value);\n }\n\n $query = Query::build($queryParams);\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function hook_domain_operations(\\Drupal\\domain\\DomainInterface $domain, \\Drupal\\Core\\Session\\AccountInterface $account) {\n $operations = [];\n // Check permissions.\n if ($account->hasPermission('view domain aliases') || $account->hasPermission('administer domain aliases')) {\n // Add aliases to the list.\n $id = $domain->id();\n $operations['domain_alias'] = [\n 'title' => t('Aliases'),\n 'url' => \\Drupal\\Core\\Url::fromRoute('domain_alias.admin', ['domain' => $id]),\n 'weight' => 60,\n ];\n }\n return $operations;\n}", "function gandiv5_TransferDomain($params)\n{\n $apiKey = $params['API Key'];\n $sld = $params['sld'];\n $tld = $params['tld'];\n $registrationPeriod = $params['regperiod'];\n $domain = $sld . '.' . $tld;\n $contacts = [];\n $contacts[\"owner\"] = [\n \"firstname\" => $params[\"firstname\"],\n \"lastname\" => $params[\"lastname\"],\n \"email\" => $params[\"email\"],\n \"address\" => $params[\"address1\"],\n \"city\" => $params[\"city\"],\n \"postcode\" => $params[\"postcode\"],\n \"countrycode\" => $params[\"countrycode\"],\n \"countryname\" => $params[\"countryname\"],\n \"phonenumber\" => $params[\"phonenumber\"],\n \"phonecountrcCode\" => $params[\"phonecc\"],\n \"phonenumberformatted\" => $params['phonenumberformatted'],\n \"orgname\" => $params['companyname'],\n \"language\" => (empty($params['language'])) ? $GLOBALS['CONFIG']['Language'] : $params['language']\n ];\n\n if( $params['accountType'] == 'individual' ){\n $organization = '';\n }else{\n $organization = $params['organization'];\n }\n\n $nameservers = [\n $params['ns1'],\n $params['ns2'],\n $params['ns3'],\n $params['ns4'],\n $params['ns5']\n ];\n\n $registrationPeriod = $params['regperiod'];\n $authCode = $params['transfersecret'];\n try {\n $api = new ApiClient($params[\"apiKey\"]);\n $response = $api->transferDomain($domain, $contacts, $nameservers, $registrationPeriod, $authCode, $organization);\n if ((isset($response->code) && $response->code != 202)|| isset($response->errors)) {\n return array(\n 'error' => json_encode($response)\n );\n }\n\n return array(\n 'success' => true,\n );\n } catch (\\Exception $e) {\n return array(\n 'error' => $e->getMessage(),\n );\n }\n}", "public function post_new_domain()\n\t{\n \t//$a_id=(int)$this->input->get_post(\"association_id\");\n \t$org_id=$this->input->get_post(\"org_id\");\n \t \n \t$domain=$this->input->get_post(\"domain\");\n \t$u=$this->permissions_model->get_active_user();\n \t$org=$this->permissions_model->get_active_org();\n\t\t$result= $this->org_model->insert_domain($org_id,$domain,$u,$org);\n\t\t$this->result->success($result); \n\t}", "private function addDomainRequest(\\Infobip\\Model\\EmailAddDomainRequest $emailAddDomainRequest): Request\n {\n $allData = [\n 'emailAddDomainRequest' => $emailAddDomainRequest,\n ];\n\n $validationConstraints = [];\n\n $this\n ->addParamConstraints(\n [\n 'emailAddDomainRequest' => [\n new Assert\\NotNull(),\n ],\n ],\n $validationConstraints\n );\n\n $this->validateParams($allData, $validationConstraints);\n\n $resourcePath = '/email/1/domains';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n $headers = [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ];\n\n // for model (json/xml)\n if (isset($emailAddDomainRequest)) {\n $httpBody = ($headers['Content-Type'] === 'application/json')\n ? $this->objectSerializer->serialize($emailAddDomainRequest)\n : $emailAddDomainRequest;\n } elseif (count($formParams) > 0) {\n $formParams = \\json_decode($this->objectSerializer->serialize($formParams), true);\n\n if ($headers['Content-Type'] === 'multipart/form-data') {\n $boundary = '----' . hash('sha256', uniqid('', true));\n $headers['Content-Type'] .= '; boundary=' . $boundary;\n $multipartContents = [];\n\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = (\\is_array($formParamValue)) ? $formParamValue : [$formParamValue];\n\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents, $boundary);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = $this->objectSerializer->serialize($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = Query::build($formParams);\n }\n }\n\n $apiKey = $this->config->getApiKey();\n\n if ($apiKey !== null) {\n $headers[$this->config->getApiKeyHeader()] = $apiKey;\n }\n\n $defaultHeaders = [];\n\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 foreach ($queryParams as $key => $value) {\n if (\\is_array($value)) {\n continue;\n }\n\n $queryParams[$key] = $this->objectSerializer->toString($value);\n }\n\n $query = Query::build($queryParams);\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createDirectoryRequest()\n {\n return new Request\\DirectoryRequest($this);\n }", "private function getDomainDetailsRequest(string $domainName): Request\n {\n $allData = [\n 'domainName' => $domainName,\n ];\n\n $validationConstraints = [];\n\n $this\n ->addParamConstraints(\n [\n 'domainName' => [\n new Assert\\NotBlank(),\n ],\n ],\n $validationConstraints\n );\n\n $this->validateParams($allData, $validationConstraints);\n\n $resourcePath = '/email/1/domains/{domainName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // path params\n if ($domainName !== null) {\n $resourcePath = str_replace(\n '{' . 'domainName' . '}',\n $this->objectSerializer->toPathValue($domainName),\n $resourcePath\n );\n }\n\n $headers = [\n 'Accept' => 'application/json',\n\n ];\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n $formParams = \\json_decode($this->objectSerializer->serialize($formParams), true);\n\n if ($headers['Content-Type'] === 'multipart/form-data') {\n $boundary = '----' . hash('sha256', uniqid('', true));\n $headers['Content-Type'] .= '; boundary=' . $boundary;\n $multipartContents = [];\n\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = (\\is_array($formParamValue)) ? $formParamValue : [$formParamValue];\n\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents, $boundary);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = $this->objectSerializer->serialize($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = Query::build($formParams);\n }\n }\n\n $apiKey = $this->config->getApiKey();\n\n if ($apiKey !== null) {\n $headers[$this->config->getApiKeyHeader()] = $apiKey;\n }\n\n $defaultHeaders = [];\n\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 foreach ($queryParams as $key => $value) {\n if (\\is_array($value)) {\n continue;\n }\n\n $queryParams[$key] = $this->objectSerializer->toString($value);\n }\n\n $query = Query::build($queryParams);\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create($accountData){\n //\n }", "function dns_gateway_TransferDomain($params)\n{\n try {\n\n // User defined configuration values\n $api_username = $params['API_Username'];\n $api_password = $params['API_Password'];\n $ote_api_username = $params['OTE_API_Username'];\n $ote_api_password = $params['OTE_API_Password'];\n $api_dev_mode = $params['Dev_Mode'];\n\n // Registration parameters\n $sld = $params['sld'];\n $tld = $params['tld'];\n $domain = $sld.'.'.$tld;\n $registrationPeriod = (\n $params['regperiod'] > 0 ?\n $params['regperiod'] :\n 1\n );\n $eppCode = $params['eppcode'];\n\n // Connect To API\n $api = new DNSAPI();\n $api->setcreds(\n $api_username,\n $api_password,\n $api_dev_mode,\n $ote_api_username,\n $ote_api_password\n );\n\n /**\n * Premium domain parameters.\n *\n * Premium domains enabled informs you if\n * the admin user has enabled\n * the selling of premium domain names.\n * If this domain is a premium name,\n * `premiumCost` will contain the cost price\n * retrieved at the time of\n * the order being placed.\n * The premium order should\n * only be processed\n * if the cost price now\n * matches the previously fetched amount.\n */\n $premiumDomainsEnabled = (bool) $params['premiumEnabled'];\n $premiumDomainsCost = $params['premiumCost'];\n\n // Transfer Domain\n $domain = [\n 'name' => $domain,\n 'authinfo' => (\n $eppCode=='' && $tld=='co.za' ?\n 'coza' :\n $eppCode\n )\n ];\n\n // Add Premium Charge If Applicable\n if($premiumDomainsEnabled && $premiumDomainsCost) {\n $domain['charge']['price'] = $premiumDomainsCost;\n }\n\n // Call The Register Domain Function\n $api->transfer_domain($domain);\n\n return [\n 'success' => true\n ];\n\n } catch (\\Exception $e) {\n return [\n 'error' => $e->getMessage()\n ];\n }\n}", "function hostcontrol_TransferDomain($params)\n{\n $api_client = new HostControlAPIClient(HostControlHelper::getApiUrl($params), $params['ApiKey']);\n $domainname = strtolower($params[\"sld\"] . \".\" . $params[\"tld\"]);\n\n /* Get or create HostControl customer ID */\n try {\n $hostcontrol_customer_id = HostControlHelper::get_or_create_hostcontrol_customer_id($params, $api_client);\n }\n catch(HostControlHelperError $e)\n {\n return array('error' => $e->getMessage());\n }\n $interval = $params[\"regperiod\"]*12;\n $privacy_protect = (empty($params[\"idprotection\"])?false:true);\n $authcode = (empty($params[\"transfersecret\"])?'':$params[\"transfersecret\"]);\n $domain_id = $params[\"domainid\"];\n\n try\n {\n $transfer = $api_client->domain->transfer(\n $hostcontrol_customer_id,\n $domainname,\n $authcode,\n $interval,\n $privacy_protect\n );\n }\n catch(HostControlAPIClientError $e)\n {\n $request = array($hostcontrol_customer_id, $domainname, $authcode, $interval, $privacy_protect);\n HostControlHelper::debugLog($params, 'transfer-domain', $request, $e);\n\n return array('error' => $e->getMessage());\n }\n\n HostControlHelper::store_transfer_id($domain_id, $transfer->id);\n\n return true;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete a given Match object from the persistent data store.
public function deleteMatch($match) { $mgmt = new MatchManager($this->db, $this->objLayer); $mgmt->delete($match); }
[ "public function deleteMatch($match );", "function dbDelete($match) {\r\n $res = $this->dbQuery(\"delete from \".$this->table.\" where $match\");\r\n return $res;\r\n }", "public function forceDeleted(Match $match)\n {\n //\n }", "public function deleteTeamAwayTeamMatch($team, $match);", "public function delete()\n {\n $this->_record->delete();\n }", "public function delete($record);", "public function deleteMatchRecord($match_record_id)\n {\n\n\n $admin_id = Auth::user()->id;\n $match_id = DB::table('MatchResult')->where('id', $match_record_id)->select('match_id')->value('match_id');\n $deleted_user_record = DB::table('MatchResult')->where('id', '=', $match_record_id)->select('player_id')->value('player_id');\n DB::table('MatchResult')->where('id', '=', $match_record_id)->delete();\n $winner_id = DB::table('Match')->where('id', $match_id)->select('winner_id')->value('winner_id');\n if ($winner_id == $deleted_user_record) {\n DB::table('Match')->where('id', $match_id)->update(['winner_id' => NULL]);\n }\n return redirect('/home/matchHistory');\n }", "public function delete() {\n\n // Does the movie object have an ID?\n if ( is_null( $this->id ) ) trigger_error ( \"movie::delete(): Attempt to delete an movie object that does not have its ID property set.\", E_USER_ERROR );\n\n // Delete the movie\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $st = $conn->prepare ( \"DELETE FROM movies WHERE id = :id LIMIT 1\" );\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n $st->execute();\n $conn = null;\n }", "public function delete() {\n $class = get_called_class();\n self::$dbConn->deleteRecord($class, $this->id);\n // clear model ID so it can be inserted again with save()\n $this->dirty = false;\n $primaryKey = static::getSchema()->getPrimaryKey();\n unset($this->data[$primaryKey]);\n }", "public function deleteOne($object);", "public function deleteMatch_post() {\r\n $this->form_validation->set_rules('MatchGUID', 'MatchGUID', 'trim|required|callback_validateEntityGUID[Matches,MatchID]');\r\n $this->form_validation->validation($this); /* Run validation */\r\n\r\n /* Delete Match Data */\r\n $this->Football_model->deleteMatch($this->MatchID);\r\n $this->Return['Message'] = \"Match deleted successfully.\";\r\n }", "public function delmatch(User $match)\n { \n $user = Auth::user();\n\n $res = Match::where('usuario1_id', $user->id)->where('usuario2_id', $match->id)->get(); \n\n if ($res->isEmpty()) { abort(404, \"Usuario not found\"); } \n\n foreach ($res as $m) {\n $id = $m->id;\n Match::destroy($id);\n }\n\n //El numero de matches borrados (uno por evento)\n return count($res);\n }", "public function delete() {\n // Get all the contestant relations\n $crelations = tourney_relation_query('tourney_match', $this->id)->entityCondition('bundle', 'contestant');\n $crids = $crelations->execute();\n foreach (array_keys($crids) as $rid) {\n relation_delete($rid);\n }\n\n // Get all the game relations and games\n $gquery = tourney_relation_query('tourney_match', $this->id)->entityCondition('bundle', 'has_game');\n $game_relations = $gquery->execute();\n\n // Delete the games in this match\n foreach (array_keys($game_relations) as $rid) {\n $relation = relation_load($rid);\n relation_delete($rid);\n $game = tourney_game_load($relation->endpoints['und'][1]['entity_id']);\n if (is_object($game)) {\n $game->delete();\n }\n else {\n drupal_set_message(t('Could not delete game entity %id. Does not exist', array(\n '%id' => $relation->endpoints['und'][1]['entity_id'],\n )), 'warning');\n }\n }\n\n parent::delete();\n }", "public function deleted(MatchInvitation $matchInvitation)\n {\n \n }", "public function delete($object);", "public function delete() {\n\t\tif( !$this->isInDb ) return;\n\t\t\n\t\t$where = array( $this->idColumn => $this->data[ $this->idColumn ] );\n\t\tDb::executeDelete($this->table, $where);\n\t\t$this->isInDb = false;\n\t\t\n\t\tunset(self::$objectCache[$this->table][$this->data[$this->idColumn]]);\n\t\t//Do I want this? $this->data[$this->idColumn] = null;\n\t}", "public function delete() {\r\n\r\n $sql = $this->db->quoteInto(\"o_id = ?\", $this->model->getObjectId());\r\n\r\n // $sql = \"o_id = \" . $this->model->getObjectId();\r\n Logger::debug(\"query= \" . $sql);\r\n $this->db->delete($this->getTableName(), $sql);\r\n }", "function delete_match_has_team($idmatch_has_team)\n {\n return $this->db->delete('match_has_team',array('idmatch_has_team'=>$idmatch_has_team));\n }", "public function delete()\r\n\t{\r\n\t\t$sql = 'DELETE FROM '.static::$_table.' WHERE id=\"'.$this->_obj_id.'\"';\r\n\t\tself::db()->delete($sql);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'dbal.extractor' shared service.
protected function getDbal_ExtractorService() { return $this->services['dbal.extractor'] = $this->get('dbal.extractor.factory')->get(); }
[ "protected function getApp_Service_Base64extractorService()\n {\n include_once \\dirname(__DIR__, 4).'/src/Service/Base64FileExtractor.php';\n\n return $this->services['app.service.base64extractor'] = new \\App\\Service\\Base64FileExtractor();\n }", "protected function getDbal_Extractor_Extractors_OracleExtractorService()\n {\n return new \\phpbb\\db\\extractor\\oracle_extractor('./../', $this->get('request'), $this->get('dbal.conn.driver'));\n }", "protected function getDbal_Extractor_Extractors_PostgresExtractorService()\n {\n return new \\phpbb\\db\\extractor\\postgres_extractor('./../', $this->get('request'), $this->get('dbal.conn.driver'));\n }", "protected function getExtractionRepositoryService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/persistence/lib/Doctrine/Persistence/ObjectRepository.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Repository/ServiceEntityRepositoryInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Repository/ServiceEntityRepository.php';\n include_once \\dirname(__DIR__, 4).'/src/Repository/ExtractionRepository.php';\n\n return $this->privates['App\\\\Repository\\\\ExtractionRepository'] = new \\App\\Repository\\ExtractionRepository(($this->services['doctrine'] ?? $this->getDoctrineService()));\n }", "protected function getDbal_Extractor_Extractors_Sqlite3ExtractorService()\n {\n return new \\phpbb\\db\\extractor\\sqlite3_extractor('./../', $this->get('request'), $this->get('dbal.conn.driver'));\n }", "protected function getDbal_Extractor_Extractors_PostgresExtractorService()\n {\n return new \\phpbb\\db\\extractor\\postgres_extractor('./../', ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn.driver']) ? $this->services['dbal.conn.driver'] : $this->get('dbal.conn.driver', 1)) && false ?: '_'});\n }", "final public function getExtractor() {\n if ($this->_extractor === null) {\n $this->_extractor = $this->createExtractor();\n }\n\n return $this->_extractor;\n }", "protected function getNelmioApiDoc_Extractor_ApiDocExtractorService()\n {\n $a = $this->get('nelmio_api_doc.doc_comment_extractor');\n\n $this->services['nelmio_api_doc.extractor.api_doc_extractor'] = $instance = new \\Nelmio\\ApiDocBundle\\Extractor\\ApiDocExtractor($this, $this->get('router'), $this->get('annotation_reader'), $a, array(0 => new \\Nelmio\\ApiDocBundle\\Extractor\\Handler\\FosRestHandler(), 1 => new \\Nelmio\\ApiDocBundle\\Extractor\\Handler\\JmsSecurityExtraHandler(), 2 => new \\Nelmio\\ApiDocBundle\\Extractor\\Handler\\SensioFrameworkExtraHandler(), 3 => new \\Nelmio\\ApiDocBundle\\Extractor\\Handler\\PhpDocHandler($a)));\n\n $instance->addParser($this->get('nelmio_api_doc.parser.form_type_parser'));\n $instance->addParser($this->get('nelmio_api_doc.parser.validation_parser'));\n $instance->addParser($this->get('nelmio_api_doc.parser.jms_metadata_parser'));\n\n return $instance;\n }", "protected function getDbal_ToolsService()\n {\n return $this->services['dbal.tools'] = ${($_ = isset($this->services['dbal.tools.factory']) ? $this->services['dbal.tools.factory'] : ($this->services['dbal.tools.factory'] = new \\phpbb\\db\\tools\\factory())) && false ?: '_'}->get(${($_ = isset($this->services['dbal.conn.driver']) ? $this->services['dbal.conn.driver'] : $this->get('dbal.conn.driver', 1)) && false ?: '_'});\n }", "public function GetExtractor()\r\n\t\t{\r\n\t\t\treturn $this->_extractor;\r\n\t\t}", "protected function getTranslation_ExtractorService()\n {\n $this->services['translation.extractor'] = $instance = new \\Symfony\\Component\\Translation\\Extractor\\ChainExtractor();\n\n $instance->addExtractor('php', $this->get('translation.extractor.php'));\n\n return $instance;\n }", "public static function service() {\r\n if (self::$_loadedService === null) {\r\n self::import('services/Handler');\r\n self::$_loadedService = self::instance('services/Handler', __CLASS__, 'configurations/Free', __FILE__);\r\n }\r\n \r\n return self::$_loadedService;\r\n }", "protected function getTranslation_ExtractorService()\n {\n $this->services['translation.extractor'] = $instance = new \\Symfony\\Component\\Translation\\Extractor\\ChainExtractor();\n\n $instance->addExtractor('php', ${($_ = isset($this->services['translation.extractor.php']) ? $this->services['translation.extractor.php'] : $this->get('translation.extractor.php')) && false ?: '_'});\n $instance->addExtractor('twig', ${($_ = isset($this->services['twig.translation.extractor']) ? $this->services['twig.translation.extractor'] : $this->get('twig.translation.extractor')) && false ?: '_'});\n\n return $instance;\n }", "protected function getFileDownloaderService()\n {\n return $this->services['file_downloader'] = new \\phpbb\\file_downloader();\n }", "protected function getExtractorPlugin() {\n // Get extractor configuration.\n $config = \\Drupal::config(FilesExtractor::CONFIGNAME);\n $extractor_plugin_id = $config->get('extraction_method');\n $configuration = $config->get($extractor_plugin_id . '_configuration');\n\n // Get extractor plugin.\n return $this->textExtractorPluginManager->createInstance($extractor_plugin_id, $configuration);\n }", "protected function getTranslation_Extractor_PhpService()\n {\n return $this->services['translation.extractor.php'] = new \\Symfony\\Bundle\\FrameworkBundle\\Translation\\PhpExtractor();\n }", "protected function getTranslation_ExtractorService()\n {\n $this->services['translation.extractor'] = $instance = new \\Symfony\\Component\\Translation\\Extractor\\ChainExtractor();\n\n $instance->addExtractor('php', $this->get('translation.extractor.php'));\n $instance->addExtractor('twig', $this->get('twig.translation.extractor'));\n\n return $instance;\n }", "protected function getMainImageService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Generators\\\\Schema\\\\Main_Image'] = new \\Yoast\\WP\\SEO\\Generators\\Schema\\Main_Image();\n }", "protected function getLoaderService()\n {\n $this->services['Yoast\\\\WP\\\\Free\\\\Loader'] = $instance = new \\Yoast\\WP\\Free\\Loader($this);\n\n $instance->register_initializer('Yoast\\\\WP\\\\Free\\\\Database\\\\Database_Setup');\n $instance->register_initializer('Yoast\\\\WP\\\\Free\\\\Database\\\\Migration_Runner');\n $instance->register_integration('Yoast\\\\WP\\\\Free\\\\Watchers\\\\Indexable_Author_Watcher');\n $instance->register_integration('Yoast\\\\WP\\\\Free\\\\Watchers\\\\Indexable_Post_Watcher');\n $instance->register_integration('Yoast\\\\WP\\\\Free\\\\Watchers\\\\Indexable_Term_Watcher');\n $instance->register_integration('Yoast\\\\WP\\\\Free\\\\Watchers\\\\Primary_Term_Watcher');\n\n return $instance;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch records for users inventory
public function usersInventory(){ $this->load->model('CKzCustomersModel'); // Create array object $data = array(); // Fetch all active products $data['rows'] = $this->CKzCustomersModel->usersInventory(); $this->load->view('admin/reports/usersInventory', $data); }
[ "function get_data_inventory_agen_get() { \n\t\t\t\t$user = $this->model_api->getDataInventoryAgen();\n\t\t\t$this->response($user, 200);\n\t\t}", "static function getUserItems() {\n\t\t$id = Users::getUser();\n\t\t\n\t\t$id = parent::escape($id, \"sql\");\n\t\t\n\t\t$data = parent::query(\"SELECT *\n\t\t\t\t\t\t\t\tFROM `user_objects`\n\t\t\t\t\t\t\t\tWHERE `user_id` = '$id'\n\t\t\t\t\t\t\t\tAND `approve` = '1'\n\t\t\t\t\t\t\t\");\n\t\t\t\t\t\t\t\n\t\treturn $data;\n\t}", "public function inventory()\n {\n $char_id = SessionFactory::getSession()->get('player_id');\n $items = query_array(\n \"SELECT item.item_display_name as item, amount \n FROM inventory join item on inventory.item_type = item.item_id \n WHERE owner = :char_id ORDER BY item_display_name\",\n [':char_id' => $char_id]\n );\n\n return ['inventory' => $items];\n }", "public function getInventory($user)\n {\n return $this->data && isset($this->data['user']['user_items']) ? $this->data['user']['user_items'] : [];\n return $inventory;\n }", "public function getUserItems() {\n return DB::table('users as u')\n ->select('i.sku', 'i.image_link', 'i.discount', 'i.title', 'i.brand', 'i.price', 'i.price_discount', 'i.is_active')\n ->join('user_items as ui', 'ui.user_id', '=', 'u.id')\n ->join('items as i', 'ui.item_id', '=', 'i.id')\n ->where('u.id', \\Auth::user()->id)\n ->orderBy('i.is_active', 'desc')\n ->orderBy('i.created_at', 'desc')\n ->get();\n }", "public function query_inventory($data) {\n\t\t$response = $this->Checkfront->get('item',array('start_date'=>$data['start_date'],'end_date'=>$data['end_date']));\n\t\treturn $response['items'];\n\t}", "public function getInventoryAction()\n {\n $offset = $this->Request()->getParam('start', 0);\n $limit = $this->Request()->getParam('limit', 100);\n \n $select = Shopware()->Db()->select()\n ->from('asign_yellowcube');\n \n //If a filter is set\n if ($this->Request()->getParam('filter')) {\n //Get the value itself\n $filters = $this->Request()->getParam('filter');\n foreach ($filters as $filter) { \n $select->where('asign_yellowcube.ycarticlenr LIKE ?', '%' . $filter[\"value\"] . '%');\n $select->orWhere('asign_yellowcube.articlenr LIKE ?', '%' . $filter[\"value\"] . '%');\n $select->orWhere('asign_yellowcube.artdesc LIKE ?', '%' . $filter[\"value\"] . '%');\n }\n }\n \n // sortin the inventory list\n $sort = $this->Request()->getParam('sort');\n if ($sort) {\n $sorting = reset($sort);\n switch ($sorting['property']) {\n case 'ycarticlenr':\n $select->order('asign_yellowcube.ycarticlenr', $sorting['direction']);\n break;\n case 'articlenr':\n $select->order('asign_yellowcube.articlenr', $sorting['direction']);\n break;\n case 'artdesc':\n $select->order('asign_yellowcube.artdesc', $sorting['direction']);\n break;\n default:\n $select->order('asign_yellowcube.createdon', 'DESC');\n }\n } else {\n $select->order('asign_yellowcube.artdesc', 'DESC');\n }\n\n // set the paginator and result\n $paginator = new Zend_Paginator_Adapter_DbSelect($select);\n $totalCount = $paginator->count();\n $result = $paginator->getItems($offset, $limit);\n\n $data = array();\n foreach ($result as $key => $inventory) {\n // unserialize and get values \n $ycAdditional = $this->getJsonEncodedData(unserialize($inventory[\"additional\"]));\n\n // set parameters\n $data[$key]['id'] = $inventory[\"id\"];\n $data[$key]['ycarticlenr'] = $inventory[\"ycarticlenr\"];\n $data[$key]['articlenr'] = $inventory[\"articlenr\"];\n $data[$key]['artdesc'] = $inventory[\"artdesc\"]; \n $data[$key]['timestamp'] = $inventory[\"createdon\"];\n $data[$key]['stockvalue'] = $this->_iStockValue;\n $data[$key]['additional'] = $ycAdditional;\n }\n\n $this->View()->assign(array('data' => $data, 'success' => true, 'total' => $totalCount));\n }", "function pip_shop_getinventory($username=\"\", $id=\"\") {\n\t\t$data = array();\n\t\tif (!empty($username) && !empty($id)) {\n\t\t\n\t\t\t$refresh = false;\n\t\t\t\n\t\t\t// -- Check if Shop exists\n\t\t\t$sql = \"SELECT * FROM <<\".CONF_PREFIX_LST.CONF_TBL_SHOP.\">> WHERE username = '\".$username.\"' AND myid = '\".$id.\"' LIMIT 1\";\n\t\t\t$row = pip_db_scalar($sql);\n\n\t\t\tif ($row) {\n\t\t\t\n\t\t\t\t// -- Get Shop Template & Shop Level Attributes\n\t\t\t\t$shop = new pip_shop($username, $id);\n\t\t\t\t\n\t\t\t\t// -- Check Shop empty\n\t\t\t\t$sql = \"SELECT * FROM <<\".CONF_PREFIX_INV.CONF_TBL_SHOP.\">> WHERE username = '\".$username.\"' AND myid = '\".$id.\"'\";\n\t\t\t\t$count = pip_db_scalar($sql);\n\t\t\t\t\n\t\t\t\tif (empty($count)) {\n\t\t\t\t\t$refresh = true;\n\t\t\t\t} else {\n\t\t\t\t\t$tstamp \t= $shop->data['tstamp'];\n\t\t\t\t\t$tspan \t\t= $shop->data['tspan'];\n\t\t\t\t\t$refresh \t= pip_checktime($tstamp, $tspan);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($refresh) {\n\t\t\t\t\tpip_shop_refreshinventory($username, $id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// -- Gather Shop Inventory\n\t\t\t\t$sql = \"SELECT * FROM <<\".CONF_PREFIX_INV.CONF_TBL_SHOP.\">> WHERE username = '\".$username.\"' AND myid = '\".$id.\"'\";\n\t\t\t\t$subrow = pip_db_reader($sql);\n\n\t\t\t\tforeach ($subrow as $item) {\n\t\t\t\t\t$subrow2 = pip_object_get($item['category'], $item['objectid']);\n\t\t\t\t\tif ($subrow2) {\n\t\t\t\t\t\t$data[] = array_merge($item, $subrow2);\n\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\treturn $data;\n\t}", "function getUserInventory($user_id = NULL, $logged_in_user_id = NULL)\n{\n\n $availLots = array();\n $assignedLots = array();\n \n if (!isset($logged_in_user_id) && !is_numeric($logged_in_user_id) && isset($_SESSION['user']))\n {\n $logged_in_user_id = $_SESSION['user']['id'];\n }\n if (is_numeric($user_id))\n {\n $user_lots = Doctrine_Query::create()->from('User u')->leftJoin('u.Lots l')->where('u.id = ?', $user_id)->orWhere('u.id = ?', $logged_in_user_id)->execute();\n }\n elseif(is_array($user_id) && !empty($user_id))\n {\n \t$user_lots = Doctrine_Query::create()->from('User u')->leftJoin('u.Lots l')->whereIn('u.id', $user_id)->orWhere('u.id = ?', $logged_in_user_id)->execute();\n }\n elseif(is_null($user_id))\n {\n \t$user_lots = Doctrine_Query::create()->from('User u')->leftJoin('u.Lots l')->where('u.id = ?', $logged_in_user_id)->execute();\n }\n \n if($user_lots)\n {\n \t$user_lots = $user_lots->toArray();\n }\n else\n {\n \t$user_lots = array();\n }\n \n foreach ($user_lots as $user)\n {\n \tforeach($user['Lots'] as $i=>$l) $user['Lots'][$i]['user_id'] = $user['id'];\n \t// while we loop thru the users, we need to figure out which array to assign this user to, either available lots (for the logged in user) or assigned lots (for the user(s) looked up)\n \t\n if (is_numeric($user_id) && $user['id'] == $user_id) // <-- if we only looked up one user, and the current user in the foreach loop is that user\n {\n $assignedLots = $user['Lots'];\n }\n elseif (is_array($user_id) && in_array($user['id'], $user_id) && $user['id'] != $logged_in_user_id) // <-- if we looked up more than one user, and the current user is one of them\n {\n \t//$assignedLots = array_merge($assignedLots, $user['Lots']);\n $assignedLots += $user['Lots'];\n }\n elseif (is_array($user_id) && in_array($user['id'], $user_id) && $user['id'] == $logged_in_user_id) // <-- if we looked up more than one user, but this is the logged in user\n {\n //$availLots = array_merge($availLots, $user['Lots']);\n $availLots += $user['Lots'];\n }\n elseif ($user['id'] == $logged_in_user_id) // <-- if this is the logged in user\n {\n //$availLots = array_merge($availLots, $user['Lots']);\n $availLots += $user['Lots'];\n }\n } \n foreach($availLots as $key=>$lot)\n {\n $lot_id = $lot['id'];\n foreach($assignedLots as $alot)\n {\n $alot_id = $alot['id'];\n if ($lot_id == $alot_id)\n {\n $availLots[$key]['assigned'] = true;\n }\n else\n {\n if (isset($availLots[$key]['assigned']) && $availLots[$key]['assigned'])\n {\n $availLots[$key]['assigned'] = true;\n }\n else\n {\n $availLots[$key]['assigned'] = false;\n }\n }\n }\n }\n return $availLots;\n}", "function getinventoryHostbillitems(){\r\n \r\n $sql=\"Select ItemID,Sku,description,product_source, ref_id,sell_price FROM inv_items where product_source='hostbill'\";\r\n\treturn $res = $this->query($sql, 1);\r\n }", "function get_item ($inventory_id){\n\t$result = dbQuery(\"\n\tSELECT *\n\tFROM inventory\n\tWHERE inventory_id = $inventory_id\n\t\")-> fetch();\n\treturn $result;\n}", "public function showInventory()\n {\n $inventory = InventoryItem::paginate(10);\n\n return responseJSON(3, $inventory, 'Data successfully shown', 200);\n }", "public function getUsersItems($user_id);", "public function index() {\n\t\t/*$this->InventoryEntry->recursive = 0;\n\t\t$this->set('inventoryEntries', $this->paginate());*/\t\t\n\t\t\n\t\t$conditionsSubQuery['`InventoryItem`.`inventory_entry_id` <>'] = 0;\n\t\t$dbo = $this->InventoryEntry->getDataSource();\n\t\t$subQuery = $dbo->buildStatement(\n\t\t array(\n\t\t 'fields' => array('`InventoryItem`.`inventory_entry_id`'),\n\t\t 'table' => $dbo->fullTableName(ClassRegistry::init('Inventory.InventoryItem')),\n\t\t 'alias' => 'InventoryItem',\n\t\t 'limit' => null,\n\t\t 'offset' => null,\n\t\t 'joins' => array(),\n\t\t 'conditions' => $conditionsSubQuery,\n\t\t 'order' => null,\n\t\t 'group' => null\n\t\t ),\n\t\t $this->InventoryEntry\n\t\t);\n\t\t$subQuery = ' `InventoryEntry`.`id` IN (' . $subQuery . ') ';\n\t\t$subQueryExpression = $dbo->expression($subQuery);\t\t\n\t\t$conditions[] = $subQueryExpression;\n\t\t\n\t\t$inventoryEntries = $this->InventoryEntry->find('all', compact('conditions'));\n\t\t$this->set('inventoryEntries', $this->paginate($conditions));\t\n\t}", "public function getItemsandAdmins()\n {\n \t$items = DB::table('inv_items_master')\n \t\t\t\t->select('name', 'id')\n \t\t\t\t->orderBy('name', 'asc')\n \t\t\t\t->get();\n\n \t$admins = DB::table('users')\n \t\t\t\t->select('name', 'id', 'email')\n \t\t\t\t->orderBy('name', 'asc')\n \t\t\t\t->get();\n\n $depots = DB::table('depots')\n ->select('name', 'id')\n ->orderBy('name', 'asc')\n ->get();\n\n $denoms = DB::table('denominations')\n ->select('description', 'id')\n ->get();\n\n \treturn response()->json(['items'=>$items, 'admins'=>$admins, 'depots'=>$depots, 'denoms'=>$denoms], 200);\n }", "function getInventory( $upc )\n{\n\t$con=createCon();\n\t\n\tif(!$result = mysqli_query($con,\"SELECT * FROM stock WHERE upc='\" . $upc . \"'\"))\n\t{\n\t\tdie('Error[getInventory]: ' . mysqli_error($con));\n\t}\n\t\n\t\n\twhile($row = mysqli_fetch_array($result))\n\t{\n\t\techo $row['upc'] . \" \" . $row['id'] . \" \" . $row['type'] . \" \" . $row['qty'];\n\t\techo \"<br />\";\n\t}\n\t\n\tmysqli_close($con);\n}", "public function getInvites($userid){\n // temp table for entries that match\n $sqlCreate = \"create temporary table if not exists invites as (select * from notify where user_id='\".$userid.\"')\";\n // delete invites that were present at the time of the first query\n $sqlDelete = \"delete notify from notify inner join invites on invites.user_id = notify.user_id where notify.user_id='\".$userid.\"'\";\n $sqlSelect = \"select * from invites\";\n $sqlDrop = \"drop table invites\";\n\n // run query\n $this->conn->query($sqlCreate);\n $this->conn->query($sqlDelete);\n $result = $this->conn->query($sqlSelect);\n $this->conn->query($sqlDrop);\n\n return $result;\n }", "public function getUserPurchases()\n {\n return PurchaseResource::collection(Purchase::with('lot:id,user_id,name', 'lot.user:id,name')\n ->where('user_id', auth('sanctum')->id())\n ->orderByDesc('created_at')\n ->paginate(5));\n }", "public function inventory_items()\n {\n $inv_table = $this->api->table_name('local_inventory');\n $items = array_map(function (Array $row) { // each inventory item entry\n $row['linked_items'] = $this->linked_items($row['inventory_itemid']);\n return $row;\n }, $this->db->query(\"select * from $inv_table\")->rows);\n return $items;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
include application information box
function include_application_information_box($id, $aid, $mid = 0, $isOwner = false , $application) { $params = array( 'id' => $id, 'aid' => $aid, 'mid' => $mid, 'isOwner' => $isOwner, 'application' => $application, ); include_partial('application/informationBox', $params); }
[ "function AppInfo()\n {\n $unit=$this->Unit();\n $table=$this->AppUnitInfoTable();\n \n $event=$this->Event();\n if (!empty($event))\n {\n $table=array_merge\n (\n $table,\n $this->AppEventInfoTable($event)\n ); \n }\n\n return \n $this->FrameIt\n (\n $this->H(1,$this->HtmlSetupHash[ \"ApplicationName\" ]).\n $this->Html_Table\n (\n \"\",\n $table,\n array(\"WIDTH\" => '100%'),\n array(),\n array(),\n $evenodd=FALSE\n ).\n \"\",\n array(\"WIDTH\" => '75%')\n ).\n $this->BR();\n }", "function getAppDetails() {\n echo \"<span>\".self::APP_NAME.\"</span></br>\";\n echo \"<span>\".self::APP_VERSION.\"</span></br>\";\n echo \"<span>\".self::APP_AUTHOR.\"</span></br>\";\n }", "function op_include_application_information_box($id, $application, $mid = null, $isOwner = false)\n{\n $params = array(\n 'id' => $id,\n 'application' => $application,\n 'mid' => $mid,\n 'isOwner' => $isOwner\n );\n include_partial('application/informationBox', $params);\n}", "public function widget_info();", "public function showInstallerApp() {\n\t\t$doc = JFactory::getDocument();\n\t\t$this->loadJQuery($doc);\n\t\t$this->loadBootstrap($doc);\n\t\t$doc->addStylesheet ( JUri::root ( true ) . '/administrator/components/com_jmap/css/cpanel.css' );\n\t\t$doc->addScript ( JUri::root ( true ) . '/administrator/components/com_jmap/js/installer.js' );\n\t\n\t\t// Set layout\n\t\t$this->setLayout('default');\n\t\n\t\t// Format data\n\t\tparent::display ('installer');\n\t}", "function infoScreenObject()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreen();\n\t}", "public function get_app_info()\n\t{\n\t\tif (is_object($this->fcbk)) {\n\t\t\ttry {\n\t\t\t\t$app_info = $this->fcbk->api('/' . $this->options['app_id']);\n\t\t\t\t$this->options['app_infos'] = $this->optionsManager->updateOption('app_infos', $app_info, true);\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->options['app_infos'] = $this->optionsManager->updateOption('app_infos', array(), true);\n\t\t\t\t$error = new WP_Error($e->getCode(), $e->getMessage());\n\t\t\t\t$this->display_messages($error->get_error_message(), 'error', false);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "protected function _showAppForm() {\n\t\tob_start();\n\t\trequire_once ROOTDIR . '/views/appform.phtml';\n\t\tViewController::setView(ob_get_clean());\n\t}", "public function app_info() {\n \n // Load the app's language files\n $this->CI->lang->load( 'facebook_ads_user', $this->CI->config->item('language'), FALSE, TRUE, MIDRUB_BASE_USER_APPS_FACEBOOK_ADS );\n \n // Return app information\n return array(\n 'app_name' => $this->CI->lang->line('advertising'),\n 'app_slug' => 'facebook_ads',\n 'app_icon' => '<i class=\"icon-social-facebook\"></i>',\n 'version' => MIDRUB_BASE_USER_APPS_FACEBOOK_ADS_VERSION,\n 'min_version' => '0.0.7.9',\n 'max_version' => '0.0.7.9'\n );\n \n }", "public static function info_page ()\n\t\t\t\t\t{\n\t\t\t\t\t\tdo_action (\"ws_widget__ad_codes_before_info_page\", get_defined_vars ());\n\t\t\t\t\t\t/**/\n\t\t\t\t\t\tinclude_once dirname (dirname (__FILE__)) . \"/menu-pages/info.inc.php\";\n\t\t\t\t\t\t/**/\n\t\t\t\t\t\tdo_action (\"ws_widget__ad_codes_after_info_page\", get_defined_vars ());\n\t\t\t\t\t\t/**/\n\t\t\t\t\t\treturn; /* Return for uniformity. */\n\t\t\t\t\t}", "function thd_re_info_show_box() {\n\tthd_meta_box_callback(thd_re_meta_box_fields(), 'page');\n}", "function enableInfoWindow() {\n $this->info_window = true;\n }", "public function additional_information() {\n\t\t?>\n\t\t<div id=\"event-additional-information\" class=\"postbox\">\n\t\t\t<div class=\"handlediv\" title=\"Click to toggle\"><br />\n\t\t\t</div>\n\t\t\t<h3 class=\"hndle\"> <span>\n\t\t\t\tAdditional Information\t\n\t\t\t</span> </h3>\n\t\t\t<div class=\"inside\">\n\t\t\t\t<?php echo $this->nonce_input( 'additional_information_noncename' ); ?>\n\t\t\t\t<?php $this->the_textboxes(); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "function plugin_info_box(){\n\n\t\t$plugin_data = get_plugin_data( $this->plugin_core->file() , false ); // false = no markup (i think)\n\n\n\t\t$last_update = $plugin_data['Last Update'] ?: $plugin_data['Release Date'];\n\t\t$last_update = DateTime::createFromFormat('Y_m_d', $last_update);\n\n\t\t// $last_update = new DateTime('now');\n\t\t// $last_update->add(new DateInterval('P1D'));\n\t\t// $last_update->add(new DateInterval('P2D'));\n\t\tif ($last_update):\n\t\t\t$diff = (int) abs( time() - $last_update->format('U') );\n\n\t\t\tif ( $diff < (DAY_IN_SECONDS) ){\n\t\t\t\t$update_message = 'Today';\n\t\t\t}elseif ($diff < (2 * DAY_IN_SECONDS)){\n\t\t\t\t$update_message = 'Yesterday';\n\t\t\t}else{\n\t\t\t\t$update_message = human_time_diff($last_update->format('U')) . ' ago';\n\t\t\t}\n\t\telse:\n\t\t\t$update_message = \"A long, long time ago\";\n\t\tendif;\n\n\t\tinclude __DIR__ . $this->tpl;\n\t}", "public function mostrar_html_app_launcher()\n\t{\n\t\techo $this->get_html_app_launcher();\n\t}", "private function display_system_info_list() {\n\t\t$directory = dirname( __FILE__ );\n\t\tforeach ( $this->wp_info as $section => $details ) {\n\t\t\tif ( ! isset( $details['fields'] ) || empty( $details['fields'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tinclude $directory . '/views/system-status-accordion.php';\n\t\t}\n\t}", "function program_settings_text() {\n\t\t\t\techo '<p>Use this section to make changes to the functionality of our programs pages and archive page. These settings may or may not effect all programs depending on which setting is changed. Settings found here will be propagated throughout the website in multiple places, so make changes wisely, and sparingly.</p>';\n\t\t\t}", "function cp_display_preview_info_bar()\n {\n require_once(CP_BASE_DIR . '/modules/info_bar/style-preview-ajax.php');\n die();\n }", "function apps_app_details_page($server_name, $app_name) {\n apps_include('manifest');\n $apps = apps_apps($server_name , array('machine_name' => $app_name)) ;\n $apps[$app_name]['#theme'] = 'apps_app_page';\n return $apps[$app_name];\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create customer Buypass profile transaction
function createCustomerProfileTransaction($params, $isRefund) { //Get customer Buypass payment profile $customerProfile = $this->getCustomerProfile($params); if($customerProfile['error']){ return $customerProfile; }else{ $profile_id = $customerProfile['profile_id']; } //Invoice Information from CE $amount = sprintf("%01.2f", round($params["invoiceTotal"], 2)); //Buypass Credentials from CE plugin $UserID = $this->settings->get('plugin_buypass_Buypass User ID'); $GatewayID = $this->settings->get('plugin_buypass_Buypass Gateway ID'); $LiveURL = $this->settings->get('plugin_buypass_Buypass Live URL'); $TestURL = $this->settings->get('plugin_buypass_Buypass Test URL'); $sandbox = $this->settings->get('plugin_buypass_Buypass Test Mode'); $USE_DEVELOPMENT_SERVER = ($sandbox)? Buypass::USE_DEVELOPMENT_SERVER : Buypass::USE_PRODUCTION_SERVER; $TerminalID = $this->settings->get('plugin_buypass_Buypass Terminal ID'); $Platform = $this->settings->get('plugin_buypass_Buypass Platform'); $ApplicationID = $this->settings->get('plugin_buypass_Buypass Application ID'); try{ // Process the transaction $buypass = new Buypass($UserID, $GatewayID, $LiveURL, $TestURL, $USE_DEVELOPMENT_SERVER); //Max Size: 11 //Terminal identifier. $buypass->setParameter('Tid', $TerminalID, 11); //Max Size: 11 //Identifies the platform to perform transaction processing. $buypass->setParameter('Platform', $Platform, 11); //Max Size: 12 //Full amount of transaction including cents. // Only numeric characters and a decimal point are allowed; for example, 1000.00 $buypass->setParameter('Amount', $amount, 12); //Max Size: 16 //Token identifying the card number to process $buypass->setParameter('Token', $profile_id, 16); //Max Size: 50 //Custom field used to record transaction details. //This field is optional and used for transaction reporting. $buypass->setParameter('Cf1', 'customerid: '.$params['CustomerID'], 50); $buypass->setParameter('Cf2', 'invoiceid: '.$params['invoiceNumber'], 50); //Max Size: 20 //Application identifier for the application used in sending/receiving transaction request. //The value of this field is assigned/authorized by the gateway and must be used in all transactions used by the certified application. $buypass->setParameter('ApplicationId', $ApplicationID, 20); //Max Size: 1 //Recurring payment indicator. 1 – ON; 0 – OFF; //Buypass currently only supports the recurring payment indicator for Visa and MasterCard transactions. $buypass->setParameter('Recurring', '0', 1); if($isRefund){ $buypass->processRefund(); }else{ $buypass->processPayment(); } // Get the payment or refund profile ID returned from the request if($buypass->isSuccessful()){ return array( 'error' => false, //Identifies the response identification assigned by the authorizing institution. Present only for approvals. 'AuthIdentificationResponse' => $buypass->getAuthIdentificationResponse(), //Unique value identifying the transaction. Used to identify the transaction for void/reversals 'ReferenceNumber' => $buypass->getReferenceNumber(), //Identifies the disposition of a message. Refer to Appendix F in https://drive.google.com/file/d/0B-NTHmk-nv8FRVZSelBERnh2Y0U/view // 00 - Approved or completed successfully // 11 - Approved (VIP) // 10 - Approved, partial amount approved 'ResponseCode' => $buypass->getResponseCode(), //Identifies the transaction's total amount in US dollars. Format assumes 2 decimal points. 'TransactionAmount' => $buypass->getTransactionAmount(), 'amount' => $amount ); }else{ //Result Code. Can have details of the error. $ResultCode = $buypass->getResultCode(); //Identifies the disposition of a message. Refer to Appendix F in https://drive.google.com/file/d/0B-NTHmk-nv8FRVZSelBERnh2Y0U/view $ResponseCode = $buypass->getResponseCode(); //Identifies a decline message, failed bit number, or auth telephone number. Present only for declines. $AdditionalResponseData = $buypass->getAdditionalResponseData(); return array( 'error' => true, 'detail' => '*Result Code: '.$ResultCode.' *Response Code: '.$ResponseCode.' *Additional Response Data: '.$AdditionalResponseData ); } }catch(BuypassException $e){ return array( 'error' => true, 'detail' => $e ); } }
[ "public function postGenerateTransaction()\n\t{\n\t\t//if($this->_isValidRequest())\n\t\t//{\n\t\t\t$params = array(\n\t\t\t\t\t'first_name' => Input::get('first_name'),\n\t\t\t 'last_name' => Input::get('last_name'),\n\t\t\t 'email' => Input::get('email'),\n\t\t\t 'password' => Input::get('password'),\n\t\t\t\t\t'product_id' => Input::get('product_id'),\n\t\t\t\t\t'plan_id' => Input::get('plan_id'),\n\t\t\t\t\t'pay_id' => Input::get('pay_id'),\n\t\t\t\t\t'stripe_token' => Input::get('stripe_token'),\n\t\t\t\t\t'paypal_sub_id' => Input::get('paypal_sub_id'),\n\t\t\t\t\t'amount' => Input::get('amount'),\n\t\t\t\t\t'affiliate_id' => Input::get('affiliate_id'),\n\t\t\t);\n\n\t\t\tif(Transaction::addManually($params))\n\t\t\t{\n\t\t\t\tdie(json_encode(array('data'=>array('success'=>TRUE))));\n\t\t\t}\n\t\t//}\n\t}", "function createFullCustomerProfile($params)\n {\n $validate = true;\n if ($params['validate'] === false) {\n $validate = false;\n }\n\n try {\n // Use Stripe's bindings...\n \\Stripe\\Stripe::setApiKey($this->settings->get('plugin_stripecheckout_Stripe Checkout Gateway Secret Key'));\n\n if (isset($params['plugincustomfields']['stripeTokenId']) && $params['plugincustomfields']['stripeTokenId'] != \"\") {\n $profile_id = '';\n $Billing_Profile_ID = '';\n $profile_id_array = array();\n $user = new User($params['CustomerID']);\n if ($user->getCustomFieldsValue('Billing-Profile-ID', $Billing_Profile_ID) && $Billing_Profile_ID != '') {\n $profile_id_array = unserialize($Billing_Profile_ID);\n if (is_array($profile_id_array) && isset($profile_id_array['stripecheckout'])) {\n $profile_id = $profile_id_array['stripecheckout'];\n }\n }\n\n if ($profile_id != '') {\n $customer = \\Stripe\\Customer::retrieve($profile_id);\n $customer->source = $params['plugincustomfields']['stripeTokenId'];\n $customer->save();\n } else {\n $customer = \\Stripe\\Customer::create(\n array(\n 'email' => $params['userEmail'],\n 'card' => $params['plugincustomfields']['stripeTokenId']\n )\n );\n }\n } else {\n $customer = \\Stripe\\Customer::create(\n array(\n 'email' => $params['userEmail'],\n 'card' => array(\n 'number' => $params['userCCNumber'],\n 'exp_month' => $params['cc_exp_month'],\n 'exp_year' => $params['cc_exp_year']\n ),\n 'validate' => $validate\n )\n );\n }\n $profile_id = $customer->id;\n $Billing_Profile_ID = '';\n $profile_id_array = array();\n $user = new User($params['CustomerID']);\n if ($user->getCustomFieldsValue('Billing-Profile-ID', $Billing_Profile_ID) && $Billing_Profile_ID != '') {\n $profile_id_array = unserialize($Billing_Profile_ID);\n }\n if (!is_array($profile_id_array)) {\n $profile_id_array = array();\n }\n $profile_id_array['stripecheckout'] = $profile_id;\n $user->updateCustomTag('Billing-Profile-ID', serialize($profile_id_array));\n $user->save();\n\n return array(\n 'error' => false,\n 'profile_id' => $profile_id\n );\n } catch (\\Stripe\\Error\\Card $e) {\n $body = $e->getJsonBody();\n $err = $body['error'];\n\n //A human-readable message giving more details about the error.\n return array(\n 'error' => true,\n 'detail' => $this->user->lang(\"There was an error performing this operation.\").\" \".$err['message']\n );\n } catch (\\Stripe\\Error\\RateLimit $e) {\n // Too many requests made to the API too quickly\n $body = $e->getJsonBody();\n $err = $body['error'];\n\n //A human-readable message giving more details about the error.\n return array(\n 'error' => true,\n 'detail' => $this->user->lang(\"There was an error performing this operation.\").\" \".$this->user->lang(\"Too many requests made to the API too quickly.\").\" \".$err['message']\n );\n } catch (\\Stripe\\Error\\InvalidRequest $e) {\n // Invalid parameters were supplied to Stripe's API.\n $body = $e->getJsonBody();\n $err = $body['error'];\n\n //A human-readable message giving more details about the error.\n return array(\n 'error' => true,\n 'detail' => $this->user->lang(\"There was an error performing this operation.\").\" \".$this->user->lang(\"Invalid parameters were supplied to Stripe's API.\").\" \".$err['message']\n );\n } catch (\\Stripe\\Error\\Authentication $e) {\n // Authentication with Stripe's API failed. Maybe you changed API keys recently.\n $body = $e->getJsonBody();\n $err = $body['error'];\n\n //A human-readable message giving more details about the error.\n return array(\n 'error' => true,\n 'detail' => $this->user->lang(\"There was an error performing this operation.\").\" \".$this->user->lang(\"Authentication with Stripe's API failed. Maybe you changed API keys recently.\").\" \".$err['message']\n );\n } catch (\\Stripe\\Error\\ApiConnection $e) {\n // Network communication with Stripe failed.\n $body = $e->getJsonBody();\n $err = $body['error'];\n\n //A human-readable message giving more details about the error.\n return array(\n 'error' => true,\n 'detail' => $this->user->lang(\"There was an error performing this operation.\").\" \".$this->user->lang(\"Network communication with Stripe failed\").\" \".$err['message']\n );\n } catch (\\Stripe\\Error\\Base $e) {\n // Display a very generic error to the user, and maybe send yourself an email.\n $body = $e->getJsonBody();\n $err = $body['error'];\n\n //A human-readable message giving more details about the error.\n return array(\n 'error' => true,\n 'detail' => $this->user->lang(\"There was an error performing this operation.\").\" \".$err['message']\n );\n } catch (Exception $e) {\n // Something else happened, completely unrelated to Stripe\n return array(\n 'error' => true,\n 'detail' => $this->user->lang(\"There was an error performing this operation.\").\" \".$e->getMessage()\n );\n }\n }", "function createCustomer() {\n\t\t// params for customer\n\t\t$result = $this->gateway->customer()->create([\n\t\t\t'firstName' => 'Mike',\n\t\t\t'lastName' => 'Jones',\n\t\t\t'company' => 'Jones Co.',\n\t\t\t'email' => 'mike.jones@example.com',\n\t\t\t'phone' => '281.330.8004',\n\t\t\t'fax' => '419.555.1235',\n\t\t\t'website' => 'http://example.com'\n\t\t]);\n\t\t\n\t\tif($result->success) {\n\t\t\techo \"Success, new customer added: \". $result->customer->id; // return customer ID\n\t\t\techo \"<br>\";\n\t\t\techo \"DATA CUSTOMER: \" . $result->customer;\n\t\t}else {\n\t\t\techo \"Errore creation Customer\";\n\t\t}\n\t\t\n\t}", "public function createWallet($account);", "public function createBillingProfileProgrammatically($order) {\n $profile_id = $this->getEntity();\n global $user;\n\n $wrapper = entity_metadata_wrapper('commerce_customer_profile', $profile_id);\n $wrapper->uid = $user->uid;\n $wrapper->commerce_customer_address->country = 'US';\n $wrapper->commerce_customer_address->name_line = Utils::getRandomString();\n $wrapper->commerce_customer_address->organisation_name = Utils::getRandomString();\n $wrapper->commerce_customer_address->administrative_area = 'CA';\n $wrapper->commerce_customer_address->locality = 'Sunnyvale';\n $wrapper->commerce_customer_address->dependent_locality = '';\n $wrapper->commerce_customer_address->postal_code = 94087;\n $wrapper->commerce_customer_address->thoroughfare = \"929 E. El Camino Real\";\n $wrapper->commerce_customer_address->premise = \"Apt. 424\";\n $wrapper->commerce_customer_address->phone_number = '(973) 328-6490';\n\n commerce_customer_profile_save($profile_id);\n\n return new Response(TRUE, $profile_id, \"\");\n }", "function createCustomerPaymentProfile($params)\n {\n if (!isset($params['Billing-Profile-ID'])) {\n // Get customer Authnet CIM profile\n $customerProfile = $this->getCustomerProfile($params);\n if ($customerProfile['error']) {\n return $customerProfile;\n }\n $params['Billing-Profile-ID'] = $customerProfile['profile_id'];\n }\n\n //Authorize.net CIM Credentials from CE plugin\n $myapilogin = $this->settings->get('plugin_authnetcim_Authorize.Net CIM API Login ID');\n $transactionKey = $this->settings->get('plugin_authnetcim_Authorize.Net CIM Transaction Key');\n $sandbox = $this->settings->get('plugin_authnetcim_Authorize.Net CIM Test Mode');\n $serverToUse = ($sandbox)? AuthnetCIM::USE_DEVELOPMENT_SERVER : AuthnetCIM::USE_PRODUCTION_SERVER;\n\n try {\n $cim = new AuthnetCIM($myapilogin, $transactionKey, $serverToUse);\n $cim->setParameter('customerProfileId', $params['Billing-Profile-ID']);\n if ($params['userFirstName'] != '') {\n $cim->setParameter('billToFirstName', $params['userFirstName']);\n }\n if ($params['userLastName'] != '') {\n $cim->setParameter('billToLastName', $params['userLastName']);\n }\n if ($params['userOrganization'] != '') {\n $cim->setParameter('billToCompany', $params['userOrganization']);\n }\n if ($params['userAddress'] != '') {\n $cim->setParameter('billToAddress', $params['userAddress']);\n }\n if ($params['userCity'] != '') {\n $cim->setParameter('billToCity', $params['userCity']);\n }\n if ($params['userState'] != '') {\n $cim->setParameter('billToState', $params['userState']);\n }\n if ($params['userZipcode'] != '') {\n $cim->setParameter('billToZip', $params['userZipcode']);\n }\n if ($params['userCountry'] != '') {\n $cim->setParameter('billToCountry', $params['userCountry']);\n }\n if ($params['userPhone'] != '') {\n $cim->setParameter('billToPhoneNumber', $params['userPhone']);\n }\n if ($params['userPhone'] != '') {\n $cim->setParameter('billToFaxNumber', $params['userPhone']);\n }\n if ($params['userCCNumber'] != '') {\n $cim->setParameter('cardNumber', $params['userCCNumber']);\n }\n if ($params['cc_exp_year'] != '' && $params['cc_exp_month'] != '') {\n $cim->setParameter('expirationDate', $params['cc_exp_year'].'-'.$params['cc_exp_month']);\n }\n $cim->createCustomerPaymentProfile();\n\n if ($cim->isSuccessful() || $cim->getCode() == 'E00039') {\n return array(\n 'error' => false,\n 'profile_id' => $cim->getProfileID(),\n 'payment_profile_id' => $cim->getPaymentProfileId(),\n 'shipping_profile_id' => $cim->getCustomerAddressId()\n );\n } else {\n return array(\n 'error' => true,\n 'detail' => $cim->getResponseSummary()\n );\n }\n } catch (AuthnetCIMException $e) {\n return array(\n 'error' => true,\n 'detail' => $e->getMessage()\n );\n }\n }", "public function actionCreate()\n {\n $model = new Wallet();\n\n if ($model->load(Yii::$app->request->post())) {\n\n if (($user = UserProfile::find()->where(['username' => $model->username])->one()) !== null) {\n\n $model->user_id = $user->id;\n // $model->description = TransactionType::findOne($model->transaction_type)->name; \n $model->save();\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n Yii::$app->session->setFlash('error', 'The username does not exist.'); \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create_credit_card_charge() {\n\n\t\t$this->create_transaction( self::TRANSACTION_TYPE_SALE );\n\t}", "protected function create_transaction() {\n\n\t\t$order = $this->get_order();\n\n\t\t$data = array(\n\t\t\t'ssl_invoice_number' => $this->str_truncate( ltrim( $order->get_order_number(), _x( '#', 'hash before order number', 'woocommerce-gateway-elavon' ) ), 25, '' ),\n\t\t\t'ssl_amount' => $order->payment_total,\n\t\t\t'ssl_salestax' => $order->get_total_tax(),\n\t\t);\n\n\t\t$data = array_merge( $data, $this->get_customer_data_from_order( $order ) );\n\n\t\t// clean any extra special characters to avoid API issues\n\t\t$data = $this->remove_special_characters( $data );\n\n\t\tif ( isset( $order->payment->token ) ) {\n\t\t\t$data['ssl_token'] = $order->payment->token;\n\t\t}\n\n\t\t$this->request_data = $data;\n\t}", "function new_transaction() {\n $_SESSION['transaction_id'] = $this->SC->Transactions->create_transaction($this->force_get_customer());\n\n $this->SC->Transactions->associate_customer($_SESSION['transaction_id'],$this->get_user());\n\n return $_SESSION['transaction_id']; \n }", "private function requestCreateOrder() {\n\t\t$data = [\"CREATESO\"];\n\t\t$this->requestDplus($data, $addcustID = false);\n\t}", "public function testCreateSubscriptionNewPlanAndNewBankAccountAndExistingCustomer() {\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\tEnvironment::setSubscriptionsCustomUrl(PayUTestUtil::SUBSCRIPTION_CUSTOM_URL);\n\t\n\t\t//Crete the Customer\n\t\t$customer = PayUCustomers::create(PayUTestUtil::buildSubscriptionParametersCustomer());\n\t\n\t\t$parameters = array();\n\t\t// Plan parameters\n\t\t//$parameters = PayUTestUtil::buildSuccessParametersPlan($parameters);\n\t\n\t\t// Subscription parameters\n\t\t$parameters[PayUParameters::QUANTITY] = \"5\";\n\t\t$parameters[PayUParameters::INSTALLMENTS_NUMBER] = \"2\";\n\t\t$parameters[PayUParameters::TRIAL_DAYS] = \"2\";\n\t\t$parameters[PayUParameters::TERMS_AND_CONDITIONS_ACEPTED] = \"true\";\n\t\t// Customer parameters\n\t\t$parameters[PayUParameters::CUSTOMER_ID] = $customer->id;\n\t\t// Plan parameters\n\t\t$parameters[PayUParameters::PLAN_DESCRIPTION] = \"Plan-SDK-PHP-Test\";\n\t\n\t\t$now = new DateTime();\n\t\t$parameters[PayUParameters::PLAN_CODE] = \"Plan-SDK-PHP-\" . $now->getTimestamp();\n\t\t$parameters[PayUParameters::PLAN_INTERVAL] = \"MONTH\";\n\t\t$parameters[PayUParameters::PLAN_INTERVAL_COUNT] = \"12\";\n\t\t$parameters[PayUParameters::PLAN_CURRENCY] = \"BRL\";\n\t\t$parameters[PayUParameters::PLAN_VALUE] = \"200\";\n\t\t$parameters[PayUParameters::PLAN_TAX] = \"10\";\n\t\t$parameters[PayUParameters::PLAN_TAX_RETURN_BASE] = \"30\";\n\t\t$parameters[PayUParameters::ACCOUNT_ID] = \"3\";\n\t\t$parameters[PayUParameters::PLAN_ATTEMPTS_DELAY] = \"2\";\n\t\t$parameters[PayUParameters::PLAN_MAX_PAYMENTS] = \"2\";\n\t\t$parameters[PayUParameters::PLAN_MAX_PENDING_PAYMENTS] = \"2\";\n\t\n\t\t// Bank account parameters\n\t\t$parameters[PayUParameters::CUSTOMER_ID] = $customer->id;\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_CUSTOMER_NAME] = \"User Test\";\n\t\t$parameters[PayUParameters::ACCOUNT_ID] = \"3\";\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_DOCUMENT_NUMBER] = \"78964874\";\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_DOCUMENT_NUMBER_TYPE] = \"CNPJ\";\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_BANK_NAME] = \"SANTANDER\";\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_TYPE] = \"CURRENT\";\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_NUMBER] = \"96325891\";\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_ACCOUNT_DIGIT] = \"2\";\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_AGENCY_DIGIT] = \"3\";\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_AGENCY_NUMBER] = \"4518\";\n\t\t$parameters[PayUParameters::COUNTRY] = \"BR\";\n\t\n\t\t$response = PayUSubscriptions::createSubscription($parameters);\n\t\n\t\t$this->assertNotNull($response->id);\n\t\t$this->assertEquals($parameters[PayUParameters::PLAN_CODE], $response->plan->planCode);\n\t\t$this->assertEquals($parameters[PayUParameters::PLAN_DESCRIPTION], $response->plan->description);\n\t\n\t\t$this->assertNotNull($response->customer->bankAccounts[0]->id);\n\t\n\t}", "function create_customer(){\n\t\t$this->simple_page(\"new_customer\");\n\t}", "public function create_wallet()\n {\n $headers = array();\n $data = null;\n return $this->get_json(Requests::post(\n $this->get_wallet_url(),\n $headers,\n $data,\n $this->get_authorisation_header($this->access_id, $this->secret_key, 'POST')));\n }", "public function create_credit_card_charge() {\n\n\t\t$this->create_transaction( self::TRANSACTION_TYPE_PURCHASE );\n\t}", "public function createCustodyRecord($user_email, $user_id, $token_symbol, $token_count, $account_id = NULL) {\n $record = array(\n 'user_email' => $user_email,\n 'user_id' => $user_id,\n 'account_id' => $account_id,\n 'token_symbol' => $token_symbol,\n 'token_count' => $token_count,\n );\n DB::table('custody_accounts')->insert($record);\n }", "public function custCreate()\n {\n $this->update( json_decode( self::custCreateUser( $this->toArray() ), true ), $this->ZoomAPI );\n }", "public function createCustomerProfile()\n {\n $params = $this->customerProfileParams();\n $profile = PaymentProcessor::createCustomerProfile($params);\n $profileKey = PaymentProcessor::getCustomerProfileKey();\n $col = $this->getCustomerProfileIdColumn();\n $attrs[$col] = $profile->$profileKey;\n $this->update($attrs);\n\n return $profile;\n }", "public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ If call undefined method, check the pdo
public function __call($method, $args) { //$args=func_get_args(); if(method_exists($this, $method)){ /* $callable = array($this, $method); call_user_func_array($callable, $args); */ return $this->{$method}($args[0],$args[1],$args[2]); }else{ $callable = array($this->pdo, $method); if(is_callable($callable)){ return call_user_func_array($callable, $args); }else exit('Undefined method of db class: '.$method); } }
[ "function _isPDO()\n{\n return extension_loaded('PDO');\n}", "public static function checkPDO()\n {\n return extension_loaded(\"pdo_mysql\");\n }", "private function validateConnection() {\n if (is_object ($this->_dbh)) {\n return true;\n } \n\t else {\n\t\tthrow new \\Exception(\"Not Connected to a database - use Connect before attempting other functions\");\t \n\t } \n }", "public function __call($method_name, $args) {\n // If PDO object does not exist it gets instantiated now.\n\n if (!method_exists($this->pdo(), $method_name))\n throw new Exception(\"No existe el metodo 'DFDB::$method_name'\");\n\n return call_user_func_array(array($this->pdo['pdo'], $method_name), $args);\n }", "abstract protected function getPdoInstance();", "function check_pdo_mysql()\n{\n \n if(extension_loaded('pdo_mysql') && class_exists('PDO')){\n \n return true;\n exit();\n \n } else {\n \n return false;\n \n }\n \n}", "public function getPDO();", "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}", "protected function checkDB() {\n }", "private static function has_driver($driver=null)\n{\n if(!in_array($driver, PDO::getAvailableDrivers(), true))\n {\n \t throw new Exception(\"Current driver is not available!\", 404); \n }\n return true;\n}", "protected function canCall($method) {\n\t\treturn method_exists($this, $method);\n\t}", "abstract public function isPrepared();", "public function injection_check()\n\t{\n\t}", "protected static function assertPDO() {\n\t\tif( is_null(static::$_PDO) )\n\t\t\tThrow new Exception(\"PDO connection has not been established\");\n\t}", "private function _doesPdoExist()\n {\n if (!extension_loaded('PDO') || !extension_loaded('pdo_sqlite')) {\n $this->fail('PDO and pdo_sqlite extensions must be installed');\n }\n }", "function methodExists($method)\n {\n return(method_exists($this,$method));\n }", "protected function isValidMethod()\n\t{\n\t\treturn is_object($this->object) && method_exists($this->object, $this->function);\n\t}", "public function checkMethod(){\n if($this->getMethod()==\"GET\"){\n return TRUE;\n }else if($this->getMethod()==\"POST\"){\n return FALSE;\n } else {\n die(\"unsupported request!\");\n }\n }", "public function methodExists($method)\n {\n if (!$this->query->isQuery($method) && !\\method_exists($this, $method)) {\n return false;\n }\n return true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the obligation liee.
public function getObligationLiee(): ?string { return $this->obligationLiee; }
[ "public function getEligibility()\n {\n return $this->Eligibility;\n }", "public function getLeitor()\n {\n return $this->leitor;\n }", "public function getReligion()\r\n {\r\n return $this->religion;\r\n }", "public function getReligion() {\r\n return $this->religion;\r\n }", "public function getLigneFolio() {\n return $this->ligneFolio;\n }", "public function getLieuNaissance()\n {\n return $this->lieuNaissance;\n }", "public function getNotaryParty()\n {\n return $this->notaryParty;\n }", "public function getAllegParticulier() {\n return $this->allegParticulier;\n }", "public function getPartyLegalEntity()\n {\n return $this->partyLegalEntity;\n }", "public function getRestriction()\n {\n return $this->restriction;\n }", "public function getLieuTravailConjoint() {\n return $this->lieuTravailConjoint;\n }", "public function getEndorserParty()\n {\n return $this->endorserParty;\n }", "public function getLegalReference()\n {\n return $this->legalReference;\n }", "public function getInvoiceeTradeParty()\n {\n return $this->invoiceeTradeParty;\n }", "public function getLegalPerson()\n {\n return $this->legal_person;\n }", "public function getLieu()\r\n {\r\n return $this->lieu;\r\n }", "public function getObligationId()\n {\n return $this->obligation_id;\n }", "public function getBookResponseLeg()\n {\n return isset($this->BookResponseLeg) ? $this->BookResponseLeg : null;\n }", "public function getPatentOffice()\n {\n return $this->patent_office;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a default "phone" value, if any is available
public function getDefaultPhone() : ?string;
[ "public function getDefaultPhone() {\n\n\t\treturn self::getPhone();\n\t}", "public function getDefaultTelephone()\n {\n return self::DEFAULT_TELEPHONE_NUMBER;\n }", "public function getPhone()\n {\n return parent::getValue('phone');\n }", "private function getGeneralPhoneNumber()\n {\n try {\n return Mage::getStoreConfig(\n Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE,\n Mage::app()->getStore()\n );\n } catch (Exception $e) {\n return \"\";\n }\n }", "public function phone(){\n\t\tif(trim($this->mobile) != ''){\n\t\t\treturn $this->mobile;\n\t\t}else{\n\t\t\treturn $this->phone_areacode . $this->phone;\n\t\t}\n\t}", "public function getAvailablePhoneNumber()\n {\n if ( !empty( $this->fatherRecord->sms_cell ) ) {\n $phone = $this->fatherRecord->sms_cell;\n } else if ( !empty( $this->fatherRecord->mobile ) ) {\n $phone = $this->fatherRecord->mobile;\n } else if ( !empty( $this->mother_phone ) ) {\n $phone = $this->mother_phone;\n } else {\n $phone = null;\n }\n\n return $phone;\n }", "public function getPhone()\n {\n return isset($this->Phone) ? $this->Phone : null;\n }", "public function get_phone(){ return $this->phone; }", "public function get_phone() {\n return $this->phone;\n }", "public function getStorePhone();", "function getPrimaryPhone() {\n\t\treturn $this->getData('primaryPhone');\n\t}", "function getPhone() {\n return $this->phone;\n }", "public function getCustomerPhone()\n {\n if (array_key_exists(\"customerPhone\", $this->_propDict)) {\n return $this->_propDict[\"customerPhone\"];\n } else {\n return null;\n }\n }", "public function getAdditionalPhone(): ?string\n {\n return $this->additional_phone;\n }", "public function getUserPhone(){\n return $this->user[\"PERSONAL_PHONE\"];\n }", "public function getPhone(): string\n {\n return $this->_phone;\n }", "public function phonePrivateDefault() {\n\t\t$relation\t\t\t= $this->phoneNumbers()->where('is_private', '=', true)->orderBy('type')->get();\n\t\t$phoneNumberList\t= $relation->toArray();\n\t\tif (count($phoneNumberList)) {\n\t\t\treturn $phoneNumberList[0]['number'];\n\t\t}\n\t\treturn false;\n\t}", "function getPhone() {\n\t\treturn $this->_Phone;\n\t}", "public function getBillingPhone();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defines the link between the Tags and their Blogs Return a relationship
public function blogs() { return $this->belongsToMany('App\Blog', 'tags_has_blogs', 'tags_id', 'blogs_id'); }
[ "public function tags()\n {\n return $this->belongsToMany('App\\Models\\Tag', 'blog_tag', 'blog_id', 'tag_id');\n }", "abstract public function tags(): BelongsToMany;", "abstract public function links(): JsonApiParser\\Collections\\Links;", "public function blogs()\n {\n return $this->morphedByMany(App\\Blog::class, 'taggable');\n }", "public function links(Contracts\\Entity\\Entity $entity);", "public function blogs()\n {\n return $this->belongsToMany(Blog::class);\n }", "public function tags(){\n return $this->belongsToMany('LaravelBlog\\Tag');\n }", "public function blog()\n {\n return $this->hasMany(Blog::class, 'category_id', 'id');\n }", "public function tags($id){\n\t\t$link = Link::with(['tags'])->findOrFail($id);\n\t\t\n\t\treturn $link;\n\t}", "function loadTagLinksData() {\n if (isset($this->linkId) && !is_array($this->linkId) && $this->linkId != '' &&\n isset($this->tagType)) {\n $this->linkedTags = $this->getLinkedTags($this->tagType, $this->linkId);\n $this->linkedTagsData = $this->getTags(\n $this->linkedTags, $this->lngSelect->currentLanguageId\n );\n } elseif (isset($this->linkId) && is_array($this->linkId) && count($this->linkId) > 0) {\n $linkedTagsMulti = $this->getLinkedTagsForIds($this->tagType, $this->linkId);\n /*\n * we need to translate the array,\n * since the output of getLinkedTagsForIds was changed, and that's okay\n */\n foreach ($linkedTagsMulti as $linkId => $tagIds) {\n foreach ($tagIds as $tagId) {\n $this->linkedTagsMulti[$tagId][$linkId] = $tagId;\n }\n }\n if (is_array($linkedTagsMulti) && count($linkedTagsMulti) > 0) {\n $this->linkedTags[] = array_keys($this->linkedTagsMulti);\n $this->linkedTagsData = $this->getTags(\n $this->linkedTags, $this->lngSelect->currentLanguageId\n );\n }\n }\n\n // expand tags list to category list size, use a reasonable minimum size: 10\n if ($this->categoryTreeSize > 10 && $this->categoryTreeSize > $this->params['limit']) {\n $this->params['limit'] = $this->categoryTreeSize;\n }\n\n if (isset($this->params['cat_id'])) {\n $this->loadCategory();\n $this->tags = $this->getTagsByCategory(\n $this->params['cat_id'],\n $this->lngSelect->currentLanguageId,\n $this->params['limit'],\n $this->params['offset_tags']\n );\n if ($this->absCount > 0 && (!is_array($this->tags) || count($this->tags) == 0 )) {\n $this->params['offset_tags'] =\n (floor(($this->absCount - 1) / $this->params['limit'])) * $this->params['limit'];\n $this->tags = $this->getTagsByCategory(\n $this->params['cat_id'],\n $this->lngSelect->currentLanguageId,\n $this->params['limit'],\n $this->params['offset_tags']\n );\n }\n }\n }", "public function buildRelationshipLinks(): array;", "public function tag()\n {\n \treturn $this->belongsToMany('App\\Tag', 'ad_tags', 'ad_id', 'tag_id');\n }", "public function tag()\n\t{\n\t\t$crud = $this->generate_crud('blog_tags');\n\t\t$this->mPageTitle = 'Blog Tags';\n\t\t$this->render_crud();\n\t}", "function get_tag_link($tag)\n {\n }", "public function blog() \n {\n \treturn $this->belongsTo('App\\Blog');\n }", "private function updateBlogLinks() {\n\t\t$this->Link->recursive = -1;\n\t\t\n\t\t// get the new handle \n\t\t$handle = $this->data['Blog']['short_name'];\n\t\t$model \t= '/blogs/';\n\t\t$action = $handle;\n\t\t\n\t\t// form the new route\n\t\t$route = $model . $handle;\n\t\t// form the new fields and values\n\t\t$fields = array('Link.route' =>$route,\n\t\t\t\t'Link.model' =>$model,\n\t\t\t\t'Link.action'=>$action);\n\t\t\n\t\t// prepare the fields by wrapping the values in quotes\n\t\tApp::uses('StringLib', 'UtilityLib.Lib');\n\t\t$fields = StringLib::iterateArrayWrapStringValuesInQuotes($fields);\n\t\t\n\t\t// meant only for all the Links belonging to this Blog\n\t\t$conditions = array('Link.parent_id'=>$this->id,\n\t\t\t\t 'Link.parent_model'=>'Blog');\n\t\t\n\t\treturn $this->Link->updateAll($fields, $conditions);\n\t}", "public function blogs()\n {\n return $this->hasMany(Blogs::class, 'category_id');\n }", "public function blogs(){\n return $this->hasMany('App\\Blog','user_id','id');\n }", "private function manage_tags($tags,$post_id){\n foreach($tags as $tag){\n $tag = Tag::get_by_id($tag);\n $tag->link_tag($post_id); \n }\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If this tag has an error, wrap it with a visual indicator
function error_wrapping($html_tag, $has_error) { return ($has_error ? '<span class="fieldWithErrors">' . str_replace(array("\n","\r"), '', $html_tag) . '</span>' : $html_tag); }
[ "public function createTaggerCustomErrorNotice() {\n\t\tglobal $current_screen;\n\t\tglobal $post_ID;\n\t\t\n\t\tif ( $current_screen->id == get_option( 'tagger_post_type' ) ) {\n\t\t\t$img = get_the_post_thumbnail( $post_ID );\n\t\t\tif ( ! $img ) {\n\t\t\t\t$attention = \" <p> <b> Please remember to add a Featured image in order to use Tagger features</b><br/>\n </p> \";\n\t\t\t\techo '<div class=\"error\">' . $attention . '</div>';\n\t\t\t}\n\t\t}\n\t}", "public function invalid_tag($message = '')\n {\n return '<img data-twig-error=\"' . $message . '\">';\n }", "function renderErrorIcon($campo) {\n $html = \"\";\n if ($campo->hasError()) {\n $html = \"<i class='fa fa-warning' data-toggle='tooltip' data-placement='auto left' data-container='form' data-title='{$campo->getError()}'></i>\";\n }\n echo $html;\n}", "function render_error_notice() { ?>\n\t\t<div class=\"jp-idc-error__notice dops-notice is-error\">\n\t\t\t<svg class=\"gridicon gridicons-notice dops-notice__icon\" height=\"24\" width=\"24\" viewBox=\"0 0 24 24\">\n\t\t\t\t<g>\n\t\t\t\t\t<path d=\"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2l-.5-6h3l-.5 6z\"></path>\n\t\t\t\t</g>\n\t\t\t</svg>\n\t\t\t<div class=\"dops-notice__content\">\n\t\t\t\t<span class=\"dops-notice__text\">\n\t\t\t\t\t<?php esc_html_e( 'Something went wrong:', 'jetpack' ); ?>\n\t\t\t\t\t<span class=\"jp-idc-error__desc\"></span>\n\t\t\t\t</span>\n\t\t\t\t<a class=\"dops-notice__action\" href=\"javascript:void(0);\">\n\t\t\t\t\t<span id=\"jp-idc-error__action\">\n\t\t\t\t\t\t<?php esc_html_e( 'Try Again', 'jetpack' ); ?>\n\t\t\t\t\t</span>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</div>\n\t<?php }", "public function markAsError()\n {\n $newClass = $this->getOption('class') . ' ' . TwitterBootstrap_Css::ERROR;\n $this->setOption('class', trim($newClass));\n }", "private function renderError(string $message): void\n {\n echo '<span class=\"deet--wikitext-error\">';\n echo \"Invalid Wikitext at offset $this->offset: \";\n echo \\htmlentities($message);\n echo '.</span>';\n }", "public function hasXMLError() {\n return $this->root->getAttribute('avancement') == 'error';\n }", "function ShowErrBackEnd() {\n if ($this->Err) {\n echo '\n <fieldset class=\"err\" title=\"' . $this->Msg->show_text('MSG_ERRORS') . '\"> <legend>' . $this->Msg->show_text('MSG_ERRORS') . '</legend>\n <div class=\"err_text\">' . $this->Err . '</div>\n </fieldset>';\n }\n }", "function showErr()\n {\n if ($this->Err){\n ?>\n <div class=\"err\" align=center>\n <h2><?=$this->Msg->show_text('MSG_ERR', TblSysTxt);?></h2>\n <?=$this->Err;?>\n </div>\n <?\n }\n }", "public function display_error_holder() {\r\n\t\tprintf( '<div id=\"nyp-error-%s\" class=\"woocommerce-nyp-message\" aria-live=\"assertive\" style=\"display: none\"><ul class=\"woocommerce-error\"></ul></div>', esc_attr( WC_Name_Your_Price_Helpers::get_counter() ) );\r\n\t}", "function ShowErrBackEnd()\n {\n if ($this->Err){\n $title=$this->Msg->show_text('MSG_ERRORS');\n echo '\n <fieldset class=\"err\" title=\"'.$title.'\"> <legend>'.$title.'</legend>\n <div class=\"err_text\">'.$this->Err.'</div>\n </fieldset>';\n }\n }", "private function addAlertSpan($errorName, $attributes = NULL) {\n\t\tif (isset($errorName))\n\t\t{\n\t\t\t$result = '<span class=\"error help-inline\">' \n\t\t\t . ucfirst($errorName) \n\t\t\t . '</span>';\n\t\t}\n\t\telse \n\t\t{\n\t\t\tif (isset($attributes['info']))\n\t\t\t{\n\t\t\t\t// else add info span\n\t\t\t\t$result = '<span class=\"'.$this->info_class.' help-inline\">' \n\t\t\t\t . $attributes['info'] \n\t\t\t\t . '</span>';\n\t\t\t}\n\t\t}\n\t\treturn (string) (isset($result))?$result:'';\n\t}", "public function shouldRendererRenderErrors();", "protected static function error($name, $element)\n\t{\n\t\treturn '<span class=\"error\">' . $element . '</span>';\n\t}", "public static function htmlError(){\n $run = new Run;\n $run->pushHandler(new PrettyPageHandler);\n $run->register();\n }", "function di_error ( $message = \"\" ) {\r\n\r\n if ( $message )\r\n echo \"<div id=\\\"message\\\" class=\\\"error\\\"><p>$message</p></div>\\n\";\r\n}", "public function renderErroneousField() {\n $html = '<span class=\"erroneous-field\">';\n $html .= Yii::t('app', 'Field could not be found');\n $html .= '</span>';\n return $html;\n }", "public function tagline_notice()\n {\n }", "function ShowErrBackEnd()\n\t {\n\t\t if ($this->Err){\n\t\t echo '\n\t\t\t<table border=0 cellspacing=4 cellpadding=5 class=\"err\" align=\"center\">\n\t\t\t <tr><td align=\"left\">'.$this->Err.'</td></tr>\n\t\t\t</table>';\n\t\t }\n\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new dataObjectRef
public function setDataObjectRef($dataObjectRef) { $this->dataObjectRef = $dataObjectRef; return $this; }
[ "function SetData(wxDataObject &$data){}", "public function assignData(DataObject $data)\n {\n }", "public function setReferencedData($referencedData)\n {\n $this->referencedData = $referencedData;\n return $this;\n }", "function setRefId($a_refid)\n\t{\n\t\t$this->refid = $a_refid;\n\t}", "private function ReferenceObject()\n\t{\n\t\tif ($this->objectReferenced)\n\t\t\treturn;\n\n\t\tif (!$this->object)\n\t\t\treturn;\n\n\t\tif ($this->type == 'commit') {\n\t\t\t$this->object = $this->object->GetHash();\n\t\t} else if ($this->type == 'tag') {\n\t\t\t$this->object = $this->object->GetName();\n\t\t} else if ($this->type == 'blob') {\n\t\t\t$this->object = $this->object->GetHash();\n\t\t}\n\n\t\t$this->objectReferenced = true;\n\t}", "function setData($objName, $dataString)\r\n {\r\n $delim = \"PCDELIM\";\r\n $bTag = \"<\".$delim.\">\";\r\n $eTag = \"</\".$delim.\">\";\r\n\r\n // replace all occurances of \\n with <PCNL> in dataString\r\n $dataString = preg_replace(\"/\\n/\", \"<PCNL>\", $dataString);\r\n\r\n $tmpData = $bTag . \"setdata\" . $eTag . $bTag . $objName . $eTag . $bTag . $dataString . $eTag;\r\n\r\n if($this->genericData != null && strlen(trim($this->genericData)) > 0)\r\n {\r\n $this->genericData .= $tmpData;\r\n }\r\n else //genericData empty or null\r\n {\r\n $this->genericData = $tmpData;\r\n }\r\n }", "public function setRef(Ref $ref)\n {\n $this->ref = $ref;\n $this->refString = $ref->getRef();\n }", "public function setDataFrameRef($dataFrameRef)\n {\n $this->dataFrameRef = $dataFrameRef;\n return $this;\n }", "private function set_data($data) {\n $this->cm->data = $data;\n }", "function setDataField($newDataField) {\n $this->dataField = $newDataField;\n }", "public function fill_obj($data_obj)\n {\n // section -64--88-56-1-530ab1a6:1720ae78e2d:-8000:0000000000000AEC begin\n // section -64--88-56-1-530ab1a6:1720ae78e2d:-8000:0000000000000AEC end\n }", "abstract public function set($data);", "public function setRef($key, &$value);", "function setDataSet(&$DataSet)\n\t{\n\t\t$this->DataSet = $DataSet;\n\t}", "public function setObject($object);", "public function add_dataObject(DataObject $dataObject) {\n $this->dataObjects[] = $dataObject;\n }", "public function setReference($name, $object)\n {\n $this->getReferenceRepository()->setReference($name, $object);\n }", "function setRecord($data = null) {\n $this->recordData = $data;\n }", "public function setRef($ref): self;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Map a controller to given PATCH route
public function patch(string $path, $controller, ?string $name = null): void { $this->define('PATCH', $path, $controller, $name); }
[ "public function patch($route, $action);", "public function patch($routePattern, $handler){ }", "public function patch(Request $request): Response;", "function testRunMethodWithParamsPatch() {\n\t\t$_SERVER['REQUEST_METHOD'] = 'PATCH';\n\t\t$_SERVER['REQUEST_URI'] = '/exposeFunc2/123456patch';\n\n\t\t$r = new \\KungFoo\\Routing\\Router();\n\t\t$result = $r->addFromController(ControllerWithAnnotationsDispatch::class);\n\t\t$this->assertTrue($result);\n\n\t\t$r->run();\n\t}", "public function testPatch()\n {\n $route = '/patch';\n $callable = function() { echo 'hi'; };\n $app = new App();\n $routes = new MockRoutes($app);\n $routes->applyPatch($route, $callable);\n $slimRoutes = $app->getContainer()->router->getRoutes();\n $firstRoute = array_pop($slimRoutes);\n $this->assertTrue($firstRoute->getMethods() === ['PATCH']);\n $this->assertTrue($firstRoute->getPattern() === $route);\n }", "public function patch(string $pattern, array $callable): RouteInterface;", "public static function patch($pattern, callable $callback): RouteInterface;", "protected function patch()\n {\n $this->respondWithMethodNotAllowed();\n }", "public function patch(string $route, array|Closure|string $action, ?string $name = null): Route\n\t{\n\t\treturn $this->registerRoute(['PATCH', 'OPTIONS'], $route, $action, $name);\n\t}", "public function patch($path = '', array $request = array()) {\n return $this->process($path, $request, \\RestfulInterface::PATCH);\n }", "public function patch(string $uri, $callable, ?string $name = null): Route;", "public function patch(string $path, callable $handler): HttpRouteHandler\n {\n }", "public function patch(string $path, string $middleware): void;", "public function patch($handler = null)\n {\n return $this->method('PATCH', func_get_args());\n }", "public function patch($route, $handler)\n {\n $this->addRoute('PATCH', $route, $handler);\n }", "#[@test]\n public function doPatch() {\n $this->assertHandlerForMethodTriggered('PATCH');\n }", "public function routeAction() {\n // handle grabbing PUT vars\n $request = $this->getRequest();\n if ($request->isPut()) {\n parse_str($request->getRawBody(), $params);\n foreach ($params as $key => $value) {\n $request->setParam($key, $value);\n }\n }\n\t\t$this->_forward(strtolower($request->getMethod()));\n\t}", "public function setPatchMethod()\n {\n $this->method = self::METHOD_PATCH;\n }", "public function PATCH () {\n $this->Response->throw_exception(501, \"Method not imeplemented\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the snapshot_reduce_skills_by_group column Example usage: $query>filterBySnapshotReduceSkillsByGroup(1234); // WHERE snapshot_reduce_skills_by_group = 1234 $query>filterBySnapshotReduceSkillsByGroup(array(12, 34)); // WHERE snapshot_reduce_skills_by_group IN (12, 34) $query>filterBySnapshotReduceSkillsByGroup(array('min' => 12)); // WHERE snapshot_reduce_skills_by_group > 12
public function filterBySnapshotReduceSkillsByGroup($snapshotReduceSkillsByGroup = null, $comparison = null) { if (is_array($snapshotReduceSkillsByGroup)) { $useMinMax = false; if (isset($snapshotReduceSkillsByGroup['min'])) { $this->addUsingAlias(SettingsTableMap::COL_SNAPSHOT_REDUCE_SKILLS_BY_GROUP, $snapshotReduceSkillsByGroup['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($snapshotReduceSkillsByGroup['max'])) { $this->addUsingAlias(SettingsTableMap::COL_SNAPSHOT_REDUCE_SKILLS_BY_GROUP, $snapshotReduceSkillsByGroup['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(SettingsTableMap::COL_SNAPSHOT_REDUCE_SKILLS_BY_GROUP, $snapshotReduceSkillsByGroup, $comparison); }
[ "function addCustomerGroupFilter($customer_group_id){\r\n return $this->addSerialFilter('customer_group_ids', $customer_group_id, true);\r\n }", "public function filterByGroupkey($groupkey = null, $comparison = null)\n {\n if (is_array($groupkey)) {\n $useMinMax = false;\n if (isset($groupkey['min'])) {\n $this->addUsingAlias(MatchesTableMap::COL_GROUPKEY, $groupkey['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($groupkey['max'])) {\n $this->addUsingAlias(MatchesTableMap::COL_GROUPKEY, $groupkey['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(MatchesTableMap::COL_GROUPKEY, $groupkey, $comparison);\n }", "protected function getGroupFilter(){\n\t\t$groupFilter = \"\";\n\t\tif($this->LevelOfProductsToShow < 0) {\n\t\t\t//no produts but if LevelOfProductsToShow = -1 then show all\n\t\t\t$groupFilter = \" (\".$this->LevelOfProductsToShow.\" = -1) \" ;\n\t\t}\n\t\telseif($this->LevelOfProductsToShow > 0) {\n\t\t\t$groupIDs = array($this->ID => $this->ID);\n\t\t\t$groupFilter .= $this->getProductsToBeIncludedFromOtherGroups();\n\t\t\t$childGroups = $this->ChildGroups($this->LevelOfProductsToShow);\n\t\t\tif($childGroups->count()) {\n\t\t\t\tforeach($childGroups as $childGroup) {\n\t\t\t\t\t$groupIDs[$childGroup->ID] = $childGroup->ID;\n\t\t\t\t\t$groupFilter .= $childGroup->getProductsToBeIncludedFromOtherGroups();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$groupFilter = \" ( \\\"ParentID\\\" IN (\".implode(\",\", $groupIDs).\") ) \".$groupFilter;\n\t\t}\n\t\t$this->allProducts = $this->allProducts->where($groupFilter);\n\t\treturn $this->allProducts;\n\t}", "public function filterByGroup($group = '', $inGroup = true)\n {\n if (!$group instanceof Group) {\n $group = Group::getByName($group);\n }\n $tbl = 'ug_'.$group->getGroupID();\n $this->addToQuery(\"left join UserGroups $tbl on {$tbl}.uID = u.uID \");\n if ($inGroup) {\n $this->filter(false, \"{$tbl}.gID=\".intval($group->getGroupID()));\n } else {\n $this->filter(false, \"{$tbl}.gID is null\");\n }\n }", "private function filter_group_name( $group ) {\n\t\t/**\n\t\t * Filter the group name\n\t\t *\n\t\t * @since 2.1.0\n\t\t */\n\t\t$filtered_group = apply_filters( 'give_cache_filter_group_name', '', $group );\n\n\t\tif ( empty( $filtered_group ) ) {\n\n\t\t\tswitch ( $group ) {\n\t\t\t\tcase 'give-db-queries':\n\t\t\t\t\t$incrementer = self::$instance->get_incrementer();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$incrementer = self::$instance->get_incrementer( false, 'give-cache-incrementer' );\n\n\t\t\t}\n\n\t\t\t$current_blog_id = get_current_blog_id();\n\t\t\t$filtered_group = \"{$group}_{$current_blog_id}_{$incrementer}\";\n\t\t}\n\n\t\treturn $filtered_group;\n\t}", "public function posts_groupby($groupby) {\n if($this->_search_distance && $this->_search_latitude && $this->_search_longitude){\n $groupby .= ' HAVING distance <= '.$this->_search_distance;\n }\n\n return $groupby;\n }", "private function applyGroupBy() {\n if (!count($this->groupByStatements)) {\n return;\n }\n\n $this->query .= ' group by '.implode(',', $this->groupByStatements);\n }", "private function applyFilterGroup(\n FilterableQueryInterface $query,\n FilterGroupInterface $filterGroup\n ): void {\n $queryFilterGroup = new QueryFilterGroup();\n $filterAdded = false;\n foreach ($filterGroup->getFilters() as $filter) {\n if ($filter instanceof FilterGroupInterface) {\n $this->applyFilterGroup($query, $filter);\n continue;\n }\n\n $ordinal = ComparatorEnum::getOrdinal((string) $filter->getComparator());\n $comparator = [SqlComparatorEnum::class, $ordinal];\n /** @var FilterInterface $filter */\n $queryFilterGroup->addFilter(\n new ComparatorFilter(\n $filter->getField(),\n $filter->getValue(),\n $comparator()\n )\n );\n $filterAdded = true;\n }\n\n if ($filterAdded) {\n $query->addFilterGroup($queryFilterGroup);\n }\n }", "public function orHavingGroup($group);", "private function setGroup2() {\n $this->qestion->groupBy(\"moods.id\");\n //$this->qestion->havingRaw(\"CASE WHEN count(forwarding_drugs.id_mood) = 0 THEN 1 else forwarding_drugs.id_mood END \");\n }", "function groupedQuery($class)\r\n{\r\n\t$field = $prototype->primary_key;\r\n\t\r\n\t$filter = null;\r\n\t\r\n\t$query = new GroupedQuery($class);\r\n\t\r\n\tif (func_num_args() > 1)\r\n\t{\r\n\t\t$query->constraints(func_get_arg(1));\r\n\t\t\r\n\t\tif (func_num_args() > 2)\r\n\t\t{\r\n\t\t\t$query->groupBy(func_get_arg(2));\r\n\t\t\t\r\n\t\t\tif (func_num_args() > 3)\r\n\t\t\t{\r\n\t\t\t\t$query->filter(func_get_arg(3));\r\n\t\t\t} \r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $query->execute();\r\n}", "public function filterByStartgroup($startgroup, $comparison = null)\n {\n if ($startgroup instanceof \\iuf\\junia\\model\\Startgroup) {\n return $this\n ->addUsingAlias(JudgeTableMap::COL_STARTGROUP_ID, $startgroup->getId(), $comparison);\n } elseif ($startgroup instanceof ObjectCollection) {\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n\n return $this\n ->addUsingAlias(JudgeTableMap::COL_STARTGROUP_ID, $startgroup->toKeyValue('PrimaryKey', 'Id'), $comparison);\n } else {\n throw new PropelException('filterByStartgroup() only accepts arguments of type \\iuf\\junia\\model\\Startgroup or Collection');\n }\n }", "protected function setGroup() {\r\n //var_dump($this->sql);\r\n if( $this->sqlGroupBy ) {\r\n var_dump($this->sql);\r\n $this->sql .= ' GROUP BY ' . $this->sqlGroupBy;\r\n }\r\n //var_dump($this->sql);\r\n }", "public function addGroupFunction(string $value): \\SolrQuery {}", "function test_unique_newest_filter_on_scale_field() {\n\t\t\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\n\t\t$filter_args = array(\n\t\t\tarray( 'type' => 'field',\n\t\t\t 'col' => 'qbrd2o',\n\t\t\t 'op' => 'group_by_newest',\n\t\t\t 'val' => '',\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( 'Jwahlin', 'Steve' ), array( 'Steph' ) );\n\n\t\tself::run_get_display_data_tests( $d, 'unique filter' );\n\t}", "function automap_filter_by_group(&$obj, $params) {\n if(!isset($params['filter_group']) || $params['filter_group'] == '')\n return;\n\n global $_BACKEND;\n $_BACKEND->checkBackendExists($params['backend_id'][0], true);\n $_BACKEND->checkBackendFeature($params['backend_id'][0], 'getHostNamesInHostgroup', true);\n $hosts = $_BACKEND->getBackend($params['backend_id'][0])->getHostNamesInHostgroup($params['filter_group']);\n\n $allowed_ids = array_flip(automap_hostnames_to_object_ids($hosts));\n automap_filter_tree($allowed_ids, $obj);\n}", "private function _applyGroupIdParam()\n {\n if ($this->groupId) {\n // Should we set the structureId param?\n if ($this->structureId === null && (!is_array($this->groupId) || count($this->groupId) === 1)) {\n $structureId = (new Query())\n ->select(['structureId'])\n ->from([Table::CATEGORYGROUPS])\n ->where(Db::parseParam('id', $this->groupId))\n ->scalar();\n $this->structureId = (int)$structureId ?: false;\n }\n\n $this->subQuery->andWhere(Db::parseParam('categories.groupId', $this->groupId));\n }\n }", "public function filterByGroupId($groupId = null, $comparison = null)\n {\n if (is_array($groupId)) {\n $useMinMax = false;\n if (isset($groupId['min'])) {\n $this->addUsingAlias(AliProductTableMap::COL_GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($groupId['max'])) {\n $this->addUsingAlias(AliProductTableMap::COL_GROUP_ID, $groupId['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(AliProductTableMap::COL_GROUP_ID, $groupId, $comparison);\n }", "private function applyGroup(): void\n {\n if ($this->hasAggregation) {\n $statement = sprintf('%s.%s', $this->configuration->getAlias(), $this->configuration->getIdentifier());\n $this->queryBuilder->groupBy($statement);\n } else {\n $this->queryBuilder->distinct();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the invites_sent column Example usage: $query>filterByInvitesSent(1234); // WHERE invites_sent = 1234 $query>filterByInvitesSent(array(12, 34)); // WHERE invites_sent IN (12, 34) $query>filterByInvitesSent(array('min' => 12)); // WHERE invites_sent > 12
public function filterByInvitesSent($invitesSent = null, $comparison = null) { if (is_array($invitesSent)) { $useMinMax = false; if (isset($invitesSent['min'])) { $this->addUsingAlias(CandidateTableMap::COL_INVITES_SENT, $invitesSent['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($invitesSent['max'])) { $this->addUsingAlias(CandidateTableMap::COL_INVITES_SENT, $invitesSent['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(CandidateTableMap::COL_INVITES_SENT, $invitesSent, $comparison); }
[ "public function filterBySentAt($sentAt = null, $comparison = null)\n\t{\n\t\tif (is_array($sentAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($sentAt['min'])) {\n\t\t\t\t$this->addUsingAlias(LogMailtoPeer::SENT_AT, $sentAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($sentAt['max'])) {\n\t\t\t\t$this->addUsingAlias(LogMailtoPeer::SENT_AT, $sentAt['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(LogMailtoPeer::SENT_AT, $sentAt, $comparison);\n\t}", "public function filterBySmsSendAt($smsSendAt = null, $comparison = null)\n {\n if (is_array($smsSendAt)) {\n $useMinMax = false;\n if (isset($smsSendAt['min'])) {\n $this->addUsingAlias(EventsParticipantsPeer::SMS_SEND_AT, $smsSendAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($smsSendAt['max'])) {\n $this->addUsingAlias(EventsParticipantsPeer::SMS_SEND_AT, $smsSendAt['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(EventsParticipantsPeer::SMS_SEND_AT, $smsSendAt, $comparison);\n }", "public function filterBySend($send = null, $comparison = null)\n {\n if (is_array($send)) {\n $useMinMax = false;\n if (isset($send['min'])) {\n $this->addUsingAlias(AliIsalehTableMap::COL_SEND, $send['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($send['max'])) {\n $this->addUsingAlias(AliIsalehTableMap::COL_SEND, $send['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(AliIsalehTableMap::COL_SEND, $send, $comparison);\n }", "public function filterBySend($send = null, $comparison = null)\n {\n if (is_array($send)) {\n $useMinMax = false;\n if (isset($send['min'])) {\n $this->addUsingAlias(AliEsalehTableMap::COL_SEND, $send['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($send['max'])) {\n $this->addUsingAlias(AliEsalehTableMap::COL_SEND, $send['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(AliEsalehTableMap::COL_SEND, $send, $comparison);\n }", "public function filterBySender($sender = null, $comparison = null)\n {\n if (is_array($sender)) {\n $useMinMax = false;\n if (isset($sender['min'])) {\n $this->addUsingAlias(AliTsalehTableMap::COL_SENDER, $sender['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($sender['max'])) {\n $this->addUsingAlias(AliTsalehTableMap::COL_SENDER, $sender['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(AliTsalehTableMap::COL_SENDER, $sender, $comparison);\n }", "public function filterBySend($send = null, $comparison = null)\n {\n if (is_array($send)) {\n $useMinMax = false;\n if (isset($send['min'])) {\n $this->addUsingAlias(AliAdjustTableMap::COL_SEND, $send['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($send['max'])) {\n $this->addUsingAlias(AliAdjustTableMap::COL_SEND, $send['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(AliAdjustTableMap::COL_SEND, $send, $comparison);\n }", "public function filterBySender($sender = null, $comparison = null)\n {\n if (is_array($sender)) {\n $useMinMax = false;\n if (isset($sender['min'])) {\n $this->addUsingAlias(AliImportStockHTableMap::COL_SENDER, $sender['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($sender['max'])) {\n $this->addUsingAlias(AliImportStockHTableMap::COL_SENDER, $sender['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(AliImportStockHTableMap::COL_SENDER, $sender, $comparison);\n }", "public function filterBySender($sender = null, $comparison = null)\n {\n if (is_array($sender))\n {\n $useMinMax = false;\n if (isset($sender['min']))\n {\n $this->addUsingAlias(PrivateMessagePeer::SENDER, $sender['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($sender['max']))\n {\n $this->addUsingAlias(PrivateMessagePeer::SENDER, $sender['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax)\n {\n return $this;\n }\n if (null === $comparison)\n {\n $comparison = Criteria::IN;\n }\n }\n return $this->addUsingAlias(PrivateMessagePeer::SENDER, $sender, $comparison);\n }", "public function filterByRecoverySent($recoverySent = null, $comparison = null)\n\t{\n\t\tif (is_array($recoverySent)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($recoverySent['min'])) {\n\t\t\t\t$this->addUsingAlias(UserPeer::RECOVERY_SENT, $recoverySent['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($recoverySent['max'])) {\n\t\t\t\t$this->addUsingAlias(UserPeer::RECOVERY_SENT, $recoverySent['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(UserPeer::RECOVERY_SENT, $recoverySent, $comparison);\n\t}", "public function filterBySentDate($sentDate = null, $comparison = null)\n\t{\n\t\tif (is_array($sentDate)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($sentDate['min'])) {\n\t\t\t\t$this->addUsingAlias(StudentPublicationPeer::SENT_DATE, $sentDate['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($sentDate['max'])) {\n\t\t\t\t$this->addUsingAlias(StudentPublicationPeer::SENT_DATE, $sentDate['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(StudentPublicationPeer::SENT_DATE, $sentDate, $comparison);\n\t}", "public function filterByInvitedBy($invitedBy = null, $comparison = null)\n {\n if (is_array($invitedBy)) {\n $useMinMax = false;\n if (isset($invitedBy['min'])) {\n $this->addUsingAlias(EventsParticipantsPeer::INVITED_BY, $invitedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($invitedBy['max'])) {\n $this->addUsingAlias(EventsParticipantsPeer::INVITED_BY, $invitedBy['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(EventsParticipantsPeer::INVITED_BY, $invitedBy, $comparison);\n }", "function filter_invite_list(){\n \n }", "public function filterByInvStatus($invStatus = null, $comparison = null)\n\t{\n\t\tif (is_array($invStatus)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($invStatus['min'])) {\n\t\t\t\t$this->addUsingAlias(InvitationPeer::INV_STATUS, $invStatus['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($invStatus['max'])) {\n\t\t\t\t$this->addUsingAlias(InvitationPeer::INV_STATUS, $invStatus['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(InvitationPeer::INV_STATUS, $invStatus, $comparison);\n\t}", "function setRevenueFilter($min) {\n $this->WHERE['rev_avg >= '] = $min;\n }", "public function tobeSentEmails(){\n $results = $this->where('status', 'pending')\n ->where('confirm_send', 1)\n ->get();\n $emails = $results->filter(function($item){\n if($item->offers->has_communication_package == \"yes\"){\n return true;\n }\n });\n return $emails;\n }", "public function filterBySendLimit($sendLimit = null, $comparison = null)\n {\n if (is_array($sendLimit)) {\n $useMinMax = false;\n if (isset($sendLimit['min'])) {\n $this->addUsingAlias(SegmentTableMap::COL_SEND_LIMIT, $sendLimit['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($sendLimit['max'])) {\n $this->addUsingAlias(SegmentTableMap::COL_SEND_LIMIT, $sendLimit['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(SegmentTableMap::COL_SEND_LIMIT, $sendLimit, $comparison);\n }", "public function addOnlyForSendingFilter()\n {\n $this->getSelect()\n ->where('main_table.queue_status in (?)', array(Mage_Newsletter_Model_Queue::STATUS_SENDING,\n Mage_Newsletter_Model_Queue::STATUS_NEVER))\n ->where('main_table.queue_start_at < ?', Mage::getSingleton('core/date')->gmtdate())\n ->where('main_table.queue_start_at IS NOT NULL');\n\n return $this;\n }", "public function filterByData($data = null, $comparison = null)\n\t{\n\t\tif (is_array($data)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($data['min'])) {\n\t\t\t\t$this->addUsingAlias(MensagemPeer::DATA, $data['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($data['max'])) {\n\t\t\t\t$this->addUsingAlias(MensagemPeer::DATA, $data['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(MensagemPeer::DATA, $data, $comparison);\n\t}", "public function filterBySenderDate($senderDate = null, $comparison = null)\n {\n if (is_array($senderDate)) {\n $useMinMax = false;\n if (isset($senderDate['min'])) {\n $this->addUsingAlias(AliIsalehTableMap::COL_SENDER_DATE, $senderDate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($senderDate['max'])) {\n $this->addUsingAlias(AliIsalehTableMap::COL_SENDER_DATE, $senderDate['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(AliIsalehTableMap::COL_SENDER_DATE, $senderDate, $comparison);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test handle event with an invalid stats
public function testHandleEventWithInvalidConfigIncrement() { $client = $this->getMockedClient(); $client->addEventToListen('test', array( 'increment' => 'stats.<toto>' )); $this->exception(function () use ($client) { $event = new \Symfony\Component\EventDispatcher\Event(); $event->setName('test'); $client->handleEvent($event); }); }
[ "public function testHandleEventWithInvalidEventTiming()\n {\n $client = $this->getMockedClient();\n\n $client->addEventToListen('test', array(\n 'timing' => 'stats.<name>'\n ));\n\n $this->exception(function () use ($client) {\n $event = new \\Symfony\\Component\\EventDispatcher\\Event();\n $event->setName('test');\n\n $client->handleEvent($event);\n });\n\n $client = $this->getMockedClient();\n\n $client->addEventToListen('test', array(\n 'timingMemory' => 'stats.raoul'\n ));\n\n $this->exception(function () use ($client) {\n $event = new \\Symfony\\Component\\EventDispatcher\\Event();\n $event->setName('test');\n\n $client->handleEvent($event);\n });\n\n }", "public function testReceiveBadInput()\n {\n $this->expectException(Error::class);\n\n Event::receive('bad input');\n }", "public function testPopulatedStatAndEvent()\n\t{\n\t\t$data = new Blackbox_Data();\n\t\t$state_data = new Blackbox_StateData();\n\t\t\n\t\t$rule = $this->getMock('OLPBlackbox_Rule',\n\t\t\tarray('canRun', 'runRule', 'hitEvent', 'hitBBStat'));\n\t\t$rule->expects($this->any())->method('canRun')->will($this->returnValue(TRUE));\n\t\t$rule->expects($this->any())->method('runRule')->will($this->returnValue(FALSE));\n\t\t\n\t\t$rule->expects($this->once())->method('hitEvent');\n\t\t$rule->expects($this->once())->method('hitBBStat');\n\t\t\n\t\t// setup stat and event names for the rule\n\t\t$rule->setEventName('TEST_EVENT');\n\t\t$rule->setStatName('test_stat');\n\t\t\n\t\t$valid = $rule->isValid($data, $state_data);\n\t\t$this->assertFalse($valid);\n\t}", "public function testInvalidEventHandling() {\n\t\t$session = $this->getSession();\n\t\t$session->handleEvent(new Event(Event::TYPE_APPLICATION_BEFORE_CONTROLLER_RUN));\n\t\t$session['test'] = 'testValue';\n\t\t$session->handleEvent(new Event(Event::TYPE_APPLICATION_BEFORE_CONTROLLER_RUN));\n\t\t$this->assertSame('testValue', $session['test'], 'Loading the session twice overwrites data');\n\t}", "public function testReceiveNoInput()\n {\n $this->expectException(Error::class);\n\n Event::receive();\n }", "function testEventName(){\n \n }", "public function testTaskStatusTimeWrongCollection()\n {\n $project = $this->getNewProject();\n $event = new TaskStatusTimeCalculation($project);\n $listener = new \\App\\Listeners\\TaskStatusTimeCalculation();\n $out = $listener->handle($event);\n $this->assertEquals(false, $out);\n }", "public function testHandleEventMissingMethod()\n {\n $fakeSender = $this->getMock('Sender', array('addMetric'));\n $fakeSender->expects($this->never())\n ->method('addMetric');\n\n $client = new Client(array('fakeSender' => $fakeSender));\n\n $client->setMetricClass('timer', 'Guerriat\\MetricsBundle\\Metric\\TimerMetric');\n\n $client->addEventToListen(\n 'eventName',\n array(\n 'timer' => array(\n 'key' => 'app.timer',\n 'method' => 'getTiming',\n )\n )\n );\n\n $fakeEvent = $this->getMock('Symfony\\Component\\EventDispatcher\\Event', array('getName'));\n $fakeEvent->expects($this->once())\n ->method('getName')\n ->will($this->returnValue('eventName'));\n\n $this->setExpectedException('InvalidArgumentException');\n $this->assertNull($client->handleEvent($fakeEvent));\n }", "public function testGetInvalidEventByEventId() {\n\t\t//grab a truck id that exceeds the maximum allowable truck id\n\t\t$event = Event::getEventByEventId($this->getPDO(), CrumbTrailTest::INVALID_KEY);\n\t\t$this->assertNull($event);\n\t}", "public function testStatsRead0()\n {\n\n }", "public function testEventsBadPermissionsStats($appId, $index)\n {\n $this->queryEvents(\n Query::createMatchAll(),\n 1513470315000000,\n 1513470315000000,\n $appId,\n $index\n );\n }", "public function testGetInvalidEventByEventProfileId(): void {\n\t\t//grab a profile id that exceeds the maximum allowable profile Id\n\t\t$event = Event::getEventByEventProfileId($this->getPDO(), generateUuidV4());\n\t\t$this->assertCount(0, $event);\n\t}", "public function testGetInvalidEventByEventId() : void {\n\t\t//grab a profile id that exceeds the maximum allowable profile Id\n\t\t$event = Event::getEventByEventId($this->getPDO(), generateUuidV4());\n\t\t$this->assertNull($event);\n\t}", "function test__events_trigger__failed_instant() {\n $this->assertEqual(1, events_trigger('test_instant', 'fail'), 'fail first event: %s');\n $this->assertEqual(1, events_trigger('test_instant', 'ok'), 'this one should fail too: %s');\n $this->assertEqual(0, events_cron('test_instant'), 'all events should stay in queue: %s');\n $this->assertEqual(2, events_pending_count('test_instant'), 'two events should in queue: %s');\n $this->assertEqual(0, sample_function_handler('status'), 'verify no event dispatched yet: %s');\n sample_function_handler('ignorefail'); //ignore \"fail\" eventdata from now on\n $this->assertEqual(1, events_trigger('test_instant', 'ok'), 'this one should go to queue directly: %s');\n $this->assertEqual(3, events_pending_count('test_instant'), 'three events should in queue: %s');\n $this->assertEqual(0, sample_function_handler('status'), 'verify previous event was not dispatched: %s');\n $this->assertEqual(3, events_cron('test_instant'), 'all events should be dispatched: %s');\n $this->assertEqual(3, sample_function_handler('status'), 'verify three events were dispatched: %s');\n $this->assertEqual(0, events_pending_count('test_instant'), 'no events should in queue: %s');\n $this->assertEqual(0, events_trigger('test_instant', 'ok'), 'this event should be dispatched immediately: %s');\n $this->assertEqual(4, sample_function_handler('status'), 'verify event was dispatched: %s');\n $this->assertEqual(0, events_pending_count('test_instant'), 'no events should in queue: %s');\n }", "public function testGetInvalidEventName (): void {\n // grab an name that does not exist\n $event = Event::getEventByEventName($this->getPDO(), \"omgmynameisLuther\");\n $this->assertEmpty($event);\n }", "public function testProfilerQueryEndHandleInvalid()\n {\n $prof = $this->_db->getProfiler();\n\n $prof->queryEnd('invalid');\n\n $prof->setEnabled(true);\n\n try {\n $prof->queryEnd('invalid');\n $this->fail('Expected Zend_Db_Profiler_Exception not thrown');\n } catch (Zend_Db_Profiler_Exception $e) {\n $this->assertStringContainsString('no query with handle', $e->getMessage());\n }\n }", "public static function failed_event_method()\n {\n return false;\n }", "public function handle_expt_event();", "public function testUpdateInvalidStatistic(){\n\t\t//create a Statistic with a non null tweet id and watch it fail\n\t\t$statistic = new Statistic(null, $this->VALID_STATISTICNAME);\n\t\t$statistic->insert($this->getPDO());\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
retrieves the history for $wantedNonEmptyCols. $wantedAdditionalCols is added on every returned row
public function subHistory($value, $wantedNonEmptyCols, $wantedAdditionalCols=['updated']){ $subHistory = []; if (!empty($expandedHistory = $value['history'])){ $compressedHistory = ItemsCache::getExtrafromCache('compressedhistory', $value['id']); if (count($compressedHistory) > ($length = count($expandedHistory))){ $expandedHistory = array_merge($expandedHistory, $this->_expandHistory(end($expandedHistory), array_slice($compressedHistory, $length))); } $wantedNonEmptyKeys = array_flip($wantedNonEmptyCols); $wantedAdditionalKeys = array_flip($wantedAdditionalCols); foreach ($expandedHistory as $historicValue){ $subHistoryItem = array_intersect_key(array_filter($historicValue), $wantedNonEmptyKeys); if (!empty($subHistoryItem)){ $subHistory[] = array_merge($subHistoryItem, array_intersect_key($historicValue, $wantedAdditionalKeys)); } } } return $subHistory; }
[ "private function prepareExceptColumns()\n {\n $ar = self::getActiveRecord();\n // we will get the table schema\n $select = Schema::instance(\n $this,\n function ($table) use ($ar) {\n $table->database = $ar->getDatabase();\n $table->tableName = $ar->getTableName();\n\n return $table->getColumns();\n }\n );\n\n $columns = $this->query($select->schema)->getAll();\n\n // Get all column name which need to remove from the result set\n $exceptColumns = $ar->exceptColumns();\n $columnArray = array();\n foreach ($columns as $key => $value) {\n\n if (!in_array($value->column_name, $exceptColumns)) {\n $columnArray[] = $value->column_name;\n }\n }\n $this->_selectColumns = (string)implode(',', $columnArray);\n }", "private function prepareExceptColumns()\n {\n $ar = self::cyrus();\n // we will get the table schema\n $select = Schema::make(\n $this,\n function ($table) use ($ar) {\n $table->database = $ar->getDatabase();\n $table->tableName = $ar->getTableName();\n\n return $table->getColumns();\n }\n );\n\n $columns = $this->query($select->schema)->getAll();\n\n // Get all column name which need to remove from the result set\n $exceptColumns = $ar->skip();\n $columnArray = [];\n foreach ($columns as $key => $value) {\n if (!in_array($value->COLUMN_NAME, $exceptColumns)) {\n $columnArray[] = $value->COLUMN_NAME;\n }\n }\n $this->_selectColumns = (string)implode(',', $columnArray);\n }", "private function prepareAdditionalColumns()\n {\n $columns = [];\n foreach ($this->additionalColumns as $column) {\n $columns[] = self::USE_CONFIG_PREFIX . $column;\n $columns[] = self::GIFTCARD_PREFIX . $column;\n }\n return $columns;\n }", "abstract protected function getTmpTableColumns();", "function get_hint_cols() {\n //\n //Filter from this table's columns those that are descriptive\n $descriptives = array_filter($this->fields, function($col) {\n //Get the column name\n $name = $col->name;\n //\n //Descriptive columns are named are name, description or have a \n //name //suffix\n $filter = ((substr($name, -4) == \"name\") || ($name == \"description\")) ? true : false;\n //\n return $filter;\n });\n //\n //Let $c be the combination of indexing and descriptive columns\n $c = array_merge($this->first_index_cols(), $descriptives);\n //\n //Remove duplicates. Get the __toString to work correctly, i.e, the \n //array unique function requires us to convert the columns to strings\n $d = array_unique($c);\n //\n //return the combination\n return $d;\n }", "public function addColumns(){\r\n\t\t$tmpArgArr = func_get_args();\r\n if(isset($tmpArgArr[0]) && is_array($tmpArgArr[0]) && count($tmpArgArr[0]) > 0){\r\n foreach($tmpArgArr[0] as $columnName){\r\n if(!in_array($columnName, $this->logArrayKeys)){\r\n array_push($this->logArrayKeys, $columnName);\r\n }\r\n }\r\n }\r\n }", "public function getModifiedColumns()\n {\n return array_unique($this->modifiedColumns);\n }", "function getExtraColumns(){\n return $this->extra_columns;\n }", "public function getExistColumns() {\n\t\t$result = array();\n\t\tforeach($this->notorm_source as $row) {\n\t\t\t$result = array_keys(iterator_to_array($row)); \n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->exist_columns = $result;\n\t}", "function mem_get_extra_user_columns()\r\n{\r\n\tstatic $default_columns = array('user_id','name','pass','RealName','email','privs','last_access','nonce');\r\n\tstatic $xtra_columns = false;\r\n\r\n\tif (is_array($xtra_columns))\r\n\t\treturn $xtra_columns;\r\n\r\n\t$table_name = mem_get_user_table_name();\r\n\t$txpdesc = getRows('describe '.PFX. $table_name);\r\n\r\n\t$xtra_cols = array();\r\n\r\n\t$dcols = $default_columns;\r\n\r\n\tforeach($txpdesc as $r) {\r\n\t\tif ( !in_array($r['Field'], $default_columns) )\r\n\t\t\t$xtra_cols[] = $r;\r\n\t}\r\n\r\n\treturn $xtra_cols;\r\n}", "public function get_columns();", "protected function processRowsHeads() {\n $cols = $this->getCols();\n $this->data = $this->rows;\n if (!empty($cols)) {\n array_unshift($this->data, $cols);\n }\n return $this->data;\n }", "protected function _getAdditionalCustomColumns()\n {\n return array();\n }", "public function getDirtyColumns()\n {\n $ret = array_keys($this->_cleanData);\n foreach ($this->_getSiblingRows() as $r) {\n $ret = array_merge($ret, $r->getDirtyColumns());\n }\n return $ret;\n }", "protected function selectColumns() {}", "abstract protected function getFetchColumns();", "private function getColumns()\n {\n $this->existingCols = $this->db->getColumns($this->tableName);\n if(count($this->existingCols) > 0)\n {\n $this->tableExists = true;\n }\n }", "function insert_history_tracking_fields_to_master_view(Array $visible_columns):Array{\n if( !in_array($this->CI->grants->history_tracking_field($this->controller,'created_by'),$visible_columns) || \n !in_array($this->CI->grants->history_tracking_field($this->controller,'last_modified_by'),$visible_columns)\n \n ){\n array_push($visible_columns,$this->CI->grants->history_tracking_field($this->controller,'created_by'),\n $this->CI->grants->history_tracking_field($this->controller,'last_modified_by')); \n }\n\n return $visible_columns;\n }", "protected function getCopiedColumns(): array\n {\n $aColumns = array_keys($this->describeFields());\n $aColumns = array_filter($aColumns, function ($sColumn) {\n return !in_array($sColumn, array_filter([\n\n // Base model\n $this->getColumnId(),\n $this->getColumnIsDeleted(),\n\n // Trait\\Model\\User\n method_exists($this, 'getColumnCreatedBy') ? $this->getColumnCreatedBy() : null,\n method_exists($this, 'getColumnModifiedBy') ? $this->getColumnModifiedBy() : null,\n\n // Trait\\Model\\Slug\n method_exists($this, 'getColumnSlug') ? $this->getColumnSlug() : null,\n\n // Trait\\Model\\Token\n method_exists($this, 'getColumnToken') ? $this->getColumnToken() : null,\n\n // Trait\\Model\\Timestamps\n method_exists($this, 'getColumnCreated') ? $this->getColumnCreated() : null,\n method_exists($this, 'getColumnModified') ? $this->getColumnModified() : null,\n ]));\n });\n\n return $aColumns;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the getLastBlock function
public function testGetLastBlock() { $this->assertEquals("Result", "Result"); }
[ "public function getLastBlock()\n {\n }", "private function getLastBlock()\n {\n return $this->chain[count($this->chain) - 1];\n }", "public function getLastBlock(): ?Block;", "public function getLastBlock()\n {\n return $this->getDB()->getLastBlock();\n }", "public function getLastBlock()\n {\n return $this->chain[count($this->chain) - 1];\n }", "public function getLastBlock()\n {\n return $this->chain[count($this->chain)-1];\n }", "public function getLastBlock()\n {\n return $this->chain[count($this->chain) - 1];\n }", "public function getLastBlock(): int\n {\n $result = $this->getNodeStatusData();\n return $result['latest_block_height'];\n }", "public function getLastBlockHash()\n {\n return $this->lastBlockHash;\n }", "public function latest_block() {\n\t\t$this->db->select('hash, number')\n\t\t\t\t ->order_by('id', 'desc')\n\t\t\t\t ->limit(1);\n\t\t$query = $this->db->get('blocks');\n\t\treturn ($query->num_rows() > 0) ? $query->row_array() : FALSE;\n\t}", "public function testGetHighestRowOnEmptyBlock()\n {\n $block = new DynamicBlock();\n $this->assertEquals(1, $block->getHighestRow());\n }", "public function getFinalBlock()\n {\n return end($this->_blocks);\n }", "public function getLastBlockHeader(){\n\treturn $this->_postRequest('getlastblockheader',[]);\n }", "public function setLastBlock($var)\n {\n GPBUtil::checkInt32($var);\n $this->lastBlock = $var;\n\n return $this;\n }", "public function getLastBlockId(): int\n {\n if (!$this->lastBlockId) {\n $this->lastBlockId = $this->blockStorage->getBlock($this->getKeyCache()) ?? 0;\n }\n if (!$this->lastBlockId) {\n $this->setLastBlockId($this->getCurrentBlockId());\n }\n return $this->lastBlockId;\n }", "public function getLastBlockData()\n {\n $contents = file_get_contents($this->filename);\n $this->chain = unserialize($contents);\n\n if ($this->chain == FALSE) {\n return json_encode([\n \"status\" => \"error\",\n \"message\" => \"Unable to read blockchain\"\n ]);\n }\n\n $last = $this->getLastBlock()->data;\n\n return json_encode([\"status\" => \"success\", \"lastBlock\" => $last]);\n }", "public static function lastBlockEndpoint()\n {\n return sprintf('%s/blocks/last', self::getApiUrl());\n }", "public function getBlocksLast() {\n $data = $this->request('/blocks/last/');\n return $data;\n }", "public function getBlockHeight() {\n if ($this->headBlockNum === null || $this->blockHeight >= $this->headBlockNum) {\n $this->headBlockNum = $this->getLastIrreversibleBlockNum();\n }\n\n if (file_exists($this->currentBlockLog)) {\n $this->blockHeight = trim(file_get_contents($this->currentBlockLog));\n }\n\n // if no blockHeight yet, which mean we running for the first time so start from the headblocknum since our\n // contract only available from headblocknum block.\n if (!$this->blockHeight) {\n $this->blockHeight = $this->headBlockNum;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get relation to the guarantors table.
public function guarantors() { return $this->hasMany(Guarantor::class); }
[ "public function loanGuarantors()\n {\n return $this->hasMany('App\\LoanGuarantor');\n }", "public function getGarantia()\n {\n return $this->garantia;\n }", "public function getForeignRelation()\n {\n return $this->foreignRelation;\n }", "public function getTableRelation(){\n\t\treturn $this->table_relation;\n\t}", "public function referrals()\n {\n return $this->hasMany('App\\User');\n }", "public function getIdContratoGarantia()\n {\n return $this->id_contrato_garantia;\n }", "public function getRelTable()\n {\n return $this->rel_table;\n }", "public function referrals()\n {\n return $this->hasMany(User::class, 'referrer_id', 'id');\n }", "public function getRelation()\n {\n return $this->relation;\n }", "public function referral(): HasMany\n {\n return $this->hasMany(User::class, 'referrer_id', 'id');\n }", "private function getAuthLogRelation()\n {\n return $this->owner->getRelation($this->authLogRelation);\n }", "final public function relationTable():?Core\\Table\n {\n return $this->relation()->relationTable();\n }", "public function referral () {\n return $this->belongsTo(Chats::class, 'referred_by', 'chat_id');\n }", "public function getFkLicitacaoTipoGarantia()\n {\n return $this->fkLicitacaoTipoGarantia;\n }", "public function getGuarantor(RentRecoveryPlusReference $tenant)\r\n {\r\n if (null === $this->rrpGuarantor) {\r\n $this->rrpGuarantor = $this->createGuarantor($tenant);\r\n }\r\n\r\n return $this->rrpGuarantor;\r\n }", "public function borrower()\n {\n return $this->hasOne('App\\User', 'id', 'borrower_id');\n }", "public function getTableGuilde() {\n if (!$this->_tableGuildes) {\n $this->_tableGuildes = $this->getServiceLocator()->get('\\Commun\\Table\\GuildesTable');\n }\n return $this->_tableGuildes;\n }", "public function getReferencedTable()\n {\n return $this->referencedTable;\n }", "public function getBuyerAssignable();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the icons presenter instance.
public function getPresenter(): ?IconSetInterface { static $presenter; if ($presenter instanceof IconSetInterface) { return $presenter; } return $presenter = $this->hasPresenter() ? app($this->icons_presenter_class) : null; }
[ "public function getProviderIcons();", "protected function getIconsService()\n {\n }", "private function getIcons()\n {\n return Asset::find()\n ->volume(HOMMIcons::$plugin->getSettings()->iconsVolume)\n ->all();\n }", "public function getProviderIcon();", "function zuhaus_mikado_icon_collections() {\n\t\treturn ZuhausMikadoIconCollections::get_instance();\n\t}", "public function index()\n {\n return IconResource::collection(Icon::all());\n }", "public function getPresenter();", "function GetIcon(){}", "public function get_icon () {\n return $this->icon;\n }", "protected function _buildListOfIcons()\n {\n $iconLoader = new \\Yana\\Views\\Icons\\Loader();\n return $iconLoader->getIcons();\n }", "public function icon()\n {\n return $this->icon;\n }", "public function getOwnerIconFarm();", "function getIcon() {return $this->_icon;}", "protected function getIconForResourceViewHelperService()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Core\\ViewHelpers\\IconForResourceViewHelper::class);\n }", "public function getIconSet()\n\t{\n\t\treturn $this->iconSet;\n\t}", "public function presenter()\n {\n return MediaFractalPresenter::class;\n }", "function getIconList()\n\t{\n\t\treturn $this->iconlist;\n\t}", "protected function getImager()\n\t{\n\t\tif (isset($this->_imager))\n\t\t\treturn $this->_imager;\n\t\telse\n\t\t\treturn $this->_imager = Yii::app()->getComponent($this->componentID);\n\t}", "public function getIconsArray()\n\t{\n\t\treturn $this->icons;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Format $key to be used as URL key.
public function formatProductUrlKey($key) : string { return Mage::getSingleton('catalog/product')->formatUrlKey($key); }
[ "protected function format_key($key)\n {\n }", "public function formatKey(string $key): string;", "private function formatKey($key)\n {\n return strtolower($key);\n }", "public function getKeyUrl($key);", "public static function encodeKey($key)\n {\n return str_replace('%2F', '/', rawurlencode($key));\n }", "public function setFormatKey($key){\n $this->formatKey = $key;\n }", "public static function escapeKey($key)\n {\n return str_replace('.', '', $key);\n }", "private function normalize_key(string $key): string\n\t{\n\t\treturn str_replace('/', '--', $key);\n\t}", "protected function transform_key( $key ) {\n\t\treturn Utils::to_dots_key( $key );\n\t}", "protected function transformKey($key)\n\t{\n\t\treturn str_replace(array('.', '[]', '[', ']'), array('_', '', '.', ''), $key);\n\t}", "public function buildKey($key);", "private function buildKey($key): string\n {\n return $this->prefix . $key;\n }", "public function formatKey () {\r\n return 'location-' . $this->type;\r\n }", "protected function prepare_key($key) {\n return $this->cacheprefix . $key;\n }", "protected function parseKey(): string\n {\n foreach ($this->getParams() as $key => $value) {\n $this->key = \\str_replace($key, $value, $this->key);\n }\n\n return $this->key;\n }", "protected function wrapKey($key)\n {\n return '<' . $key . '>';\n }", "public function beautifyHCardKey($key)\n {\n return ucfirst($key) . \":\";\n }", "public function formatUrlKey($str)\n\t{\n\t\t$urlKey = str_replace(\"'\", '', $str);\n\t\t$urlKey = preg_replace('#[^0-9a-z\\/]+#i', '-', Mage::helper('catalog/product_url')->format($urlKey));\n\t\t$urlKey = strtolower($urlKey);\n\t\t$urlKey = trim($urlKey, '-');\n\t\t\n\t\treturn $urlKey;\n\t}", "private function formatDibiRowKey($key)\n\t{\n\t\tif ($offset = strpos($key, '.')) {\n\t\t\treturn substr($key, $offset + 1);\n\t\t}\n\n\t\treturn $key;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the parser's current cancellation flag pointer.
public function getCancelationFlag(): int { return API::ffi()->ts_parser_cancellation_flag($this->data); }
[ "public function getCancellationReference()\n {\n return $this->cancellationReference;\n }", "public function getCancelIntiator()\n {\n return $this->cancelIntiator;\n }", "public function getCancellationNote()\n {\n return $this->cancellationNote;\n }", "public function getCancelComment()\n\t{\n\t\treturn $this->cancel_comment;\n\t}", "public static function getStatusCancel()\n {\n return self::$statusCancel;\n }", "public function getCancelPolicyIndicator()\n {\n return $this->cancelPolicyIndicator;\n }", "public function getHcancel()\n {\n return $this->hcancel;\n }", "public function getCancelStatus()\n {\n return $this->cancelStatus;\n }", "protected function getCancelReturn()\n {\n return $this->cancel_return;\n }", "public function getCancelled()\n\t{\n\t\treturn $this->cancelled;\n\t}", "public function getCancelDeadline() {\n\t\treturn $this->cancelDeadline;\n\t}", "public function getCancelType()\n {\n return $this->cancelType;\n }", "public function isCancellation()\n {\n return $this->getOperation() === self::OP_CANCEL;\n }", "public function getStopToken()\n {\n return end($this->stack)[2];\n }", "public function getCancelURL() {\n\t\treturn $this->cancelurl;\n\t}", "public function getCancelType() {\n return $this->get(self::CANCELTYPE);\n }", "public function is_cancelled() {\n }", "public function getCancelledInfo();", "public function getCancelledEOI() {\n\n return $this->_cancelledEOI ? $this->_cancelledEOI : 0;\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the altitude The altitude of the location.
public function setAltitude($val) { $this->_propDict["altitude"] = $val; return $this; }
[ "public function setAltitude($var)\n {\n GPBUtil::checkDouble($var);\n $this->altitude = $var;\n\n return $this;\n }", "public function setAltitude($altitude)\n {\n $this->altitude = $altitude;\n return $this;\n }", "public function setAltitude(int $altitude): void\n {\n if ($altitude < 0 || $altitude >= self::MAX_ALTITUDE) {\n throw new Exception(\"Invalid altitude supplied for {$this->getType()}({$this->getId()}): {$altitude}\");\n }\n WorldManager::getInstance()->getObjects()->updateAltitude($this, $altitude);\n $this->altitude = $altitude;\n }", "public function setAltitudeAccuracy($val)\n {\n $this->_propDict[\"altitudeAccuracy\"] = $val;\n return $this;\n }", "public function altitude($lon, $lat);", "public function getAltitude()\n {\n return $this->altitude;\n }", "public function setAltitude($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\DoubleValue::class);\n $this->altitude = $var;\n\n return $this;\n }", "public function setAltitudeMeasure(\\Greenter\\Ubl\\Entity\\CommonBasic\\AltitudeMeasure $altitudeMeasure)\n {\n $this->altitudeMeasure = $altitudeMeasure;\n return $this;\n }", "public function setAltitudeInMeters($val)\n {\n $this->_propDict[\"altitudeInMeters\"] = $val;\n return $this;\n }", "public function altitude($_DEC, $_LAT, $_HA) {\n // Convert all the necessary values to radians.\n $_DEC = deg2rad($_DEC);\n $_LAT = deg2rad($_LAT);\n $_HA = deg2rad($_HA);\n\n // Calculate and retutn the altitude.\n return rad2deg(asin(sin($_DEC) * sin($_LAT) + cos($_DEC) * cos($_LAT) * cos($_HA)));\n }", "protected function setAlt($alt) {\n $this->_alt = $alt;\n $this->updateMeta('_wp_attachment_image_alt', $alt);\n }", "public function setAltitudeAccuracy($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\DoubleValue::class);\n $this->altitude_accuracy = $var;\n\n return $this;\n }", "public function getAltitude();", "function averageAltitude ()\n\t{\n\t\t$this->aveAlt =-1;\n\t}", "public function filterByAltitude($altitude = null, $comparison = null)\n {\n if (is_array($altitude)) {\n $useMinMax = false;\n if (isset($altitude['min'])) {\n $this->addUsingAlias(LakeTableMap::COL_ALTITUDE, $altitude['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($altitude['max'])) {\n $this->addUsingAlias(LakeTableMap::COL_ALTITUDE, $altitude['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(LakeTableMap::COL_ALTITUDE, $altitude, $comparison);\n }", "public function altitude($arg, $lat = null) {\n if (is_numeric($arg) and is_numeric($lat)) {\n $lon = $arg;\n if ($lon < -180 or $lon > 180 or $lat < -90 or $lat > 90) {\n throw new \\InvalidArgumentException();\n }\n return $this->source->altitude($lon, $lat);\n } else if (is_array($arg) and (count($arg) == 2) and is_numeric($arg[0]) and is_numeric($arg[1])) {\n return $this->source->altitude($arg[0], $arg[1]);\n } else if (is_array($arg)) {\n $res = array();\n foreach ($arg as $comp) {\n $altitude = $this->altitude($comp);\n $res[] = $altitude;\n }\n return $res;\n } else if ($arg instanceof \\gisconverter\\Point) {\n return $this->source->altitude($arg->lon, $arg->lat);\n } else if ($arg instanceof \\gisconverter\\Geometry) {\n return $this->altitude($arg->components);\n } else {\n throw new \\InvalidArgumentException();\n }\n }", "public function setAltText($alt)\n {\n $this->_alt = $alt;\n }", "public function set_alt_body($altBody = 'ALTBODY NOT SET') {\n\n\t\t$this->AltBody = $altBody;\n\t\t\n\t}", "function GetmaxAltitude ()\n\t{\n\t\treturn $this->maxAlt;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Guess the primary key for current table
private function _fetch_primary_key() { if($this->primaryKey == NULl) { $this->primaryKey = $this->db->query("SHOW KEYS FROM `".$this->_table."` WHERE Key_name = 'PRIMARY'")->row()->Column_name; } }
[ "public static function get_primary_key();", "private function _get_primary_key_from_schema()\n\t{\t\t\n\t\tforeach($this->schema as $name => $definition)\n\t\t{\n\t\t\tif ($definition[2] & PK)\n\t\t\t{\n\t\t\t\treturn $name;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Primary key not defined, try the default\n\t\treturn 'id';\n\t}", "function determine_primary() {\n\t\t\t$this->dao->myquery(\"SHOW index FROM $this->table where Key_name = 'PRIMARY';\");\n\t\t\t// var_dump($this->dao->fetch_one_obj());\n\t\t\t$this->primary_key = $this->dao->fetch_one_obj()->Column_name;\n\t\t\tif (isset($this->{$this->primary_key})) {\n\t\t\t\t$this->primary_id = $this->{$this->primary_key};\n\t\t\t}\n\t\t}", "function getPrimaryKey($tablename){\r\n\t\tif ($this->_primaryKeys==null) $this->_loadPrimaryKeyData();\r\n\t\tif (array_key_exists($tablename,$this->_primaryKeys)) return $this->_primaryKeys[$tablename];\r\n\t\telse return \"id\";\r\n\t}", "public function _current_model_primary_key(){\n $table_columns = $this->_context->meta();\n\n $primary_key_column = NULL;\n foreach ($table_columns as $col) :\n if($col->primary_key):\n $primary_key_column = $col->name;\n endif;\n endforeach;\n\n return $primary_key_column;\n }", "public function get_primary_key() {\n $primary = array();\n $columns = $this->get_columns();\n $column_first = null;\n foreach ($columns as $column) {\n if (empty($column_first)) {\n $column_first = $column;\n }\n if ($column->get('key') == 'PRI') {\n $primary[] = $column;\n }\n }\n if (empty($primary[0]) === false) {\n return ($primary[0]);\n }\n return ($column_first);\n }", "function getPrimaryKey($table)\r\n {\r\n $result\t=\tmysql_query(\"SELECT * FROM $table where 0\");\r\n $num\t=\tmysql_num_fields($result);\r\n for($i=0;$i<$num;$i++)\r\n {\r\n if(strstr(mysql_field_flags($result, $i),\"primary_key\"))\r\n $primary_key=mysql_field_name($result, $i);\r\n }\r\n return $primary_key;\r\n }", "public function get_primary_row(){\r\n $result = $this->db->query(\"SHOW KEYS FROM \". $this->db->formatTableName($this->table). \"\r\n WHERE Key_name = %s\"\r\n , \"PRIMARY\");\r\n $pk = \"\";\r\n foreach ($result as $res){\r\n $pk = $res[\"Column_name\"];\r\n }\r\n return $pk;\r\n }", "public function primaryKeyForTable(Table $table)\n {\n // Execute the query directly\n $result = $this->client->query(\"SHOW KEYS FROM $table->name WHERE Key_name = 'PRIMARY'\");\n\n // If no results are returned, return null\n if ($result === false) {\n return;\n }\n\n // Fetch the query results\n $data = $result->fetch(PDO::FETCH_ASSOC);\n\n // Return the field name\n return $data['Column_name'];\n }", "public function getPrimaryKey($table)\n\t{\n\t\t$keys = $this->getTableKeys($table);\n\t\t$key = false;\n\n\t\tif ($keys && count($keys) > 0)\n\t\t{\n\t\t\tforeach ($keys as $k)\n\t\t\t{\n\t\t\t\tif ($k->Key_name == 'PRIMARY')\n\t\t\t\t{\n\t\t\t\t\t$key = $k->Column_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $key;\n\t}", "public function primaryKeyForTable(Table $table)\n {\n // Execute the query directly\n $result = $this->client->query(\"SHOW KEYS FROM $table->name WHERE Key_name = 'PRIMARY'\");\n\n // If no results are returned, return null\n if ($result === false) {\n return;\n }\n\n // Fetch the query results\n $data = $result->fetch_assoc();\n\n // Return the field name\n return $data['Column_name'];\n }", "protected function initPrimaryKey()\r\n {\r\n // columns have to be loaded first\r\n if (!$this->colsLoaded) $this->initColumns();\r\n include_once 'creole/metadata/PrimaryKeyInfo.php';\r\n \r\n if (!@mssql_select_db($this->dbname, $this->conn->getResource())) {\r\n throw new SQLException('No database selected');\r\n } \r\n \r\n $res = mssql_query(\"SELECT COLUMN_NAME \r\n FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS \r\n INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ON \r\n INFORMATION_SCHEMA.TABLE_CONSTRAINTS.CONSTRAINT_NAME = INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE.constraint_name\r\n WHERE (INFORMATION_SCHEMA.TABLE_CONSTRAINTS.CONSTRAINT_TYPE = 'PRIMARY KEY') AND \r\n (INFORMATION_SCHEMA.TABLE_CONSTRAINTS.TABLE_NAME = '\".$this->name.\"')\", $this->conn->getResource());\r\n \r\n // Loop through the returned results, grouping the same key_name together.\r\n // name of the primary key will be the first column name in the key.\r\n while($row = mssql_fetch_row($res)) {\r\n $name = $row[0]; \r\n if (!isset($this->primaryKey)) {\r\n $this->primaryKey = new PrimaryKeyInfo($name);\r\n }\r\n $this->primaryKey->addColumn($this->columns[ $name ]);\r\n } \r\n \r\n $this->pkLoaded = true;\r\n }", "abstract public function get_primary_key($object);", "public function get_primary_key() {\n return $this->primary_key;\n }", "protected function loadPK()\n {\n global $db;\n \n $sql = \"SHOW KEYS FROM $this->table \"\n . 'WHERE Key_name = \"PRIMARY\"';\n \n $result = $db->get_row($sql);\n if ($result) $this->pk = $result->Column_name;\n else $this->pk = '';\n \n }", "public static function primary_key() {\n\t\treturn static::$_primary_key;\n\t}", "protected function get_primary_column_name()\n {\n }", "public function primary_key() {\n $field = $this->_primary_key;\n return $this->$field;\n }", "public function get_primary_column_for_table( Table $table );" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set information of person will display and it's org information
protected function setOrgValues(){ $tper = $this->config->getGet('per'); $tget = $this->config->getGet('org'); $torg = true; if(($tget == '') && ($tper != '')){ $tget = $tper; if(eregi("^[1-9]{1}[0-9]*$", $tget)){ $torg = false; } } $this->existInLDAP($tget,$torg,false); //get org info. if(!$this->orgValues['dn']){ //http has org or person and does not exist in ldap,redirect $this->mediator->redirector(); } }
[ "public function infoOwner() {\n echo 'Nom : '.$this->_surname.' Prénom : '.$this->_name.'<br>Age : '.$this->calcAge($this->_birthdate).'<br>Ville : '.$this->_city.'<br> Comptes :<ul>';\n foreach ($this->_accounts as $value) {\n echo \"<li>$value</li>\";\n }\n echo '</ul>';\n }", "public function show_person() {\n\t\techo \"The information of this person is:</br>\";\n\t\techo \"First Name: \".$this->fname.\"</br>\";\n\t\techo \"Last Name: \".$this->lname.\"</br>\";\n\t\techo \"ID: \".$this->id.\"</br>\";\n\t\techo \"Age: \".$this->age.\"</br>\";\n\t\techo \"Gender: \".$this->gender.\"</br>\";\n\t\techo \"Phone: \".$this->phone.\"</br>\";\n\t\techo \"Email: \".$this->email.\"</br></br>\";\n\t}", "function loadPersonInfo()\n {\n // GROUP 2: CAMPUS ADMINS AND ABOVE ONLY.\n if ( ( $this->accessPrivManager->hasSitePriv() ) || ( $this->accessPrivManager->hasCampusPriv($this->viewer->getID()) ) ){\n\t \n\t // set the pageCallBack to be without any additional parameters\n\t // (an AdminBox needs this so Language Switching on a page doesn't\n\t // pass a previous operations)\n\t $parameters = array('PERSON_ID'=>$this->PERSON_ID, 'PROVINCE_ID'=>$this->PROVINCE_ID, 'GENDER_ID'=>$this->GENDER_ID, 'STAFF_ID'=>$this->STAFF_ID, 'CAMPUS_ID'=>$this->CAMPUS_ID, 'ADMIN_ID'=>$this->ADMIN_ID, 'PRIV_ID'=>$this->PRIV_ID, 'CAMPUSADMIN_ID'=>$this->CAMPUSADMIN_ID, 'USER_ID'=>$this->USER_ID, 'ASSIGNMENT_ID'=>$this->ASSIGNMENT_ID);//[RAD_CALLBACK_PARAMS]\n\t $pageCallBack = $this->getCallBack(modulecim_hrdb::PAGE_PERSONINFO, $this->sortBy, $parameters);\n\t $this->setPageCallBack( $pageCallBack );\n\t\n\t\n\t $this->pageDisplay = new page_PersonInfo( $this->moduleRootPath, $this->viewer, $this->PERSON_ID );\n\t\n\t $links = array();\n\t\n\t/*[RAD_LINK_INSERT]*/\n\t\n\t $parameters = array('PERSON_ID'=>$this->PERSON_ID, 'PROVINCE_ID'=>$this->PROVINCE_ID, 'GENDER_ID'=>$this->GENDER_ID, 'STAFF_ID'=>$this->STAFF_ID, 'CAMPUS_ID'=>$this->CAMPUS_ID, 'ADMIN_ID'=>$this->ADMIN_ID, 'PRIV_ID'=>$this->PRIV_ID, 'CAMPUSADMIN_ID'=>$this->CAMPUSADMIN_ID, 'USER_ID'=>$this->USER_ID, 'ASSIGNMENT_ID'=>$this->ASSIGNMENT_ID);//[RAD_CALLBACK_PARAMS]\n\t $continueLink = $this->getCallBack( modulecim_hrdb::PAGE_PEOPLEBYCAMPUSES, \"\", $parameters );\n\t $links[\"cont\"] = $continueLink;\n\t\n\t $this->pageDisplay->setLinks( $links );\n }\n else\n {\n\t $this->pageDisplay = new page_NotAuthorized($this->moduleRootPath, $this->viewer); \n } \n \n }", "function getOwnerInfo()\r\n\t{\r\n\t\t$this->_setPropertyData();\r\n\t\t$this->_setOwnerData();\r\n\t\t$this->_setDataToSession();\r\n\r\n if($this->propertyType != 'fsbo' && $this->propertyType != 'expireds' && $this->propertyType != 'nod' && $this->propertyType != 'jljs')\r\n $this->load->view('leads/view_leads_ownerinfo_content_info', $this->data);\r\n else\r\n $this->load->view('leads/view_leads_ownerinfo_content_info_' . $this->propertyType, $this->data);\r\n\t}", "public function set_person_title() {\n $this->set_title( $this->get_full_name() );\n }", "public function getPersonalInfo(){\r\n\t $this->_personalInfo;\r\n\t}", "function setPersonInfoFromLoggedUser(){\n\t\t$user = $GLOBALS[\"TSFE\"]->fe_user->user;\n\t\t$this->basket[\"personinfo\"][\"NAME\"] = strip_tags($user[\"name\"]);\n\t\t$this->basket[\"personinfo\"][\"ADDRESS\"] = strip_tags($user[\"address\"]);\n\t\t$this->basket[\"personinfo\"][\"CITY\"] = strip_tags($user[\"city\"]);\n\t\t$this->basket[\"personinfo\"][\"ZIP\"] = strip_tags($user[\"zip\"]);\n\t\t$this->basket[\"personinfo\"][\"STATE\"] = strip_tags($user[\"tx_extendedshop_state\"]!=\"\" ? $user[\"tx_extendedshop_state\"] : $user[\"zone\"]);\n\t\t$this->basket[\"personinfo\"][\"COUNTRY\"] = strip_tags($user[\"static_info_country\"]!=\"\" ? $user[\"static_info_country\"] : $user[\"country\"]);\n\t\t$this->basket[\"personinfo\"][\"COMPANY\"] = strip_tags($user[\"company\"]);\n\t\t$this->basket[\"personinfo\"][\"VATCODE\"] = strip_tags($user[\"tx_extendedshop_vatcode\"]);\n\t\t$this->basket[\"personinfo\"][\"PRIVATE\"] = strip_tags($user[\"tx_extendedshop_private\"]);\n\t\t$this->basket[\"personinfo\"][\"WWW\"] = strip_tags($user[\"www\"]);\n\t\t$this->basket[\"personinfo\"][\"PHONE\"] = strip_tags($user[\"telephone\"]);\n\t\t$this->basket[\"personinfo\"][\"MOBILE\"] = strip_tags($user[\"tx_extendedshop_mobile\"]);\n\t\t$this->basket[\"personinfo\"][\"FAX\"] = strip_tags($user[\"fax\"]);\n\t\t$this->basket[\"personinfo\"][\"EMAIL\"] = strip_tags($user[\"email\"]);\n\t\t//$this->basket[\"personinfo\"][\"NEW\"] = 0;\n\t}", "function displayPerson($db,$person,$showClass=false,$showDate=false,$action=null,$changeUserID=null, $changeDate=null) {\n //TODO user the function $db->getPersonWithInfo()\n\tif ($person==null) {\n $person = $db->getPersonDummy();\n }\n $dbOpinion = new dbDaOpinion($db);\n $dbFamily = new dbDaFamily($db);\n\t$d=$person;\n\t?>\n\t<div class=\"element\">\n <?php\n $school = displaySchoolName(isset($d[\"schoolID\"])?$d[\"schoolID\"]:null);\n $personClass = displayPersonNameAndGetClass($db,$person,$showClass);\n ?>\n <?php if ($person[\"gdpr\"]==100) {?>\n <img title=\"A személy jováhagyta a személyes adatainak a használatát kizárolag ezen az oldalon!\" src=\"images/gdpr.png\" style=\"position: absolute;width:58px;left:435px;top:3px\" />\n <?php } ?>\n <?php if ($person[\"gdpr\"]>0 && $person[\"gdpr\"]<=5) {?>\n <img title=\"A személy tiltja részben vagy teljes mértékben a személyes adatainak a használatát!\" src=\"images/gdpr.png\" style=\"position: absolute;width:58px;left:435px;top:3px;filter: hue-rotate(90deg);\" />\n <?php } ?>\n <?php displayPersonPictureAndHistory($db,$d);?>\n\t\t<div class=\"personboxc\">\n <?php if (strstr($d[\"role\"],\"jmlaureat\")!==false)\n echo('<div><a href=\"search?type=jmlaureat\">'.$school['awardName'].' díjas</a></div>');?>\n <?php if ($showClass)\n echo($personClass);?>\n <div class=\"fields\"><?php\n\t\t\t\tif ($d[\"schoolIdsAsTeacher\"]===NULL) {\n\t\t\t\t\tif(showField($d,\"partner\")) echo \"<div><div>Élettárs:&nbsp;</div><div>\".getFieldValue($d,\"partner\").\"</div></div>\";\n\t\t\t\t\tif(showField($d,\"education\")) echo \"<div><div>Végzettség:&nbsp;</div><div>\".getFieldValue($d,\"education\").\"</div></div>\";\n\t\t\t\t\tif(showField($d,\"employer\")) \t{\n\t\t\t\t\t\t$fieldString = preg_replace(\"~[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]~\", \"\",\tgetFieldValue($d[\"employer\"]));\n\t\t\t\t\t\techo \"<div><div>Munkahely:&nbsp;</div><div>\".$fieldString .\"</div></div>\";\n\t\t\t\t\t}\n\t\t\t\t\tif(showField($d,\"function\")) echo \"<div><div>Beosztás:&nbsp;</div><div>\".getFieldValue($d[\"function\"]).\"</div></div>\";\n\t\t\t\t} else {\n\t\t\t\t\tif (isset($d[\"function\"]))\n\t\t\t\t\t echo \"<div><div>Tantárgy:&nbsp;</div><div> \".getFieldValue($d[\"function\"]).\"</div></div>\";\n echo \"<div><div>Iskola:&nbsp;</div><div>\";\n $schools = explode(\")\",$d[\"schoolIdsAsTeacher\"]);\n foreach ($schools as $school) {\n $school = intval(trim($school,\"(\"));\n if (($school=$db->getSchoolById($school,true))!=null) {\n echo '<span><img src=\"images/school' . $school[\"id\"] . '/'.$school[\"logo\"].'\" title=\"' . $school[\"name\"] . '\"/>&nbsp;';\n echo $db->getTeacherPeriod($d, $school[\"id\"]).'</span>';\n }\n }\n echo \"</div></div>\";\n\t\t\t\t}\n\t\t\t\tif(showField($d,\"country\")) \techo \"<div><div>Ország:&nbsp;</div><div>\".getFieldValue($d[\"country\"]).\"</div></div>\";\n\t\t\t\tif(showField($d,\"place\")) \t\techo \"<div><div>Város:&nbsp;</div><div>\".getFieldValue($d[\"place\"]).\"</div></div>\";\n\t\t\t\t?>\n\t\t\t\t\t<div class=\"diakCardIcons\" style=\"margin-top:10px\">\n <?php\n\t\t\t\t\t displayIcon($d,\"phone\",\"phone.png\",\"Telefon\",\"tel:\");\n displayIcon($d,\"mobil\",\"mobile.png\",\"Mobil\",\"tel:\");\n displayIcon($d,\"email\",\"email.png\",\"E-Mail\",\"mailto:\");\n displayIcon($d,\"facebook\",\"facebook.png\",\"Facebook\",\"\");\n //displayIcon($d,\"twitter\",\"twitter.png\",\"Twitter\",\"\");\n displayIcon($d,\"homepage\",\"www.png\",\"Honoldal\",\"\");\n displayIcon($d,\"wikipedia\",\"wikipedia.png\",\"Wikipedia\",\"\");\n $pictures=$db->getNrOfPersonPictures($d[\"id\"]);\n\t\t\t\t\t\tif ($pictures>0)\n\t\t\t\t\t\t\techo '<a href=\"editPerson?tabOpen=pictures&uid='.$d[\"id\"].'\" title=\"Képek\"><img src=\"images/picture.png\" /><span class=\"countTag\">'.$pictures.'</span></a>';\n\t\t\t\t\t\tif (isset($d[\"cv\"]) && $d[\"cv\"]!=\"\")\n\t\t\t\t\t\t\techo '<a href=\"editPerson?tabOpen=cv&uid='.$d[\"id\"].'\" title=\"Életrajz\"><img src=\"images/calendar.png\" /></a>';\n\t\t\t\t\t\tif (isset($d[\"story\"]) && $d[\"story\"]!=\"\")\n\t\t\t\t\t\t\techo '<a href=\"editPerson?tabOpen=school&uid='.$d[\"id\"].'\" title=\"Diákkori történet\"><img src=\"images/gradcap.png\" /></a>';\n\t\t\t\t\t\tif (isset($d[\"aboutMe\"]) && $d[\"aboutMe\"]!=\"\")\n\t\t\t\t\t\t\techo '<a href=\"editPerson?tabOpen=hobbys&uid='.$d[\"id\"].'\" title=\"Magamról szabadidőmben\"><img src=\"images/info.gif\" /></a>';\n\t\t\t\t\t\tif (isset($d[\"geolat\"]) && $d[\"geolat\"]!=\"\")\n\t\t\t\t\t\t\techo '<a href=\"editPerson?tabOpen=geoplace&uid='.$d[\"id\"].'\" title=\"Itt vagyok otthon\"><img style=\"width:25px\" src=\"images/geolocation.png\" /></a>';\n\t\t\t\t\t\t$relatives=$dbFamily->getPersonRelativesCountById($d[\"id\"]);\n\t\t\t\t\t\tif ($relatives>0)\n echo '<a href=\"editPerson?tabOpen=family&uid='.$d[\"id\"].'\" title=\"Családom\"><img style=\"width:25px\" src=\"images/relatives.png\" /><span class=\"countTag\">'.$relatives.'</span></a>';\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t \t\t</div>\n\t\t</div>\n <?php if ($showDate) {\n if ($action!='change')\n $changePerson=$db->getPersonByID($changeUserID);\n else\n $changePerson=$db->getPersonByID($d[\"changeUserID\"]);\n if ($action=='candle') $action=\"Gyertyát gyújtott \";\n if ($action=='change' || $action==null) $action=\"Módosította \";\n if ($action=='family' || $action==null) $action=\"Rokont jelölt \";\n if ($action=='opinion') $action=\"Vélemény \";\n if ($action=='easter') $action=$changePerson[\"gender\"]==\"m\"?\"Locsoló \":\"Piros tojás\";\n if ($changeDate==null)\n $changeDate = maierlabs\\lpfw\\Appl::dateTimeAsStr($d[\"changeDate\"]);\n else\n $changeDate = maierlabs\\lpfw\\Appl::dateTimeAsStr($changeDate);\n ?><div class=\"diakCardIcons\" style=\"margin-bottom: 5px\">\n <?php echo $action. getPersonLinkAndPicture($changePerson) .' '. $changeDate;?><br/>\n </div>\n <?php }?>\n <?php\n /*Easter to be changed*/\n /*\n if ((!isset($person[\"deceasedYear\"]) || $person[\"deceasedYear\"]==null) ) {\n if (!isset($person[\"gender\"]) || $person[\"gender\"]==\"f\" && ($db->getPersonByID(getLoggedInUserId())[\"gender\"]==\"m\" || !isUserLoggedOn())) {\n ?>\n <button style=\"margin-bottom: 5px\" onclick=\"return saveEasterOpinion(<?php echo $person['id'] ?>,'person','easter',<?php echo getLoggedInUserId()!=null?getLoggedInUserId():\"null\" ?>)\" title=\"Megszabad locsolni?\" class=\"btn btn-success\"><img src=\"images/easter.png\" style=\"width: 26px\"/> Szabad öntözni?</button>\n <?php\n }\n }\n */\n displayPersonOpinion($dbOpinion,$d[\"id\"],$d[\"gender\"],(isset($d[\"schoolIdsAsTeacher\"]) && $d[\"schoolIdsAsTeacher\"]!=NULL),isset($d[\"deceasedYear\"]));\n ?>\n\t</div>\n<?php\n}", "public function getPeople()\n {\n echo $this->getName(), \" \", $this->getFirstname(), \" \", $this->getAddress(),\"<br />\";\n }", "function project_manage_persons_info_callback($path, $info_card){\n //TODO: add person info page for manage\n}", "public function get_full_person(){\n\t\t$this->get_name();\n\t\t$this->get_email();\n\t\t$this->get_phone();\n\t\t$this->get_address();\n\t }", "private function _addEditInfo () {\r\n $countries = ClassRegistry::init('Country')->find('list');\r\n $userCategories = ClassRegistry::init('UserCategory')->find('list');\r\n $this->set(compact('countries', 'userCategories'));\r\n }", "function showPersonBox($person) {\n\t\t$content = '';\n\t\t\n\t\t// Define the detail-Page (either from the TS setup, or from the FlexForm-Setting).\n\t\t$this->detailPage = $this->getConfValueInteger('detailPage', 's_contactbox');\n\n\t\tif ($this->hasValue('title', $person)) {\n\t\t\t$this->setMarker('title', $this->getValue('title', $person, true));\n\t\t\t$this->setMarker('label_title', $this->pi_getLL('label_title'));\n\t\t} else {\n\t\t\t$this->hideSubparts('title', 'field_wrapper');\n\t\t}\n\n\t\tif ($this->hasValue('first_name', $person)) {\n\t\t\t$this->setMarker('first_name', $this->getValue('first_name', $person, true));\n\t\t\t$this->setMarker('label_first_name', $this->pi_getLL('label_first_name'));\n\t\t} else {\n\t\t\t$this->hideSubparts('first_name', 'field_wrapper');\n\t\t}\n\n\t\tif ($this->hasValue('last_name', $person)) {\n\t\t\t$this->setMarker('last_name', $this->getValue('last_name', $person, true));\n\t\t\t$this->setMarker('label_last_name', $this->pi_getLL('label_last_name'));\n\t\t} else {\n\t\t\t$this->hideSubparts('last_name', 'field_wrapper');\n\t\t}\n\n\t\tif ($this->hasValue('function', $person)) {\n\t\t\t$this->setMarker('function', $this->getValue('function', $person, true));\n\t\t\t$this->setMarker('label_function', $this->pi_getLL('label_function'));\n\t\t} else {\n\t\t\t$this->hideSubparts('function', 'field_wrapper');\n\t\t}\n\n\t\t// define the marker for the image (always shown)\n\t\t$this->setMarker('image', $this->getImage($person));\n\n\t\t// create the link to the detail page\n\t\t$linkToDetailPage = $this->linkToDetailPage($this->pi_getLL('label_link_detail'), $this->getValue('uid', $person));\n\t\t$this->setMarker('link_detail', $linkToDetailPage);\n\n\t\t// merge the marker content with the template\n\t\t$content .= $this->getSubpart('TEMPLATE_BOX_PERSON');\n\n\t\treturn $content;\n\t}", "public function personsAction() {\n $pid = $GLOBALS['TSFE']->id;\n\n if ($this->request->hasArgument('person')) {\n $person = $this->request->getArgument('person');\n\n $this->view->assign('personuid', $person);\n }\n \n $pR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\PersonRepository');\n $psgR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\PersonsubgroupRepository');\n $persons = $pR->findByMember($this->showOnWebpageMemberAttr);\n \n $subgroups = $psgR->findAll();\n $cR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\PersoncategoryRepository');\n $categories = $cR->findAll();\n $prR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\ProjectRepository');\n $projects = $prR->findAll();\n\n $paR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\PersonaddressRepository');\n $pas = $paR->findAll();\n\n $pMailR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\PersonemailRepository');\n $pmails = $pMailR->findAll();\n\n\n $pubR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\PublicationRepository');\n\n $array = array();\n $arrayInc = 0;\n $parray = array();\n $darray = array();\n $usedPersons = array();\n \n // Konfigurationsarray für den listing-Teil der Lap-Staff-Seite\n $siteCategories = array(\n 'director' => array(\n 'title' => 'Director',\n 'personuids' => array(\n $this->config['attoworld2']['person']['ferenc'] // Ferenc Krausz\n )\n ),\n 'pcs' => array(\n 'title' => 'Research Group leaders',\n 'categoryuids' => array(\n $this->config['attoworld2']['category']['atto3']\n )\n ),\n 'directorsteam_2' => array(\n 'title' => 'Director’s team',\n 'categoryuids' => array(\n $this->config['attoworld2']['category']['administration']\n )\n \n /* - rausnehmen, Anweisung von Karolina\n 'subgroups' => array(\n $this->config['attoworld2']['subgroups']['assistents'],\n $this->config['attoworld2']['subgroups']['administration'],\n $this->config['attoworld2']['subgroups']['mapcala'],\n $this->config['attoworld2']['subgroups']['publicoutreach'],\n $this->config['attoworld2']['subgroups']['communications']\n )\n */\n ),\n 'scientists' => array(\n 'title' => 'Scientists',\n 'categoryuids' => array(\n $this->config['attoworld2']['category']['guestscientists'], \n $this->config['attoworld2']['category']['seniorscientists'],\n $this->config['attoworld2']['category']['juniorscientists'],\n )\n ),\n 'students' => array(\n 'title' => 'Students',\n 'categoryuids' => array(\n $this->config['attoworld2']['category']['diplstudent'], \n $this->config['attoworld2']['category']['gradstudent'],\n $this->config['attoworld2']['category']['assdirectors']\n )\n ),\n 'technicalstaff' => array(\n 'title' => 'Technical staff',\n 'categoryuids' => array(\n $this->config['attoworld2']['category']['technicalstaff']\n )\n ),\n );\n\n $psgR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\PersonsubgroupRepository');\n $psRes = $psgR->findForPersons(array(\n $this->config['attoworld2']['subgroups']['assistents'],\n $this->config['attoworld2']['subgroups']['administration'],\n $this->config['attoworld2']['subgroups']['mapcala'],\n $this->config['attoworld2']['subgroups']['publicoutreach'],\n $this->config['attoworld2']['subgroups']['communications']\n ));\n \n // Durcheghen und zusammenbauen der einzelnen Personentabs\n foreach ($siteCategories as $catIndex => $category) {\n\n\n // Kategorien\n // 3 - Technical Staff\n // 4,5,6 - Scientists\n // 7,8,9 - Students\n // 12 - Directors Team\n // PCs\n\n $array[$arrayInc] = array(\n 'title' => $category['title'],\n 'shouldbesorted' => true,\n 'data' => array()\n );\n \n // Sonderbehandlung für das Director's Team\n if($catIndex === 'directorsteam') {\n $array[$arrayInc]['shouldbesorted'] = false;\n \n $personInc = 0;\n foreach($category['subgroups'] as $subgroup) {\n $subgroup = $psgR->findByUid($subgroup);\n \n $members = $subgroup->getMembers();\n \n $tmpCategory = array('title' => 'Directors Team',);\n foreach($members as $memberIndex => $member) {\n $tmpCategory['personuids'][] = $member->getUid();\n }\n \n $orderedMembers = array();\n \n $leaderDataSet = null;\n foreach($members as $memberIndex => $member) {\n $leader = false;\n $assistents = false;\n foreach($member->getSubgroup() as $lGroup) {\n if($lGroup->getUid() == $this->config['attoworld2']['subgroups']['executive']) {\n $leader = true;\n }\n if($lGroup->getUid() == $this->config['attoworld2']['subgroups']['assistents']) {\n $assistents = true;\n }\n }\n \n if($leader === true && $assistents === false || $member->getIsgroupleader() == 1) {\n \n $orderedMembers = array_reverse($orderedMembers);\n array_push($orderedMembers, $member);\n $orderedMembers = array_reverse($orderedMembers);\n \n } else {\n array_push($orderedMembers, $member);\n }\n \n \n }\n \n // $orderedMembers = array_reverse($orderedMembers);\n \n $currentLoop = 0;\n foreach($orderedMembers as $memberIndex => $member) {\n \n if($member->getMember() == $this->showOnWebpageMemberAttr) {\n $this->createperson(null, $member, $array, $personInc, $arrayInc, $tmpCategory, $pR, $pubR, 'dt', $persons, $catIndex, $usedPersons, $currentLoop, $paR);\n\n $personInc++;\n }\n }\n }\n \n } else {\n $personInc = 0;\n foreach ($persons as $personIndex => $person) {\n \n // Sonderbehandlung für PCs\n if($catIndex === 'pcs') {\n $pos = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Model\\Personposition');\n\n $isAttoGroup = false;\n foreach ($person->getCategory() as $pCategory) {\n if ($pCategory->getUid() == $this->config['attoworld2']['category']['atto3']) {\n $isAttoGroup = true;\n }\n }\n \n if($isAttoGroup === true) {\n $projecttitle = '';\n foreach($projects as $project) {\n $members = $project->getMember();\n foreach($members as $member) {\n if($member->getUid() == $person->getUid()) {\n $projecttitle = $project->getShorttitle();\n }\n }\n }\n \n $catTitle = 'Research Group leader of '.$projecttitle;\n $pos->setTitle(ucfirst($catTitle));\n $person->setPosition(array($pos));\n }\n }\n \n // Sonderbehandlung für Director\n if($catIndex === 'director') {\n if($person->getSurname() === 'Krausz' &&\n $person->getForename() === 'Ferenc') {\n \n $pos = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Model\\Personposition');\n\n $catTitle = $category['title'];\n $pos->setTitle(ucfirst($catTitle));\n $person->setPosition(array($pos));\n }\n }\n \n // Erzeugt die einzelnen Personen\n $this->createperson($personIndex, $person, $array, $personInc, $arrayInc, $category, $pR, $pubR, null, $persons, $catIndex, $usedPersons, null, $paR);\n $personInc++;\n }\n }\n \n $arrayInc++;\n }\n\n // Sortierung der Personen\n foreach ($array as $index => $category) {\n if($category['shouldbesorted'] === true) {\n $tmp = $category['data'];\n $tmp = $this->array_msort($tmp, array('sorting' => SORT_ASC));\n $array[$index]['data'] = $tmp;\n }\n }\n \n // Array für die Speicherung der UIDs der bereits benutzten Personen (nicht nochmal ausgeben)\n $usedPersons = null;\n\n // Konfiguration des Arrays für den project-listing-Bereich\n $siteCategories = array();\n foreach ($projects as $p) {\n $help = array(\n 'title' => $p->getTitle(),\n 'uid' => $p->getUid(),\n 'pagepid' => $p->getPagepid(),\n 'personuids' => array(\n )\n );\n\n foreach ($p->getMember() as $m) {\n $help['personuids'][] = $m->getUid();\n }\n\n $siteCategories[] = $help;\n }\n\n \n $arrayInc = 0;\n foreach ($siteCategories as $p) {\n $parray[$arrayInc] = array(\n 'title' => $p['title'],\n 'uid' => $p['uid'],\n 'pagepid' => $p['pagepid'],\n 'data' => array()\n );\n\n $personInc = 0;\n foreach ($persons as $personIndex => $person) {\n $this->createperson($personIndex, $person, $parray, $personInc, $arrayInc, $p, $pR, $pubR, null, $persons, $catIndex, $usedPersons, null, $paR);\n $personInc++;\n }\n\n $arrayInc++;\n }\n\n foreach ($parray as $index => $category) {\n $tmp = $category['data'];\n $tmp = $this->array_msort($tmp, array('sorting' => SORT_ASC));\n $parray[$index]['data'] = $tmp;\n }\n \n // Gruppenleiter bei Projektlisting vorne dran\n foreach($parray as $ci => $c) {\n $leaders = array();\n \n foreach($c['data'] as $pi => $p) {\n \n $isGroupLeader = false;\n foreach ($p['model']->getCategory() as $pCategory) {\n // var_dump('?',$p['model']->getSurname());\n if ($pCategory->getTitle() == 'pc_atto3') {\n $isGroupLeader = true;\n }\n }\n \n if($isGroupLeader === true) {\n $leaders[] = $parray[$ci]['data'][$pi];\n unset($parray[$ci]['data'][$pi]);\n }\n \n }\n \n $leaders = $this->array_msort($leaders, array('sorting' => SORT_DESC));\n \n if(!empty($leaders)) {\n foreach($leaders as $leader) {\n $parray[$ci]['data'] = array_reverse($parray[$ci]['data']);\n array_push($parray[$ci]['data'], $leader);\n $parray[$ci]['data'] = array_reverse($parray[$ci]['data']);\n }\n }\n }\n \n $siteCategories = array(\n 'directorsteam1' => array(\n 'uid' => $this->config['attoworld2']['subgroups']['assistents'],\n 'title' => 'Personal assistants',\n 'subgroups' => array(\n $this->config['attoworld2']['subgroups']['assistents']\n )\n ),\n 'directorsteam2' => array(\n 'uid' => $this->config['attoworld2']['subgroups']['administration'],\n 'title' => 'Finance & administration',\n 'subgroups' => array(\n $this->config['attoworld2']['subgroups']['administration']\n )\n ),\n 'directorsteam3' => array(\n 'uid' => $this->config['attoworld2']['subgroups']['mapcala'],\n 'title' => 'MAP/CALA',\n 'subgroups' => array(\n $this->config['attoworld2']['subgroups']['mapcala']\n )\n ),\n /*\n 'directorsteam4' => array(\n 'uid' => $this->config['attoworld2']['subgroups']['publicoutreach'],\n 'title' => 'Public outreach',\n 'subgroups' => array(\n $this->config['attoworld2']['subgroups']['publicoutreach']\n )\n ),\n */\n 'directorsteam5' => array(\n 'uid' => $this->config['attoworld2']['subgroups']['communications'],\n 'title' => 'Communications',\n 'subgroups' => array(\n $this->config['attoworld2']['subgroups']['communications']\n )\n ),\n );\n \n foreach ($siteCategories as $catIndex => $category) {\n\n\n // Kategorien\n // 3 - Technical Staff\n // 4,5,6 - Scientists\n // 7,8,9 - Students\n // 12 - Directors Team\n // PCs\n\n $darray[$arrayInc] = array(\n 'title' => $category['title'],\n 'shouldbesorted' => true,\n 'uid' => $category['uid'],\n 'data' => array()\n );\n\n \n $darray[$arrayInc]['shouldbesorted'] = false;\n\n $personInc = 0;\n foreach($category['subgroups'] as $subgroup) {\n $subgroup = $psgR->findByUid($subgroup);\n\n $members = $subgroup->getMembers();\n\n $tmpCategory = array('title' => 'Directors Team',);\n foreach($members as $memberIndex => $member) {\n $tmpCategory['personuids'][] = $member->getUid();\n }\n\n $orderedMembers = array();\n\n foreach($members as $memberIndex => $member) {\n $leader = false;\n $assistents = false;\n foreach($member->getSubgroup() as $lGroup) {\n if($lGroup->getUid() == $this->config['attoworld2']['subgroups']['executive']) {\n $leader = true;\n }\n if($lGroup->getUid() == $this->config['attoworld2']['subgroups']['assistents']) {\n $assistents = true;\n }\n }\n\n if($leader === true && $assistents === false || $member->getIsgroupleader() == 1) {\n $orderedMembers = array_reverse($orderedMembers);\n array_push($orderedMembers, $member);\n $orderedMembers = array_reverse($orderedMembers);\n\n } else {\n array_push($orderedMembers, $member);\n }\n }\n\n $currentLoop = 0;\n foreach($orderedMembers as $memberIndex => $member) {\n $this->createperson(null, $member, $darray, $personInc, $arrayInc, $tmpCategory, $pR, $pubR, 'dt', $persons, $catIndex, $usedPersons, $currentLoop, $paR);\n\n $personInc++;\n }\n }\n \n $arrayInc++;\n }\n\n foreach ($darray as $index => $category) {\n if($category['shouldbesorted'] === true) {\n $tmp = $category['data'];\n $tmp = $this->array_msort($tmp, array('sorting' => SORT_ASC));\n $darray[$index]['data'] = $tmp;\n }\n }\n \n // Teammember-Ergänzung\n /*\n $sort_col = array();\n foreach ($array as $key=> $row) {\n $sort_col[$key] = $row['crdate'];\n }\n\n array_multisort($sort_col, SORT_ASC, $array);\n */\n\n $pR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\ProjectRepository');\n $projects = $pR->findAll();\n \n if ($this->request->hasArgument('group')) {\n $group = $this->request->getArgument('group');\n\n $this->view->assign('group', $group);\n } else {\n $this->view->assign('group', '');\n }\n \n // Welcher Tab soll nach Aufruf der Gruppe geöffnet sein?\n if ($this->request->hasArgument('type')) {\n $type = $this->request->getArgument('type');\n \n $this->view->assign('type', $type);\n }\n \n // Bei Gruppen, mit zwei Leadern, die erste Person nicht anklicken\n $this->view->assign('twoleaders', json_encode($this->config['attoworld2']['projects']['twoleaders']));\n \n $pR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\PersonRepository');\n $person = $pR->findByUid($this->config['attoworld2']['person']['nils']);\n \n $nils['sorting'] = $person->getSurname();\n $nils['model'] = $person;\n $pubs = $pubR->findByAuthors($person->getUid());\n\n if(empty($pubs)) {\n $i = 0;\n foreach ($pubs as $pub) {\n if ($i >= 3) {\n break;\n } else {\n $nils['pubs'][] = $pubs->offsetGet($i);\n }\n\n $i++;\n }\n }\n\n /*\n $pas = $paR->findAll();\n foreach ($pas as $pa) {\n if ($pa->getPerson() == $person->getUid()) {\n foreach($pa->getLocation() as $iLocation => $vLocation) {\n $nils['address']['locations'][$vLocation->getTitle()]['address'] = $pa;\n $nils['address']['locations'][$vLocation->getTitle()]['rooms']['value'] = $pa->getRoomnumber();\n $nils['address']['locations'][$vLocation->getTitle()]['rooms']['type'] = $pa->getKind();\n $nils['address']['locations'][$vLocation->getTitle()]['rooms']['numbers'][$pa->getKind()][] = $pa->getPhonenumber();\n }\n }\n }\n */\n \n $pas = $paR->findAll();\n foreach ($pas as $pa) {\n if($pa->getPerson() == $person->getUid()) {\n foreach($pa->getLocation() as $iLocation => $vLocation) {\n $nils['address']['locations'][$vLocation->getTitle()]['address'] = $pa;\n\n $rn = $pa->getRoomnumber();\n $k = $pa->getKind();\n\n if(!empty($rn)) {\n $nils['address']['locations'][$vLocation->getTitle()]['rooms']['value'] = $rn;\n }\n if(!empty($k)) {\n $nils['address']['locations'][$vLocation->getTitle()]['rooms']['type'] = $k;\n }\n\n $nils['address']['locations'][$vLocation->getTitle()]['rooms']['numbers'][$pa->getKind()][] = $pa->getPhonenumber();\n }\n }\n }\n \n \n \n\n foreach ($pmails as $pmail) {\n if ($pmail->getPerson() == $person->getUid()) {\n $nils['emails'][] = $pmail;\n }\n }\n\n // $teammembers = $pR->findByCategory($pCategory->getUid());\n $sgR = $this->objectManager->get('Ferenckrausz\\Attoworld\\Domain\\Repository\\PersonsubgroupRepository');\n $sgRes = $sgR->findByUid($this->config['attoworld2']['subgroups']['technicalstaff']);\n\n $members = array();\n $ms = $sgRes->getMembers();\n\n $mWO = array();\n foreach($ms as $m) {\n if($m->getUid() !== $person->getUid()) {\n $onwebpage = true;\n foreach ($m->getCategory() as $pCategory) {\n if ($pCategory->getUid() == $this->config['attoworld2']['category']['notinweb']) {\n $onwebpage = false;\n }\n }\n \n if($onwebpage === true) {\n $mWO[] = $m;\n }\n }\n }\n \n $nils['members'] = $mWO;\n\n $this->view->assign('nils', $nils);\n $this->view->assign('categories', $categories);\n $this->view->assign('persons', $persons);\n $this->view->assign('subgroups', $subgroups);\n $this->view->assign('projects', $projects);\n $this->view->assign('myarray', $array);\n $this->view->assign('parray', $parray);\n $this->view->assign('darray', $darray);\n $this->view->assign('subgroups', $psRes);\n }", "public function organisationAction() {\n if($this->_getParam('id',false)){\n $this->view->orgs = $this->_organisations\n ->getOrgDetails($this->_getParam('id'));\n $this->view->members = $this->_organisations\n ->getMembers($this->_getParam('id'));\n } else {\n throw new Pas_Exception_Param($this->_missingParameter, 500);\n }\n }", "function organization( $org )\n\t{\n if( trim( $org != \"\" ) )\n \t$this->xheaders['Organization'] = $org;\n\t}", "private function admin_show_person () {\n\t\t$show = true;\n\t\t\n\t\treturn $show;\n\t}", "public function setProfileInformation()\n {\n $view = \\Utility\\Singleton::getInstance(\"\\View\\Main\");\n\t\t$username=$view->get('userProfile');\n\t\t$this->getUserInformations($view,$username);\n\t\t$this->setResourcesUploaded($view,$username);\n\t\treturn $view->fetch('profile.tpl');\n\t}", "function printUserInfo(){\n\n\t\t/* Get User Info */\n\t\t$user = $this->getUserInfo();\n\n\t\t/* Check for Real Name */\n\t\tif($user->person->realname->_content){\n\t\t\t$name = $user->person->realname->_content;\n\t\t} else {\n\t\t\t$name = $user->person->username->_content;\n\t\t}\n\t\t$description = $user->person->description->_content;\n\n\n\t\t/* Add <br> tags */\n\t\t$description = str_replace(\"\\n\",'<br/>',$description);\n\n\t\t/* Generate output */\n\t\t$output = '<section class=\"person\" itemscope itemtype=\"http://schema.org/Person\">'; // Using some Microdata for Additional Searchability\n\t\t$output .= '<img src=\"http://farm'.$user->person->iconfarm.'.staticflickr.com/'.$user->person->iconserver.'/buddyicons/'.$user->person->nsid.'_r.jpg\" class=\"avatar\" itemprop=\"photo\" alt=\"'.$user->person->realname->_content.'\" />';\n\t\t$output .= '<h3 >Hi! I\\'m <span class=\"name\" itemprop=\"name\" rel=\"author\">'.$name.'</span></h3>';\n\t\t$output .= '<p class=\"description span6\" itemprop=\"description\">'.$description.'<br/><br/>View my Photos on <a href=\"'.$user->person->photosurl->_content.'\" target=\"_blank\" rel=\"autor\">Flickr</a>.</p>';\n\t\t$output .= '</section>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function loads a set of default fields into the profile, then triggers a hook letting other plugins to edit add and delete fields. Note: This is a secondary system:init call and is run at a super low priority to guarantee that it is called after all other plugins have initialised.
function elgg_profile_fields_setup() { global $CONFIG; $profile_defaults = array ( 'description' => 'longtext', 'briefdescription' => 'text', 'location' => 'location', 'interests' => 'tags', 'skills' => 'tags', 'contactemail' => 'email', 'phone' => 'text', 'mobile' => 'text', 'website' => 'url', 'twitter' => 'text' ); $loaded_defaults = array(); if ($fieldlist = elgg_get_config('profile_custom_fields')) { if (!empty($fieldlist)) { $fieldlistarray = explode(',', $fieldlist); foreach ($fieldlistarray as $listitem) { if ($translation = elgg_get_config("admin_defined_profile_{$listitem}")) { $type = elgg_get_config("admin_defined_profile_type_{$listitem}"); $loaded_defaults["admin_defined_profile_{$listitem}"] = $type; add_translation(get_current_language(), array("profile:admin_defined_profile_{$listitem}" => $translation)); } } } } if (count($loaded_defaults)) { $CONFIG->profile_using_custom = true; $profile_defaults = $loaded_defaults; } $CONFIG->profile_fields = elgg_trigger_plugin_hook('profile:fields', 'profile', NULL, $profile_defaults); // register any tag metadata names foreach ($CONFIG->profile_fields as $name => $type) { if ($type == 'tags' || $type == 'location' || $type == 'tag') { elgg_register_tag_metadata_name($name); // register a tag name translation add_translation(get_current_language(), array("tag_names:$name" => elgg_echo("profile:$name"))); } } }
[ "public function load_fields() {\n\t\tinclude_once plugin_dir_path( __FILE__ ) . 'class-simpleportfoliogenesis-sixtenfields.php';\n\t\t$custom_fields = new SimplePortfolioGenesisSixTenFields();\n\t}", "public function initialize_fields() {\n\t\t\tWPS\\Core\\Fields::get_instance();\n\t\t}", "public function init_form_fields() {\n\t\t\t//$this->form_fields = include( dirname( __FILE__ ) . '/settings-one-click.php' );\n\t\t}", "public function init_fields() {\n\t\t// Override this function in your class and assign the array of sections to $this->fields.\n\t\t_e( 'Override init_fields() in your class.', '{plugin_jump_starter_textdomain}' );\n\t}", "function ep_fill_default_fields(&$fields)\n{\n\tglobal $context;\n\n\t$new_fields = array(\n\t\t'module_title' => array(\n\t\t\t'type' => 'text',\n\t\t),\n\t\t'module_template' => array(\n\t\t\t'type' => 'select',\n\t\t\t'preload' => create_function('$field', '\n\t\t\t\tglobal $context, $smcFunc, $txt;\n\n\t\t\t\t$files = array();\n\t\t\t\tep_list_files__recursive($context[\\'ep_module_template\\'], $files);\n\t\t\t\t$field[\\'options\\'] = array();\n\n\t\t\t\tforeach ($files as $file)\n\t\t\t\t{\n\t\t\t\t\tif ($file != \\'index.php\\')\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_file = explode(\\'.\\', $file);\n\t\t\t\t\t\t$field[\\'options\\'][] = $file;\n\t\t\t\t\t\t$txt[\\'ep_module_template_\\' . $file] = $smcFunc[\\'ucfirst\\']($new_file[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $field;'),\n\t\t\t'value' => 'default.php',\n\t\t),\n\t\t'module_header_display' => array(\n\t\t\t'type' => 'select',\n\t\t\t'options' => array('enabled', 'disable', 'collapse'),\n\t\t\t'value' => 'enabled',\n\t\t),\n\t\t'module_icon' => array(\n\t\t\t'type' => 'select',\n\t\t\t'preload' => create_function('&$field', '\n\t\t\t\tglobal $context, $smcFunc, $txt;\n\n\t\t\t\t$files = array();\n\t\t\t\tep_list_files__recursive($context[\\'ep_module_icon_dir\\'], $files);\n\t\t\t\t$field[\\'options\\'] = array();\n\n\t\t\t\tforeach ($files as $file)\n\t\t\t\t{\n\t\t\t\t\tif ($file != \\'index.php\\')\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_file = explode(\\'.\\', $file);\n\t\t\t\t\t\t$field[\\'options\\'][] = $file;\n\t\t\t\t\t\t$txt[\\'ep_module_icon_\\' . $file] = $smcFunc[\\'ucfirst\\']($new_file[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $field;'),\n\t\t\t'iconpreview' => true,\n\t\t\t'url' => $context['ep_module_icon_url'],\n\t\t\t'value' => '',\n\t\t),\n\t\t'module_link' => array(\n\t\t\t'type' => 'text',\n\t\t\t'value' => '',\n\t\t),\n\t\t'module_target' => array(\n\t\t\t'type' => 'select',\n\t\t\t'options' => array('_self', '_parent', '_blank'),\n\t\t\t'value' => '_self',\n\t\t),\n\t\t'module_groups' => array(\n\t\t\t'type' => 'callback',\n\t\t\t'callback_func' => 'list_groups',\n\t\t\t'preload' => create_function('&$field', '\n\t\t\t\t$field[\\'options\\'] = ep_list_groups($field[\\'value\\']);\n\n\t\t\t\treturn $field;'),\n\t\t\t'value' => '-3',\n\t\t),\n\t);\n\n\t$fields = array_replace_recursive($new_fields, $fields);\n}", "public static function load_fields() {\n\t\tnew Fields\\Plugin\\Banners();\n\t\tnew Fields\\Plugin\\Icons();\n\t\tnew Fields\\Plugin\\Rating();\n\t\tnew Fields\\Plugin\\Ratings();\n\t\tnew Fields\\Plugin\\Screenshots();\n\t}", "public function init_form_fields() {\n $this->form_fields = require( dirname( __FILE__ ) . '/admin/digitalriver-settings.php' );\n }", "private function load_fields() {\n\t\t$this->_sections = Options::get_sections();\n\t\t$this->_fields = Options::get_fields();\n\n\t\tforeach ( $this->_fields as $key => $field ) {\n\t\t\t$this->_sections[ $field->args['section'] ]['fields'][] = $field;\n\t\t}\n\n\t\t$this->_options = Options::get_options();\n\t}", "public function save_defaults() {\n\n $tmp_options = $this->options;\n\n if ( ! empty( $this->pre_fields ) ) {\n foreach ( $this->pre_fields as $field ) {\n if ( ! empty( $field['id'] ) ) {\n $this->options[$field['id']] = ( isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : $this->get_default( $field );\n }\n }\n }\n\n if ( $this->args['save_defaults'] && empty( $this->args['show_in_customizer'] ) && empty( $tmp_options ) ) {\n\n if ( $this->args['database'] === 'theme_mod' ) {\n set_theme_mod( $this->unique, $this->options );\n } else {\n update_option( $this->unique, $this->options );\n }\n\n }\n\n }", "function scratchpad_profile_profile_install_profile(){\n // Load the file for doing the stuff!\n module_load_include('inc', 'content', 'includes/content.crud');\n fieldgroup_save_group('profile', array(\n 'label' => 'Personal Information',\n 'group_name' => 'group_personal',\n 'group_type' => 'standard'\n ));\n $fields = array(\n array(\n 'label' => 'Title',\n 'field_name' => 'field_title',\n 'type' => 'text',\n 'widget_type' => 'text_textfield',\n 'type_name' => 'profile',\n 'weight' => 0,\n 'required' => 1\n ),\n array(\n 'label' => 'Given name(s)',\n 'field_name' => 'field_givennames',\n 'type' => 'text',\n 'widget_type' => 'text_textfield',\n 'type_name' => 'profile',\n 'weight' => 1,\n 'required' => 1\n ),\n array(\n 'label' => 'Family name',\n 'field_name' => 'field_familyname',\n 'type' => 'text',\n 'widget_type' => 'text_textfield',\n 'type_name' => 'profile',\n 'weight' => 2,\n 'required' => 1\n ),\n array(\n 'label' => 'Institution',\n 'field_name' => 'field_institution',\n 'type' => 'text',\n 'widget_type' => 'text_textfield',\n 'type_name' => 'profile',\n 'weight' => 3\n ),\n array(\n 'label' => 'Area of Taxonomic Interest',\n 'field_name' => 'field_taxonomicinterest',\n 'type' => 'text',\n 'widget_type' => 'text_textfield',\n 'type_name' => 'profile',\n 'weight' => 4\n )\n );\n foreach($fields as $field){\n content_field_instance_create($field);\n db_query(\"INSERT INTO {content_group_fields} (type_name, group_name, field_name) VALUES ('profile','group_personal','%s')\", $field['field_name']);\n }\n variable_set('content_profile_profile', array(\n 'weight' => 0,\n 'user_display' => 'full',\n 'edit_link' => 1,\n 'edit_tab' => 'sub',\n 'add_link' => 1,\n 'registration_use' => 1,\n 'admin_user_create_use' => 1,\n 'registration_hide' => array(\n 'other'\n )\n ));\n db_query(\"UPDATE {node_type} SET has_body = 0 WHERE type = 'profile'\");\n variable_set('content_profile_use_profile', TRUE);\n variable_set('ant_pattern_profile', '[field_title-formatted] [field_givennames-formatted] [field_familyname-formatted]');\n variable_set('ant_php_profile', 0);\n variable_set('ant_profile', 1);\n variable_set('node_options_profile', array(\n 'status'\n ));\n}", "public function save_defaults() {\n\n $tmp_options = $this->options;\n\n foreach( $this->pre_fields as $field ) {\n if( ! empty( $field['id'] ) ) {\n $this->options[$field['id']] = $this->get_default( $field, $this->options );\n }\n }\n\n if( $this->args['save_defaults'] && empty( $tmp_options ) ) {\n $this->save_options( $this->options );\n }\n\n }", "function profile_install_addField( $name, $title, $description, $category, $type, $valuetype, $weight, $canedit, $options, $step_id, $length, $visible = true )\r\n{\r\n\tglobal $module_id;\r\n\r\n\t$profilefield_handler = xoops_getModuleHandler( 'field', 'profile' );\r\n\t$obj = $profilefield_handler->create();\r\n\t$obj->setVar( 'field_name', $name, true );\r\n\t$obj->setVar( 'field_moduleid', $module_id, true );\r\n\t$obj->setVar( 'field_show', 1 );\r\n\t$obj->setVar( 'field_edit', $canedit ? 1 : 0 );\r\n\t$obj->setVar( 'field_config', 0 );\r\n\t$obj->setVar( 'field_title', strip_tags( $title ), true );\r\n\t$obj->setVar( 'field_description', strip_tags( $description ), true );\r\n\t$obj->setVar( 'field_type', $type, true );\r\n\t$obj->setVar( 'field_valuetype', $valuetype, true );\r\n\t$obj->setVar( 'field_options', $options, true );\r\n\tif ( $canedit ) {\r\n\t\t$obj->setVar( 'field_maxlength', $length, true );\r\n\t}\r\n\t$obj->setVar( 'field_weight', $weight, true );\r\n\t$obj->setVar( 'cat_id', $category, true );\r\n\t$obj->setVar( 'step_id', $step_id, true );\r\n\t$profilefield_handler->insert( $obj );\r\n\r\n\tprofile_install_setPermissions( $obj->getVar( 'field_id' ), $module_id, $canedit, $visible );\r\n\r\n\treturn true;\r\n}", "private function define_field_profile_crud_hooks() { \r\n $field_profile_crud = new WPF_Field_Profile_CRUD( $this->get_WPF(), $this->get_version() ); \r\n $this->loader->add_action( 'admin_enqueue_scripts', $field_profile_crud, 'enqueue_styles' );\r\n $this->loader->add_action( 'admin_enqueue_scripts', $field_profile_crud, 'enqueue_scripts', 10, 1 );\r\n // crud \r\n $this->loader->add_action( 'admin_menu', $field_profile_crud, 'admin_menu_pages' ); \r\n $this->loader->add_action( 'admin_menu', $field_profile_crud, 'field_profiles_links' );\r\n $this->loader->add_action( 'cmb2_admin_init', $field_profile_crud, 'form' );\r\n $this->loader->add_action( 'cmb2_after_init', $field_profile_crud, 'form_submit' ); \r\n // shortcode \r\n $this->loader->add_shortcode( $field_profile_crud::FORM_SHORTCODE, $field_profile_crud, 'form_shortcode' ); \r\n }", "public function initSettingsData()\n {\n foreach ($this->getFieldConfig()->fields as $field => $data) {\n $this->{$field} = isset($data['default']) ? $data['default'] : '';\n }\n }", "abstract protected function get_default_fields();", "protected function _load_default_request_fields()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $suva = new Suva();\n $this->hostkey = $suva->get_hostkey();\n\n $os = new OS();\n $this->os_name = $os->get_name();\n $this->os_version = $os->get_version();\n\n $product = new Product();\n $this->vendor = $product->get_vendor();\n \n $language= new Locale();\n $this->langcode = $language->get_language_code();\n }", "protected function _init() {\n\t\t$this->_fields += array(\n\t\t\t'id' => new Sprig_Field_Auto,\n\t\t\t'version' => new Sprig_Field_Integer(array(\n\t\t\t\t'editable' => FALSE,\n\t\t\t\t'default' => 1,\n\t\t\t)),\n\t\t\t// Internal, not in DB\n\t\t\t'editor' => new Sprig_Field_Integer(array(\n\t\t\t\t'editable' => FALSE,\n\t\t\t\t'in_db' => FALSE,\n\t\t\t\t'default' => 1,\n\t\t\t)),\n\t\t\t'comments' => new Sprig_Field_Char(array(\n\t\t\t\t'editable' => FALSE,\n\t\t\t\t'in_db' => FALSE,\n\t\t\t\t'default' => array(),\n\t\t\t)),\n\t\t);\n\t}", "function createDefaultCpFields()\n\t{\n\t\t// Check for request forgeries\n\t\tJSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t$db = JFactory::getDbo();\n\n\t\tJFactory::getLanguage()->load('plg_flexicontent_fields_coreprops', JPATH_ADMINISTRATOR, 'en-GB', true);\n\t\tJFactory::getLanguage()->load('plg_flexicontent_fields_coreprops', JPATH_ADMINISTRATOR, null, true);\n\t\t\n\t\t// !! IMPORTANT core fields have specific fields ID, ranging from 1 - 14\n\t\t// !! Make sure these have been creating before trying to add any other fields into the flexicontent_fields DB table\n\t\t$this->createDefaultFields($_skip_success_msg = true);\n\n\t\t$p = 'FLEXI_COREPROPS_';\n\t\t$coreprop_names = array\n\t\t(\n\t\t\t// Single properties\n\t\t\t'id' => 'FLEXI_ID', 'alias' => 'FLEXI_ALIAS', 'category' => $p.'CATEGORY_MAIN', 'lang' => $p.'LANGUAGE', 'vstate' => $p.'PUBLISH_CHANGES',\n\t\t\t'disable_comments' => $p.'DISABLE_COMMENTS', 'notify_subscribers' => $p.'NOTIFY_SUBSCRIBERS', 'notify_owner' => $p.'NOTIFY_OWNER',\n\t\t\t'captcha' => $p.'CAPTCHA', 'layout_selection' => $p.'LAYOUT_SELECT',\n\n\t\t\t//Publishing\n\t\t\t'timezone_info' => $p.'TIMEZONE', 'created_by_alias' => $p.'CREATED_BY_ALIAS',\n\t\t\t'publish_up' => $p.'PUBLISH_UP', 'publish_down' => $p.'PUBLISH_DOWN',\n\t\t\t'access' => $p.'VIEW_ACCESS',\n\n\t\t\t// Attibute groups or other composite data\n\t\t\t'item_screen' => $p.'VERSION_INFOMATION', 'lang_assocs' => $p.'LANGUAGE_ASSOCS',\n\t\t\t'jimages' => $p.'JIMAGES', 'jurls' => $p.'JURLS',\n\t\t\t'metadata' => $p.'META', 'seoconf' => $p.'SEO',\n\t\t\t'display_params' => $p.'DISP_PARAMS', 'layout_params' => $p.'LAYOUT_PARAMS',\n\t\t\t'perms' => 'FLEXI_PERMISSIONS', 'versions' => 'FLEXI_VERSIONS',\n\t\t);\n\n\n\t\t/**\n\t\t * First try to publish existing coreprops fields with name 'form_*' that are not published\n\t\t */\n\t\t$query = 'UPDATE #__flexicontent_fields SET published = 1 '\n\t\t\t. ' WHERE field_type = \"coreprops\" AND name LIKE \"form_%\"'\n\t\t\t;\n\t\t$db->setQuery($query)->execute();\n\n\n\t\t/**\n\t\t * Now find coreprops fields that are missing\n\t\t */\n\t\t$query = 'SELECT name'\n\t\t\t. ' FROM #__flexicontent_fields'\n\t\t\t. ' WHERE field_type = \"coreprops\" AND name LIKE \"form_%\"'\n\t\t\t;\n\t\t$existing = $db->setQuery($query)->loadColumn();\n\t\t$existing = array_flip($existing);\n\n\t\t$vals = array();\n\t\t$n = 14;\n\n\t\tforeach($coreprop_names as $prop_name => $prop_label)\n\t\t{\n\t\t\t$name = 'form_' . $prop_name;\n\t\t\t$label = JText::_($prop_label); // Maybe use language string\n\t\t\tif (!isset($existing[$name]))\n\t\t\t{\n\t\t\t\t$vals[$name] = ' (\"coreprops\",\"' . $name . '\", ' . $db->Quote($label). ',\"\",0,0,0,0,0,0,0,1,\"\",1,'\n\t\t\t\t\t. '\\'{\"display_label\":\"1\",\"props_type\":\"'.$prop_name.'\"}\\',0,\"0000-00-00 00:00:00\",1,'. ($n + 1) . ')';\n\t\t\t}\n\t\t}\n\n\n\t\t/**\n\t\t * Create any missing fields\n\t\t */\n\t\tif (count($vals) > 0)\n\t\t{\n\t\t\t$query \t= '\n\t\t\tINSERT INTO `#__flexicontent_fields` (\n\t\t\t\t`field_type`,`name`,`label`,`description`,`isfilter`,`iscore`,`issearch`,`isadvsearch`,\n\t\t\t\t`untranslatable`,`formhidden`,`valueseditable`,`edithelp`,`positions`,`published`,\n\t\t\t\t`attribs`,`checked_out`,`checked_out_time`,`access`,`ordering`\n\t\t\t) VALUES '\t. implode(', ', $vals);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$db->setQuery($query)->execute();\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tjexit('<span class=\"install-notok\"></span>' . $e->getMessage());\n\t\t\t}\n\t\t}\n\n\n\t\t/**\n\t\t * Make sure all coreprops fields with name 'form_*' are assigned to all types\n\t\t */\n\t\t$coreprops_field_ids = $db->setQuery('SELECT id FROM #__flexicontent_fields WHERE field_type = \"coreprops\" AND name LIKE \"form_%\"')->loadColumn();\n\t\t$coreprops_field_ids = array_flip($coreprops_field_ids);\n\n\t\t$type_ids = $db->setQuery('SELECT id FROM `#__flexicontent_types`')->loadColumn();\n\n\t\tif ($type_ids)\n\t\t{\n\t\t\t$query = 'REPLACE INTO `#__flexicontent_fields_type_relations` (`field_id`,`type_id`,`ordering`) VALUES';\n\t\t\t$rels = array();\n\n\t\t\tforeach ($type_ids as $type_id)\n\t\t\t{\n\t\t\t\tforeach ($coreprops_field_ids as $field_id => $i)\n\t\t\t\t{\n\t\t\t\t\t$rels[] = '(' . (int) $field_id . ',' . (int) $type_id . ', 0)';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$query .= implode(', ', $rels);\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$db->setQuery($query)->execute();\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tjexit('<span class=\"install-notok\"></span>' . $e->getMessage());\n\t\t\t}\n\t\t}\n\n\t\techo '<span class=\"install-ok\"></span>';\n\t}", "private function _load_fields() {\n $contextlevel = $this->get_field_context_level();\n if (!isset(self::$_fields[$contextlevel])) {\n $fields = field::get_for_context_level($contextlevel);\n if (!is_array($fields)) {\n $fields = $fields->to_array('shortname');\n }\n self::$_fields[$contextlevel] = $fields;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all the existing ship types
public static function getAllShipsType() { $mysqli = db::get_mysqli(); $shipTypes = []; $ships = $mysqli->query("SELECT * FROM star_ship"); while($list = $ships->fetch_assoc()) $shipTypes[] = new ShipTypeModel($list); return $shipTypes; }
[ "public function getShippingTypes()\n {\n return $this->app['db.utils']->getEnumValues(self::$table_name, 'shipping_type');\n }", "public function getShipType()\n {\n return $this->ShipType;\n }", "function get_shiptype_byshipid($type_id)\n\n\t{\n\n\t\t// type_id didapat dari table ship \n\n\t\t$str = \"select * from ship_type where type_id = '$type_id' \";\n\n\t\t$q = $this->db->query($str);\n\n\t\t$f = $q->row_array();\n\n\t\t\n\n\t\treturn $f;\n\n\t\t\n\n\t\t\n\n\t\t\n\n\t}", "public function WC_getDeliveryTypes() {\n\t\t\t$wc_shipping_list = array();\n\n\t\t\tforeach ( VK_get_wc_shipping_methods() as $shipping_code => $shipping ) {\n\t\t\t\tif ( isset( $shipping['enabled'] ) && $shipping['enabled'] == WC_VKontakte_Abstracts_Settings::YES ) {\n\t\t\t\t\t$wc_shipping_list[ $shipping_code ] = __( $shipping['title'], 'woocommerce' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $wc_shipping_list;\n\t\t}", "public function getAll(){\n\t\t\n\t\treturn $this->shipping->all();\t\n\t}", "public function getAllShips() {\n\t\t$act = \"get_all_ships\";\n\n\t\treturn $this->dbSelect(\n\t\t\t$act,\n\t\t\t'id, name, serial_number, image_url',\n\t\t\t'ships'\n\t\t);\n\t}", "public function getShippingMethods();", "public function locationTypes()\n {\n return $this->type->all();\n }", "public function get_port_types()\n {\n return $this->retrieve('SELECT * FROM isys_port_type;');\n }", "public function getTypesByPurger();", "public function getTypes()\n {\n return $this->get('Types');\n }", "private function allTypes(){\n if(!$this->hasAirline()){\n return Redirect::to('/backend/home');\n }\n //returns array of all types\n $types = AircraftType::all();\n $list = array();\n foreach($types as $t){\n array_push($list, $t->name);\n }\n return $list; \n }", "public function getTypes() {\n return ProductType::find('id = ' . $this->type . '');\n }", "public function getTypes()\n {\n }", "static function getShipFacilities() : Array {\n\n $select = \"select fs.id as id, s.id as ship, s.name as shipName, s.yearservice, f.name as facilityName, f.id as facilities\n from ships s \n JOIN facilities_ship fs ON fs.ship = s.id\n JOIN facilities f ON f.id = fs.facilities\n \";\n\n self::$db->query($select);\n self::$db->execute();\n\n return self::$db->resultSet();\n }", "public function getWarehouseTypes();", "public function getAll() : array\n {\n return $this->types;\n }", "public function getShipmentSpecialServices() {\r\n return inship_fedexship_get($this->handle, 156 );\r\n }", "private function getTypes() {\n $conn = DBConnection::getInstance();\n $query = \"CALL getAddressTypes();\";\n $result = $conn->performQueryFetchAll($query);\n $result_array = [];\n foreach ($result as $row) {\n $result_array[$row['id']] = $row['name'];\n }\n return $result_array;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test if the given url is the ACF PRO download url
protected function isAcfProPackageUrl($url) { return strpos($url, self::ACF_PRO_PACKAGE_URL) !== false; }
[ "function isDownloadable();", "protected function isSupportedUrl($url)\n {\n return preg_match('/https\\:\\/\\/deliciousbrains.com\\/dl\\/wp-migrate-db-pro(-media-files|-cli|-multisite-tools)?-latest.zip/', $url);\n }", "public function isDownload(): bool;", "private function isurl() {\r\n\r\n $u = $this->getcode();\r\n\r\n return $u != '0';\r\n\r\n }", "function is_wpsc_downloads_page() {\n\t_wpsc_deprecated_function( __FUNCTION__, '3.8.10' );\n\treturn !empty($_REQUEST['tab']) && ( $_REQUEST['tab'] == 'downloads' );\n}", "public function isExternalPaymentUrl();", "function is_local_attachment($url) {\n\tif (strpos($url, get_bloginfo('url')) === false)\n\t\treturn false;\n\tif (strpos($url, get_bloginfo('url') . '/?attachment_id=') !== false)\n\t\treturn true;\n\tif ( $id = url_to_postid($url) ) {\n\t\t$post = & get_post($id);\n\t\tif ( 'attachment' == $post->post_type )\n\t\t\treturn true;\n\t}\n\treturn false;\n}", "function _drush_patchfile_is_url($url) {\n return parse_url($url, PHP_URL_SCHEME) !== NULL;\n}", "private function checkExternal( $url ) {\n\t\treturn isset( $url ) ? preg_match( '/(http)s?/', $url ) : false;\n\t}", "function url_exists($url)\n {\n $handle = @fopen($url,'r');\n return ($handle !== false);\n }", "public static function isFile( $url ) {\n\t\treturn !static::isExternal( $url );\n\t}", "function url_exists($url)\n {\n $handle = @fopen($url,'r');\n return ($handle !== false);\n }", "function url_exists($url)\r\n{\r\n //Check if a URL exists\r\n return (!$fp = curl_init($url)) ? false : true;\r\n}", "function isURL() {\n\t\tif ($this->data_array['simtk_filetype'] == \"URL\") {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function url_is_local_attachment($url) {\n\n $upload_dir = wp_get_upload_dir();\n $baseurl = $upload_dir['baseurl'];\n $baseurl_len = strlen($baseurl);\n if (substr($url, 0, $baseurl_len) != $baseurl) {\n return false;\n }\n\n /* Extract only the file path relative to the uploads dir */\n $url = str_replace($baseurl . '/', '', $url);\n\n /* Thanks to https://core.trac.wordpress.org/ticket/41816#comment:7 */\n /* Remove dimensions from URL */\n $url_nonumber = preg_replace('/-\\d+[Xx]\\d+\\./', '.', $url);\n\n /* Look for the attachment */\n $att_id = attachment_url_to_postid($url_nonumber);\n if ($att_id) {\n return $att_id;\n }\n\n /* No attachment can be found, search scaled version */\n $url_nonumber_noscaled = preg_replace('/-\\d+[Xx]\\d+\\./', '-scaled.', $url);\n return attachment_url_to_postid($url_nonumber_noscaled);\n }", "function is_external_url($url)\n{\n $main_url = parse_url( getenv('URL') );\n $url_to_check = parse_url( $url );\n if( $main_url['host'] != $url_to_check['host'] )\n {\n return true;\n }\n\n return false;\n}", "public static function isURL($filename) {\n\t\treturn preg_match('!^(https?|ftp)://!', $filename);\n\t}", "function check_file_exists( $url ) {\r\n\t\t\t$url = str_replace( ' ', '%20', $url );\r\n\t\t\t$ch = curl_init( $url );\r\n\r\n\t\t\tcurl_setopt( $ch, CURLOPT_NOBODY, true );\r\n\t\t\tcurl_exec( $ch );\r\n\t\t\t$return_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\r\n\t\t\tcurl_close( $ch );\r\n\r\n\t\t\treturn $return_code == 200 ? true : false;\r\n\t\t}", "private function hasDownloadID($url)\n\t{\n\t\t$uri = JUri::getInstance($url);\n\t\t$dlid = $uri->getVar('dlid', null);\n\n\t\treturn !empty($dlid);\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load user answers for specified qids
static function getUserAnswersForQids($qids, $uid, $mode = 'num') { if(sizeof($qids) == 0 ) { return array(); } $query = "SELECT a.* FROM #PX#_polls_useranswers a LEFT JOIN #PX#_polls_questions b USING (qid) WHERE a.uid = '{$uid}' AND a.qid IN (".implode(',', $qids).") ORDER BY b.priority ASC"; $result = ( $mode == 'clear' ) ? D::$db->fetchlines_clear($query) : D::$db->fetchlines($query); foreach($result AS &$res) { if(!empty($res['own_answer'])) { $res['own_answer'] = html_entity_decode($res['own_answer']); } } return $result; }
[ "public function loadAnswers()\n\t{\n\t\t$this->answers = Answer::getByQuestionId($this->id);\n\t}", "function getAnswersFromDb($qid)\t{\t\t\r\n\t\t$this->answers=array();\r\n\t\t$where_string = 'qid = '.$qid ;\n\t\tswitch( $this->userIdentity ) {\r\n\t\t case \"userId\" : \r$where_string .= ' AND fe_user_id = '.$this->loginUserId ;\n\t\t\t\t break;\r\n\t\t case \"userIp\" : $where_string .= ' AND fe_user_id = 0 AND fe_user_ip = \"'.$this->userIp.'\"' ; \r\n\t\t\t\t break;\n\t\t case \"cookie\" : $where_string .= ' AND fe_user_id = 0 AND cookie = \"'.$this->cookieValue.'\"' ; \r\n\t\t\t\t break;\n\t\t}\r\n //debug($where_string, \"getAnswersFromDb().wherestring\");\t\t\r\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_questionnaire_answers', $where_string); \r\n\t\tif ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t\t{\r\n\t\t\t$this->answers=$row;\r\n\t\t\t//debug(\"answer got from db\");\r\n\t\t}\r\n\t\telse {\r\n\t\t $this->answers = array();\r\n\t\t $this->answers[\"tstamp\"]= time();\r\n\t\t $this->answers[\"crdate\"] = time();\r\n\t\t $this->answers[\"fe_user_id\"] = $this->userIdentity == \"userId\" ? $this->loginUserId : 0 ;\r\n\t\t $this->answers[\"fe_user_ip\"] = $this->userIp ;\r\n\t\t $this->answers[\"cookie\"] = $this->cookieValue ;\r\n\t\t $this->answers[\"qid\"] = $qid;\r\n\t\t $this->answers[\"content\"] = t3lib_div::array2xml( array(),'',0,'T3QuestionnaireAnswer',0,array(\"useNindex\" => 1, \"useIndexTagForNum\" => \"A\" ));\t\t\r\n \t\t $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_questionnaire_answers', $this->answers );\r\n \t\t //debug(\"new answer created\");\t\t\t\r\n\r\n \t\t }\r\n\t}", "function loadQuestionsFromDb() \n\t{\n\t\tglobal $ilDB;\n\t\t$this->questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s ORDER BY sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t{\n\t\t\t$this->questions[$data[\"sequence\"]] = $data[\"question_fi\"];\n\t\t}\n\t}", "private function get_answers($question_id){\n\n\t\t$query=$this->conn->query(\"SELECT * FROM Answers WHERE question_id = '\".$question_id.\"'\");\n\t\twhile ($row=$query->fetch_array(MYSQLI_ASSOC)){\n\n\t\t\t//add fetched rows to ques array\n\t\t\t$this->answers[]=$row;\n\t}\n\n\t}", "function load_podcast_questions() {\n\t\tglobal $I2_SQL;\n\n\t\t$qs = $I2_SQL->query('SELECT qid FROM podcast_questions WHERE '.\n\t\t\t'pid=%d',$this->pid)->fetch_all_single_values();\n\t\tforeach ($qs as $q) {\n\t\t\t$this->qs[$q] = new PodcastQuestion($this->pid, $q);\n\t\t}\n\t }", "public function populate_answered_questions()\n\t{\n\t\t$user_data=$_SESSION['user_data'];\n\t\t$u_id=$user_data['u_id'];\n\t\t$from=$this->input->get('from');\n\t\t$model=$this->getQuestionModel();\n\t\t$result=$model->get_questions_answered($u_id,$from);\n\t\t$set=$result['set'];\n\t\t//$html_string='';\n\t\tfor($i=1; $i<=$result['no']; $i++)\n\t\t{\n\t\t\t$data=$set[$i];\n\t\t\t$this->load->view('Question_view',$data);\n\t\t}\n\n\t}", "function load()\r\n {\r\n $query = <<<SQL\r\nSELECT\r\n *\r\nFROM\r\n response\r\nWHERE\r\n response_id = $this->response_id AND\r\n question_id = $this->question_id\r\nORDER BY\r\n id DESC\r\nSQL;\r\n\r\n $result = $this->DB->execute($query,'retrieving response question info');\r\n if(!$result)\r\n {\r\n $this->response_id = FALSE;\r\n $this->error = 'Unable to load a response question due to a database error: \"'.$this->DB->getError().'\"';\r\n }\r\n else\r\n {\r\n if($this->DB->numRows($result) == 1)\r\n {\r\n\t$answer = $this->DB->getData($result);\r\n\r\n\tif($answer['answer_id'] == 0)\r\n\t{\r\n\t $this->response_question_id = $answer['id'];\r\n\t $this->answers = FALSE;\r\n\t}\r\n\telse if($answer['answer_id'] == -1)\r\n\t{\r\n\t $answer_text = $this->_getAnswerText($answer['id']);\r\n\t $this->response_question_id = $answer['id'];\r\n\t if($answer_text === FALSE)\r\n\t $this->answers = $this->error;\r\n\t else\r\n\t $this->answers = $answer_text;\r\n\t}\r\n\telse if($this->type == 'single')\r\n\t{\r\n\t $this->answers = $answer['answer_id'];\r\n\t $this->answer_id = $answer['answer_id'];\r\n\t $this->response_question_id = $answer['id'];\r\n\t}\r\n\telse if($this->type == 'multiple')\r\n\t{\r\n\t $this->answers[$answer['answer_id']] = $answer['answer_id'];\r\n\t $this->response_question_id = $answer['id'];\r\n\t}\r\n }\r\n else\r\n {\r\n\twhile($row = $this->DB->getData($result))\r\n\t{\r\n\t $this->answers[$row['answer_id']] = $row['answer_id'];\r\n\t $this->response_question_id = $row['id'];\r\n\t}\r\n }\r\n }\r\n }", "function magtest_get_useranswers($magtestid, $forusers = null) {\n global $DB;\n\n if (is_array($forusers)) {\n $userlist = implode(\"','\", array_keys($forusers));\n } else if (is_string($forusers)) {\n // Admits a single user or a comma separated list.\n $userlist = str_replace(',', \"','\", $forusers);\n }\n\n // @TODO : use more portable IN sql version.\n $userclause = (!empty($forusers)) ? \" AND userid IN ('$userlist') \" : '';\n $select = \" magtestid = ? {$userclause} \";\n if ($useranswers = $DB->get_records_select('magtest_useranswer', $select, array($magtestid), 'questionid')) {\n return $useranswers;\n }\n return array();\n}", "public function findAnsweredQuestions($user_id)\n {\n $sql = \"SELECT answer.*, question.title\n FROM answer\n INNER JOIN question ON answer.question_id = question.id\n WHERE answer.user_id = ?\n GROUP BY question_id\";\n $params = [$user_id] ;\n \n return $this->db->executeFetchAll($sql, $params);\n }", "function quiz_report_load_questions($quiz){\n global $CFG;\n $questionlist = quiz_questions_in_quiz($quiz->questions);\n //In fact in most cases the id IN $questionlist below is redundant\n //since we are also doing a JOIN on the qqi table. But will leave it in\n //since this double check will probably do no harm.\n if (!$questions = get_records_sql(\"SELECT q.*, qqi.grade \" .\n \"FROM {$CFG->prefix}question q, \" .\n \"{$CFG->prefix}quiz_question_instances qqi \" .\n \"WHERE q.id IN ($questionlist) AND \" .\n \"qqi.question = q.id AND \" .\n \"qqi.quiz =\".$quiz->id)) {\n print_error('No questions found');\n }\n //Now we have an array of questions from a quiz we work out there question nos and remove\n //questions with zero length ie. description questions etc.\n //also put questions in order.\n $number = 1;\n $realquestions = array();\n $questionids = explode(',', $questionlist);\n foreach ($questionids as $id) {\n if ($questions[$id]->length) {\n // Ignore questions of zero length\n $realquestions[$id] = $questions[$id];\n $realquestions[$id]->number = $number;\n $number += $questions[$id]->length;\n }\n }\n return $realquestions;\n}", "public static function multiple_choice_load_question_data( $question_data, $question_id, $quiz_id ){\n\n if( 'multiple-choice' == Sensei()->question->get_question_type( $question_id ) ) {\n\n\n $answer_type = 'radio';\n if ( is_array( $question_data[ 'question_right_answer' ] ) && ( 1 < count( $question_data[ 'question_right_answer' ] ) ) ) {\n\n $answer_type = 'checkbox';\n\n }\n\n // Merge right and wrong answers\n if ( is_array( $question_data[ 'question_right_answer' ] ) ) {\n\n $merged_options = array_merge( $question_data[ 'question_wrong_answers' ], $question_data[ 'question_right_answer' ] );\n\n } else {\n\n array_push( $question_data[ 'question_wrong_answers' ], $question_data[ 'question_right_answer' ] );\n $merged_options = $question_data[ 'question_wrong_answers' ];\n\n }\n\n // Setup answer options array.\n $question_answers_options = array();\n $count = 0;\n\n foreach( $merged_options as $answer ) {\n\n $count++;\n $question_option = array();\n\n if( ( $question_data[ 'lesson_completed' ] && $question_data[ 'user_quiz_grade' ] != '' )\n || ( $question_data[ 'lesson_completed' ] && ! $question_data[ 'reset_quiz_allowed' ] && $question_data[ 'user_quiz_grade' ] != '' )\n || ( 'auto' == $question_data[ 'quiz_grade_type' ] && ! $question_data[ 'reset_quiz_allowed' ] && ! empty( $question_data[ 'user_quiz_grade' ] ) ) ) {\n\n $user_correct = false;\n\n\n // For zero grade mark as 'correct' but add no classes\n if ( 0 == $question_data[ 'question_grade' ] ) {\n\n $user_correct = true;\n\n } else if( $question_data[ 'user_question_grade' ] > 0 ) {\n\n $user_correct = true;\n\n }\n\n }\n\n // setup the option specific classes\n $answer_class = '';\n if( isset( $user_correct ) && 0 < $question_data[ 'question_grade' ] ) {\n if ( is_array( $question_data['question_right_answer'] ) && in_array($answer, $question_data['question_right_answer']) ) {\n\n $answer_class .= ' right_answer';\n\n } elseif( !is_array($question_data['question_right_answer']) && $question_data['question_right_answer'] == $answer ) {\n\n $answer_class .= ' right_answer';\n\n } elseif( ( is_array( $question_data['user_answer_entry'] ) && in_array($answer, $question_data['user_answer_entry'] ) )\n || ( ! $question_data['user_answer_entry'] && $question_data['user_answer_entry'] == $answer ) ) {\n\n $answer_class = 'user_wrong';\n if( $user_correct ) {\n\n $answer_class = 'user_right';\n\n }\n\n }\n\n }\n\n // determine if the current option must be checked\n $checked = '';\n if ( isset( $question_data['user_answer_entry'] ) && 0 < count( $question_data['user_answer_entry'] ) ) {\n if ( is_array( $question_data['user_answer_entry'] ) && in_array( $answer, $question_data['user_answer_entry'] ) ) {\n\n $checked = 'checked=\"checked\"';\n\n } elseif ( !is_array( $question_data['user_answer_entry'] ) ) {\n\n $checked = checked( $answer, $question_data['user_answer_entry'] , false );\n\n }\n\n } // End If Statement\n\n //Load the answer option data\n $question_option[ 'ID' ] = Sensei()->lesson->get_answer_id( $answer );\n $question_option[ 'answer' ] = $answer;\n $question_option[ 'option_class'] = $answer_class;\n $question_option[ 'checked'] = $checked;\n $question_option[ 'count' ] = $count;\n $question_option[ 'type' ] = $answer_type;\n\n // add the speci fic option to the list of options for this question\n $question_answers_options[$question_option[ 'ID' ]] = $question_option;\n\n } // end for each option\n\n\n // Shuffle the array depending on the settings\n $answer_options_sorted = array();\n $random_order = get_post_meta( $question_data['ID'], '_random_order', true );\n if( $random_order && $random_order == 'yes' ) {\n\n $answer_options_sorted = $question_answers_options;\n shuffle( $answer_options_sorted );\n\n } else {\n\n $answer_order = array();\n $answer_order_string = get_post_meta( $question_data['ID'], '_answer_order', true );\n if( $answer_order_string ) {\n\n $answer_order = array_filter( explode( ',', $answer_order_string ) );\n if( count( $answer_order ) > 0 ) {\n\n foreach( $answer_order as $answer_id ) {\n\n if( isset( $question_answers_options[ $answer_id ] ) ) {\n\n $answer_options_sorted[ $answer_id ] = $question_answers_options[ $answer_id ];\n unset( $question_answers_options[ $answer_id ] );\n\n }\n\n }\n\n if( count( $question_answers_options ) > 0 ) {\n foreach( $question_answers_options as $id => $answer ) {\n\n $answer_options_sorted[ $id ] = $answer;\n\n }\n }\n\n }else{\n\n $answer_options_sorted = $question_answers_options;\n\n }\n\n }else{\n\n $answer_options_sorted = $question_answers_options;\n\n } // end if $answer_order_string\n\n } // end if random order\n\n\n // assemble and setup the data for the templates data array\n $question_data[ 'answer_options' ] = $answer_options_sorted;\n\n }\n\n return $question_data;\n\n }", "public function getUserAnswers($id)\n {\n return $this->db->query('select q.qid,q.question,q.cr_dt,q.up_dt,a.*,u.id,u.Display_Name from forum_questions q, forum_questions_answers qa INNER JOIN users u on u.id=qa.cid, forum_answers a where q.qid=qa.qid and a.ansid=qa.ansid and qa.cid='.$id);\n }", "public function questions(){\n\t\t$this->bind( 'id', $this->segments[0] );\n\t\t$questions = $this->read(\"select a.question_id, b.qtext, b.answer, b.random_choice_order from common.quiz_question a RIGHT JOIN common.question b ON a.question_id = b.id where a.quiz_id = '|id|' order by a.question_id\", 0);\n\n\t\t$qdata = array();\n\t\tforeach($questions as $q){\n\t\t\t$choices = $this->read( \"select * from common.question_choices where question_id = \" . $q[\"question_id\"] . \" order by id\", 0);\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\tif( $q['random_choice_order'] == 1 && ! empty($choices) ){\n\t\t\t\tshuffle($choices);\n\t\t\t}\n\t\t\t*/\n\t\t\t\t\n\t\t\t$qdata[] = array(\"question_id\" => $q[\"question_id\"],\n\t\t\t\t\t\t\t \"question_text\" => $q[\"qtext\"],\n\t\t\t\t\t\t\t \"answer\" => $q[\"answer\"],\n\t\t\t\t\t\t\t \"random_choice_order\" => $q[\"random_choice_order\"],\n\t\t\t\t\t\t\t \"choices\" => $choices);\t\t\t\n\t\t}\n\t\t\n\t\treturn $qdata;\n\t}", "function get_answers_from_exam($qid){\n\t$data = array();\n\t$result = mysql_query(\"SELECT * FROM `mock_exam_answers` WHERE `question_id` = '$qid'\");\n\twhile ($row = mysql_fetch_assoc($result)) {\n\t $data [] = $row;\n\t}\n\treturn $data;\n}", "function loadQuestions()\n {\n $Template = new Template($this->template_id);\n $this->template_name = $Template->name;\n $questionsObj = $Template->questions;\n\n foreach($questionsObj as $Question)\n {\t\t\n $Question->loadPositions();\n $this->questions[$Question->id] = array('text'=>$Question->text,\n\t\t\t\t\t 'type'=>$Question->type,\n\t\t\t\t\t 'qualitative_type'=>$Question->qualitative_type,\n\t\t\t\t\t\t 'opt_out'=>$Question->opt_out,\n\t\t\t\t\t 'position'=>$Question->positions[$this->template_id]);\n if($Question->answers_exist)\n {\n\tforeach($Question->answers as $Answer)\n\t{\n\t $answers[$Answer->id] = $Answer->text;\n\t}\n\t$this->questions[$Question->id]['answers'] = $answers;\n\tunset($answers);\n }\n }\n return TRUE;\n }", "public static function _get_all_answer_by_qid($ref_qid)\n {\n $all_answers = array();\n $connection = _database::get_connection();\n $query = \"SELECT * FROM `_answers` WHERE `_a_qid` = $ref_qid ORDER BY `_a_time` DESC\";\n if ($res = $connection->query($query)) {\n $i=0;\n while ($arr = $res->fetch_array())\n {\n $obj = new _answers();\n $obj->setAid($arr['_aid']);\n $obj->setDescription($arr['_description']);\n $obj->setAUid($arr['_a_uid']);\n $obj->setAQid($arr['_a_qid']);\n $obj->setApt($arr['_apt']);\n $obj->setNotApt($arr['_notapt']);\n $obj->setATime($arr['_a_time']);\n $all_answers[$i]=$obj;\n $i++;\n }\n return $all_answers;\n }\n else {\n return false;\n }\n }", "public function fetchQuestions() {\n $quizzes = Multitenant::getModel('Quiz')::get();\n foreach ($quizzes as $k => $v) {\n // Get the questions for the current quiz.\n $questions = json_decode(\\Helper::apiData(\"https://printful.com/test-quiz.php?action=questions&quizId=\".$v->quiz_id));\n foreach ($questions as $key => $value) {\n // store the quiz questions one by one.\n if (isset($value->id)) {\n $question = Multitenant::getModel('Question')::firstOrNew(['question_id' => $value->id]);\n $question->title = $value->title;\n $question->quiz_id = $v->quiz_id;\n $question->save();\n }\n }\n }\n }", "function load_questions_before_v4($quiz_id){\n global $DB;\n \n // Fetch the quiz slots.\n $quiz_slots = $DB->get_records('quiz_slots', ['quizid' => $quiz_id]);\n // Create an array with all the question ids.\n $question_ids = array_map(\n function ($elem) {\n return $elem->questionid;\n },\n $quiz_slots\n );\n // Get the list of questions for the quiz.\n $questions = $DB->get_records_list('question', 'id', $question_ids);\n\n return $questions;\n}", "public function populate() {\n\t\t$quiz = $this->quizesModel->getRandomQuiz();\n\t\t$this->id = $quiz['id'];\n\t\t$this->description = $quiz['description'];\n\t\t$questions = $this->quizQuestionsModel->getRecordsByKeys(array('quizId'=>$quiz['id']));\n\t\tif(is_array($questions)) {\n\t\t\tshuffle($questions);\n\t\t\tforeach (array_reverse($questions) as $question) {\n\t\t\t\t$answers = $this->quizAnswersModel->getRecordsByKeys(array('questionId'=>$question['id']));\n\t\t\t\tif(is_array($answers)) {\n\t\t\t\t\tshuffle($answers);\n\t\t\t\t\t$quizQuestion = new MowattMedia_Components_QuizQuestion($question['id'], ucwords($question['question']), $answers);\n\t\t\t\t\t$this->available[$question['id']] = $quizQuestion;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->totalQuestions = count($this->available);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hooks Save timezone on authenticated.
public function hookUserAuthenticated(GDO_User $user) { $user->saveVar('user_timezone', $user->getTimezone()); }
[ "public function setTimeZone(){\n Session::set('timezone',Input::get('tz'));\n \n if(Session::get('timezone') === Input::get('tz')){\n return Response::json(array(\n 'status' => true,\n 'timezone' => Session::get('timezone')\n ));\n }\n }", "final protected function syncTimezone():void\n {\n $timezone = $this->user()->getTimezone();\n if(is_string($timezone))\n Base\\Timezone::set($timezone);\n }", "public function setTimezone();", "function user_timezone_set($timezone = 'Australia/Sydney') {\n if (user_exists()) {\n $db = db_connect();\n \t$sql = 'UPDATE users SET timezone=' . db_clean($db, $timezone) . ' WHERE bc_id=' . db_clean($db, user_id());\n \tdb_query($db, $sql);\n \tdb_disconnect($db);\n }\n\n setcookie(\"timezone\", $timezone, time()+60*60*24*14);\n date_default_timezone_set($timezone);\n}", "public function timezoneAction()\n {\n $uid = $this->_getParam('user_id');\n $tForm = new Core_Form_User_SetTimeZone($uid);\n $form = $tForm->getForm();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n $this->_model->setId($uid)->edit($form->getValues());\n $message = 'User\\'s timezone has been changed successfully';\n $this->_helper->FlashMessenger($message);\n $this->_helper->Redirector(\n 'edit', \n 'user', \n 'default', \n array('user_id' => $uid)\n );\n } else {\n $form->populate($_POST);\n $this->view->form = $form;\n }\n\n } else {\n\n $this->view->form = $form;\n }\n \n }", "public function actionSetTimezone()\n {\n $name = Yii::$app->request->post('name');\n Yii::$app->session->set('timezone', $name);\n return null;\n }", "private function setTimeZone() {\n $companySettings = Store::get('company_settings');\n $timezone = $companySettings->time_zone;\n if ($timezone) {\n\n $dt = new \\DateTime('now', new \\DateTimeZone($timezone));\n $abbreviation = $dt->format('T');\n\n config(['app.timezone' => $timezone]);\n view()->share('time_zone', [\n 'name' => $timezone,\n 'abbr' => $abbreviation\n ]);\n\n $offsetToFormat = new \\DateTime('now', new \\DateTimeZone($timezone));\n $timezoneOffset = $offsetToFormat->format('P');\n\n DB::statement(\"SET time_zone = '\".$timezoneOffset.\"'\");\n }\n }", "public static function setTimezone(){\n $tz = Sys::get('config')->timezone;\n if(ThisUser::islogged()){\n $utz = ThisUser::get(\"timezone\");\n if(!empty($utz)){\n $tz = $utz;\n }\n }\n if(!in_array($tz,timezone_identifiers_list()))\n $tz = \"UTC\";\n date_default_timezone_set($tz);\n // Adjust in DB\n //Sys::$Db->setTimezone();\n }", "public function setTimeZone() {\n // TODO: Should the timezone be cached?\n $t_timezone = $this->getUserPreference( 'timezone' );\n if ( empty( $t_timezone ) ) {\n $t_timezone = $this->getConfigString( 'default_timezone' );\n }\n # Attempt to set the current timezone to the user's desired value\n # Note that PHP 5.1 on RHEL/CentOS doesn't support the timezone functions\n # used here so we just skip this action on RHEL/CentOS platforms.\n if ( function_exists( 'timezone_identifiers_list' ) ) {\n if ( !@date_default_timezone_set( $t_timezone ) ) {\n @date_default_timezone_set( 'America/Los_Angeles' );\n }\n }\n }", "public function changeTimezone(){\n\t\t$timezone \t= $this->input->post('timezone');\n\t\t$time \t\t= $this->timezones->getTime($timezone);\n\t\techo $time;\n\t}", "public function setTimezone() {\n\t\t\n\t\t$now \t= new DateTime();\n\t\t$mins \t= $now->getOffset() / 60;\n\t\t$sgn \t= ($mins < 0 ? -1 : 1);\n\t\t$mins \t= abs($mins);\n\t\t$hrs \t= floor($mins / 60);\n\t\t$mins \t-= $hrs * 60;\n\t\t$offset = sprintf('%+d:%02d', $hrs*$sgn, $mins);\n\t\t\n\t\t$this->executeQuery(\"SET time_zone = '$offset';\");\n\t}", "function date_timezone_set (DateTime $object, DateTimeZone $timezone) {}", "public function setTimezone($value);", "public function setTimezone($timezone);", "function phorum_mod_automatic_timezones_addon()\n{\n global $PHORUM;\n if (isset($PHORUM['args']['offset'])) {\n automatic_timezones_set_offset($PHORUM['args']['offset']);\n }\n\n $redir = isset($PHORUM['args']['redir'])\n ? $PHORUM['args']['redir'] : phorum_get_url(PHORUM_INDEX_URL);\n phorum_redirect_by_url($redir);\n}", "private static function setTimeZone() {\n\t date_default_timezone_set('UTC');\n\t}", "public static function getTimezone() {\n\n\t\t// Retorna la constante de zona horaria\n\t\tif (defined('FW_TIMEZONE')) {\n\t\t\treturn FW_TIMEZONE;\n\t\t}\n\n\t\t// Obtiene la zona horaria en la información del usuario en sesión\n\t\tif ((Auth::isLogged()) && (Auth::getCurrentUser()->timezone != null) && in_array(Auth::getCurrentUser()->timezone, DateTimeZone::listIdentifiers())) {\n\t\t\t$tz = Auth::getCurrentUser()->timezone;\n\t\t} else {\n\t\t\t$tz = false;\n\t\t}\n\n\t\t// Verifica si existe la cookie \"fw_tz\" que especifica la zona horaria del cliente\n\t\tif ($tz == false) {\n\t\t\t$tz = Input::cookie('fw_tz', [\n\t\t\t\t'type' => 'string',\n\t\t\t\t'max-length' => 255,\n\t\t\t\t'validate' => function($tz) {\n\t\t\t\t\treturn in_array($tz, DateTimeZone::listIdentifiers());\n\t\t\t\t}\n\t\t\t], false);\n\t\t}\n\n\t\t// Verifica si existe la cookie \"fw_tz_offset\" que especifica la zona horaria del cliente en segundos\n\t\tif ($tz == false) {\n\t\t\t$seconds = Input::cookie('fw_tz_offset', [\n\t\t\t\t'type' => 'int',\n\t\t\t\t'min-range' => -43200,\n\t\t\t\t'max-range' => 43200,\n\t\t\t], false);\n\t\t\tif ($seconds !== false) {\n\n\t\t\t\t// Verifica si se especificó la cookie que determina si se está usando horario de verano\n\t\t\t\t$dst = Input::cookie('fw_tz_offset_dst', [\n\t\t\t\t\t'type' => 'int',\n\t\t\t\t\t'case' => [ 0, 1 ]\n\t\t\t\t], 0);\n\n\t\t\t\t// Define la zona horaria del cliente\n\t\t\t\t$tz = timezone_name_from_abbr(null, $seconds, $dst);\n\t\t\t}\n\t\t}\n\n\t\t// Define la constante de zona horaria\n\t\tif ($tz) {\n\t\t\tdefine('FW_TIMEZONE', $tz);\n\n\t\t// Define la constante de zona horaria basándose en la del Framework como última fuente\n\t\t} else {\n\t\t\tdefine('FW_TIMEZONE', self::getParam('default_timezone'));\n\t\t}\n\n\t\treturn FW_TIMEZONE;\n\t}", "public function preferredTimezone();", "public static function set_timezone(){\n\t\ttry{\n\t\t\tdate_default_timezone_set(Application::config(\"general->application_timezone\"));\n\t\t}catch(Exception $e){\n\t\t\tthrow $e;\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test we can delete record.
public function test_delete_record() { global $CFG; $this->resetAfterTest(); $this->set_test_records(); $manager = new records_manager(); $manager->delete('test1'); $this->assertEquals([ 'test2' => (object) [ 'id' => 'test2', 'name' => '', 'enabled' => true, 'type' => 'test 2', 'trackadmin' => 0, 'cleanurl' => 0, 'settings' => [], ], 'test3' => (object) [ 'id' => 'test3', 'name' => '', 'enabled' => false, 'type' => 'test 3', 'trackadmin' => 0, 'cleanurl' => 0, 'settings' => [], ] ], unserialize($CFG->tool_webanalytics_records)); }
[ "public function testTrainingRecordRecordIDDelete()\n {\n }", "public function delete() {\n\t\tthrow new \\Exception('deleting test records is not implemented');\n\t}", "public function deleteRecordOnValidDummyRecord() {\n\t\t// Creates and directly destroys a dummy record.\n\t\t$uid = $this->subject->createRecord(OELIB_TESTTABLE, array());\n\t\t$this->subject->deleteRecord(OELIB_TESTTABLE, $uid);\n\n\t\t// Checks whether the record really was removed from the database.\n\t\t$this->assertSame(\n\t\t\t0,\n\t\t\t$this->subject->countRecords(OELIB_TESTTABLE, 'uid=' . $uid)\n\t\t);\n\t}", "public function testDeleteItemUsingDELETE()\n {\n }", "public function test_to_see_if_user_can_delete_a_customer()\n {\n\n $this->delete('/customer/1', CustomerTestConstants::CUSTOMER_EXAMPLE);\n\n $this->assertDatabaseMissing('customers', CustomerTestConstants::CUSTOMER_EXAMPLE);\n }", "public function test_delete() {\n $this->get_tournament_inactive();\n $this->assertTrue($this->object->delete());\n $this->assertNull($this->object->id);\n $this->assertNull($this->object->title);\n }", "public function testDelete() {\n $item = new Author();\n $item->name = 'Andrei Cristescu';\n $item->save();\n $this->assertEqual($item->delete(), 1);\n $this->assertEqual($item->delete(), 0);\n }", "public function testCanDeleteABook()\n {\n \t// Given I have an admin and a book\n \t$book = factory(Book::class)->create();\n\n \t// When the admin delete the book\n \t$response = $this->actingAs($this->admin)\n \t\t\t\t\t->call('DELETE', '/admin/books/'.$book->id);\n\n \t// Then it should be trashed\n \t$response->assertSuccessful();\n \t$this->assertDatabaseMissing('books', [\n \t\t'id' => $book->id,\n \t\t'deleted_at' => null,\n \t]);\n }", "public function testDelete4()\n {\n }", "protected function canDelete($record)\n {\n return true;\n }", "abstract public function supportsDeleting();", "public function testDeleteOfferUsingDELETE()\n {\n }", "public function testPrivilegeToDelete(): void\n\t{\n\t\t$this->assertTrue(self::$recordMultiCompany->privilegeToDelete());\n\t}", "public function testPostRecordingsDeletionprotection()\n {\n }", "public function testDeleteBook() {\n $return = $this->bookControllerTest->deletesBook(15);\n $this->assertTrue($return); \n }", "public function testDeleteReader()\n {\n }", "public function testDelete() {\n $simulatedGetVars = Array();\n $simulatedGetVars['id'] = 2;\n $this->object->delete($simulatedGetVars);\n $this->assertEquals(2, $this->object->carcount());\n }", "abstract public function testDelete($id);", "public function testDeleteException() {\n\t\t// try to delete person\n\t\t$this->personDAO->delete(\"DoesNotExist\");\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validar el formato para el nombre de una asignatura.
public static function validarAsignaturaNombre($nombre) { if (!ctype_digit($nombre)) { $expresion = "/^[a-záéíóúñü0-9:,. ]{5,80}$/"; return preg_match($expresion, mb_strtolower($nombre)) ? true : false; } return false; }
[ "private function validateName()\n {\n if (! preg_match('/^([^0-9]+)$/', $this->file_name)) {\n $this->info('The file name must not contain a number.')->error();\n }\n }", "public function validate_name() {\n if (!parent::validate_string_length($this->genrename, 2, 50)) {\n return 'Please insert a valid genre (2-50 characters)';\n }\n }", "function name_validation($name, $field = 'Name', $min_length = 2, $max_length = 50)\r\n\t{\r\n\t\t$name = trim($name);\r\n\t\tif (strlen($name) >= $min_length )\r\n\t\t{\r\n\t\t\tif (strlen($name) <= $max_length )\r\n\t\t\t{\r\n\t\t\t\t/*if(preg_match(\"/^[a-zA-Z][a-zA-Z -]+$/\", $name) === 0)\r\n\t\t\t\t\t//$error = $field.'must contain letters, dashes and spaces only. we don\\'t accept dash at the begining of the '.$field;\r\n\t\t\t\t\t$error = 'moze da sodrzi samo bukvi, -';\r\n\t\t\t\telse $error = null;*/\r\n\t\t\t\t$error = null;\r\n\t\t\t}else $error = 'Може да биде највеќе '.$max_length.' знака.';\r\n\t\t}else \r\n\t\t\t{\r\n\t\t\t\t$error = 'Внеси '.$field;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\treturn $error;\r\n\t\t\r\n\t\t/*\r\n\t\tif we want to impose the Full Name to start with upper case letter we have to use that:\r\n\t\tif(preg_match(\"/^[A-Z][a-zA-Z -]+$/\", $name) === 0)\r\n\t\t*/\r\n\t}", "function validarNombre($nombreruta){\r\n \tif(empty($nombreruta)){\r\n $this->numruta = false;\r\n echo $this->name_error; \r\n }\r\n else{\r\n $this->numruta = true;\r\n }\r\n }", "public function validate_name() {\n return $this->validate_string_length('Nimen', $this->name, 2, 50);\n }", "public function validateName()\n {\n return true; //todo\n }", "protected function company_nameIsValid()\n {\n return preg_match(\"/^[A-Za-zÀ-ÿ0-9 .-]{1,}$/\", $this->company_name);\n }", "public function name_validate($name){\r\n $name_pattern=\"/^[a-zA-Z ]*$/\"; //Not Accept Special character and digit\r\n if(!preg_match($name_pattern, $name)){ //check patteren match\r\n return false;\r\n }\r\n else{\r\n return true;\r\n } \r\n }", "private function __validate_name() {\n if (isset($this->initial_data[\"name\"])) {\n # Ensure the name only contains alphanumeric, underscores, and hyphens\n if (preg_match('/^[\\w-]+$/', $this->initial_data[\"name\"])) {\n # Ensure the name is greater than 1 character and less than equal to 15 characters\n if (strlen($this->initial_data[\"name\"]) >= 1 and strlen($this->initial_data[\"name\"]) <= 15) {\n # Ensure the name is not already in use\n if (!$this->is_queue_name_in_use($this->initial_data[\"name\"], $this->validated_data[\"interface\"])) {\n $this->validated_data[\"name\"] = $this->initial_data[\"name\"];\n } else {\n $this->errors[] = APIResponse\\get(4126);\n }\n } else {\n $this->errors[] = APIResponse\\get(4125);\n }\n } else {\n $this->errors[] = APIResponse\\get(4124);\n }\n } else {\n $this->errors[] = APIResponse\\get(4123);\n }\n }", "static function isValidName()\n {\n }", "function validName($name)\r\n{\r\n // required field -- non-alpha ok since D&D people make weird names sometimes\r\n return isset($name) && $name != \"\";\r\n}", "public function validateName(){\n \n return strlen(trim($this->name)) > 0;\n }", "protected function validateMainProperties(){\r\n\t\tString::validateString($this->_mName, 'Nombre inv&aacute;lido.', 'name');\r\n\t}", "function sanitizeName() {\n $pattern = \"/[0-9`!@#$%^&*()_+\\-=\\[\\]{};':\\\"\\\\|,.<>\\/?~]/\";\n if (!preg_match($pattern, $this->fname) && !preg_match($pattern, $this->lname)) {\n $this->fname = trim($this->fname);\n $this->lname = trim($this->lname);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function is_name_valid($name) {\n\t\t/* Check if the username is between 2 and 30 characters,\n\t\t\tand only contains letters or dashes */\n\t\tif (preg_match(\"#^[a-zA-Z-]{2,30}$#\", $name)) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function validate_name($name) {\r\n return preg_match('/^[A-Za-z]/', $name) === 1;\r\n}", "function validFName($fName){\r\n\treturn false;\r\n}", "function validateUserName($name) {\r\n //if it's NOT valid\r\n if (strlen($name) < 4)\r\n return false;\r\n //if it's valid\r\n else\r\n return true;\r\n }", "function nameValidCheck($name) {\n\t\t\t\tif (preg_match(Parameters::incompatibruMid, $name, $out)) {\n\t\t\t\t\terr(\"Invalid element name.\", 50);\n\t\t\t\t}\n\t\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Function to get a homepage for level
function pmpromh_getHomepageForLevel( $level_id = null ) { if ( empty( $level_id ) && function_exists( 'pmpro_getMembershipLevelForUser' ) ) { global $current_user; $level = pmpro_getMembershipLevelForUser( $current_user->ID ); if ( ! empty( $level ) ) { $level_id = $level->id; } } // look up by level if ( ! empty( $level_id ) ) { $member_homepage_id = get_option( 'pmpro_member_homepage_' . $level_id ); } else { $member_homepage_id = false; } return $member_homepage_id; }
[ "public function homepage()\n {\n $get = array();\n $get['is_home'] = 1;\n $get['single'] = 1;\n $data = $this->get($get);\n return $data;\n }", "function gen_main_home()\n{\n\n if($GLOBALS['RM_REQ']['URI'][2] != \"\") return 0;\n else return include_htm(\"main/index.htm\");\n\n}", "public static function homepage()\n\t{\n\t\tstatic $homepage;\n\n\t\tif (!$homepage)\n\t\t{\n\t\t\t// Get default page's id\n\t\t\tif (!defined('HOME') || !HOME)\n\t\t\t{\n\t\t\t\t$msg = 'No se ha definido una página de inicio (HOME)';\n\t\t\t\tthrow new PublicException($msg);\n\t\t\t}\n\n\t\t\t$home = join(':', explode(':', HOME) + ['', 'main']);\n\n\t\t\tforeach (self::pages() as $item)\n\t\t\t{\n\t\t\t\t$uri = self::uri(end(explode('|', $item['alias'])));\n\t\t\t\t$fqn = \"{$item['model']}:{$item['page']}\";\n\n\t\t\t\t// Look for home's pageid as well, to fall back if needed\n\t\t\t\tif (!strcasecmp($home, $fqn) || !strcasecmp(HOME, $uri))\n\t\t\t\t{\n\t\t\t\t\t// Is the homepage's handler valid (i.e. callable)?\n\t\t\t\t\tif (!is_callable(self::handler($item['id'])))\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg = \"La página de inicio definida no es válida\" .\n\t\t\t\t\t\t \" ({$item['model']}:{$item['page']})\";\n\t\t\t\t\t\tthrow new PublicException($msg);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ($homepage = $item['id']); # Assignment\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we're still here... means we couldn't find it\n\t\t\t$msg = 'No se encontró la página de inicio definida (' . HOME . ')';\n\t\t\tthrow new PublicException($msg);\n\t\t}\n\t}", "function pnGetHomepageURL()\n{\n // check the use of friendly url setup\n $shorturls = pnConfigGetVar('shorturls', false);\n $dirBased = (pnConfigGetVar('shorturlstype') == 0 ? true : false);\n\n if ($shorturls && $dirBased) {\n $result = pnGetBaseURL().pnConfigGetVar('entrypoint', 'index.php');\n } else {\n $result = pnConfigGetVar('entrypoint', 'index.php');\n }\n if (ZLanguage::isRequiredLangParam()) {\n $result .= '?lang='.ZLanguage::getLanguageCode();\n }\n\n return $result;\n}", "function firstLevelUrl() \n\t{\n\t\t$arURL = $this->parseURL();\n\t\tswitch ($arURL[0]) {\n\t\t\tcase '':\n\t\t\t\tinclude($_SERVER['DOCUMENT_ROOT'].'/views/pages/index.php');\n\t\t\t\tbreak;\n\t\t}\n\t}", "function site_home_page($siteObj_or_id, $lang='') {\n if(!$lang) $lang = $_SESSION['lang'];\n $siteObj = any2obj('site', $siteObj_or_id);\n $homePageObj = find_object('site_page', array('site_id' => ($siteObj->parent_site_id ?: $siteObj->id), 'page_type' => PAGE_HOME)); // home page\n return site_find_content($siteObj, $homePageObj, $lang);\n}", "public function getHomePage() {\n\t\treturn BITS_URL.'/'.configs\\Settings::getLandingPage();\n\t}", "public function homepage()\n {\n return $this->model->where('is_home', 1)->first();\n }", "public function getHomepage()\n {\n return $this->homepage;\n }", "public function getHomepage()\n {\n // Look for value only if not already set\n if(!isset($this->homepage)) {\n $us = SemanticScuttle_Service_Factory::get('User');\n $user = $us->getUser($this->id);\n $this->homepage = $user['homepage'];\n }\n return $this->homepage;\n }", "public function getHomepage() : string\n {\n return $this->__get(\"homepage\");\n }", "public function showHomePage()\n\t{\n\t\t# call the API\n\t\tif($accessKey = getAccessKey()) {\n\t\t\t$headers = ['accessKey' => $accessKey];\n\t\t}\n\t\telse {\n\t\t\t$headers = [];\n\t\t}\n\n\t\t$response = App::make(\"ApiClient\")->get(\"home\", [], $headers);\n\n\t\t# if we got some data back successfully then do something with it\n\t\tif($response['success'])\n\t\t{\n\t\t\t# short cut the data response\n\t\t\t$data = $response['success']['data'];\n\n\t\t\t# if we don't have the nav stored in the session then store it\n\t\t\tif (! Session::has('nav') ) {\n\t\t\t Session::put('nav', $data['channels']);\n\t\t\t}\n\n\t\t\t# set the browser page title\n\t\t\t$data['pageTitle'] = \"Bristol news, what's on, food and drink, lifestyle\";\n\n\t\t\t# set the pages meta description value\n\t\t\t$data['metaDescription'] = \"Bristol news, comprehensive what's on listings, reviews and special offers online, on mobile, in print - check out our FREE app and monthly magazine\";\n\n\t\t\t# make the view\n\t\t\treturn View::make('home.index', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// do something here!!!\n\t\t}\n\t}", "function ht_dms_home() {\n\t$home = home_url();\n\n\t/**\n\t * Customize the main HT DMS page\n\t *\n\t * @param string $home. URL\n\t *\n\t * @since 0.0.2\n\t */\n\treturn apply_filters( 'ht_dms_home_url', $home );\n\n}", "public function get_homepage() {\n\t\treturn $this->get_data( 'PluginURI' );\n\t}", "public function findHomepage()\n {\n return $this->remember(function () {\n return $this->repository->findHomepage();\n });\n }", "function inicio_url() {\n\tprint get_home_url();\n}", "public function get_home_page()\n\t{\n\t\t// load the markdown lib\n\t\t$this->load->library('markdown');\n\n\t\t// find the homepage\n\t\t$this->db->where('is_home', 1)\n\t\t\t\t\t->where('status', 'active')\n\t\t\t\t\t->limit(1);\n\t\t\n\t\t$query = $this->db->get($this->_table['pages']);\n\n\t\t// if we found something...\n\t\tif ($query->num_rows() == 1)\n\t\t{\t\n\t\t\t$result = $query->row_array();\n\n\t\t\t// parse markdown\n\t\t\t$result['content'] = $this->markdown->parse($result['content']);\n\n\t\t\t// return it...\n\t\t\treturn $result;\n\t\t}\n\t\treturn false;\n\t}", "function gengo_home_url($return = false) {\r\n\tglobal $gengo, $wp_rewrite;\r\n\r\n\tif ($wp_rewrite->using_index_permalinks()) $index = $wp_rewrite->index;\r\n\t$url = $gengo->append_link_language(trailingslashit(get_settings('home')) . $index, $gengo->viewable_code_string);\r\n\tif (\"index.php\" == substr($url, -9)) $url = substr($url, 0, -9);\r\n\r\n\tif ($return) return $url;\r\n\telse echo $url;\r\n}", "public function getHomePage() : string {\n return $this->configVars['site']['home-page'];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get type of collection
protected function getCollectionType() { return 'Didww\API2\CDR'; }
[ "public function getCollectionType() : IType;", "abstract public function getCollectionType(): string;", "final public static function type() : CollectionType\n {\n return Type::collectionOf(Type::int(), get_called_class());\n }", "public function collectionClass()\n {\n return $this->_class;\n }", "public function getCollectionObjectClass($collection)\n {\n $collectionArray = $collection;\n //check if collection is array, if not, try to make array out of it.\n if (!is_array($collection) && ! method_exists($collection, 'toArray')) {\n if(! method_exists($collection, 'toArray')) {\n return null;\n }\n else {\n $collectionArray = $collection->toArray();\n }\n }\n\n //Check if first element in the array is an object.\n if(reset($collectionArray) && is_object(reset($collectionArray))) {\n return get_class(reset($collectionArray));\n }\n\n return null;\n }", "protected function getTypesCollection()\n {\n if (null === $this->types) {\n $this->types = new Collection(\n array($this->type),\n $this->docblock ? $this->docblock->getContext() : null\n );\n }\n return $this->types;\n }", "public function type()\n {\n $type = GraphQL::type($this->type);\n\n return $this->collection ? Type::listOf($type) : $type;\n }", "protected function _getCollectionClass()\n\t{\n\t\tif (null == $this->_collectionClass) {\n\t\t\t$this->_collectionClass = Galahad_Model::getClassSibling($this, Galahad_Model::TYPE_COLLECTION);\t\n\t\t}\n\t\t\n\t\treturn $this->_collectionClass;\n\t}", "abstract protected function getCustomCollectionClass();", "protected function getCollectionClassName()\n {\n }", "public function getType() {\n\t\treturn self::$singular_types[$this->type];\n\t}", "public function ctr() {\n return static::$collectionTypeReference;\n }", "public function getModelCollectionClass()\n\t{\n\t\treturn $this->modelCollectionClass;\n\t}", "function collectionType($artwork, $collectionValue = true, $upper = false)\n{\n if (is_object($artwork))\n {\n $type = $artwork->getArtworkType(); \n }\n else\n {\n $type = $artwork;\n }\n \n switch($type)\n {\n case \"image\": //image\n $result = array (__(\"gallery\"), __(\"image\"));\n break;\n case \"audio\": //audio\n $result = array (__(\"playlist\"), __(\"audio\"));\n break;\n case \"text\": //text\n $result = array (__(\"collection\"), __(\"text\"));\n break;\n case \"video\": //video\n $result = array (__(\"playlist\"), __(\"video\"));\n break;\n case \"pdf\": //pdf\n $result = array (__(\"collection\"), __(\"pdf\"));\n break;\n case \"flash_animation\": //Flash animation\n $result = array(__(\"collection\"), __(\"flash animation\"));\n break;\n default:\n return \"\";\n break;\n }\n if ($collectionValue)\n {\n return $upper ? ucfirst($result[0]) : $result[0];\n }\n else\n {\n return $upper ? ucfirst($result[1]) : $result[1];\n }\n}", "public function isCollection();", "protected abstract function describeCollectionType(Description $description);", "public function getType()\n\t{\n\t\treturn $this->hit['_type'];\n\t}", "public function getLiableType() {\n\n\t\tif (! $this->offsetExist ( 0 ))\n\t\t\tthrow new \\Exception ( \"collector is empty\" );\n\t\t\n\t\treturn get_class ( $this->offsetGet ( 0 ) );\n\t\n\t}", "public function getCollectionFormat();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compares current instance to a target.
public function isEqual($target) { return $this->isEnabled() === $target->isEnabled() && $this->getCutOffHour() === $target->getCutOffHour() && $this->getCutOffMinute() === $target->getCutOffMinute(); }
[ "function compare($to)\r\n\t{\r\n\t\tif (get_class($to) != get_class($this)) return false;\r\n\t\t$num = count($this->__objects);\r\n\t\t\r\n\t\tfor($i = 0; $i < $num; ++$i)\r\n\t\t{\r\n\t\t\tif (!$this->__objects[$i]->compare($to->__objects[$i])) return false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function getTargetInstance();", "protected function isSelf(Authenticatable $source, Authenticatable $target)\n {\n return $source->getAuthIdentifier() == $target->getAuthIdentifier();\n }", "public function equals(self $other);", "public static function conflictTarget(&$source, &$target) {\r\n\t\t$comparison = new self($source, $target, self::CONFLICT);\r\n\t\t$comparison->from = &$target;\r\n\t\t$comparison->to = &$source;\r\n\t\t$comparison->direction = 2;\r\n\t\t$comparison->numFiles = 1;\r\n\t\treturn $comparison;\r\n\t}", "protected function isTargetCorrect() {}", "public function satisfies($target, array $parameters, array $operators, ExecutionContext $context): bool;", "public function testPickWinnerPassOnTarget()\n\t{\n\t\t$data = new Blackbox_Data();\n\n\t\t// Forces Blackbox_Target's isValid function to return TRUE\n\t\t$target = $this->getMock('Blackbox_Target', array('isValid'));\n\t\t$target->expects($this->any())\n\t\t\t->method('isValid')\n\t\t\t->will($this->returnValue(TRUE));\n\n\t\t$target_collection = new Blackbox_TargetCollection();\n\t\t$target_collection->addTarget($target);\n\n\t\t$this->blackbox->setRootCollection($target_collection);\n\n\t\t$winner = $this->blackbox->pickWinner($data);\n\t\t$this->assertType('Blackbox_Winner', $winner);\n\t}", "public function isTarget($target)\n\t{\n\t\tif (is_string($target)) {\n\t\t\treturn $target == $this->target;\n\t\t}\n\t\tif (!($target instanceof Atomik_Model_Builder)) {\n\t\t\t$target = Atomik_Model_Builder_Factory::get($target);\n\t\t}\n\t\t\n\t\treturn $target->name == $this->target;\n\t}", "public function matches($other) : bool\n {\n exec(\n $this->command,\n $this->executionResult\n );\n\n $comparatorFactory = ComparatorFactory::getInstance();\n\n try {\n $comparator = $comparatorFactory->getComparatorFor(\n $this->executionResult,\n $other\n );\n\n $comparator->assertEquals(\n $this->executionResult,\n $other\n );\n } catch (ComparisonFailure $f) {\n return false;\n }\n\n return true;\n }", "public function equals()\n {\n $this->assertTrue($this->stubRefClass1->equals($this->stubRefClass1));\n $this->assertTrue($this->stubRefClass2->equals($this->stubRefClass2));\n $stubRefClass = new stubReflectionObject(new stubTestWithMethodsAndProperties());\n $this->assertFalse($this->stubRefClass1->equals($stubRefClass));\n $this->assertFalse($stubRefClass->equals($this->stubRefClass1));\n $this->assertFalse($stubRefClass->equals('foo'));\n $this->assertFalse($this->stubRefClass1->equals($this->stubRefClass2));\n $this->assertFalse($this->stubRefClass2->equals($this->stubRefClass1));\n $this->assertFalse($this->stubRefClass2->equals($stubRefClass));\n }", "public function compare(Version $targetVersion)\r\n {\r\n if ($this->_major > $targetVersion->_major) {\r\n return 1;\r\n }\r\n\r\n if ($this->_major == $targetVersion->_major) {\r\n if ($this->_minor == $targetVersion->_minor) {\r\n return 0;\r\n }\r\n\r\n if ($this->_minor > $targetVersion->_minor) {\r\n return 1;\r\n }\r\n }\r\n\r\n return -1;\r\n }", "public function testCompare()\n {\n $card1 = new BlackCard(1);\n $card2 = new BlackCard(2);\n $this->assertTrue($card2->isBigger($card1));\n }", "public function compareTo($value) {\n return $value instanceof self\n ? Objects::compare(([$this->test, $this->elapsed]), [$value->test, $value->elapsed])\n : 1\n ;\n }", "function compare($to)\n\t{\n\t\tforeach($this->fields as $field => $type)\n\t\t{\n\t\t\tif ($this->filter && $this->filter->isExcluded($field)) continue;\n\t\t\tif ($to->$field != $this->$field)\n\t\t\t{\n\t\t\t\ttrace(\"$field '{$this->$field}' != '{$to->$field}'\", 3);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function equal($other){}", "public abstract function synchronize( Tracker $source, Tracker $target );", "public static function ping($source, $target)\n {\n \n }", "public function equals(self $other): bool\n {\n return $this->getCurrency()->equals($other->getCurrency()) && $this->compareTo($other) === 0;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provides an add form for a micro entity of a specific type.
public function add(MicroType $micro_type) { $user = $this->currentUser(); $type = $micro_type->id; $langcode = $this->moduleHandler()->invoke('language', 'get_default_langcode', array('micro', $type)); $micro = Micro::create([ 'uid' => $user->id(), 'name' => $user->getUsername(), 'bundle' => $type, 'type' => $type, // @todo The form code should already handle that, test whether this is // is still needed. 'langcode' => $langcode ? $langcode : \Drupal::languageManager()->getDefaultLanguage()->getId(), ]); $form = $this->entityFormBuilder()->getForm($micro); return $form; }
[ "function field_test_entity_add($fttype) {\n $fttype = str_replace('-', '_', $fttype);\n $entity = (object)array('fttype' => $fttype);\n drupal_set_title(t('Create test_entity @bundle', array('@bundle' => $fttype)), PASS_THROUGH);\n return drupal_get_form('field_test_entity_form', $entity, TRUE);\n}", "public function addAction() {\n\t\t$form = new Admin_Form_BusinessType ();\n\t\t\n\t\t$this->_save ( $form , self::$ADD_MODE );\n\t\t\n\t\t$this->view->form = $form;\n\t\t$this->view->assign ( array (\n\t\t\t\t\"partial\" => \"business-type/partials/add.phtml\"\n\t\t) );\n\t\t$this->render ( \"add-edit\" );\n\t}", "function budgetsys_line_add($type) {\n $line_type = budgetsys_line_item_types($type);\n\n $line_item = entity_create('budgetsys_line', array('type' => $type));\n drupal_set_title(t('Create @name', array('@name' => entity_label('budgetsys_line_type', $line_type))));\n\n $output = drupal_get_form('budgetsys_line_item_form', $line_item);\n\n return $output;\n}", "private function createAddForm() {\n return $this->createFormBuilder\n ->setAction($this->generateUrl('nn_genie_infos_mat_type_add'))\n ->setMethod('POST')\n ->getForm()\n ;\n }", "function mee_asset_type_form($form, &$form_state, $mee_asset_type, $op = 'edit') {\n\n if ($op == 'clone') {\n $mee_asset_type->label .= ' (cloned)';\n $mee_asset_type->type = '';\n }\n\n drupal_add_library('mee', 'mee', FALSE);\n\n $form['label'] = array(\n '#title' => t('Label'),\n '#type' => 'textfield',\n '#default_value' => $mee_asset_type->label,\n '#description' => t('The human-readable name of this mee asset type.'),\n '#required' => TRUE,\n '#size' => 30,\n );\n // Machine-readable type name.\n $form['type'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($mee_asset_type->type) ? $mee_asset_type->type : '',\n '#maxlength' => 32,\n //'#disabled' => $mee_asset_type->isLocked() && $op != 'clone',\n '#machine_name' => array(\n 'exists' => 'mee_asset_get_types',\n 'source' => array('label'),\n ),\n '#description' => t('A unique machine-readable name for this mee asset type. It must only contain lowercase letters, numbers, and underscores.'),\n );\n\n $form['data']['#tree'] = TRUE;\n\n $options = array();\n foreach(fawesome_list() as $icon){\n $options[$icon] = '<i class=\"icon-'.$icon.'\"></i>';\n }\n $form['data']['icon'] = array(\n '#type' => 'radios',\n '#title' => t('Toolbar Icon'),\n '#options' => $options,\n '#required' => TRUE,\n '#default_value' => empty($mee_asset_type->data['icon']) ? array() : $mee_asset_type->data['icon'],\n '#attributes' => array('class'=>array('clearfix')),\n );\n\n $form['data']['tip'] = array(\n '#type' => 'textfield',\n '#title' => t('Tooltip'),\n '#required' => TRUE,\n '#default_value' => empty($mee_asset_type->data['tip']) ? '' : $mee_asset_type->data['tip'],\n );\n\n $form['data']['shortcut'] = array(\n '#type' => 'textfield',\n '#title' => t('Shortcut'),\n '#description' => t('The keyboard shortcut that can be used to access this button. Example: ctrl+b.'),\n '#default_value' => empty($mee_asset_type->data['shortcut']) ? '' : $mee_asset_type->data['shortcut'],\n );\n $instances = mee_get_plugin('instance');\n usort($instances, 'drupal_sort_weight');\n if(!empty($instances)){\n $form['data']['instances'] = array(\n '#tree' => TRUE,\n '#access' => FALSE,\n '#type' => 'fieldset',\n '#title' => t('Instance options'),\n '#description' => t('An asset can have instance settings. These settings allow changes per asset on an individual implementation.') . '<hr /><br />',\n );\n }\n foreach($instances as $instance){\n $handler = _mee_get_handler('instance', $instance['name']);\n $form['data']['instances'][$instance['name']] = array(\n '#type' => 'checkbox',\n '#title' => $instance['title'],\n '#default_value' => empty($mee_asset_type->data['instances'][$instance['name']]) ? 0 : 1,\n '#description' => !empty($instance['description']) ? $instance['description'] : NULL,\n );\n\n $settings_defaults = !empty($mee_asset_type->data['instances'][$instance['name']]) ? $mee_asset_type->data['instances'][$instance['name']] : array();\n $settings_form = array();\n $handler->settings_form($settings_form, $form_state, $settings_defaults);\n if(!empty($settings_form)){\n\n $form['data']['instances'][$instance['name'].'_settings'] = array(\n '#tree' => TRUE,\n '#type' => 'fieldset',\n '#title' => $instance['title'] . ' ' . t('Settings'),\n );\n\n $form['data']['instances'][$instance['name'].'_settings']['#states'] = array(\n 'visible' => array(\n ':input[name=\"data[instances]['.$instance['name'].']\"]' => array('checked' => TRUE),\n ),\n );\n\n $form['data']['instances'][$instance['name'].'_settings'] += $settings_form;\n\n }\n\n $form['data']['instances']['#access'] = TRUE;\n }\n\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save mee asset type'),\n '#weight' => 40,\n );\n\n //Locking not supported yet\n /*if (!$mee_asset_type->isLocked() && $op != 'add') {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete mee_asset type'),\n '#weight' => 45,\n '#limit_validation_errors' => array(),\n '#submit' => array('mee_asset_type_form_submit_delete')\n );\n }*/\n return $form;\n}", "function my_entity_admin_add_page() {\n $items = array();\n foreach (my_entity_types() as $my_entity_type_key => $my_entity_type) {\n $items[] = l(entity_label('my_entity_type', $my_entity_type), 'my_entity/add/' . $my_entity_type_key);\n }\n if (!empty($items)) {\n return array(\n 'list' => array(\n '#theme' => 'item_list',\n '#items' => $items,\n '#title' => t('Select type of My Entity to create.')\n )\n );\n }\n else {\n return t('You need to add My Entity types before create My Entity items. !link', array('!link' => l(t('You can add My Entity types here.'), 'admin/structure/my_entity-types/add', array('query' => array('destination' => 'my_entity/add')))));\n }\n}", "protected abstract function createNewFormType();", "public function addSubForm();", "function bat_type_create_form_wrapper($type) {\n global $user;\n\n // Add the breadcrumb for the form's location.\n bat_type_set_breadcrumb();\n\n $type = bat_type_create(array('type' => $type, 'uid' => $user->uid));\n $type->created = REQUEST_TIME;\n $type->author_name = $user->name;\n $type->status = 1;\n\n return drupal_get_form('bat_type_edit_form', $type);\n}", "function component_entity_type_form($form, &$form_state, $component_entity_type, $op = 'edit') {\n\n if ($op == 'clone') {\n $component_entity_type->label .= ' (cloned)';\n $component_entity_type->type = '';\n }\n\n $form['label'] = array(\n '#title' => t('Label'),\n '#type' => 'textfield',\n '#default_value' => $component_entity_type->label,\n '#description' => t('The human-readable name of this component_entity type.'),\n '#required' => TRUE,\n '#size' => 30,\n );\n // Machine-readable type name.\n $form['type'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($component_entity_type->type) ? $component_entity_type->type : '',\n '#maxlength' => 32,\n '#machine_name' => array(\n 'exists' => 'component_entity_get_types',\n 'source' => array('label'),\n ),\n '#description' => t('A unique machine-readable name for this component_entity type. It must only contain lowercase letters, numbers, and underscores.'),\n );\n\n $form['data']['#tree'] = TRUE;\n\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save component_entity type'),\n '#weight' => 40,\n );\n return $form;\n}", "public function add(Application $app) {\n\t\t$this->typeOperationModel = new TypeOperationModel ( $app );\n\t\t$type_operations = $this->typeOperationModel->getAllTypeOperations ();\n\t\t$prepared_array = array ();\n\t\tforeach ( $type_operations as $key => $value ) {\n\t\t\t$prepared_array [$value ['libelle_operation']] = $value ['id_type'];\n\t\t}\n\t\t\n\t\t$initial_data = array (\n\t\t\t\t'date_effet' => '',\n\t\t\t\t'type' => '',\n\t\t\t\t'montant' => '0',\n\t\t\t\t'id_libelle_operation' => '' \n\t\t);\n\t\t\n\t\t$form = $app ['form.factory']->createBuilder ( FormType::class, $initial_data );\n\t\t\n\t\t$form = $form->add ( 'Date', DateType::class, array (\n\t\t\t\t'widget' => 'single_text',\n\t\t\t\t'input' => 'string',\n\t\t\t\t'required' => true,\n\t\t\t\t'constraints' => array (\n\t\t\t\t\t\tnew Assert\\Date () \n\t\t\t\t) \n\t\t) );\n\t\t$form = $form->add ( 'Type_operation', ChoiceType::class, array (\n\t\t\t\t'required' => true,\n\t\t\t\t'choices' => $prepared_array,\n\t\t\t\t'constraints' => array (\n\t\t\t\t\t\tnew Assert\\Type ( array (\n\t\t\t\t\t\t\t\t'type' => 'numeric' \n\t\t\t\t\t\t) ) \n\t\t\t\t) \n\t\t) );\n\t\t$form = $form->add ( 'montant', MoneyType::class, array (\n\t\t\t\t'required' => true,\n\t\t\t\t'constraints' => array (\n\t\t\t\t\t\tnew Assert\\Type ( array (\n\t\t\t\t\t\t\t\t'type' => 'numeric' \n\t\t\t\t\t\t) ) \n\t\t\t\t) \n\t\t) );\n\t\t$form = $form->add ( 'Nature', TextType::class, array (\n\t\t\t\t'required' => true,\n\t\t\t\t'constraints' => array (\n\t\t\t\t\t\tnew Assert\\NotBlank (),\n\t\t\t\t\t\tnew Assert\\Length ( array (\n\t\t\t\t\t\t\t\t'min' => 3 \n\t\t\t\t\t\t) ) \n\t\t\t\t) \n\t\t) );\n\t\t\n\t\t$form = $form->getForm ();\n\t\treturn $app ['twig']->render ( 'operation/index.twig', array (\n\t\t\t\t'form' => $form->createView () \n\t\t) );\n\t}", "function message_type_form($form, &$form_state, $message_type, $op = 'edit') {\n if ($op == 'clone') {\n $message_type->description .= ' (cloned)';\n // Save the original message type into form state so that the submit\n // handler can clone its field instances.\n $form_state['original_message_type'] = menu_get_object('entity_object', 4);\n }\n\n $form['description'] = array(\n '#title' => t('Description'),\n '#type' => 'textfield',\n '#default_value' => $message_type->description,\n '#description' => t('The human-readable description of this message type.'),\n '#required' => TRUE,\n '#weight' => -5,\n );\n // Machine-readable type name.\n $form['name'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($message_type->name) ? $message_type->name : '',\n '#disabled' => $message_type->hasStatus(ENTITY_IN_CODE),\n '#machine_name' => array(\n 'exists' => 'message_type_load',\n 'source' => array('description'),\n ),\n '#description' => t('A unique machine-readable name for this message type. It must only contain lowercase letters, numbers, and underscores.'),\n '#weight' => -5,\n );\n\n // We might have gotten the message type category via ajax, so set it in the\n // message type entity.\n if (!empty($form_state['values']['message_type_category'])) {\n $message_type->category = $form_state['values']['message_type_category'];\n }\n\n if ($op == 'add') {\n // Get all the message type category, and allow user to choose one using ajax.\n $options = array();\n $options['message_type'] = t('Default message type category');\n foreach (message_type_category_load() as $message_category) {\n $options[$message_category->category] = !empty($message_category->description) ? $message_category->description : $message_type->category;\n }\n\n $form['message_type_category'] = array(\n '#title' => t('Message type category'),\n '#type' => count($options) > 1 ? 'select' : 'value',\n '#options' => $options,\n '#default_value' => $message_type->category,\n '#description' => t('Select the message type category.'),\n '#required' => TRUE,\n '#ajax' => array(\n 'callback' => 'message_type_fields_ajax_callback',\n 'wrapper' => 'message-type-wrapper',\n ),\n );\n }\n else {\n if ($message_category = message_type_category_load($message_type->category)) {\n $value = !empty($message_category->description) ? check_plain($message_category->description) : check_plain($message_type->category);\n }\n else {\n $value = t('Default message type category');\n }\n $form['message_type_category'] = array(\n '#title' => t('Message type category'),\n '#type' => count(message_type_category_load()) > 1 ? 'item' : 'value',\n '#markup' => $value,\n );\n }\n\n $form['language'] = array(\n '#title' => t('Field language'),\n '#description' => t('The language code that will be saved with the field values. This is used to allow translation of fields.'),\n );\n\n $field_language = NULL;\n if (module_exists('locale')) {\n $options = array();\n foreach (language_list() as $key => $value) {\n if (!empty($value->enabled)) {\n $options[$key] = $value->name;\n }\n }\n $field_language = !empty($form_state['values']['language']) ? $form_state['values']['language'] : language_default()->language;\n $form['language'] += array(\n '#type' => 'select',\n '#options' => $options,\n '#required' => TRUE,\n '#default_value' => $field_language,\n '#ajax' => array(\n 'callback' => 'message_type_fields_ajax_callback',\n 'wrapper' => 'message-type-wrapper',\n ),\n );\n }\n else {\n $form['language'] += array(\n '#type' => 'item',\n '#markup' => t('Undefined language'),\n );\n }\n\n $form['message_type_fields'] = array(\n '#prefix' => '<div id=\"message-type-wrapper\">',\n '#suffix' => '</div>',\n '#tree' => TRUE,\n '#parents' => array('message_type_fields'),\n );\n field_attach_form('message_type', $message_type, $form['message_type_fields'], $form_state, $field_language);\n\n $token_types = module_exists('entity_token') ? array('message') : array();\n if (!$token_types) {\n $form['entity_token'] = array('#markup' => '<p>' . t('Optional: Enable \"Entity token\" module to use Message and Message-type related tokens.') . '</p>');\n }\n\n if (module_exists('token')) {\n $form['token_tree'] = array(\n '#theme' => 'token_tree',\n '#token_types' => $token_types + array('all'),\n );\n\n }\n else {\n $form['token_tree'] = array(\n '#markup' => '<p>' . t(\"Optional: Install <a href='@token-url'>Token</a> module, to show a the list of available tokens.\", array('@token-url' => 'http://drupal.org/project/token')) . '</p>',\n );\n }\n\n $params = array(\n '@url-rules' => 'http://drupal.org/project/rules',\n '!link' => 'http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/t/7',\n );\n\n $form['argument_keys'] = array(\n '#title' => t('Replacement tokens'),\n '#type' => 'textfield',\n '#default_value' => implode(', ', (array) $message_type->argument_keys),\n '#description' => t('Optional: For <a href=\"@url-rules\">Rules</a> module, in order to set argument using Rules actions, a comma-separated list of replacement tokens, e.g. %title or !url, of which the message text makes use of. Each replacement token has to start with one of the special characters \"@\", \"%\" or \"!\". This character controls the sanitization method used, analogously to the <a href=\"!link\">t()</a> function.', $params),\n );\n\n $form['data'] = array(\n // Placeholder for other module to add their settings, that should be added\n // to the data column.\n '#tree' => TRUE,\n );\n\n\n $form['data']['token options']['clear'] = array(\n '#title' => t('Clear empty tokens'),\n '#type' => 'checkbox',\n '#description' => t('When this option is selected, empty tokens will be removed from display.'),\n '#default_value' => isset($message_type->data['token options']['clear']) ? $message_type->data['token options']['clear'] : FALSE,\n );\n\n $form['data']['purge'] = array(\n '#type' => 'fieldset',\n '#title' => t('Purge settings'),\n );\n\n $form['data']['purge']['override'] = array(\n '#title' => t('Override global settings'),\n '#type' => 'checkbox',\n '#description' => t('Override global purge settings for messages of this type.'),\n '#default_value' => !empty($message_type->data['purge']['override']),\n );\n\n $states = array(\n 'visible' => array(\n ':input[name=\"data[purge][override]\"]' => array('checked' => TRUE),\n ),\n );\n\n $form['data']['purge']['enabled'] = array(\n '#type' => 'checkbox',\n '#title' => t('Purge messages'),\n '#description' => t('When enabled, old messages will be deleted.'),\n '#default_value' => !empty($message_type->data['purge']['enabled']),\n '#states' => $states,\n );\n\n $states = array(\n 'visible' => array(\n ':input[name=\"data[purge][enabled]\"]' => array('checked' => TRUE),\n ),\n );\n\n $form['data']['purge']['quota'] = array(\n '#type' => 'textfield',\n '#title' => t('Messages quota'),\n '#description' => t('Maximal (approximate) amount of messages of this type.'),\n '#default_value' => !empty($message_type->data['purge']['quota']) ? $message_type->data['purge']['quota'] : '',\n '#element_validate' => array('element_validate_integer_positive'),\n '#states' => $states,\n );\n\n $form['data']['purge']['days'] = array(\n '#type' => 'textfield',\n '#title' => t('Purge messages older than'),\n '#description' => t('Maximal message age in days, for messages of this type.'),\n '#default_value' => !empty($message_type->data['purge']['days']) ? $message_type->data['purge']['days'] : '',\n '#element_validate' => array('element_validate_integer_positive'),\n '#states' => $states,\n );\n\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save message type'),\n '#weight' => 40,\n );\n\n if (!$message_type->hasStatus(ENTITY_IN_CODE) && $op != 'add') {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete message type'),\n '#weight' => 45,\n '#limit_validation_errors' => array(),\n '#submit' => array('message_type_form_submit_delete')\n );\n }\n return $form;\n}", "function micro_form_submit_build_micro($form, &$form_state) {\n unset($form_state['submit_handlers']);\n\n form_execute_handlers('submit', $form, $form_state);\n\n $micro = $form_state['micro'];\n entity_form_submit_build_entity('micro', $micro, $form, $form_state);\n\n micro_submit($micro);\n foreach (module_implements('micro_submit') as $module) {\n $function = $module . '_micro_submit';\n $function($micro, $form, $form_state);\n }\n return $micro;\n}", "function message_type_form($form, &$form_state, $message_type, $op = 'edit') {\n if ($op == 'clone') {\n $message_type->label .= ' (cloned)';\n $message_type->name .= '_clone';\n }\n\n $form['description'] = array(\n '#title' => t('Description'),\n '#type' => 'textfield',\n '#default_value' => $message_type->description,\n '#description' => t('The human-readable description of this message type.'),\n '#required' => TRUE,\n );\n // Machine-readable type name.\n $form['name'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($message_type->name) ? $message_type->name : '',\n '#disabled' => entity_has_status('message_type', $message_type, ENTITY_IN_CODE),\n '#machine_name' => array(\n 'exists' => 'message_type_load',\n 'source' => array('description'),\n ),\n '#description' => t('A unique machine-readable name for this message type. It must only contain lowercase letters, numbers, and underscores.'),\n );\n\n field_attach_form('message_type', $message_type, $form, $form_state);\n\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save message type'),\n '#weight' => 40,\n );\n\n if (!entity_has_status('message_type', $message_type, ENTITY_IN_CODE) && $op != 'add') {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete message type'),\n '#weight' => 45,\n '#limit_validation_errors' => array(),\n '#submit' => array('message_type_form_submit_delete')\n );\n }\n return $form;\n}", "function bat_type_add_units_form_wrapper($type, $unit_type) {\n global $user;\n\n // Add the breadcrumb for the form's location.\n bat_type_set_breadcrumb();\n\n $unit_model = bat_unit_create(array('type' => $unit_type, 'uid' => $user->uid));\n $unit_model->type_id = $type->type_id;\n $unit_model->created = REQUEST_TIME;\n $unit_model->author_name = $user->name;\n $unit_model->status = 1;\n\n return drupal_get_form('bat_type_add_units_form', $unit_model);\n}", "public function addMicrocategoria($microcategoria){\n\n }", "function bat_type_add_page() {\n $controller = entity_ui_controller('bat_type');\n return $controller->addPage();\n}", "function mongo_node_bundle_create_form($form, $form_state, $entity_type) {\n $form = array();\n\n $form['label'] = array(\n '#type' => 'textfield',\n '#title' => t('Entity type'),\n '#description' => t('The human readable name of the entity.'),\n );\n\n $form['name'] = array(\n '#type' => 'machine_name',\n '#required' => FALSE,\n '#machine_name' => array(\n 'exists' => '_mongo_node_bundle_exists',\n 'source' => array('label'),\n ),\n );\n\n $form['description'] = array(\n '#type' => 'textarea',\n '#title' => t('Description'),\n '#description' => t('Describe this bundle.'),\n );\n\n $form['entity_type'] = array(\n '#type' => 'value',\n '#value' => $entity_type,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n\n return $form;\n}", "function admin_add() {\r\n\t\t// if the form data is not empty\r\n\t\tif (!empty($this->data)) {\r\n\t\t\t// initialise the Type model\r\n\t\t\t$this->Type->create();\r\n\t\r\n\t\t\t// create the slug\r\n\t\t\t$this->data['Type']['slug'] = $this->slug($this->data['Type']['name']);\r\n\t\r\n\t\t\t// try saving the Type\r\n\t\t\tif ($this->Type->save($this->data)) {\r\n\t\t\t\t// set a flash message\r\n\t\t\t\t$this->Session->setFlash('The Type has been saved', 'flash_good');\r\n\t\t\t\t// redirect\r\n\t\t\t\t$this->redirect(array('action'=>'index'));\r\n\t\t\t} else {\r\n\t\t\t\t// set a flash message\r\n\t\t\t\t$this->Session->setFlash('The Type could not be saved. Please, try again.', 'flash_bad');\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all config.php of the files from the given directory (recursive).
private function allConfigs($directory) { if(!is_dir($directory)) return []; return iterator_to_array(Finder::create()->files()->name('config.php')->in($directory), false); }
[ "protected function getConfigurationFiles()\n\t{\n\t\t$files = [];\n\t\t\n\t\t/** @noinspection PhpUndefinedMethodInspection */\n\t\t$configPath = realpath($this->app->configPath());\n\t\t\n\t\tforeach (Finder::create()->files()->name('*.php')->in($configPath) as $file) {\n\t\t\t$nesting = $this->getConfigurationNesting($file, $configPath);\n\t\t\t\n\t\t\t$files[ $nesting . basename($file->getRealPath(), '.php') ] = $file->getRealPath();\n\t\t}\n\t\t\n\t\treturn $files;\n\t}", "public function loadConfig()\n {\n \t$files = [];\n $configPath = $this->app->configPath();\n $itr = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(\n $configPath, RecursiveDirectoryIterator::SKIP_DOTS\n ));\n\n foreach($itr as $file) {\n if (pathinfo($file, PATHINFO_EXTENSION) == \"php\" && $file->getFileName() != 'app.php') {\n $fileRealPath = $file->getRealPath();\n $directory = $this->getDirectory($file, $configPath);\n $this->app->config->set($directory.basename($fileRealPath, '.php'), include $fileRealPath);\n }\n }\n }", "protected function getConfigurationFiles(): array\n {\n $configPath = $this->rootPath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR;\n\n $files = [];\n foreach (scandir($configPath) as $file) {\n if (fnmatch('*.php', $file)) {\n $files[basename($file, '.php')] = $configPath . $file;\n }\n }\n\n return $files;\n }", "public function getConfigFiles()\n {\n return Finder::create()\n ->files()\n ->in(ASSELY_FRAMEWORK_DIR.'config')\n ->name('*.php');\n }", "public function getConfigFiles()\n {\n $arrConfigs = array();\n $arrFiles = scan(TL_ROOT . '/system/config/');\n\n foreach ($arrFiles as $file) {\n if (substr($file, 0, 4) == 'tiny') {\n $arrConfigs[] = basename($file, '.php');\n }\n }\n return $arrConfigs;\n }", "protected function getBaseConfigurationFiles()\n {\n $config = [];\n\n foreach (Finder::create()->files()->name('*.php')->in(__DIR__.'/../../../../config') as $file) {\n $config[basename($file->getRealPath(), '.php')] = $file->getRealPath();\n }\n\n return collect($config)->sortKeys()->all();\n }", "public function getConfigs()\n {\n $configs = [];\n\n foreach ($this->getConfigFiles() as $file) {\n $name = basename($file->getFilename(), '.php');\n\n $values = require $file->getRealPath();\n\n $configs[$name] = $values;\n }\n\n return $configs;\n }", "public function loadConfigs()\n {\n $filesList = new \\FilesystemIterator($this->basePath, \\FilesystemIterator::SKIP_DOTS);\n foreach ($filesList as $fileInfo):\n if ($fileInfo->isFile()) {\n $this->loadConfig($fileInfo);\n }\n endforeach;\n }", "public function searchConfig($dir) {\n\t\t// for opencart just search where the config.php and index.php from the first level of sub directory\n\t\t$cdir = scandir($dir);\n\t\t$config = array();\n\t\t$hasConfig = false;\n\t\t$hasIndex = true;\n\n\t\tforeach ($cdir as $value) {\n\t\t\t/*if ($subvalue == 'index.php') {\n\t\t\t\t$hasIndex = true;\n\t\t\t\tinclude_once $filename . DIRECTORY_SEPARATOR . $subvalue;\n\t\t\t\t$config['ver'] = VERSION;\n\t\t\t}*/\n\n\t\t\tif ($value == 'config.php') {\n\t\t\t\t$hasConfig = true;\n\t\t\t\tinclude_once ($dir . DIRECTORY_SEPARATOR . $value);\n\n\t\t\t\t$config['DIR_QC'] = DIR_QC;\n\t\t\t\t$config['DB_DRIVER'] = DB_DRIVER;\n\t\t\t\t$config['DB_HOSTNAME'] = DB_HOSTNAME;\n\t\t\t\t$config['DB_USERNAME'] = DB_USERNAME;\n\t\t\t\t$config['DB_DATABASE'] = DB_DATABASE;\n\t\t\t\t$config['DB_PORT'] = DB_PORT;\n\t\t\t\t$config['DB_PREFIX'] = DB_PREFIX;\n\t\t\t\t$config['HTTP_SERVER'] = HTTP_SERVER;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($hasIndex && $hasConfig) {\n\t\t\treturn $config;\n\t\t}\n\n\t\treturn null;\n\t}", "protected function getConfigurationFiles()\n {\n $files = [];\n $path = $this->laravel->configPath();\n $found = Finder::create()->files()->name('*.php')->depth('== 0')->in($path);\n\n foreach ($found as $file) {\n $files[] = basename($file->getRealPath(), '.php');\n }\n\n return $files;\n }", "function get_config_files() {\n include('config.php');\n $cfg_raw = file($nagios_cfg_file);\n\n $comment = \";\";\n $comment2 = \"#\";\n foreach ($cfg_raw as $line) {\n $line = trim($line);\n if (preg_match(\"/^cfg_file/i\",$line)) {\n $file = explode('=',$line,2);\n $file[1] = trim($file[1]);\n $files[] = $file[1];\n //echo \"// including Nagios config file \".$file[1].\", config reference $line\\n\";\n unset($file);\n } elseif (preg_match(\"/^cfg_dir/i\",$line)) {\n $dir = explode('=',$line,2);\n $dir[1] = trim($dir[1]);\n read_recursive_dir($files, $dir[1]);\n }\n }\n //echo \"// end of reading config file $nagios_cfg_file\\n\\n\";\n $file_list = array_unique($files);\n return $file_list;\n}", "protected function loadConfigurations()\n {\n\n $files = feather_dir_files(static::$configPath);\n\n foreach ($files as $file) {\n\n if (is_file(static::$configPath . \"/$file\") && stripos($file, '.php') === strlen($file) - 4) {\n $filename = substr($file, 0, strripos($file, '.php'));\n static::$config[strtolower($filename)] = include static::$configPath . '/' . $file;\n }\n }\n }", "function __loadconfigs()\n {\n if (($_dir = opendir(PATH_CONFIG)) === false)\n {\n echo \"Fatal error - couldn\\'t open config path \" . CONFIG_PATH . \"<br>\";\n exit(1);\n }\n\n while ($_entry = readdir($_dir))\n {\n if (substr($_entry, 0, 1) == \".\")\n continue;\n\n $_ext = substr($_entry, (strlen($_entry) - strlen(CONFIG_EXT)));\n \n if ($_ext !== CONFIG_EXT)\n continue;\n\n include(__buildpath(Array(PATH_CONFIG, $_entry)));\n }\n\n closedir($_dir);\n }", "private function loadConfigurationFiles()\n {\n $finder = new Finder();\n\n $iterator = $finder\n ->files()\n ->name('*.yml')\n ->in(CONFIG_DIR);\n\n $config = array();\n\n foreach ($iterator as $file) {\n $content = file_get_contents($file->getRealPath());\n\n if (!empty($content)) {\n $array = Yaml::parse($content);\n $config[$file->getBasename('.'.$file->getExtension())] = $array;\n }\n }\n\n $this['config'] = $config;\n }", "private function loadConfigurationFromFiles()\n {\n $configDirPath = getcwd().DIRECTORY_SEPARATOR.'config';\n\n foreach (scandir($configDirPath) as $directoryItem) {\n $directoryItemFullPath = $configDirPath.DIRECTORY_SEPARATOR.$directoryItem;\n\n if (is_file($directoryItemFullPath) && pathinfo($directoryItem, PATHINFO_EXTENSION) === 'php') {\n $fileName = pathinfo($directoryItem, PATHINFO_FILENAME);\n\n $this->configurations[$fileName] = require $directoryItemFullPath;\n }\n }\n }", "public function collectConfigFiles()\n {\n $files = [];\n\n // Load config.yaml.dist as latest - this way the fallback config options are defined\n $files[] = $this->pathProvider->getCliToolPath() . '/config.yaml.dist';\n\n $extensionPath = $this->pathProvider->getExtensionPath();\n $files = \\array_merge($files, $this->iterateVendors($extensionPath));\n $files = \\array_merge($files, $this->iterateVendors(__DIR__ . '/Extensions'));\n\n // Load user file first. Its config values cannot be overwritten\n $userConfig = $this->pathProvider->getConfigPath() . '/config.yaml';\n if (\\file_exists($userConfig)) {\n $files[] = $userConfig;\n }\n\n return $files;\n }", "protected function _getAllConfigFiles()\n {\n return array(\n ENGINEBLOCK_FOLDER_APPLICATION . self::CONFIG_FILE_DEFAULT,\n self::CONFIG_FILE_ENVIORNMENT,\n );\n }", "public function collectConfigFiles()\n {\n $files = [];\n\n // Load config.yaml.dist as latest - this way the fallback config options are defined\n $files[] = $this->pathProvider->getCliToolPath() . '/config.yaml.dist';\n\n $extensionPath = $this->pathProvider->getExtensionPath();\n $files = array_merge($files, $this->iterateVendors($extensionPath));\n $files = array_merge($files, $this->iterateVendors(__DIR__ . '/Extensions'));\n\n // Load user file first. Its config values cannot be overwritten\n $userConfig = $this->pathProvider->getConfigPath() . '/config.yaml';\n if (file_exists($userConfig)) {\n $files[] = $userConfig;\n }\n\n return $files;\n }", "private function get_configs()\n {\n if ( isset( $this->resources['plugin_directories'] ) && is_array( $this->resources['plugin_directories'] ) ) {\n foreach ( $this->resources['plugin_directories'] as $path => &$configuration ){\n foreach ( $this->config['definitions'] as $slug => $definition ){\n $config_path = $path . $definition[1] . '/';\n $configuration[ $slug ] = $this->get_files($config_path);\n }\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ajax Handling for Question
public function ajaxQuestionAction(){ $this->ajaxify(); $this->checkProjectAndUser(); $facadeTeam = new \App\Facade\Project\TeamFacade($this->_em); if($this->_request->isPost() || $this->_request->isGet()){ switch ($this->_request->getParam("_method")){ case 'findAll' : $questions = $facadeTeam->findAllProjectRoleWidgetQuestions($this->project_id); $data = array(); // data for sending to the script foreach($questions as $q){ $data[] = $q->toArray(); } $respond = array("respond" => "success", "message" => "Data loaded successfully.", "data" => $data); $this->_response->setBody(json_encode($respond)); break; // create new question case 'create' : try{ $facadeTeam->createProjectWidgetQuestion($this->_member_id,$this->project_id, $this->_request->getParams()); $respond = array("respond" => "success",'message' => "Question was added."); $this->_response->setBody(json_encode($respond)); }catch(Exception $e){ $respond = array("respond" => "error","message" => $e->getMessage()); $this->_response->setBody(json_encode($respond)); } break; case 'update' : try{ $facadeTeam->updateProjectWidgetQuestion($this->_member_id,$this->project_id,$this->_request->getParam('question_id'),$this->_request->getParams()); $respond = array("respond" => "success",'message' => "Question was updated."); $this->_response->setBody(json_encode($respond)); }catch(Exception $e){ $respond = array("respond" => "error","message" => $e->getMessage()); $this->_response->setBody(json_encode($respond)); } break; case 'delete' : try{ $facadeTeam->deleteProjectRoleWidgetQuestion($this->_member_id,$this->project_id,$this->_request->getParam('question_id')); $respond = array("respond" => "success",'message' => "Question was deleleted."); $this->_response->setBody(json_encode($respond)); }catch(Exception $e){ $respond = array("respond" => "error","message" => $e->getMessage()); $this->_response->setBody(json_encode($respond)); } break; } } else { $this->_response->setHttpResponseCode(503); // echo error } }
[ "public function ajaxAddQuestion(){\n\t\t$Quizs__questionManager = new \\Manager\\Quizs__questionManager();\n\t\t$Quizs__questionManager->setTable('quizs__questions');\n\t\t$Quizs__questionManager->insert([\t\t\t\n\t\t\t\"quiz_id\" => (int) $_POST[\"quizId\"],\n\t\t\t\"question_id\" => (int) $_POST[\"questionId\"],\n\t\t\t\"is_active\" => 1,\n\t\t]);\n\t}", "protected function _process_ajax() {}", "public function ajax()\n {\n \t\n \t $answer=$this->input->post('answer');\n \t $qid=$this->input->post('qid');\n \t $title=$this->input->post('title');\n \t$data= array('answer' => $answer, 'qid'=>$qid, 'title'=>$title);\n \t$insert=$this->insert->insertvoting($data);\n \tif($insert)\n {\n return \"Success\";\n }\n }", "public function getSuplementaryQuestions()\n\t{\n\t\t$session = $this->session->userdata('AuthUser');\n\n\t\tif ($this->input->is_ajax_request()) {\n\t\t\t$this->load->model('SuplementaryQuestionsModel');\n\n\t\t\t$input = array_map('trim', $this->input->post());\n\n\t\t\tif (array_key_exists('id', $input)) {\n\t\t\t\tif (is_numeric($input['id'])) {\n\t\t\t\t\t$request = $this->SuplementaryQuestionsModel->getDetail($input['id']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$condition = [];\n\n\t\t\t\tif (!array_key_exists('is_active', $input)) {\n\t\t\t\t\t$input['is_active'] = 1;\n\t\t\t\t}\n\n\t\t\t\tforeach ($input as $key => $val) {\n\t\t\t\t\tif (!empty($val)) {\n\t\t\t\t\t\t$condition[$key] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$request = $this->SuplementaryQuestionsModel->getAll($condition);\n\n\t\t\t}\n\n\t\t\tif ($request['status'] == 'success') {\n\t\t\t\t$this->result = $request;\n\t\t\t}\n\n\t\t\techo json_encode($this->result); exit();\n\t\t}\n\n\t\tredirect($_SERVER['HTTP_REFERER']);\n\t}", "public function askquestion()\r\n {\r\n if (isset($_POST['action']) && $_POST['action'] == 'PostQuestion') {\r\n $handler = ConnectionDatabase();\r\n $title = $_POST['title'];\r\n $message = $_POST['message'];\r\n\r\n // Insert the question into the database\r\n $sqlInsertQuestion = \"INSERT INTO question (title, message, person_id, related_question)\r\n VALUES(:title, :message, :person_id, :related_question)\";\r\n $query = $handler->prepare($sqlInsertQuestion);\r\n $query->bindValue(':title', $title);\r\n $query->bindValue(':message', $message);\r\n $query->bindValue(':person_id', $_SESSION['person_id']);\r\n $query->bindValue(':related_question', 0);\r\n $query->execute();\r\n\r\n $number_of_rows = $query->rowCount();\r\n\r\n // Select the question that was just inserted and assign an ID to the question\r\n // That value will be used to display the question and any provided answer related to it\r\n if ($number_of_rows > 0) {\r\n\r\n $sqlgetId = \"SELECT question_id FROM question WHERE related_question = :related_question\";\r\n $query = $handler->prepare($sqlgetId);\r\n $query->bindValue(':related_question', 0);\r\n $query->execute();\r\n $questionId = $query->fetch(PDO::FETCH_COLUMN, 0);\r\n\r\n $sqlUpdateQuestion = \"UPDATE question\r\n SET related_question = question_id\r\n WHERE person_id = :person_id AND question_id = :question_id\";\r\n\r\n $query = $handler->prepare($sqlUpdateQuestion);\r\n $query->bindValue(':person_id', $_SESSION['person_id']);\r\n $query->bindValue(':question_id', $questionId);\r\n $query->execute();\r\n $number_of_rows2 = $query->rowCount();\r\n if ($number_of_rows2) {\r\n header('location:/MVC/teacher/showAllQuestions');\r\n }\r\n }\r\n }\r\n }", "public function ajax_add_existing_question() {\n\t\t$challengeId = $this->input->post('challenge_id');\n $questionId = $this->input->post('question_id');\n\n\t\t$this->challenge_question_model->update_challenge_question_table($questionId, $challengeId, 0);\n $out = array('success' => true);\n $this->output->set_output(json_encode($out));\n\t}", "public function ajax_fetch() {\n\n $conditions = array();\n if ($this->request->isget() && $this->request->query != null) {\n $data = $this->request->query;\n //for Global AJAX search filter\n if (isset($data['searchTerm']) && ($data['searchTerm'] != '' && $data['searchTerm'] != null )) {\n $where_conditions['Faq.question LIKE'] = \"%\" . $data['searchTerm'] . \"%\";\n $where_conditions['Faq.answer LIKE'] = \"%\" . $data['searchTerm'] . \"%\";\n if (preg_match('/active/i',$data['searchTerm'])) {\n $where_conditions['Faq.status'] = 1;\n }\n if (preg_match('/inactive/i',$data['searchTerm'])) {\n $where_conditions['Faq.status'] = 0;\n }\n $conditions['conditions'] = array(\"OR\" => $where_conditions);\n }\n }\n $config = array('find_configs' => $conditions);\n $faqMasters = $this->Crud->listdata($config, false);\n $this->autoRender = false;\n\n echo $faqMasters;\n exit();\n }", "public function process_question() {\n\t\t$model = new InicioModel();\n\t\tif ($this->request->getMethod() === 'post') {\n\t\t\t\t$data = array(\n\t\t\t\t\t'name' => $this->request->getPost('name'),\n\t\t\t\t\t'phone' => $this->request->getPost('phone'),\n\t\t\t\t\t'email' => $this->request->getPost('email'),\n\t\t\t\t\t'date' => date('Y-m-d h:i:s'),\n\t\t\t\t\t'message' => $this->request->getPost('message'),\n\t\t\t\t);\n\t\t\t$model->process_question($data);\n\n\t\t} else {\n\t\t\treturn $this->_cargaError();\n\t\t}\t\n\t}", "abstract protected function _ajax_action();", "protected function handleAjaxRequest()\n {\n $pagevar = $this->getAjaxAction();\n $ajaxaction = $this->helper->specChars($pagevar);\n\n switch($ajaxaction)\n {\n\n } \n }", "public static function process_enquiry_form_ajax()\n\t{\n\t\t$result = self::process_enquiry_form();\n\t\techo ($result)? 1: 0;\n\t\tdie();\n\t}", "public function fetch_question_post()\n {\n\n $id = $this->post('id');\n\t\t$category = $this->post('category');\n\t\t$id=(int)$id;\n\t\t//query to retrieve the question from the database\n\t\tif($id==1)\n\t\t$query=\"select id, question_text, answer_option1, answer_option2, answer_option3, answer_option4,image_location from q_data where category=\".$category.\" order by id limit \".$id; \n\t\telse\n\t\t$query=\"select id, question_text, answer_option1, answer_option2, answer_option3, answer_option4,image_location from q_data where category=\".$category.\" order by id limit \".($id-1).\", 1\"; \n\t\t//execute the query\n\t\t$db_response = $this->Model->fetch($query);\n\t\tif($id==1)\n\t\t{\n\t\t//get the total number of questions from the database in the first request from UI\n\t\t$count_query=\"select count(*) as number_questions from q_data where category=\".$category; \n\t\t$number_questions = $this->Model->fetch($count_query);\n\t\t}\n\n if ($db_response)\n {\n\t\t\t//set the question data and number of question in the response and send the response back to the client\n\t\t\tif($id==1)\n\t\t\t$response = array('response' => $db_response,'number_questions'=>$number_questions);\n\t\t\telse\n\t\t\t$response = array('response' => $db_response);\n $this->set_response($response, REST_Controller::HTTP_OK); \n }\n else\n {\n\t\t\t//set an error message if no records found\n $this->set_response(['response_status' => FALSE,'message' => 'Record could not be found'], REST_Controller::HTTP_OK); \n }\n }", "public function submitAnswer()\n\t{\n\t\t// Check the AJAX nonce\t\t\t\t\n\t\tcheck_ajax_referer( 'submitQuestion_ajax_nonce', 'security' );\n\t\t\n\n\t\t\n\t\t$userID = $_POST['userID']; \n\t\t$questionID = $_POST['questionID'];\n\t\t$userResponse = $_POST['userResponse'];\n\t\t$saveResponse = $_POST['saveResponse'];\n\t\t$correctFeedback = $_POST['correctFeedback'];\n\t\t$incorrectFeedback = $_POST['incorrectFeedback'];\n\t\t$optionOrder = $_POST['optionOrder'];\n\t\t$qType = $_POST['qType'];\t\t\n\t\t$showAnswer = $_POST['showAnswer'];\t\n\n\t\t\n\t\t\n\t\n\t\t\n\t\n\t\t$saveResponse=true; // Set this to true- we always want to save it\n\t\t/* If the shortcode savedata is passed then save this data */\n\t\tif($saveResponse==true)\n\t\t{\t\n\t\t\t\n\t\t\t$gotItCorrect='';\n\t\t\tif($qType<>\"reflectiveText\")\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$args = array(\n\t\t\t\t\t\"questionID\" \t=> $questionID,\n\t\t\t\t\t\"userResponse\"\t=> $userResponse,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$thisQ_class = 'ek_'.$qType;\t\t\t\t\n\t\t\t\t$gotItCorrect = $thisQ_class::markQuestion($args);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$ek_quiz_actions = new ek_quiz_actions();\t\t\t\n\t\t\t\n\t\t\t$ek_quiz_actions->saveUserResponse($questionID, $userResponse, $gotItCorrect);\n\t\t}\n\t\t\n\t\t// If its text based then convert for JSON\n\t\tif($qType==\"singleResponse\")\n\t\t{\n\t\t\t$userResponse = htmlspecialchars(stripslashes($userResponse) );\n\t\t}\n\n\t\t// If its multi response then convert each array value\n\t\tif($qType==\"multiBlanks\")\n\t\t{\n\t\t\t\n\t\t\t$tempResponseArray = array();\n\t\t\t\n\t\t\tforeach ($userResponse as $KEY => $VALUE)\n\t\t\t{\n\t\t\t\t$tempResponseArray[$KEY] = htmlspecialchars(stripslashes($VALUE) );\n\t\t\t}\n\t\t\t\n\t\t\t$userResponse = $tempResponseArray;\n\t\t}\t\n\t\t\n\t\t$args = array(\n\t\t\n\t\t\t\"questionID\" \t\t\t=> $questionID,\n\t\t\t\"readOnly\"\t\t\t\t=> true,\n\t\t\t\"userResponse\"\t\t\t=> $userResponse,\n\t\t\t\"correctFeedback\"\t\t=> $correctFeedback,\n\t\t\t\"incorrectFeedback\"\t\t=> $incorrectFeedback,\n\t\t\t\"optionOrder\"\t\t\t=> $optionOrder,\n\t\t\t\"showAnswer\"\t\t\t=> $showAnswer,\n\t\n\t\t);\n\t\t\n\n\t\t\n\t\tif($qType==\"reflectiveText\")\n\t\t{\n\t\t\t// Get the Reflection feedback\n\t\t\t$correctFeedback = get_post_meta($questionID, \"correctFeedback\", true);\n\t\t\techo apply_filters('the_content', $correctFeedback);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Draw the question again with the correct answers etc\n\t\t\t$drawClass = 'ek_'.$qType;\t\t\t\n\t\t\t$qString = $drawClass::drawQuestion($args);\t\t\t\n\t\t\techo $qString;\n\t\t}\n\t\t\t\n\t\tdie();\n\t}", "public function getSurveyQuestions(){\n $tmp_question=new Question();\n\n $question_heritage_list=$tmp_question->getQuestionByForm(3);\n $question_heritage=$question_heritage_list[0];\n\n $question_relax_list=$tmp_question->getQuestionByForm(4);\n $question_relax=$question_relax_list[0];\n\n $question_sightseeing_list=$tmp_question->getQuestionByForm(5);\n $question_sightseeing=$question_sightseeing_list[0];\n\n $question_weather_list=$tmp_question->getQuestionByForm(6);\n $question_weather=$question_weather_list[0];\n\n $question_populated_list=$tmp_question->getQuestionByForm(7);\n $question_populated=$question_populated_list[0];\n\n $data=['heritage'=>$question_heritage->text,\n 'relax'=>$question_relax->text,\n 'sightseeing'=>$question_sightseeing->text,\n 'populated'=>$question_populated->text,\n 'weather'=>$question_weather->text\n ];\n echo json_encode($data);\n\n\n }", "public function add_survey_question()\r\n {\r\n if (!has_permission('surveys', '', 'edit')) {\r\n echo json_encode(array(\r\n 'success' => false,\r\n 'message' => _l('access_denied')\r\n ));\r\n die();\r\n }\r\n if ($this->input->is_ajax_request()) {\r\n if ($this->input->post()) {\r\n echo json_encode(array(\r\n 'data' => $this->surveys_model->add_survey_question($this->input->post()),\r\n 'survey_question_only_for_preview' => _l('survey_question_only_for_preview'),\r\n 'survey_question_required' => _l('survey_question_required'),\r\n 'survey_question_string' => _l('question_string')\r\n ));\r\n die();\r\n }\r\n }\r\n }", "public function getAnswer()\n {\n // Checks if it is an ajax request\n if ($_SERVER['REQUEST_METHOD'] != 'POST')\n header(\"Location: \".BASE_URL);\n\n $dbConnection = new MySqlPDODatabase();\n \n $questionnaireDAO = new QuestionnairesDAO($dbConnection);\n\n echo $questionnaireDAO->getAnswer($_POST['id_module'], $_POST['class_order']);\n }", "private function processAjaxRequest() {\r\n//t3lib_div::devlog('processAjaxRequest()', 'newspaper', 0, array('ajaxController' => $this->input['ajaxController']));\r\n\t\t\tswitch($this->input['ajaxController']) {\r\n\t\t\t\tcase 'fixPubDate':\r\n\t\t\t\t\t// update publish date for published articles without publish date\r\n\t\t\t\t\tdie($this->fixPublishDate());\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'fixDefaultTemplateSet':\r\n\t\t\t\t\t// set all template_set fields to \"default\"\r\n\t\t\t\t\tdie($this->fixDefaultTemplateSet());\r\n\t\t\t\tbreak;\r\n case 'depTree':\r\n $this->callDepTree();\r\n break;\r\n\t\t\t}\r\n\t\t}", "abstract protected function run_AJAX();", "function answer_process()\n\t{\n\t if($this->Auth->request_access_check())\n\t {\n $post_arr = array();\n\n\t\t foreach($_POST as $key => $value)\n\t\t {\n\t\t \t\t$post_value = $this->input->post($key,TRUE);\n\t\t \t\t$post_arr[$key] = $post_value ? $post_value : '';\n\t\t }\n\t $code = $this->Check_process->submit_content_check(array('text'=>$post_arr['answer']));\n\t\t if($code == CONTENT_VALID)\n\t\t {\n\t\t\t $uId = $this->session->userdata('uId');\n\t\t\t $time = date(\"Y-m-d H:i:s\", time());\n\t\t\t $send_place = $this->session->userdata('location_city');\n\t\t\t $lang_code = $this->language_translate->check($post_arr['answer']);\n\n\t\t\t $data = array('to_nId'=>$post_arr['question_id'], 'uId'=> $uId, 'ntId'=>ANSWER, 'text'=> $post_arr['answer'], 'langCode'=>$lang_code, 'time'=>$time, 'stId'=> ONLINE, 'sendPlace'=>$send_place);\n\t\t\t $node_id = $this->Content_process->content_insert($data);\n\n\t\t\t echo $node_id.\"#---#\".$this->ajax_generate_answer_view($node_id);\n\t\t\t \n\t\t\t $server_data = array('host'=>'127.0.0.1','port'=>'4040','is_return'=>'');\n\t\t\t $content_data = $data;\n\t\t\t $content_data['nId'] = $node_id;\n\t\t\t $this->Http_process->_send_content_event($server_data, $content_data);\n\n\t\t\t \n\t\t }\n\t\t else\n\t\t {\n\t\t $msg = $this->Check_process->get_prompt_msg(array('pre'=>'common','code'=>$code));\n echo \"##\".$msg.\"##\";\n\t\t }\n }\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is the first row column headers?
public function isFirstRowHeaders() { return true; }
[ "public function isFirstRowHeaders()\n {\n return $this->firstRowIsHeaders;\n }", "function is_header_row() {\n\t\treturn TRUE;\n\t}", "public static function is_one_row_header() {\n\t\t$headers = array( 'header--default', 'header--transparency' );\n\t\tif ( in_array( Habakiri::get( 'header' ), $headers ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function setFirstRowIsHeaders($firstRowIsHeaders = true);", "public function isFirstRowHeaders()\n\t{\n\t\treturn $this->firstRowHeaders;\n\t}", "public function loadColumnHeaders() {\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t// Make sure we include the empty fields\n\t\tfor ($i=1; $i<=$this->data[0]['numCols']; $i++) {\n\t\t\tif (!isset($this->data[0]['cells'][1])) $this->data[0]['cells'][1][$i] = '';\n\t\t}\n\t\t$headers = array_values($this->data[0]['cells'][1]);\n\t\t$jinput->set('columnheaders', $headers);\n\t\t$this->linepointer++;\n\t\treturn true;\n\t}", "public function getFirstHeader(): bool \n\t{\n\t\treturn $this->firstHeader;\n\t}", "protected function shouldHaveHeaderRow()\n {\n return ! (bool) array_get($this->exportInfo->options(), 'no_header_row', false);\n }", "function getFirstColumn() { }", "public function getShowFirstColumn(): bool\n {\n return $this->showFirstColumn;\n }", "public function hasHeadingRow(): bool\n {\n return !empty($this->getHeadingRow());\n }", "public function checkFirstLineContainsHeaderDataProvider()\n {\n return array(\n array(false, \"\"),\n array(false, \"\\n#useFirstLineAsLabels\"),\n array(false, \"#useFirstLineAsLabels\\n\"),\n array(false, \"#useFirstLineAsLabels\\nasdf\\n\"),\n array(false, \"#useFirstLineAsLabels\\nlabel1\\ndata1\"),\n array(true, \"#useFirstLineAsLabels=1&columnDelimiter=,&lineDelimiter=%0A\\n\"),\n );\n }", "public function hasColumnNames()\n {\n return count($this->_columnNames) > 0;\n }", "public function hasHeading()\n {\n if (!$this->noHeading) {\n $config = config('excel.import.heading', true);\n\n return $config !== false && $config !== 'numeric';\n }\n\n return $this->noHeading ? false : true;\n }", "public function hasColumns();", "public function isHeader()\n {\n return false;\n }", "public static function setCsvHeaderColumns()\n {\n self::$file->rewind();\n self::$headerColumns = array_map('strtolower', self::$file->current());\n return true;\n }", "public function isFirst()\n\t{\n\t\treturn $this->getAttribute($this->positionColumn) === $this->topOfList;\n\t}", "public function hasAnyHeader(): bool;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the recipientType property value. The type of recipient of the notification. The possible values are Requestor, Approver, Admin.
public function setRecipientType(?string $value): void { $this->getBackingStore()->set('recipientType', $value); }
[ "public function setRecipientType($value)\n {\n return $this->set('RecipientType', $value);\n }", "public function setRecipientRelationType($recipientRelationType)\n {\n $this->recipientRelationType = $recipientRelationType;\n return $this;\n }", "public function setRecipientScope(?RecipientScopeType $value): void {\n $this->getBackingStore()->set('recipientScope', $value);\n }", "function set_type($type) {\n\n\t\t// Security control\n\t\tif ( $type === EMAIL_REPLY or $type === EMAIL_REPLYALL or $type === EMAIL_FORWARD ) {\n\t\t\t$this->type = $type;\n\t\t}\n\t}", "function SetType($type = \"mail\")\n {\n switch($type)\n {\n case \"smtp\":\n $this->base->IsSMTP();\n break;\n case \"sendmail\":\n $this->base->IsSendmail();\n break;\n case \"qmail\":\n $this->base->IsQmail();\n break;\n case \"mail\":\n default:\n $this->base->IsMail();\n break;\n }\n }", "public function setNotificationType($value)\n {\n $this->_fields['NotificationType']['FieldValue'] = $value;\n return $this;\n }", "public function setRecipient($recipient);", "public function addRecipient($recipient, $type = 'to') {\n\t\t\tif (is_string($recipient)) {\n\t\t\t\t$recipient = new \\Postman\\Library\\Email\\Address\\Recipient($recipient, $type);\n\t\t\t} elseif (!is_a($recipient, '\\Postman\\Library\\Email\\Address\\Recipient')) {\n\t\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t\t'Email::addRecipient expects a string or valid Address object.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Add the recipient (if not already added) and return the object\n\t\t\tif (!in_array($recipient, $this->_recipients)) {\n\t\t\t\t$this->_recipients[] = $recipient;\n\t\t\t}\n\t\t\treturn $recipient;\n\t\t}", "public function setReceiverType($var)\n {\n GPBUtil::checkInt64($var);\n $this->receiverType = $var;\n\n return $this;\n }", "protected function setRecipient( $value ){\n\t\t$this -> recipient = $value;\n\t}", "public function setMessageType(string $type):void\n {\n $this->messageType = $type;\n }", "public function setType($messageType);", "function setMessageType($type)\n\t{\n\t\t$this->add('message_type', $type);\n\t}", "public function setTypeApprover($typeApprover)\n {\n $this->typeApprover = $typeApprover;\n return $this;\n }", "public function setUserType( $userType )\n {\n $this->_daUser->setUserType( $this->getId(), $userType );\n }", "public function setActor($actorType, $actorId);", "function setRecipient($recipient)\n\t{\n\t\t$this->recipient = $recipient;\n\t}", "protected function _flushRecipientType( $sType )\n\t\t{\n\t\t\tif ( in_array( $sType, Array( \"to\", \"cc\", \"bcc\" ) ) )\n\t\t\t\t$this->{\"_{$sType}\"} = Array();\n\t\t}", "public function set_type($type)\n\t{\n\t\t$this->contrib_type = $type;\n\t\t$this->type = $this->types->get($this->contrib_type);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object. Login page URI associated with the GCIP tenants. Typically, all resources within the same project share the same login page, though it could be overridden at the sub resource level. Generated from protobuf field .google.protobuf.StringValue login_page_uri = 2;
public function setLoginPageUriValue($var) { $this->writeWrapperValue("login_page_uri", $var); return $this;}
[ "public function setLoginPageUri($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\StringValue::class);\n $this->login_page_uri = $var;\n\n return $this;\n }", "function _display_option_login_uri() {\r\n\t\t$login_uri = $this->options['login_uri'];\r\n\t\t$this->_display_input_text_field('login_uri', $login_uri);\r\n?>\r\nDefault is <code><?php echo wp_login_url(); ?></code>; override to direct users to a single sign-on system.<br />\r\nThe string <code>%s</code> will be replaced with the appropriate return URI as provided by WordPress.\r\n<?php\r\n\t}", "public function set_login_uri( $login_uri ) {\n if ( !empty( $login_uri ) && is_string( $login_uri ) ) {\n $this->login_uri = $login_uri;\n }\n }", "function setLogin( $value )\r\n {\r\n\r\n $this->Login = $value;\r\n }", "public function getLoginPageUri()\n {\n return $this->login_page_uri;\n }", "function setLogin( $value )\r\n {\r\n $this->Login = $value;\r\n }", "function setLoginType($loginType) {\r\r\n\t\t$this->loginType = $loginType;\r\r\n\t}", "public function setLoginUrl($val)\n {\n $this->_propDict[\"loginUrl\"] = $val;\n return $this;\n }", "public function set_login_url($url)\n {\n $this->login_url = $url;\n }", "function setLoginPageElementType($a_type)\n\t{\n\t\tif (!empty($a_type))\n\t\t{\n\t\t\t$this->res_node->set_attribute('Type',$a_type);\n\t\t}\n\t}", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function getLoginUri()\n {\n return $this->loginUri;\n }", "protected function setLoginUrl()\n {\n $userModule = Yii::$app->getModule('user');\n if ($userModule->enableRememberLoginPage) {\n $cookieName = $userModule->originCookieName;\n if (Yii::$app->getRequest()->cookies[$cookieName]) {\n $origin = Yii::$app->getRequest()->cookies->getValue($cookieName);\n $this->loginUrl = base64_decode($origin);\n }\n }\n }", "public function setServerLoginURL($url)\n {\n // Argument Validation\n if (gettype($url) != 'string')\n throw new CAS_TypeMismatchException($url, '$url', 'string');\n\n return $this->_server['login_url'] = $url;\n }", "public function setStateLoginAttribute($value)\n {\n $this->attributes['state_login'] = $value;\n }", "public function setLogin(string $login): void\n {\n }", "protected function setLoginUrl($loginUrl)\n {\n $this->loginUrl = $loginUrl;\n }", "public function setLogin($sLogin) {\n $this->sLogin = $sLogin;\n }", "public function setLoginType($var)\n {\n GPBUtil::checkEnum($var, \\Pack\\Base\\LoginType::class);\n $this->login_type = $var;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Get user profile data Input data: token=> auth id from login Output data: status => ok all profile fields data
function _exec_function_get_profile_data($data) { $user_id = $data['tokendata']['user_id']; $this->load->model('user_model'); $userData = $this->user_model->get_user_info_by_user_id($user_id); $userData['status'] = 'ok'; $this->_show_output($userData); }
[ "public function getProfileDetails()\n {\n // check if the respective cookies exist or not\n if (check_jwt_cookie($this->auth[\"service_name\"], $this->auth[\"cookie_name\"])) {\n // check if the user_id is provided\n if (empty($_POST['user_id'])) {\n json_output(BAD_DATA, array(\n \"code\" => BAD_DATA,\n \"message\" => \"user_id missing from input params\"\n ));\n return;\n }\n $user_id = $_POST['user_id'];\n $user_details = $this->UserModel->getUserDetails($user_id);\n if (isset($user_details)) {\n json_output(SUCCESS, array(\n \"code\" => SUCCESS,\n \"message\" => \"User profile details fetched\",\n \"data\" => [\n \"user_id\" => $user_details->id,\n \"email\" => $user_details->email,\n \"first_name\" => $user_details->firstname,\n \"last_name\" => $user_details->lastname,\n \"phone_number\" => $user_details->phonenumber,\n \"gender\" => $user_details->gender,\n ]));\n return;\n }\n } else {\n json_output(UNAUTHORIZED, array(\n \"code\" => UNAUTHORIZED,\n \"message\" => \"Invalid cookies\"\n ));\n }\n return;\n }", "private function getProfile()\n {\n if ($this->http->headers->has('JWT_TOKEN')) {\n $this->options['headers'] = [\n 'Content-type' => 'application/json',\n 'Authorization' => $this->http->headers->get('JWT_TOKEN')\n ];\n\n $get_profile = $this->client->request('GET', '/employee/my-profile', $this->options);\n if ($get_profile->getStatusCode() === 200) {\n $get_profile = \\GuzzleHttp\\json_decode($get_profile->getBody());\n $this->output($get_profile);\n }\n }\n $this->output([\n 'status' => false\n ]);\n }", "public function loginradius_get_data(){\n\t$this->IsAuthenticated = false;\n\t$ValidateUrl = \"https://hub.loginradius.com/userprofile.ashx?token=\".$this->LRToken.\"&apisecrete=\".$this->LRSecret.\"\";\n\t$JsonResponse = $this->loginradius_call_api($ValidateUrl);\n\t$UserProfile = json_decode($JsonResponse);\n\tif(isset($UserProfile->ID) && $UserProfile->ID != ''){\n\t\t$this->IsAuthenticated = true;\n\t\treturn $UserProfile;\n\t}\n}", "function getUserProfile()\n {\n $this->api->curl_header = array(\n 'Authorization: Bearer '.$this->api->access_token,\n );\n $data = $this->api->get( $this->userProfileUrl );\n $data = VariableUtil::json2Array($data);\n\n /*\n * Get the base URL with the instance to store it along with the\n * Token data.\n */\n $urlParts = parse_url($data['profile']);\n $this->api->api_base_url = $urlParts['scheme'].'://'.$urlParts['host'];\n\n return $data;\n }", "public function getUserProfile();", "function getUserProfile()\r\n\t{\r\n\t\tHybrid_Logger::info( \"Enter [{$this->providerId}]::getUserProfile()\" );\r\n\r\n\t\tif ( ! Hybrid_Auth::hasSession() )\r\n\t\t{\r\n\t\t\tthrow new Exception( \"HybridAuth can't access user profile data. The current user have to sign in with [{$this->providerId}] before any request!\" );\r\n\t\t}\r\n\r\n\t\t$access_token = Hybrid_Auth::storage()->get( \"hauth_session.live.access_token\" ); \r\n\t\t$info_url = 'http://apis.live.net/V4.1/cid-'. $this->user->providerUID .'/Profiles/1-' . $this->user->providerUID ;\r\n\t\t\r\n\t\t$response = $this->api->GET($info_url, false, $access_token );\r\n\t\t$response = @ json_decode( $response );\r\n\r\n\t\tHybrid_Logger::debug( \"[{$this->providerId}]::getUserProfile(), received response\", $response );\r\n\r\n\t\tif ( ! is_object( $response ) )\r\n\t\t{\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! {$this->providerId} returned an invalid response.\" );\r\n\t\t}\r\n\r\n\t\t$this->user->profile->firstName = @ (string) $response->FirstName; \r\n\t\t$this->user->profile->lastName = @ (string) $response->LastName; \r\n\t\t$this->user->profile->profileURL = @ (string) $response->UxLink; \r\n\t\t$this->user->profile->gender = @ (string) $response->Gender; \r\n\t\t$this->user->profile->email = @ (string) $response->Emails[0]->Address; \r\n\r\n\t\t$this->user->profile->displayName = $this->user->profile->firstName . \" \" . $this->user->profile->lastName; \r\n\r\n\t\tif( $this->user->profile->gender == 1 ){\r\n\t\t\t$this->user->profile->gender = \"female\";\r\n\t\t}\r\n\t\telseif( $this->user->profile->gender == 2 ){\r\n\t\t\t$this->user->profile->gender = \"male\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->user->profile->gender = \"\";\r\n\t\t}\r\n\r\n\t\tHybrid_Logger::info( \"[{$this->providerId}]::loginFinish(), set user data\", $this->user );\r\n\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", $this->user ); \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 getAuthUserProfile();", "function getUserProfile()\r\n\t{\r\n\t\tHybrid_Logger::info( \"Enter [{$this->providerId}]::getUserProfile()\" );\r\n\r\n\t\tif ( ! Hybrid_Auth::hasSession() )\r\n\t\t{\r\n\t\t\tthrow new Exception( \"HybridAuth can't access user profile data. The current user have to sign in with [{$this->providerId}] before any request!\" );\r\n\t\t}\r\n\r\n\t\t// add / remove watever u want\r\n\t\t// http://developer.linkedin.com/docs/DOC-1061\r\n\t\t$response = $this->api->profile('~:(id,first-name,last-name,public-profile-url,picture-url,date-of-birth,phone-numbers,summary)');\r\n\r\n\t\tif( isset( $response['success'] ) && $response['success'] === TRUE ) \r\n\t\t{\r\n\t\t\t$data = new SimpleXMLElement($response['linkedin']); \r\n\r\n\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), Get user data\", $data );\r\n\r\n\t\t\tif ( ! is_object( $data ) )\r\n\t\t\t{\r\n\t\t\t\tHybrid_Logger::info( \"[{$this->providerId}]::getUserProfile(), reSet user to deconnected\" );\r\n\t\t\t\tHybrid_Auth::storage()->set( \"hauth_session.is_logged_in\", 0 );\r\n\t\t\t\tHybrid_Auth::storage()->set( \"hauth_session.user.data\", NULL );\r\n\r\n\t\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalide xml data.\" );\r\n\t\t\t} \r\n\r\n\t\t\t$this->user->providerUID \t= @ (string) $data->{'id'};\r\n\t\t\t$this->user->profile->firstName \t= @ (string) $data->{'first-name'};\r\n\t\t\t$this->user->profile->lastName \t= @ (string) $data->{'last-name'}; \r\n\t\t\t$this->user->profile->displayName \t= @ $this->user->profile->firstName . \" \" . $this->user->profile->lastName;\r\n\r\n\t\t\t$this->user->profile->photoURL \t= @ (string) $data->{'picture-url'}; \r\n\t\t\t$this->user->profile->profileURL = @ (string) $data->{'public-profile-url'}; \r\n\t\t\t$this->user->profile->description = @ (string) $data->{'summary'}; \r\n\r\n\t\t\t$this->user->profile->phone = @ (string) $data->{'phone-numbers'}->{'phone-number'}->{'phone-number'}; \r\n\r\n\t\t\tif( $data->{'date-of-birth'} ) { \r\n\t\t\t\t$this->user->profile->birthDay = @ (string) $data->{'date-of-birth'}->day; \r\n\t\t\t\t$this->user->profile->birthMonth = @ (string) $data->{'date-of-birth'}->month; \r\n\t\t\t\t$this->user->profile->birthYear = @ (string) $data->{'date-of-birth'}->year; \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\t\t} \r\n\t\telse {\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! {$this->providerId} returned an invalide response.\" );\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 getProfile();", "function getUserProfile(){\n\t\t$data = $this->api->get(\"athlete\"); \n\t\t\n\t\tif ( ! isset( $data->id ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalid response.\", 6 );\n\t\t}\n\n\t\t$this->user->profile->identifier = $data->id; \n\t\t$this->user->profile->username = $data->username; \n\t\t$this->user->profile->displayName = $data->firstname.' '.$data->lastname;\n\t\t$this->user->profile->photoURL = $data->profile_medium;\n\t\t$this->user->profile->profileURL = 'https://www.strava.com/athletes/'.$data->id; \n\t\t$this->user->profile->email = $data->email;\n\t\t$this->user->profile->emailVerified = $data->email;\n\t\t$this->user->profile->gender = $data->sex;\n $this->user->profile->city = array_key_exists('city', $data)?$data->city:'';\n $this->user->profile->state = array_key_exists('state', $data)?$data->state:'';\n $this->user->profile->country = array_key_exists('country', $data)?$data->country:'';\n\n return $this->user->profile;\n\t}", "public function getUserProfile()\n {\n $this->resetParams();\n return $this->sendRequest(\"users/profile\",\"GET\");\n }", "function user_profile_post()\n\t{\n\t\t$response = array('status' => false, 'message' => '', 'response' => array());\n\t\t$user_input = $this->client_request;\n\t\textract($user_input);\n \n if(!$user_id)\n\t\t{\n\t\t\t$response = array('status' => false, 'message' => 'Enter user id!', 'response' => array());\n\t\t\tTrackResponse($user_input, $response);\t\t\n\t\t\t$this->response($response);\n\t\t}\n\n\t\t$user_details = user_by_id($user_id);\n\t\t//print_r($user_details);exit;\n\t//echo $this->db->last_query();exit;\n\t\tif(empty($user_details))\n\t\t{\n\t\t\t$response = array('status' => false, 'message' => 'No Data Found!', 'response' => array());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = array('status' => true, 'message' => 'Data Fetched Successfully!', 'response' => $user_details);\n\t\t}\n\n\t\tTrackResponse($user_input, $response);\t\t\n\t\t$this->response($response);\n\t}", "public function getManageAccountData()\n {\n if (Auth::user()) {\n $json = array();\n $user_id = Auth::user()->id;\n $user_meta = User::find($user_id)->profile->first();\n if (!empty($user_meta)) {\n $json['type'] = 'success';\n if ($user_meta->profile_searchable == 'true') {\n $json['profile_searchable'] = 'true';\n }\n if ($user_meta->profile_blocked == 'true') {\n $json['profile_blocked'] = 'true';\n }\n return $json;\n } else {\n $json['type'] = 'error';\n $json['message'] = trans('lang.something_wrong');\n return $json;\n }\n }\n }", "function loadProfile() {\n $response = $this->client->get(\n sprintf(\"http://%s/v1/user/%s/profile\",\n SOCIAL_WS_HOSTNAME,\n urlencode($this->guid)));\n if(is_null($response) || $response[\"code\"] != 200) {\n return NULL;\n }\n\n $profile = json_decode($response[\"responseBody\"]);\n return $profile->profile;\n }", "function get_magic_user() {\n if (empty($_POST[\"oauth_id\"])) {\n $this->http->response_code(403, false);\n exit();\n }\n\n $oauth_id = $_POST[\"oauth_id\"];\n\n $user = $this->auth_model->get_user($oauth_id);\n\n if (!empty($user)\n && isset($user[\"resitration_status\"]) && $user[\"resitration_status\"] == \"complete\"\n && isset($user[\"email_verified\"]) && $user[\"email_verified\"]\n ) {\n $user_data = [];\n $user_data[\"nick\"] = $user[\"nick\"];\n $user_data[\"country\"] = $user[\"country\"];\n echo json_encode($user_data);\n exit();\n }\n\n $this->http->response_code(403, false);\n exit();\n }", "public function getUserProfile()\n {\n }", "function requestProfile() {\n $username = $_GET['username'];\n\n $response = retrieveProfile($username);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function getPersonalData() {\n return $this->get('profile');\n }", "function getUserData()\n {\n $state = $_SESSION['state'];\n \n // Set our GET request URL\n $getURL = $state->instanceURL . '/services/data/v20.0/sobjects/User/' . $state->userId . '?fields=Name,Email,ContactId,contact.name,contact.number_of_friends__c,contact.Facebook_picture__c';\n \n // Header options\n $headerOpts = array('Authorization: Bearer ' . $state->token);\n \n // Open connection\n $ch = curl_init();\n \n // Set the url and header options\n curl_setopt($ch, CURLOPT_URL, $getURL);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headerOpts);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n \n // Execute GET\n $result = curl_exec($ch);\n \n // Close connection\n curl_close($ch);\n \n // Get the results\n $typeString = gettype($result);\n $resultArray = json_decode($result, true);\n \n // Return them as an html String\n $rtnString = '<hr><h2>User Data</h2>';\n \n foreach($resultArray as $key=>$value) \n { \n $rtnString .= \"<pre>$key=$value</pre>\";\n }\n\n $rtnString .= \" \" . $result;\n \n return $rtnString;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insert directives into .htaccess file to enable Shibboleth Lazy Sessions.
function shibboleth_insert_htaccess() { $disabled = defined( 'SHIBBOLETH_DISALLOW_FILE_MODS' ) && SHIBBOLETH_DISALLOW_FILE_MODS; if ( got_mod_rewrite() && ! $disabled ) { $htaccess = get_home_path() . '.htaccess'; $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>' ); insert_with_markers( $htaccess, 'Shibboleth', $rules ); } }
[ "function enableCache () {\r\n\tglobal $HTTP_SESSION_VARS;\r\n\r\n\t@session_start();\r\n\t$this->cache_active = true;\r\n\r\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}", "function set_session_handling()\n {\n // Safety before everything. Session may not be saved in the url\n ini_set(\"session.use_only_cookies\",\"1\");\n\n // Start output buffering\n ob_start();\n \n // Start the sessions\n session_start();\n }", "function create_class_htaccess($student_class_path) {\n $class_htaccess = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options +Indexes\n</Files>\n\";\n $file_path = \"${student_class_path}/.htaccess\";\n if (file_exists($file_path))\n return \"<!-- Class htaccess already exists -->\";\n if (file_put_contents($file_path, $class_htaccess))\n return \"<!-- Created class htaccess -->\";\n return \"<!-- Unable to create class htaccess -->\";\n}", "function create_class_htaccess($class_path)\n{\n $class_htaccess = \"\nSetEnv wsgi_max_requests 10\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n\n<Files *>\n Options +Indexes\n</Files>\n\";\n $file_path = \"${class_path}/.htaccess\";\n if (file_exists($file_path))\n return \"<!-- Class htaccess already exists -->\";\n if (file_put_contents($file_path, $class_htaccess))\n return \"<!-- Created class htaccess -->\";\n return \"<!-- Unable to create class htaccess -->\";\n}", "protected function writehtaccess()\n {\n $content = '# Deny access to supersake\n<Files supersake>\n\tOrder allow,deny\n\tDeny from all\n</Files>';\n }", "public function enableRedirects(){}", "public function activate_no_htaccess_html_expire() {\r\n\t\tadd_filter( 'rocket_htaccess_mod_expires', [ $this, 'remove_htaccess_html_expire' ] );\r\n\t}", "public function make_htaccess ($full_path) //$full_path = full path to cache directory with trailing slash\n\t{\n\t\tif ($full_path == SQLITE_DIR && $this->get_permissions(SQLITE_DIR) == '0777') return;\n\n\t\tif (defined('USE_HTACCESS') && USE_HTACCESS == FALSE) return;\n\t\n\t\tif (!file_exists($full_path . \".htaccess\") && is_writable($full_path))\n\t\t{\n\t\t\t$h = fopen ($full_path . \".htaccess\", 'wb');\n\t\t\t$text = \"# Prevent access from outside web root\n\torder deny, allow\n\tdeny from all\";\n\t\t\tfwrite($h, $text);\n\t\t\tfclose ($h);\n\t\t}\n\n\t}", "function ob_sessrewrite($buffer)\n{\n\tglobal $scripturl, $modSettings, $user_info, $context;\n\n\t// If $scripturl is set to nothing, or the SID is not defined (SSI?) just quit.\n\tif ($scripturl == '' || !defined('SID'))\n\t\treturn $buffer;\n\n\t// Do nothing if the session is cookied, or they are a crawler - guests are caught by redirectexit(). This doesn't work below PHP 4.3.0, because it makes the output buffer bigger.\n\tif (empty($_COOKIE) && SID != '' && (!$user_info['is_guest'] || (strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false)) && @version_compare(PHP_VERSION, '4.3.0') != -1)\n\t\t$buffer = preg_replace('/\"' . preg_quote($scripturl, '/') . '(?!\\?' . preg_quote(SID, '/') . ')(\\?)?/', '\"' . $scripturl . '?' . SID . '&amp;', $buffer);\n\t// You can't do both, because session_start() won't catch the session if you do. But this should work even in 4.2.x, just not CGI.\n\telseif (!empty($modSettings['queryless_urls']) && !$context['server']['is_cgi'] && $context['server']['is_apache'])\n\t\t$buffer = preg_replace('/\"' . preg_quote($scripturl, '/') . '\\?((?:board|topic)=[^#\"]+)(#[^\"]*)?\"/e', \"'\\\"' . \\$scripturl . '/' . strtr('\\$1', '&;=', '//,') . '.html\\$2\\\"'\", $buffer);\n\n\t// Return the changed buffer.\n\treturn $buffer;\n}", "function htaccess_rewrite(){\n\tglobal $SETTINGS;\n\n\t$Plugins = Plugins::getInstance( );\n\n\tif(function_exists('apache_get_modules')){\n\t\t$modules=apache_get_modules();\n\n\t\tif(!in_array('mod_rewrite',$modules))\n \t\terror('The apache module mod_rewrite must be installed. Please visit <a href=\"http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html\">Apache Module mod_rewrite</a> for more details.','Apache Error');\n\t}\n\n\t$htaccess=\n\t\t\"# .htaccess - Furasta.Org\\n\".\n\t\t\"<IfModule mod_deflate.c>\\n\".\n \t\"\tSetOutputFilter DEFLATE\\n\".\n\t\t\"\tHeader append Vary User-Agent env=!dont-vary\\n\".\n \t\"</IfModule>\\n\\n\".\n\n \t\"php_flag magic_quotes_gpc off\\n\\n\".\n\n\t\t\"RewriteEngine on\\n\".\n\t\t\"RewriteCond %{SCRIPT_NAME} !\\.php\\n\".\n\t\t\"RewriteRule ^admin[/]*$ /admin/index.php [L]\\n\".\n\t \"RewriteRule ^sitemap.xml /_inc/sitemap.php [L]\\n\".\n\t\t\"RewriteRule ^([^./]{3}[^.]*)$ /index.php?page=$1 [QSA,L]\\n\\n\".\n\n\t\t\"AddCharset utf-8 .js\\n\".\n\t\t\"AddCharset utf-8 .xml\\n\".\n\t\t\"AddCharset utf-8 .css\\n\".\n \"AddCharset utf-8 .php\";\n\n\t$htaccess = $Plugins->filter( 'general', 'filter_htaccess', $htaccess );\n\n\tfile_put_contents(HOME.'.htaccess',$htaccess);\n\t$_url='http://'.$_SERVER[\"SERVER_NAME\"].'/';\n\t\n\tif($SETTINGS['index']==0){\n\t\t$robots=\n\t\t\"# robots.txt - Furasta.Org\\n\".\n\t\t\"User-agent: *\\n\".\n\t\t\"Disallow: /admin\\n\".\n\t\t\"Disallow: /install\\n\".\n\t\t\"Disallow: /_user\\n\".\n\t\t\"Sitemap: \".$_url.\"sitemap.xml\";\n\n\t\t$robots = $Plugins->filter( 'general', 'filter_robots', $robots );\n\t}\n else{\n $robots=\n \"# robots.txt - Furasta.Org\\n\".\n \"User-agent: *\\n\".\n \"Disallow: /\\n\";\n $file=HOME.'sitemap.xml';\n if(file_exists($file))\n unlink($file);\n\n }\n\treturn file_put_contents(HOME.'robots.txt',$robots);\n}", "public static function enable() {\n session_start();\n }", "private function createHtaccess():void\n {\n //Add apache security configurations.\n $fp = fopen($this->projectDir.'/.htaccess', 'a+');\n if ($fp) {\n fwrite($fp, $this->htaccessConfig());\n }\n fclose($fp);\n }", "private function enableRewrite()\n\t{\n\t\t$this->line('Making sure rewrite is enabled...');\n\t\t$this->exec('a2enmod rewrite');\n\t}", "function yourls_create_htaccess() {\n\t$host = parse_url( yourls_get_yourls_site() );\n\t$path = ( isset( $host['path'] ) ? $host['path'] : '' );\n\n\tif ( yourls_is_iis() ) {\n\t\t// Prepare content for a web.config file\n\t\t$content = array(\n\t\t\t'<?'.'xml version=\"1.0\" encoding=\"UTF-8\"?>',\n\t\t\t'<configuration>',\n\t\t\t' <system.webServer>',\n\t\t\t' <security>',\n\t\t\t' <requestFiltering allowDoubleEscaping=\"true\" />',\n\t\t\t' </security>',\n\t\t\t' <rewrite>',\n\t\t\t' <rules>',\n\t\t\t' <rule name=\"YOURLS\" stopProcessing=\"true\">',\n\t\t\t' <match url=\"^(.*)$\" ignoreCase=\"false\" />',\n\t\t\t' <conditions>',\n\t\t\t' <add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" ignoreCase=\"false\" negate=\"true\" />',\n\t\t\t' <add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" ignoreCase=\"false\" negate=\"true\" />',\n\t\t\t' </conditions>',\n\t\t\t' <action type=\"Rewrite\" url=\"'.$path.'/yourls-loader.php\" appendQueryString=\"true\" />',\n\t\t\t' </rule>',\n\t\t\t' </rules>',\n\t\t\t' </rewrite>',\n\t\t\t' </system.webServer>',\n\t\t\t'</configuration>',\n\t\t);\n\n\t\t$filename = YOURLS_ABSPATH.'/web.config';\n\t\t$marker = 'none';\n\n\t} else {\n\t\t// Prepare content for a .htaccess file\n\t\t$content = array(\n\t\t\t'<IfModule mod_rewrite.c>',\n\t\t\t'RewriteEngine On',\n\t\t\t'RewriteBase '.$path.'/',\n\t\t\t'RewriteCond %{REQUEST_FILENAME} !-f',\n\t\t\t'RewriteCond %{REQUEST_FILENAME} !-d',\n\t\t\t'RewriteRule ^.*$ '.$path.'/yourls-loader.php [L]',\n\t\t\t'</IfModule>',\n\t\t);\n\n\t\t$filename = YOURLS_ABSPATH.'/.htaccess';\n\t\t$marker = 'YOURLS';\n\n\t}\n\n\treturn ( yourls_insert_with_markers( $filename, $marker, $content ) );\n}", "public static function preventHtaccessWrites() {\n\t\treturn false;\n\t}", "function sessionAllowed() {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_robots.php');\n if (!$this->sessionProtocolAllowed() || base_robots::checkRobot()) {\n $pattern = '{^/'.preg_quote($this->sessionName).$this->sessionPattern.'}i';\n if ($this->allowRedirects &&\n isset($_SERVER['REQUEST_URI']) &&\n preg_match($pattern, $_SERVER['REQUEST_URI'], $regs)) {\n // session not permitted but sid in url - remove it\n $this->reloadPage(FALSE, NULL, NULL, 'No session, remove sid from url');\n }\n return FALSE;\n }\n return TRUE;\n }", "public static function setup()\n\t{\n\t\t#Setup session with different id and start it\n\t\t@session_name('CMSSESSID' . CmsSession::generate_session_key());\n\t\t@ini_set('url_rewriter.tags', '');\n\t\t@ini_set('session.use_trans_sid', 0);\n\t\t\n\t\tif(!@session_id())\n\t\t{\n\t\t @session_start();\n\t\t}\n\n\t\tcmsms()->variables['user_id'] = '';\n\t\tif (isset($_SESSION['cmsms_user_id']))\n\t\t{\n\t\t $gCms->variables['user_id'] = $_SESSION['cmsms_user_id'];\n\t\t}\n\n\t\t$gCms->variables['username'] = '';\n\t\tif (isset($_SESSION['cms_admin_username']))\n\t\t{\n\t\t $gCms->variables['username'] = $_SESSION['cms_admin_username'];\n\t\t}\n\t\t\n\t\tif( isset($GLOBALS['CMS_ADMIN_PAGE']) )\n\t\t{\n\t\t\tif( !isset($_SESSION[CMS_USER_KEY]) )\n\t\t\t{\n\t\t\t\tif( isset($_COOKIE[CMS_SECURE_PARAM_NAME]) )\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[CMS_USER_KEY] = $_COOKIE[CMS_SECURE_PARAM_NAME];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// maybe change this algorithm.\n $dirname = dirname(__FILE__);\n\t\t\t\t\t$key = substr(str_shuffle(md5($dirname.time().session_id())),-8);\n\t\t\t\t\t$_SESSION[CMS_USER_KEY] = $key;\n\t\t\t\t\tsetcookie(CMS_SECURE_PARAM_NAME, $key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function sessionStart() { }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run authorization code request.
public function requestAuthorizationCode() { if ($this->hasAuthorizationCode()) { return; } $url = $this->service->getAuthorizationUri(array('state' => 'DCEEFWF45453sdffef424')); $curl_options = array( CURLOPT_URL => $url, CURLOPT_FOLLOWLOCATION => true, ); $ch = curl_init(); curl_setopt_array($ch, $curl_options); curl_exec($ch); curl_close($ch); }
[ "public function execute()\n\t{\n\t\t// The implicit grant flow is never executed because the access token is\n\t\t// returned to the client when handling the authorization request. This\n\t\t// is because the implicit grant essentially \"skips\" the generation of\n\t\t// an authorization code. Refer to section 4.2 of RFC 6749.\n\t}", "public function auth() {\n $code = $_GET['code'];\n\n $is = new InstagramService();\n $is->authorize($code); \n\n }", "public static function handleAuthorizationResponse() : void {\n if (isset($_GET['error_reason'])) {\n echo 'Error requesting authorization token, reason: ' . ($_GET['error'] ?? 'unknown') . '<br />';\n die($_GET['error_description'] ?? '');\n }\n\n if (empty($_GET['code'])) {\n die(\"Unable to obtain code\");\n }\n\n $authCode = trim($_GET['code']);\n\n echo \"🔑 Congratulations, the authorization code was retrieved!<br />\";\n echo \"<pre><code>$authCode</code></pre>\";\n }", "public function handleAuthorizationCodeRedirect(): void{\n $this->session->set('state', $state = sha1(uniqid(\"\", true)));\n\n $query = http_build_query([\n 'client_id' => $this->clientId,\n 'redirect_uri' => $this->request->getSchemeAndHttpHost() . $this->request->getBasePath() . self::$PROXY_CALLBACK_ENDPOINT,\n 'response_type' => 'code',\n 'scope' => $this->scope,\n 'state' => $state,\n ]);\n\n header('location: ' . $this->apiHost . self::$REMOTE_AUTHORIZE_ENDPOINT . '?' . $query);\n exit();\n }", "public function ExchangeAuthorizationToken($code);", "public function testProcessGetAuthorizationCode(): string\n {\n $grant = new AuthCodeGrant(\n $this->authCodeRepository,\n $this->refreshTokenRepository,\n new DateInterval('PT10M') // authorization codes will expire after 10 minutes\n );\n $grant->setRefreshTokenTTL(new DateInterval('P1M')); // refresh tokens will expire after 1 month\n\n // Enable the authentication code grant on the server\n $this->authServer->enableGrantType(\n $grant,\n new DateInterval('PT1H') // access tokens will expire after 1 hour\n );\n $state = bin2hex(random_bytes(10)); // CSRF token\n // Server request\n $params = [\n 'response_type' => 'code',\n 'client_id' => 'client_test2',\n 'redirect_uri' => 'http://example.com/redirect',\n 'scope' => 'test',\n 'state' => $state,\n ];\n\n $codeVerifier = new S256Verifier();\n\n $params['code_challenge_method'] = $codeVerifier->getMethod();\n $params['code_verifier'] = self::CODE_VERIFIER;\n $params['code_challenge'] = strtr(\n rtrim(base64_encode(hash('sha256', self::CODE_VERIFIER, true)), '='),\n '+/',\n '-_'\n );\n\n $request = $this->buildServerRequest(\n 'GET',\n '/auth_code?' . http_build_query($params),\n '',\n [],\n [],\n $params\n );\n\n // mocks the authorization endpoint pipe\n $authMiddleware = new AuthorizationMiddleware($this->authServer, $this->responseFactory);\n $authHandler = new AuthorizationHandler($this->authServer, $this->responseFactory);\n $consumerHandler = $this->buildConsumerAuthMiddleware($authHandler);\n\n $response = $authMiddleware->process($request, $consumerHandler);\n\n self::assertEquals(302, $response->getStatusCode());\n self::assertTrue($response->hasHeader('Location'));\n [$url, $queryString] = explode('?', $response->getHeader('Location')[0]);\n self::assertEquals($params['redirect_uri'], $url);\n parse_str($queryString, $data);\n self::assertTrue(isset($data['code']));\n self::assertTrue(isset($data['state']));\n self::assertEquals($state, $data['state']);\n\n return $data['code'];\n }", "public function get_code(){\n $this->provider->authenticate($_GET['code']);\n $_SESSION[$this->session_name] = $this->provider->getAccessToken();\n $redirect = $this->url;\n header('Location:'.filter_var($redirect, FILTER_SANITIZE_URL));\n }", "public function getAuthorizationCode();", "public function get_token_from_request() { \n \n if (isset($_GET['code'])) { \n $auth_code = $_GET['code'];\n $options['grant_type'] = \"authorization_code\";\n $options['code'] = $auth_code;\n $options['client_id'] = $this->options['client_id'];\n $options['client_secret'] = $this->options['client_secret'];\n $options['redirect_uri'] = $this->get_current_url(); \n $options = $this->set_default_value($options, $this->options);\n $auth_result = $this->auth->authenticate($options); \n $this->setToken($auth_result->access_token);\n } else {\n $this->setError(\"Can not get authroization code\");\n return false;\n }\n return true;\n }", "protected function getAuthorizationCode()\n {\n $code = null;\n if ($this->responseMode === 'query' && isset($_GET['code'])) {\n $code = $_GET['code'];\n } else if ($this->responseMode === 'form_post' && isset($_POST['code'])) {\n $code = $_POST['code'];\n }\n\n return $code;\n }", "protected function getAuthorizationCode()\n\t{\n\t\t$params = [\n\t\t\t'response_type' => 'code',\n\t\t\t'access_type' => 'offline', // the app needs to use Google API in the background\n\t\t\t'approval_prompt' => 'force',\n\t\t\t'client_id' => \\Yii::$app->params['clientId'],\n\t\t\t'redirect_uri' => \\Yii::$app->params['redirectUri'],\n\t\t\t'scope' => self::SCOPE,\n\t\t];\n\n\t\t$this->redirect(self::ACCOUNTS_OAUTH2 . '?' . http_build_query($params));\n\t}", "public function begin()\n {\n $is_authorized = (Service\\Sessions::getAuthUser()) ? true : false; //user дб залогинен в senler\n if ($is_authorized === false) {\n return false;\n }\n $user_id = VkSender / Core / App::getUserId(); // authorization_codes привязывается к user_id\n $state = $_REQUEST['state'];\n $scope = $_REQUEST['scope'];\n $client_id = $_REQUEST['client_id'];\n\n\n $clientData = $this->db->prepare(sprintf('SELECT * from oauth_clients where client_id = :client_id'));\n if (!$clientData) {\n return false;\n }\n\n\n if (!$this->validateRedirectUri($_REQUEST['redirect_uri'], $clientData['redirect_uri'])) {\n return false;\n };\n\n if (!$this->checkScope($scope, $clientData['scope'])) {\n return false;\n };\n\n $params = array(\n 'scope' => $scope,\n 'state' => $state,\n 'client_id' => $client_id,\n 'redirect_uri' => $clientData['redirect_uri']\n );\n\n $code = $this->generateAuthorizationCode();\n $code_ = $this->db->prepare(sprintf('SELECT * from oauth_authorization_codes where authorization_code = :code'));\n\n $expires = date('Y-m-d H:i:s', time() + $this->auth_code_lifetime);\n if ($code_) {\n $stmt = $this->db->prepare($sql = sprintf('UPDATE oauth_authorization_codes SET client_id=:client_id, user_id=:user_id, redirect_uri=:redirect_uri, expires=:expires, scope=:scope where authorization_code=:code'));\n } else {\n $stmt = $this->db->prepare(sprintf('INSERT INTO oauth_authorization_codes (authorization_code, client_id, user_id, redirect_uri, expires, scope) VALUES (:code, :client_id, :user_id, :redirect_uri, :expires, :scope)'));\n }\n\n\n header(\"Location: http://{$clientData['redirect_uri']}/?code={$code}&state={$state}\");\n exit;\n\n }", "public function authorize($code)\n\t{\n\t\n\t\t$authorization_url = 'https://api.instagram.com/oauth/access_token';\n\t\t\n\t\treturn $this->__apiCall($authorization_url, \"client_id=\" . $this->CI->config->item('instagram_client_id') . \"&client_secret=\" . $this->CI->config->item('instagram_client_secret') . \"&grant_type=authorization_code&redirect_uri=\" . $this->CI->config->item('instagram_callback_url') . \"&code=\" . $code);\t\t\n\t\t\n\t}", "public function authorize($code) {\n // Configure the request:\n $provider = $this->getOauthProvider();\n\n // Try to get an access token using the authorization code grant.\n try {\n $accessToken = $provider->getAccessToken(\n 'authorization_code',\n [\n 'code' => $code,\n ]\n );\n $this->state->set('fa_form.access_token', $accessToken);\n }\n catch (\\Exception $e) {\n $this->logger->critical(\n 'FormAssembly authorization request failed with Exception: %exception_type.',\n ['%exception_type' => get_class($e)]\n );\n }\n }", "function authorize($ig_client_id, $ig_client_secret, $ig_redirect_uri, $code)\n\t{\n\t\n\t\t$authorization_url = 'https://api.instagram.com/oauth/access_token';\n\t\t\n\t\treturn $this->__apiCall($authorization_url, \"client_id=\" . $ig_client_id . \"&client_secret=\" . $ig_client_secret . \"&grant_type=authorization_code&redirect_uri=\" . $ig_redirect_uri . \"&code=\" . $code);\t\t\n\t\t\n\t}", "public function authenticate()\n\t{\n\t\t//only redirect if gowalla hasn't given us a code\n\t\tif(!isset($_GET['code']))\n\t\t{\n\t\t\t//build query string\n\t\t\t$queryString = http_build_query(array('redirect_uri' => $this->redirectURI, 'client_id' => $this->clientId, 'scope' => 'read-write', 'grant_type' => 'authorization_code'));\n\n\t\t\t// redirect to gowalla authentication page\n\t\t\theader('Location: '. self::OAUTH_URL . $queryString);\n\n\t\t\t// exit\n\t\t\texit();\n\t\t}\n\t}", "private function loginAuthCode() : void {\n\t\t$b = Utilities::isValidAuthCode($_GET['auth']) && Utilities::isValidId($_GET['id']);\n\t\t\n\t\tif ($b && User::validateAuthCode($_GET['id'], $_GET['auth'])) {\n\t\t\t$this->login($_GET['id']);\n\t\t} else {\n\t\t\t$_GET['loginFailAuth'] = true;\n\t\t}\n\t}", "public static function processorAuthorizationCode()\n {\n return new TextNode('processor_authorization_code');\n }", "static function get_auth_code() {\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Mark a volunteer as cancelled for the event they applied for.
public function cancelled($volunteerId);
[ "public function cancel_event_request() {\n\t\t$this->event_details(TRUE);\n\t}", "public function cancelAndSave(\\Tx_Seminars_Model_Event $event)\n {\n $event->cancel();\n $this->eventMapper->save($event);\n }", "public function partialyCanceled()\n {\n\t\t$this->status = self::STATUS_PARTIALY_CANCELED;\n\t\t$this->save();\n\t\t\n $this->fireModelEvent('partialy-canceled');\n }", "function mark_cancelled() {\r\n global $db;\r\n if ($this->status == false || $this->status == \"completed\") {\r\n $db->Execute(\"UPDATE \" . TABLE_ORDERS . \" SET date_cancelled = now() WHERE orders_id = '\" . $this->oID . \"'\");\r\n\r\n if ($this->status == \"completed\") {\r\n $db->Execute(\"UPDATE \" . TABLE_ORDERS . \" SET date_completed = NULL WHERE orders_id = '\" . $this->oID . \"'\");\r\n }\r\n if (STATUS_ORDER_CANCELLED != 0) {\r\n update_status($this->oID, STATUS_ORDER_CANCELLED);\r\n }\r\n $this->status = \"cancelled\";\r\n $this->status_date = zen_datetime_short(date('Y-m-d H:i:s'));\r\n }\r\n }", "public function cancelNow()\n {\n $this->update([\n 'status' => self::STATUS_CANCELED\n ]);\n }", "public function setEventCancel($cancelAt)\n {\n $this->_isAutoRenew = false;\n $this->_cancelAt = $cancelAt;\n $this->_status = \\Pley\\Enum\\SubscriptionStatusEnum::CANCELLED;\n }", "public function cancel_commitment() {\n $this->form_validation->set_rules('id', 'Opportunity', 'trim|required|callback__verify_cancellation');\n if ($this->form_validation->run()) {\n $this->opportunity_model->unschedule_user($this->input->post('id'), $_SESSION['user']->id);\n }\n else{\n echo $this->form_validation->error_string('<li>', '</li>');\n }\n }", "public function cancel() {\n\t\t$this->state->status = WorkflowState::STATUS_CANCELLED;\n\t\t$this->state->save();\n\t}", "public function cancel() {\n\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::CANCELLED);\n\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onCancel($this->runtimeContext);\n\t}", "public function cancel(Request $request){\n $event = Event::find($request->event_id);\n if (Auth::id() == $event->user->id){\n $event->users()->detach();\n $event->delete();\n// $event->forceDelete();\n }\n\n return redirect('/events')->with('success','Event successfully canceled!');\n\n }", "public function setCanceled() {\n $this->status = self::STATUS_CANCELED;\n return $this->save(false, array('status'));\n }", "public function cancel($reason)\n {\n // todo: Implement transaction cancelling on data store\n\n // todo: Populate $cancel_time with value\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n // todo: Change $state to cancelled (-1 or -2) according to the current state\n\n if ($this->state == self::STATE_COMPLETED) {\n // Scenario: CreateTransaction -> PerformTransaction -> CancelTransaction\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n // Scenario: CreateTransaction -> CancelTransaction\n $this->state = self::STATE_CANCELLED;\n }\n\n // set reason\n $this->reason = $reason;\n\n // todo: Update transaction on data store\n $this->save();\n }", "public function cancelled()\n {\n\n $this->alert('info', 'Understood');\n }", "public function cancelar()\n\t{\n\t\t$this->estatus = CitaEstatus::CANCELADA;\n\t}", "public function cancel() {\n\n\t\t$args = array(\n\t\t\t'status' => 'cancelled'\n\t\t);\n\n\t\tif( $this->subs_db->update( $this->id, $args ) ) {\n\n\t\t\tif( is_user_logged_in() ) {\n\n\t\t\t\t$userdata = get_userdata( get_current_user_id() );\n\t\t\t\t$user = $userdata->user_login;\n\n\t\t\t} else {\n\n\t\t\t\t$user = __( 'gateway', 'edd-recurring' );\n\n\t\t\t}\n\n\t\t\t$note = sprintf( __( 'Subscription #%d cancelled by %s', 'edd-recurring' ), $this->id, $user );\n\t\t\t$this->customer->add_note( $note );\n\n\t\t\tdo_action( 'edd_subscription_cancelled', $this->id, $this );\n\n\t\t}\n\n\t}", "public function requestCancel(){\n\t\t$this->checkWorkflow(self::STATUS_CANCELED, false);\n\t\tif ($this->hasCancelPeriod()) {\n\t\t\t$this->getSubscription()->setCancelRequest(true);\n\t\t\t$this->save();\n\t\t\t$this->sendCancelRequestEmail();\n\t\t\t$this->getLogger()->info('The cancelation of the subscription was requested.');\n\t\t}\n\t\telse {\n\t\t\t$this->cancel();\n\t\t\t$this->sendCancelEmail();\n\t\t}\n\t}", "public function cancelAppointment() \n {\n // check that appointment is set for stylist & client set during initialization\n if ( $this->appointmentSet() ) {\n // set client ID to null for the slots\n self::whereIn('slot_begin', $this->increments)\n ->where('stylist_id', $this->stylist_id)\n ->where('client_id', $this->client_id)\n ->update(['client_id' => NULL]);\n return array_merge(self::STATUS_SUCCESS, ['message' => 'Appointment has been canceled.']);\n } else {\n return array_merge(self::STATUS_FAILED, ['message' => 'Appointment could not be canceled.']);\n }\n }", "public function cancel(Evento $evento) {\n $this->authorize('update', $evento);\n $evento->canceled = true;\n //get all the rsvps that have already been sent\n $rsvps = $evento->getRsvps();\n\n foreach ($rsvps as $rsvp) {\n dispatch(\n new SendGuestEmail($rsvp, 'emails.canceled', \"Canceled: \")\n );\n }\n $evento->save();\n return redirect('/eventos/details/' . $evento->id);\n }", "public function cancel_speaker_invite(){\n\t\tself::checkAuth();\n\t\t$userId = $this->input->get('uid');\n\t\t$event_id = $this->input->get('eid');\n\t\t$reference_id = $this->input->get('id');\n\t\t$comment = $this->input->get('comment');\n\t\t$referenceType = $this->input->get('rtype');\n\t\t$role_id = $this->roles['speaker'];\n\n\t\t$this->_email_notify_owner_invite($userId, $event_id, $reference_id, 'declined', $comment);\n\t\t$this->Guest->cancelJoinSpeaker($data = array(\n\t\t\t\t'user_id' => $userId ,\n\t\t\t\t'event_id' => $event_id,\n\t\t\t\t'reference_id' => $reference_id,\n\t\t\t\t'role_id' => $role_id,\n\t\t\t\t'comment' => $comment,\n\t\t\t\t'reference_type' => $referenceType,\n\t\t\t\t'status' => 'rejected'));\n\n\t\treturn;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setter for column `dy_currencies`.`name_real`.
public function setNameReal($name_real) { $column = self::COL_NAME_REAL; $this->$column = $name_real; return $this; }
[ "public function setName($name)\n\t{\n\t\t$this->currencyName = $name;\n\t}", "public function setVirtualCurrencyName(string $name);", "function setName($name)\n {\n $this->name = cleanGPC($name);\n }", "final public function setName($name) {\n\t\t$this->_external_name = $name;\n\t}", "function setName($new_name)\n {\n\n $this->name = $new_name ;\n }", "public function setInternalName( $value ) { $this->_internalName = $value; }", "public function setName($name)\n {\n $this->_data['name'] = $name;\n }", "function setName($objectName, $versionNum = false, $languageCode = false)\n {\n $initialLanguageCode = false;\n if ($initialLanguage = $this->initialLanguage()) {\n $initialLanguageCode = $initialLanguage->attribute('locale');\n }\n $db = eZDB::instance();\n\n if ($languageCode == false) {\n $languageCode = $initialLanguageCode;\n }\n $languageCode = $db->escapeString($languageCode);\n if ($languageCode == $initialLanguageCode) {\n $this->Name = $objectName;\n }\n\n if (!$versionNum) {\n $versionNum = $this->attribute('current_version');\n }\n $objectID = (int)$this->attribute('id');\n $versionNum = (int)$versionNum;\n\n $languageID = (int)eZContentLanguage::idByLocale($languageCode);\n\n $objectName = $db->escapeString($objectName);\n\n $db->begin();\n\n // Check if name is already set before setting/changing it.\n // This helps to avoid deadlocks in mysql: a pair of DELETE/INSERT might cause deadlock here\n // in case of concurrent execution.\n $rows = $db->arrayQuery(\"SELECT COUNT(*) AS count FROM ezcontentobject_name WHERE contentobject_id = '$objectID'\n AND content_version = '$versionNum' AND content_translation ='$languageCode'\");\n if ($rows[0]['count']) {\n $db->query(\"UPDATE ezcontentobject_name SET name='$objectName'\n WHERE\n contentobject_id = '$objectID' AND\n content_version = '$versionNum' AND\n content_translation ='$languageCode'\");\n } else {\n $db->query(\"INSERT INTO ezcontentobject_name( contentobject_id,\n name,\n content_version,\n content_translation,\n real_translation,\n language_id )\n VALUES( '$objectID',\n '$objectName',\n '$versionNum',\n '$languageCode',\n '$languageCode',\n '$languageID' )\");\n }\n\n $db->commit();\n }", "public function setFieldname($name) {\r\n $this->fieldname = $name;\r\n }", "public function setName($name): void\n {\n if (strrpos($name, '!') === strlen($name) - 1) {\n $this->name = substr($name, 0, strlen($name) - 1);\n $this->discardedOnNull = false;\n } else {\n $this->name = $name;\n $this->discardedOnNull = true;\n }\n }", "function setName($value) {\n $this->name = $value;\n }", "final public function setInternalName($name) {\n\t\t$this->_internal_name = $name;\n\t}", "public function updateName()\n {\n $this->name = $this->slugify($this->label) . \"-imagine-block\";\n }", "public function setNiceName($name)\n {\n /** @var \\App\\Models\\Tag_meta $nice_name_row */\n $nice_name_row = Tag_meta::where('tag_id', '=', $this->get_id())->where('name', '=', 'nice_name')->first();\n if (!isset($nice_name_row)) {\n $nice_name_row = new Tag_meta();\n $nice_name_row->tag_id = $this->get_id();\n $nice_name_row->name = 'nice_name';\n $nice_name_row->value = $name;\n $nice_name_row->save();\n } else {\n $nice_name_row->value = $name;\n $nice_name_row->save();\n }\n }", "public function setName(string $name = null) : CNabuDataObject\n {\n $this->setValue('nb_commerce_product_lang_name', $name);\n \n return $this;\n }", "public function setNameAttribute($name)\n {\n $this->attributes['name'] = strtolower($name);\n }", "function set_original_name($original_name)\n\t{\n\t\t$this->set_default_property(self :: PROPERTY_ORIGINAL_NAME, $original_name);\n\t}", "public function quoteColumnName($name)\n{\n if ($name[0] == $this->quoteChar) {\n return $name;\n }\n // $name = str_replace('.', $this->quoteChar.'.'.$this->quoteChar, $name);\n return $this->quoteChar.$name.$this->quoteChar;\n}", "protected function setName()\n {\n $this->DateName = 'Palmarum/Palmsonntag';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the form action URI to be used in mode TX_TRANSACTOR_GATEWAYMODE_FORM. This is used by PayPal and DIBS
public function transaction_formGetActionURI () { $result = false; if ($this->getGatewayMode() == TX_TRANSACTOR_GATEWAYMODE_FORM) { $conf = $this->getConf(); if (isset($conf['formActionURI'])) { $result = $conf['formActionURI']; } } return $result; }
[ "public function transaction_formGetActionURI () {\n $result = $this->getGatewayObj()->transaction_formGetActionURI();\n return $result;\n }", "public static function getFormActionUrl() {\n\t\treturn self::$formAction;\n\t}", "public function get_form_action_url() {\n\t\treturn $this->form_action_url;\n\t}", "public function getFormAction()\n {\n return $this->getUrl('support/customer/replyPost', ['_secure' => true, '_current' => true]);\n }", "public function get_formaction()\r\n\t{\r\n\t\treturn $this->get_attr('formaction');\r\n\t}", "public function FormAction()\n {\n if ($this->formActionPath) {\n return $this->formActionPath;\n }\n\n // Get action from request handler link\n return $this->getRequestHandler()->Link();\n }", "public function getFormActionUrl()\n {\n return $this->_customerUrl->getLoginPostUrl();\n }", "public function getFormAction()\n {\n return $this->form_action;\n }", "public function getFormAction(){\r\n return $this->getUrl(self::URL_PATH);\r\n }", "public function getFormActionUrl()\n {\n if ($this->hasFormActionUrl()) {\n return $this->getData('form_action_url');\n }\n return $this->getUrl('*/' . 'hotkeys_routes/save');\n }", "public function getContactFormUrl()\n {\n return $this->contactHelper->getContactFormUrl($this->getRetailer());\n }", "public function getFormAction()\n {\n return $this->getUrl('contact/index/submit', ['_secure' => true]);\n }", "public function getContactFormAction()\n {\n return $this->getUrl('contacts/index/post');\n }", "public function getFormAction()\n {\n return $this->strFormAction;\n }", "public function getFormAction()\n {\n return $this->getUrl('zirconprocessing/catalogrequest');\n }", "function gw_generate_normal_form_action()\n\t{\n\t\t// Test\n\t\t//return 'https://www.nochex.com/nochex.dll/apc/testapc';\n\t\t\n\t\treturn \"https://www.nochex.com/nochex.dll/checkout\";\n\t}", "public function getFormUrl(): string\n {\n if (!is_null($this->options->get('custom_url'))) {\n return $this->buildCustomUrl();\n } else {\n return $this->buildAmazonUrl();\n }\n }", "public function getFormAction()\n {\n return $this->getUrl('scontact/index/post', ['_secure' => true]);\n }", "protected function getFormActionUrl() \n {\n return $this->getUrl('adminhtml/klevu_search_wizard/configure_userplan_post');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$cadena = str_replace('(Video Oficial)', '', $cadena);
function spam($cadena){ //$cadena = str_replace('(Lyrics)', '', $cadena); //$cadena = str_replace('(Lyric Video)', '', $cadena); //$cadena = str_replace('Letra', '', $cadena); //$cadena = str_replace('LETRA', '', $cadena); $cadena = str_replace('.wmv', '', $cadena); //$cadena = str_replace('(LYRICS)', '', $cadena); //$cadena = str_replace('( Audio Oficial )', '', $cadena); $cadena = str_replace('|', '', $cadena); $cadena = str_replace('(', '', $cadena); $cadena = str_replace(')', '', $cadena); $cadena = str_replace('/', '', $cadena); //$cadena = str_replace('(Con La Letra)', '', $cadena); //$cadena = str_replace('(con Letra)', '', $cadena); //$cadena = str_replace('Official Video', '', $cadena); //$cadena = ucwords($cadena); return $cadena; }
[ "function remove_video($content) {\r\n\t$content= preg_replace('/<object[^>]*?>.*?<\\/object>/', '',$content);\r\n\t$content= preg_replace('/<embed[^>]*?>.*?<\\/embed>/', '',$content);\r\n\treturn $content;\r\n}", "public function spam($cadena) {\n //$cadena = str_replace('(Lyrics)', '', $cadena);\n //$cadena = str_replace('(Lyric Video)', '', $cadena);\n //$cadena = str_replace('Letra', '', $cadena);\n //$cadena = str_replace('LETRA', '', $cadena);\n $cadena = str_replace('.wmv', '', $cadena);\n //$cadena = str_replace('(LYRICS)', '', $cadena);\n //$cadena = str_replace('( Audio Oficial )', '', $cadena);\n $cadena = str_replace('|', '', $cadena);\n $cadena = str_replace('(', '', $cadena);\n $cadena = str_replace(')', '', $cadena);\n $cadena = str_replace('/', '', $cadena);\n //$cadena = str_replace('(Con La Letra)', '', $cadena);\n //$cadena = str_replace('(con Letra)', '', $cadena);\n //$cadena = str_replace('Official Video', '', $cadena);\n //$cadena = ucwords($cadena);\n return $cadena;\n }", "function fix_special_lesson_moments($the_content)\n{\n\t$url = getPageURL();\n\tif (!preg_match(\"/video-yarkie-momenty/\", $url))\n\t\treturn $the_content;\n\treturn str_replace('Самые яркие моменты ежедневного урока:', \"\", $the_content);\n}", "function cambioComodin($texto) {\r\n\t\treturn str_replace('*', '%', $texto);\r\n\t}", "function remove_video_shortcode( $content = null ){\n global $post;\n \n //if( is_single() && is_main_query() && $post->post_type == 'portfolio' ){\n if( is_main_query() && $post->post_type == 'portfolio' ){\n $pattern = get_shortcode_regex();\n preg_match('/'.$pattern.'/s', $content, $matches);\n if ( isset($matches[2]) && is_array($matches) && $matches[2] == 'video_sc') {\n //shortcode is being used\n $content = str_replace( $matches[0], '', $content );\n }\n }\n return $content;\n}", "function remover_caracter($string) {\n\t\t $string = preg_replace(\"/[áàâãä]/\", \"a\", $string);\n\t\t $string = preg_replace(\"/[ÁÀÂÃÄ]/\", \"A\", $string);\n\t\t $string = preg_replace(\"/[éèê]/\", \"e\", $string);\n\t\t $string = preg_replace(\"/[ÉÈÊ]/\", \"E\", $string);\n\t\t $string = preg_replace(\"/[íì]/\", \"i\", $string);\n\t\t $string = preg_replace(\"/[ÍÌ]/\", \"I\", $string);\n\t\t $string = preg_replace(\"/[óòôõö]/\", \"o\", $string);\n\t\t $string = preg_replace(\"/[ÓÒÔÕÖ]/\", \"O\", $string);\n\t\t $string = preg_replace(\"/[úùü]/\", \"u\", $string);\n\t\t $string = preg_replace(\"/[ÚÙÜ]/\", \"U\", $string);\n\t\t $string = preg_replace(\"/ç/\", \"c\", $string);\n\t\t $string = preg_replace(\"/Ç/\", \"C\", $string);\n\t\t $string = preg_replace(\"/[][><}{)(:;,!?*%~^`&#@]/\", \"\", $string);\n\t\t //$string = preg_replace(\"/ /\", \"_\", $string);\n\t\t return $string;\n\t\t}", "function filter_category_title($title) {\n return str_replace('Category: ', '', $title);\n}", "function removeVideo($html, $data, $url) {\n return '';\n}", "function videoToURL($vinfo) {\n\n $url = remove_accents($vinfo['title']);\n //$url = strtolower( $url );\n $url = str_replace(' ', '-', $url);\n $url = preg_replace('/[^a-z0-9A-Z\\-]/', '', $url);\n $url = str_replace('--', '-', $url);\n\n $url = substr($url, 0, 80);\n\n if ($url[strlen($url) - 1] != '-')\n $url = $url . '-';\n\n $url = $url . $vinfo['id'];\n\n return $url;\n}", "function cleanStringUrl($cadena) {\r\n\t\t$cadena = strtolower($cadena);\r\n\t\t$cadena = trim($cadena);\r\n\t\t$cadena = strtr($cadena, \"���̀����������ͅ���������菎�������쓒����󆝜��؄�\", \"aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn\");\r\n\t\t$cadena = strtr($cadena, \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", \"abcdefghijklmnopqrstuvwxyz\");\r\n\t\t$cadena = preg_replace('#([^.a-z0-9]+)#i', '-', $cadena);\r\n\t\t$cadena = preg_replace('#-{2,}#', '-', $cadena);\r\n\t\t$cadena = preg_replace('#-$#', '', $cadena);\r\n\t\t$cadena = preg_replace('#^-#', '', $cadena);\r\n\t\treturn $cadena;\r\n\t}", "function QuitarArticulos($palabra) \r\n {\r\n #$palabra = preg_replace('/\\bMC/', '', $palabra); \r\n $palabra = preg_replace('/\\b(DE(L)?|LA(S)?|LOS|Y|A|VON|VAN)\\s+/i', '', $palabra); \r\n return $palabra; \r\n }", "function remove_acentos($string=NULL){\n\t$procurar = array('À','Á','Ã','Â','É','Ê','Í','Ó','Õ','Ô','Ú','Ü','Ç','à','á','ã','â','é','ê','í','ó','õ','ô','ú','ü','ç');\n\t$substituir = array('A','A','A','A','E','E','I','O','O','O','U','U','C','a','a','a','a','e','e','i','o','o','o','u','u','c');\n\treturn str_replace($procurar, $substituir, $string);\n}", "function acf_str_replace($string = '', $search_replace = array())\n{\n}", "function PCO_EscaparContenido($texto)\n\t{\n\t\t//$texto = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\\'()\\\\x80-\\\\xff]|i', '', $texto); // Muy estricto\n\t\t$texto = str_ireplace(\"script\",\"\",$texto);\n\n\t\treturn $texto;\n\t}", "function retornarEmbed($url){\r\n $urlEmbed = str_replace(\"watch?v=\", \"embed/\", $url);\r\n $urlEmbed = str_replace(\"&feature=youtu.be\", \"\", $urlEmbed);\r\n return $urlEmbed; \r\n}", "function eliminaUnidores($string) {\n // Devuelve el string sin eso\n if(!empty($string)) {\n return preg_replace(\"/(\\bel)|(\\bla.)|(\\blo.)|(\\by\\b)|(\\bo\\b)/\", $string);\n }\n }", "function disemvowel($comment) {\n $vowels = array('a', 'e', 'i', 'o', 'u');\n $new = str_replace($vowels, '', $comment);\n return $new;\n}", "public function stringReplace(){\n\t\t\t\treturn str_replace(\"WEB APPLICATION\",\"WEBSITE\",$this->sentence);\n\t\t\t}", "function cleanTitle($title) {\n if ($title === '') return '';\n\n $cleaned = str_replace(array('$', '='), '', $title);\n\n return $cleaned;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$cipher = new serpent();
function serpent_enc(string $text, string $key) { //$cipher->serset_key($key); //$cipher->serencrypt($text); $code = openssl_encrypt($text, 'aes-256-ecb', $key);//, OPENSSL_RAW_DATA, $iv); //$code = mcrypt_encrypt(MCRYPT_SERPENT_256, $key, $text, MCRYPT_MODE_ECB); return $code; }
[ "public function createCipher();", "final public function getCipher() {}", "public function setCipher($cipher){ }", "public function createStreamCipher();", "public function MyEncryption() {\t\t\r\n\t\t\r\n\t}", "private static function getCypherMethod() {\n return self::AES128;\n }", "public function encrypt()\n {\n }", "public static function setCipher($cipher) {\n \n }", "function openssl_spki_new(&$privkey, &$challenge, $algorithm = false)\n{\n}", "public function encrypt();", "public function __construct($multipass_secret){\n ### one for encryption, one for signing\n\n $method = 'sha256';\n $key_material = openssl_digest ( $multipass_secret, $method , TRUE);\n if($key_material){\n $this->encryption_key = substr($key_material,0,16);\n $this->signature_key = substr($key_material,16,16);\n }\n \n}", "private static function Crypto() {\n if (self::$cripto == null) {\n self::$cripto = new \\PlayPHP\\Classes\\Security\\Crypto();\n }\n return self::$cripto;\n }", "function encryption($key = null)\n {\n return new \\OwenMelbz\\IllumiPress\\Encryption($key);\n }", "function startCrypto($k){\n /* Load up AES equivalent encryption module */\n $crypto = mcrypt_module_open('rijndael-128', '', 'nofb', '');\n /* Create an initialization vector */\n if(isset($_SESSION['iv'])){\n $iv=$_SESSION['iv'];\n }else{\n if(!file_exists('classes/crypto/iv.rij128')){\n $iv=mcrypt_create_iv(mcrypt_enc_get_iv_size($crypto), MCRYPT_DEV_RANDOM);\n $_SESSION['iv']=$iv;\n }else{\n $iv=file_get_contents('classes/crypto/iv.rij128', FILE_BINARY);\n }\n }\n /* Get the key size for the algorithm*/\n $keysize=mcrypt_enc_get_key_size($crypto);\n if(!file_exists('classes/crypto/key.rij128')){\n /* Build a key */\n $key=substr(md5($k), 0, $keysize);\n }else{\n $key=substr(md5(file_get_contents('classes/crypto/key.rij128')), 0, $keysize);\n }\n $this->cryptObj=array('crypto' => $crypto, 'iv' => $iv, 'key' => $key);\n}", "public static function getEncrypter() {\n \n }", "public function decrypt();", "public function getAsymmetricCipher();", "public function testCryptoSymbols()\n {\n }", "abstract public function encrypt($s);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the next incomplete list response based on the given resumption token.
private function resumeListResponse($token) { $tokenTable = get_db()->getTable('OaiPmhRepositoryToken'); $tokenTable->purgeExpiredTokens(); $tokenObject = $tokenTable->find($token); if(!$tokenObject || ($tokenObject->verb != $this->query['verb'])) $this->throwError(self::OAI_ERR_BAD_RESUMPTION_TOKEN); else $this->listResponse($tokenObject->verb, $tokenObject->metadata_prefix, $tokenObject->cursor, $tokenObject->set, $tokenObject->from, $tokenObject->until); }
[ "public function getResumptionToken();", "function _oai20_list_element_callback($verb, $params, $xpathquery, $callback) { \n\t\t$haveresumptiontokens=false;\n\t\t$res=$this->_oai_fetch($verb.$params);\n\t\twhile($res) {\n\t\t\tif($this->abort_callback && call_user_func($this->abort_callback)) {\n\t\t\t\t// we were killed in the meantime, so abort\n\t\t\t\tthrow new OAIServiceProviderAbortException('aborted by signal or user request');\n\t\t\t}\n\t\t\t$this->_oai20_checkerrors($res); // check for server-side error messages (throws exception)\n\t\t\t$rt=$this->_oai20_get_resumption_token($res,$verb);\n\n if($rt) {\n\t\t\t\t$this->_log('flow control: resumptionToken found. Expires: '.\n\t\t\t\t\t(isset($rt['expirationDate'])?$rt['expirationDate']:'n/a').', cursor: '.\n\t\t\t\t\t(isset($rt['cursor'])?$rt['cursor']:'n/a').', completeListSize: '.\n\t\t\t\t\t(isset($rt['completeListSize'])?$rt['completeListSize']:'n/a').'.', 19);\n\t\t\t\t$this->resTo = $rt; //Copy of RT for logging purposes\n\n\t\t\t}\n\t\t\t$xpath=$this->_oai_xpath($res); // XPath context, w/ registered namespaces\n\t\t\t// execute XPath query for result entities\n\t\t\t$nodes=$xpath->query($xpathquery);\n\n\t\t\t// pass on to parser callback function\n\t\t\tcall_user_func($callback, $res);\n\n\t\t\t// check for resumptionToken and query next parts if found\n\t\t\tif($rt) {\n\t\t\t\tif(!$haveresumptiontokens) $haveresumptiontokens=true;\n\t\t\t\tif($rt['token'])\n\t\t\t\t\t$res=$this->_oai_fetch($verb.'&resumptionToken='.rawurlencode($rt['token']));\n\t\t\t\telse\n\t\t\t\t\t$res=false;\n\t\t\t} else {\n\t\t\t\tif($haveresumptiontokens) {\n\t\t\t\t\t// sanity check: OAI-PMH 2.0 defines that the last part\n\t\t\t\t\t// MUST include an empty resumptionToken\n\t\t\t\t\tthrow new OAIServiceProviderOAIParserException(\n\t\t\t\t\t\t'illegal OAI server output: No final empty resumptionToken');\n\t\t\t\t}\n\t\t\t\t$res=false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function listAllFulfillmentOrdersByNextToken($request): ListAllFulfillmentOrdersByNextTokenResponse;", "public function getResumptionToken()\n {\n if (isset($this->oaipmh->ListRecords->resumptionToken)) {\n $resumptionToken = (string) $this->oaipmh->ListRecords->resumptionToken;\n if (!empty($resumptionToken)) {\n return $resumptionToken;\n }\n }\n return false;\n }", "protected function dispatchNextResponse()\n {\n $response = new Response($this->com, $this->_streamResponses);\n if ($response->getType() === Response::TYPE_FATAL) {\n $this->pendingRequestsCount = 0;\n $this->com->close();\n return $response;\n }\n\n $tag = $response->getTag();\n $isLastForRequest = $response->getType() === Response::TYPE_FINAL;\n if ($isLastForRequest) {\n $this->pendingRequestsCount--;\n }\n\n if (null !== $tag) {\n if ($this->isRequestActive($tag, self::FILTER_CALLBACK)) {\n if ($this->callbacks[$tag]($response, $this)) {\n $this->cancelRequest($tag);\n } elseif ($isLastForRequest) {\n unset($this->callbacks[$tag]);\n }\n } else {\n $this->responseBuffer[$tag][] = $response;\n }\n }\n return $response;\n }", "protected function loadResumptionToken($token)\n {\n // Create object for loading tokens:\n $search = new Oai_resumption();\n\n // Clean up expired records before doing our search:\n $search->removeExpired();\n\n // Load the requested token if it still exists:\n $search->id = $token;\n if ($search->find(true)) {\n return $search->restoreParams();\n }\n\n // If we got this far, the token is invalid or expired:\n return false;\n }", "public function listFinancialEventsByNextToken($request): ListFinancialEventsByNextTokenResponse;", "private function decodeResumptionToken($token)\n {\n $params = (array) json_decode(base64_decode($token));\n\n if (!empty($params['from'])) {\n $params['from'] = new \\DateTime('@' . $params['from']);\n }\n\n if (!empty($params['until'])) {\n $params['until'] = new \\DateTime('@' . $params['until']);\n }\n\n return $params;\n }", "function invokeListOrdersByNextToken(MarketplaceWebServiceOrders_Interface $service, $request)\n {\n global $nextTokenCounter;\n try {\n $response = $service->ListOrdersByNextToken($request);\n\n// echo (\"Service Response\\n\");\n// echo (\"=============================================================================\\n\");\n\n $dom = new DOMDocument();\n $dom->loadXML($response->toXML());\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $str = $dom->saveXML();\n $nextToken = $dom->getElementsByTagName('NextToken')->item(0);\n $Orderstr = $dom->getElementsByTagName('AmazonOrderId')->item(0);\n $OrderId = $Orderstr->textContent;\n $request = new MarketplaceWebServiceOrders_Model_ListOrderItemsRequest();\n $request->setSellerId(MERCHANT_ID);\n $request->setAmazonOrderId($OrderId);\n invokeListOrderItems($service, $request);\n\n if ($nextToken != null) {\n $fo = fopen('c:\\wamp64\\www\\vendexcel.txt', 'a+');\n fwrite($fo, $str . \"<br>\");\n fclose($fo);\n echo(\"Next Token: \".$nextToken->nodeValue.\"\\n<br>\\n\");\n $nextTokenCounter++;\n listOrdersWithNextToken($nextToken);\n }\n\n\n\n// echo $dom->saveXML();\n// echo(\"ResponseHeaderMetadata: \" . $response->getResponseHeaderMetadata() . \"\\n\");\n\n } catch (MarketplaceWebServiceOrders_Exception $ex) {\n echo(\"Next Token call failed <br>\");\n\n echo(\"Caught Exception: \" . $ex->getMessage() . \"\\n\");\n echo(\"Response Status Code: \" . $ex->getStatusCode() . \"\\n\");\n echo(\"Error Code: \" . $ex->getErrorCode() . \"\\n\");\n echo(\"Error Type: \" . $ex->getErrorType() . \"\\n\");\n echo(\"Request ID: \" . $ex->getRequestId() . \"\\n\");\n echo(\"XML: \" . $ex->getXML() . \"\\n\");\n echo(\"ResponseHeaderMetadata: \" . $ex->getResponseHeaderMetadata() . \"\\n\");\n }\n }", "function invokeListInventorySupplyByNextToken(FBAInventoryServiceMWS_Interface $service, $request) \n {\n try {\n $response = $service->listInventorySupplyByNextToken($request);\n \n echo (\"Service Response\\n\");\n echo (\"=============================================================================\\n\");\n\n echo(\" ListInventorySupplyByNextTokenResponse\\n\");\n if ($response->isSetListInventorySupplyByNextTokenResult()) { \n echo(\" ListInventorySupplyByNextTokenResult\\n\");\n $listInventorySupplyByNextTokenResult = $response->getListInventorySupplyByNextTokenResult();\n if ($listInventorySupplyByNextTokenResult->isSetInventorySupplyList()) { \n echo(\" InventorySupplyList\\n\");\n $inventorySupplyList = $listInventorySupplyByNextTokenResult->getInventorySupplyList();\n $memberList = $inventorySupplyList->getmember();\n foreach ($memberList as $member) {\n echo(\" member\\n\");\n if ($member->isSetSellerSKU()) \n {\n echo(\" SellerSKU\\n\");\n echo(\" \" . $member->getSellerSKU() . \"\\n\");\n }\n if ($member->isSetFNSKU()) \n {\n echo(\" FNSKU\\n\");\n echo(\" \" . $member->getFNSKU() . \"\\n\");\n }\n if ($member->isSetASIN()) \n {\n echo(\" ASIN\\n\");\n echo(\" \" . $member->getASIN() . \"\\n\");\n }\n if ($member->isSetCondition()) \n {\n echo(\" Condition\\n\");\n echo(\" \" . $member->getCondition() . \"\\n\");\n }\n if ($member->isSetTotalSupplyQuantity()) \n {\n echo(\" TotalSupplyQuantity\\n\");\n echo(\" \" . $member->getTotalSupplyQuantity() . \"\\n\");\n }\n if ($member->isSetInStockSupplyQuantity()) \n {\n echo(\" InStockSupplyQuantity\\n\");\n echo(\" \" . $member->getInStockSupplyQuantity() . \"\\n\");\n }\n if ($member->isSetEarliestAvailability()) { \n echo(\" EarliestAvailability\\n\");\n $earliestAvailability = $member->getEarliestAvailability();\n if ($earliestAvailability->isSetTimepointType()) \n {\n echo(\" TimepointType\\n\");\n echo(\" \" . $earliestAvailability->getTimepointType() . \"\\n\");\n }\n if ($earliestAvailability->isSetDateTime()) \n {\n echo(\" DateTime\\n\");\n echo(\" \" . $earliestAvailability->getDateTime() . \"\\n\");\n }\n } \n if ($member->isSetSupplyDetail()) { \n echo(\" SupplyDetail\\n\");\n $supplyDetail = $member->getSupplyDetail();\n $member1List = $supplyDetail->getmember();\n foreach ($member1List as $member1) {\n echo(\" member\\n\");\n if ($member1->isSetQuantity()) \n {\n echo(\" Quantity\\n\");\n echo(\" \" . $member1->getQuantity() . \"\\n\");\n }\n if ($member1->isSetSupplyType()) \n {\n echo(\" SupplyType\\n\");\n echo(\" \" . $member1->getSupplyType() . \"\\n\");\n }\n if ($member1->isSetEarliestAvailableToPick()) { \n echo(\" EarliestAvailableToPick\\n\");\n $earliestAvailableToPick = $member1->getEarliestAvailableToPick();\n if ($earliestAvailableToPick->isSetTimepointType()) \n {\n echo(\" TimepointType\\n\");\n echo(\" \" . $earliestAvailableToPick->getTimepointType() . \"\\n\");\n }\n if ($earliestAvailableToPick->isSetDateTime()) \n {\n echo(\" DateTime\\n\");\n echo(\" \" . $earliestAvailableToPick->getDateTime() . \"\\n\");\n }\n } \n if ($member1->isSetLatestAvailableToPick()) { \n echo(\" LatestAvailableToPick\\n\");\n $latestAvailableToPick = $member1->getLatestAvailableToPick();\n if ($latestAvailableToPick->isSetTimepointType()) \n {\n echo(\" TimepointType\\n\");\n echo(\" \" . $latestAvailableToPick->getTimepointType() . \"\\n\");\n }\n if ($latestAvailableToPick->isSetDateTime()) \n {\n echo(\" DateTime\\n\");\n echo(\" \" . $latestAvailableToPick->getDateTime() . \"\\n\");\n }\n } \n }\n } \n }\n } \n if ($listInventorySupplyByNextTokenResult->isSetNextToken()) \n {\n echo(\" NextToken\\n\");\n echo(\" \" . $listInventorySupplyByNextTokenResult->getNextToken() . \"\\n\");\n }\n } \n if ($response->isSetResponseMetadata()) { \n echo(\" ResponseMetadata\\n\");\n $responseMetadata = $response->getResponseMetadata();\n if ($responseMetadata->isSetRequestId()) \n {\n echo(\" RequestId\\n\");\n echo(\" \" . $responseMetadata->getRequestId() . \"\\n\");\n }\n } \n\n } catch (FBAInventoryServiceMWS_Exception $ex) {\n echo(\"Caught Exception: \" . $ex->getMessage() . \"\\n\");\n echo(\"Response Status Code: \" . $ex->getStatusCode() . \"\\n\");\n echo(\"Error Code: \" . $ex->getErrorCode() . \"\\n\");\n echo(\"Error Type: \" . $ex->getErrorType() . \"\\n\");\n echo(\"Request ID: \" . $ex->getRequestId() . \"\\n\");\n echo(\"XML: \" . $ex->getXML() . \"\\n\");\n }\n }", "public function getSkipToken()\n {\n if (array_key_exists(Constants::ODATA_NEXT_LINK, $this->getBody())) {\n $nextLink = $this->getBody()[Constants::ODATA_NEXT_LINK];\n $url = explode(\"?\", $nextLink)[1];\n $url = explode(\"skiptoken=\", $url);\n if (count($url) > 1) {\n return $url[1];\n }\n return null;\n }\n return null;\n }", "private function fetchOutstanding()\n {\n // continuation\n $response = $this->_connection->post($this->url() . '/' . $this->_id, '', []);\n ++$this->_fetches;\n\n $data = $response->getJson();\n\n $this->_hasMore = (bool) $data[self::ENTRY_HASMORE];\n $this->add($data[self::ENTRY_RESULT]);\n\n if (!$this->_hasMore) {\n // we have fetched the complete result set and can unset the id now\n $this->_id = null;\n }\n\n $this->updateLength();\n }", "protected function requireNextToken()\n {\n $next = $this->tokenizer->next();\n\n if ($next instanceof Token) {\n return $next;\n }\n\n throw new TokenStreamEndException($this->tokenizer);\n }", "public function getNextList($list)\n {\n # can't do anything without a feed\n if (! $list) {\n return null; # TODO : should raise error\n }\n \n # see if there's a next link in the feed -> if so, take its url\n $url = null;\n foreach($list->feed->link as $link) {\n if ($link->rel == \"next\") {\n $url = $link->href;\n }\n }\n # No next link available -> EOF\n if (! $url) {\n return null;\n }\n \n return $this->json_client->do_request($url, \"GET\");\n }", "function readResumToken($resumptionToken) {\n $rtVal = false;\n $fp = fopen($resumptionToken, 'r');\n if ($fp != false) {\n $filetext = fgets($fp, 255);\n $textparts = explode('#', $filetext);\n fclose($fp);\n unlink($resumptionToken);\n $rtVal = array((int) $textparts[0], $textparts[1], $textparts[2],$textparts[3],$textparts[4]);\n }\n return $rtVal;\n }", "public function testPullRequestImmediateFailureBadResponse() {\n\t\n\t\t$this->stdLocalNodeInterfaceUri($this->mNode);\n\t\t$otherNode = $this->mockLocalNodeInterface();\n\t\t$nodePublicKey = new Key('nodepublicarmor');\n\t\t$nodeCertificate = new Certificate('nodepublicarmor', false,\n\t\t\t\t'alpha.venus.uk', 'alpha@example.com',\n\t\t\t\t'nodekeyid',[new Signature('nodekeyid')]);\n\t\n\t\n\t\n\t\t$otherNode->method('uri')->willReturn('other.venus.uk');\n\t\t$responseMessage = Message::fromStr(ServiceEncoding::json(['nonsense' => 'blah'], $otherNode));\n\n\t\t$this->mKeyring->expects($this->once())\n\t\t\t->method('getNodeKeyid')\n\t\t\t->withAnyParameters()\n\t\t\t->willReturn('nodekeyid');\n\t\n\t\t$this->mKeyring->expects($this->never())->method('getNodeCertificate');\n\t\n\t\t$this->mKeyring->expects($this->never())->method('getNodePublicKey');\n\t\n\t\t$this->mSnur->expects($this->once())\n\t\t\t->method('requestFirstResponseFromUri')\n\t\t\t->with('spring://other.venus.uk', 'service spring://other.venus.uk/cert/pull/nodekeyid')\n\t\t\t->willReturn($responseMessage);\n\t\t\n\t\t$this->mKvs->expects($this->once())\n\t\t\t->method('get')\n\t\t\t->with('cert.notify')\n\t\t\t->willReturn(false);\n\t\n\t\t$this->mKservice->expects($this->never())->method('expand');\n\t\n\t\t$this->path[] = 'pullreq';\n\t\t$response = $this->service->run($this->path, ['source' => 'other.venus.uk']);\n\t\t$obj = MessageDecoder::jsonServiceTextStripNode($response);\n\t\n\t\t$this->assertNotNull($obj);\n\t\t$this->assertObjectHasAttribute('result', $obj);\n\t\t$this->assertEquals('error', $obj->result);\n\t}", "private function initListResponse()\n {\n $fromDate = null;\n $untilDate = null;\n \n if(($from = $this->_getParam('from')))\n $fromDate = OaiPmhRepository_Date::utcToDb($from);\n if(($until= $this->_getParam('until')))\n $untilDate = OaiPmhRepository_Date::utcToDb($until);\n \n $this->listResponse($this->query['verb'], \n $this->query['metadataPrefix'],\n 0,\n $this->_getParam('set'),\n $fromDate,\n $untilDate);\n }", "private function fetchMore(): void\n {\n $url = $this->client->urlTo($this->cql, $this->position, $this->count, $this->extraParams);\n $body = $this->client->request('GET', $url);\n $this->lastResponse = new SearchRetrieveResponse($body);\n $this->data = $this->lastResponse->records;\n\n if (count($this->data) != 0 && $this->data[0]->position != $this->position) {\n throw new Exceptions\\InvalidResponseException(\n 'Wrong index of first record in result set. '\n . 'Expected: ' .$this->position . ', got: ' . $this->data[0]->position\n );\n }\n }", "private function processListResponse()\n {\n /** @var ListDocumentsResponse $obj_list_response */\n $obj_list_response = $this->obj_last_response;\n $obj_response = (object)[\n 'status' => $this->describeStatusCode($obj_list_response->getStatus()->getCode()),\n 'count' => $obj_list_response->getDocumentSize(),\n 'docs' => []\n ];\n $obj_mapper = new Mapper();\n foreach($obj_list_response->getDocumentList() as $obj_document) {\n $obj_doc = $obj_mapper->fromGoogle($obj_document);\n $obj_response->docs[] = $obj_doc;\n }\n return $obj_response;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show file list of available export files
public function showFileList() { global $ilUser; if(!count($files = $this->fss_export->getMemberExportFiles())) { return false; } $a_tpl = new ilTemplate('tpl.table.html',true,true); $a_tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.member_export_file_row.html", "Modules/Course"); $a_tpl->setVariable('FORMACTION',$this->ctrl->getFormaction($this)); include_once("./Services/Table/classes/class.ilTableGUI.php"); $tbl = new ilTableGUI(); // load template for table content data $tbl->setTitle($this->lng->txt("ps_export_files")); $tbl->setHeaderNames(array("", $this->lng->txt("type"), $this->lng->txt("ps_size"), $this->lng->txt("date") )); $cols = array("", "type","size", "date"); $header_params = $this->ctrl->getParameterArray($this,'show'); $tbl->setHeaderVars($cols, $header_params); $tbl->setColumnWidth(array("1%", "9%", "45%", "45%")); // control $tbl->setOrderColumn($_GET["sort_by"]); $tbl->setOrderDirection($_GET["sort_order"]); $tbl->setLimit($ilUser->getPref('hits_per_page',9999)); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($files)); $tbl->disable("sort"); $a_tpl->setVariable("COLUMN_COUNTS",4); $files = array_reverse($files); $files = array_slice($files, $_GET["offset"], $_GET["limit"]); $num = 0; $i=0; foreach($files as $exp_file) { $a_tpl->setCurrentBlock("tbl_content"); $a_tpl->setVariable("TXT_FILENAME", $exp_file["file"]); $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2"); $a_tpl->setVariable("CSS_ROW", $css_row); $a_tpl->setVariable("TXT_SIZE",$exp_file['size']); $a_tpl->setVariable("TXT_TYPE", strtoupper($exp_file["type"])); $a_tpl->setVariable("CHECKBOX_ID",$exp_file["timest"]); $a_tpl->setVariable("TXT_DATE", date("Y-m-d H:i",$exp_file['timest'])); $a_tpl->parseCurrentBlock(); } // delete button $a_tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg")); $a_tpl->setCurrentBlock("tbl_action_btn"); $a_tpl->setVariable("BTN_NAME", "confirmDeleteExportFile"); $a_tpl->setVariable("BTN_VALUE", $this->lng->txt("delete")); $a_tpl->parseCurrentBlock(); $a_tpl->setCurrentBlock("tbl_action_btn"); $a_tpl->setVariable("BTN_NAME", "downloadExportFile"); $a_tpl->setVariable("BTN_VALUE", $this->lng->txt("download")); $a_tpl->parseCurrentBlock(); // footer $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next")); //$tbl->disable("footer"); $tbl->setTemplate($a_tpl); $tbl->render(); #$this->tpl->setCurrentBlock('file_list'); $this->tpl->setVariable('FILE_LIST_TABLE',$a_tpl->get()); #$this->tpl->parseCurrentBlock(); }
[ "public function display_available_files()\r\n\t{\r\n\t\techo '<pre>';\r\n\t\tprint_r( $this->get_available_files() );\r\n\t\techo '</pre>';\r\n\t}", "protected function listFiles()\n\t{\n\t\tglobal $tpl, $ilCtrl, $ilToolbar, $lng, $ilTabs;\n\n\t\t// create export / import file\n\t\tif(adnPerm::check(adnPerm::AD, adnPerm::WRITE))\n\t\t{\n\t\t\t$ilToolbar->addButton($lng->txt(\"adn_create_mc_export\"),\n\t\t\t\t$ilCtrl->getLinkTarget($this, \"exportFile\"));\n\t\t\t$ilToolbar->addButton($lng->txt(\"adn_import_mc_questions\"),\n\t\t\t\t$ilCtrl->getLinkTarget($this, \"importFile\"));\n\t\t}\n\n\t\t// table of countries\n\t\tinclude_once(\"./Services/ADN/AD/classes/class.adnMCQuestionExportTableGUI.php\");\n\t\t$table = new adnMCQuestionExportTableGUI($this, \"listFiles\");\n\t\t\n\t\t// output table\n\t\t$tpl->setContent($table->getHTML());\n\t}", "public function displayFiles()\n {\n // Specify the location of the stored files\n $path = \"application/export/files/\";\n \n // Open the folder \n $dir_handle = @opendir($path); \n\n // Loop through the files \n while ($file = readdir($dir_handle)) { \n\n if($file == \".\" || $file == \"..\" || $file == \"index.php\" ) \n\n continue; \n $myfile = $path.$file;\n $checksum = md5($myfile);\n echo \"<a href=\\\"index.php?mid=700&action=download&f=$file&csum=$checksum&area=export\\\"><span class=\\\"iconSpanExport\\\"><img src=\\\"images/icons/drive-download.png\\\" alt=\\\"User Control\\\" title=\\\"User Control\\\"/><br/>$file</a>\"; \n\n } \n // Close \n closedir($dir_handle); \n \n return;\n \n }", "public function listFiles();", "public function exportFiles();", "function get_export_file_types()\r\n {\r\n return $this->export_file_types;\r\n }", "private function list_backup_files() {\n \n // Get backup directory\n $backup_dir = $this->get_backup_directory();\n $backup_dir_url = $this->get_backup_directory( 'url' );\n \n $files = scandir( $backup_dir );\n \n echo '<h3>' . esc_html__( 'List of backups', 'predic-simple-backup' ) . '</h3>';\n \n // Make list of backup files\n echo '<ul>';\n \n foreach ( $files as $file ) {\n \n if ( $file === '.' || $file === '..' ) {\n continue;\n }\n \n $filename = $backup_dir . '/' . $file;\n \n echo '<li>'\n . $file . ' ' . round( filesize( $filename ) / ( 1024 * 1024 ), 2 ) . ' MB '\n . '<a href=\"' . esc_url( $backup_dir_url . '/' . $file ) . '\">' . esc_html__( 'Download', 'predic-simple-backup' ) . '</a> '\n . '<a class=\"ptb-delete-backup\" href=\"' . esc_url( esc_url( admin_url('admin-post.php') ) . '?action=delete_predic_simple_backup&psb_delete_file=' . $file ) . '\">' . esc_html__( 'Delete', 'predic-simple-backup' ) . '</a>'\n . '</li>';\n }\n \n echo '</ul>';\n \n }", "public function listFilesAction()\n {\n if ($this->view->aclIsAllowed($this->_moduleTitle,'edit',true))\n {\n $this->_findCsvFiles('list');\n $tables = array(\n 'FilesImport' => array(\n 'FI_ID',\n 'FI_FileName',\n 'FI_LastModif',\n 'FI_LastAccess')\n );\n $field_list = array(\n 'FI_ID' => array('width' => '50px'),\n 'FI_LastModif' => array('width' => '150px'),\n 'FI_LastAccess' => array('width' => '150px')\n );\n\n if($this->_importType)\n $field_list['FI_Type'] = array('width' => '50px');\n\n $this->view->params = $this->_getAllParams();\n\n $pageID = $this->_getParam( 'pageID' );\n $langId = $this->_registry->languageID;\n\n $lines = new ImportExportObject();\n $select = $lines->getAllByType($langId, $this->_importType);\n\n $oDate = new Zend_Date(time());\n $validDate = $oDate->subDay($this->_interval, Zend_Date::DAY);\n $validDate = $oDate->toString('Y-M-d H:m:s');\n\n $options = array(\n 'commands' => array(\n $this->view->link($this->view->url(\n array(\n 'controller'=> $this->_name,\n 'action'=> $this->_defaultAction\n )\n ),\n $this->view->getCibleText('button_import_all'),\n array('class'=>'action_submit import')\n )\n ),\n 'disable-export-to-excel' => $this->_exportExcel,\n 'disable-export-to-pdf' => $this->_exportPdf,\n 'disable-export-to-csv' => $this->_exportCsv,\n 'filters' => array(\n 'max_days_interval' => array(\n 'label' => 'Filtre 1',\n 'default_value' => $validDate,\n 'associatedTo' => 'FI_LastModif',\n 'whereClause' => ' > ',\n 'choices' => array(\n '' => '',\n 'isvalid' => $this->view->getCibleText('filter_files_to_import')\n )\n )\n ),\n 'action_panel' => array(\n 'width' => '50',\n 'actions' => array(\n 'import' => array(\n 'label' => $this->view->getCibleText('button_import'),\n 'url' => $this->view->baseUrl() . \"/\"\n . $this->_moduleTitle . \"/\"\n . $this->_name . \"/\"\n . $this->_defaultAction . \"/\"\n . $this->_paramId\n . \"/%ID%/\"\n . $pageID,\n 'findReplace' => array(\n 'search' => '%ID%',\n 'replace' => 'FI_ID'\n )\n )\n// 'delete' => array(\n// 'label' => $this->view->getCibleText('button_delete'),\n// 'url' => $this->view->baseUrl() . \"/\"\n// . $this->_moduleTitle . \"/\"\n// . $this->_name\n// . \"/delete/\"\n// . $this->_paramId\n// . \"/%ID%/\"\n// . $pageID,\n// 'findReplace' => array(\n// 'search' => '%ID%',\n// 'replace' => 'P_ID'\n// )\n// )\n )\n )\n );\n\n $mylist = New Cible_Paginator($select, $tables, $field_list, $options);\n $this->view->assign('mylist', $mylist);\n }\n }", "function displayRerportFiles(){\n\n $files = array();\n\n $curDir = getcwd();\n\n chdir(\"../..\");\n\n /**\n * Load core reports\n */\n if(file_exists(\"report\") && is_dir(\"report\")){\n\n $thedir = @ opendir(\"report\");\n\n while($entry = @ readdir($thedir))\n if(@ strtolower(substr($entry, -4)) == \".php\")\n $files[] = \"report/\".$entry;\n\n }//endif\n\n chdir(\"modules\");\n\n /**\n * Get loaded modules\n */\n $querystatement = \"\n SELECT\n `name`\n FROM\n `modules`\";\n\n $queryresult = $this->db->query($querystatement);\n\n while($therecord = $this->db->fetchArray($queryresult)){\n\n chdir($therecord[\"name\"]);\n\n $thedir = @ opendir(\"report\");\n\n while($entry = @ readdir($thedir))\n if(@ strtolower(substr($entry, -4)) == \".php\")\n $files[] = \"modules/\".$therecord[\"name\"].\"/report/\".$entry;\n\n chdir(\"..\");\n\n }//endwhile\n\n chdir($curDir);\n\n ?><label for=\"reportfile\">report file</label><br />\n <select id=\"reportfile\" name=\"reportfile\">\n <?php foreach($files as $filename){?>\n <option value=\"<?php echo $filename; ?>\"><?php echo $filename; ?></option>\n <?php }//endforeach?>\n </select><?php\n\n }", "protected function FetchExporterList()\n\t{\n\t\t$exporterRoot = APP_ROOT.\"/includes/converter/exporters/\";\n\t\t$files = scandir($exporterRoot);\n\n\t\tforeach($files as $file) {\n\t\t\tif(!is_file($exporterRoot.$file) || isc_substr($file, -3) != \"php\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trequire_once $exporterRoot.$file;\n\t\t\t$file = isc_substr($file, 0, isc_strlen($file)-4);\n\t\t\t$className = \"ISC_ADMIN_EXPORTER_\".isc_strtoupper($file);\n\t\t\tif(!class_exists($className)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$exporter = new $className;\n\t\t\t$exporters[$file] = array(\n\t\t\t\t\"title\" => $exporter->title,\n\t\t\t\t\"configuration\" => \"\"\n\t\t\t);\n\t\t\tif(method_exists($exporter, \"Configure\")) {\n\t\t\t\t$exporters[$file]['configuration'] = $exporter->Configure();\n\t\t\t}\n\t\t}\n\t\treturn $exporters;\n\t}", "public function fileList()\n {\n $files = safe_column('filename', 'txp_file',\n 'category=\"jmd_csv\"');\n if ($files)\n {\n $out = '<select name=\"file\">';\n foreach ($files as $file)\n {\n $out .= '<option value=\"' . $file . '\">' . $file . '</option>';\n }\n $out .= '</select>';\n\n return $out;\n }\n }", "public function listAction()\n {\n if ($this->folder !== null) {\n $files = $this->folder->getFiles(\n 0,\n 0,\n Folder::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS,\n false,\n $this->settings['order_by'] ?? 'name',\n $this->settings['order_direction'] === 'desc'\n );\n\n $files = $this->filterFilesByFileMetadataGroupAccess($files);\n\n $this->view->assign('files', $files);\n }\n\n $this->view->assign('folder', $this->folder);\n }", "public function listFiles(): array;", "protected function showListOfBackups()\n\t{\n\t\tif( ! $files = File::files($this->destination))\n\t\t\treturn $this->error('No backup files found');\n\n\t\tforeach($files as $key => $file)\n\t\t{\n\t\t\t$date = Carbon::createFromTimeStamp(File::lastModified($file));\n\n\t\t\t$files[$key] = [\n\t\t\t\tbasename($file),\n\t\t\t\t$date->toDateTimeString(),\n\t\t\t\t$date->diffForHumans(),\n\t\t\t\t$this->bytesToHuman(File::size($file)),\n\t\t\t];\n\t\t}\n\n\t\t$this->table(['File', 'Date', 'Age', 'Size'], $files);\n\t}", "public static function export_list() {\n\t\tif ( ! current_user_can( 'manage_follow_up_emails' ) || ! check_ajax_referer( 'fue-export' ) || empty( $_GET['id'] ) ) {\n\t\t\twp_die( esc_html__( 'You do not have permission', 'follow_up_emails' ), 'Access Denied', array( 'response' => 403 ) );\n\t\t}\n\n\t\t$id = absint( $_GET['id'] );\n\t\t$file = $export_file = sys_get_temp_dir() . '/fue_export_' . $id;\n\n\t\tif ( ! file_exists( $file ) ) {\n\t\t\twp_die( 'File not found.' );\n\t\t}\n\n\t\theader( 'Content-Type: application/csv' );\n\t\theader( 'Content-Disposition:attachment;filename=email_list.csv' );\n\t\theader( 'Pragma: no-cache' );\n\n\t\treadfile( $file );\n\t\texit;\n\t}", "public function viewAllFiles()\n {\n $totalEnabledFiles = File::where('status', 1)->count();\n $enabledFiles = File::where('status', 1)->latest()->paginate(30, ['*'], 'enabledTable');\n $totaldisabledFiles = File::where('status', 1)->count();\n $disabledFiles = File::where('status', 0)->latest()->paginate(30, ['*'], 'disabledTable');\n return view('admin.file.viewAllFiles', compact('totalEnabledFiles', 'enabledFiles', 'totaldisabledFiles', 'disabledFiles'));\n }", "public static function exportables()\n {\n return [];\n }", "function print_delete_files_list() \n\t{\n\t\t$filelist = \"\";\n\t\tif(count($this->update_delete) > 0)\n\t\t{\n\t\t\tforeach($this->update_delete as $filename) \n\t\t\t{\n\t\t\t\t$filelist .= $filename.\"<br />\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"None\";\n\t\t}\n\t\treturn $filelist;\n\t}", "public function show_migrated_files() {\n\n if($this->is_table_exist()) {\n\n $migrated_version_list = $this->get_migrated_version_list();\n\n if(empty($migrated_version_list)) {\n echo \"No migration executed so far. \\n\";\n }\n Utility::show_list($this->get_migrated_version_list());\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
split $name with '/'
private function getFileName($name) { return explode('/', $name); }
[ "function splitName($name) {\n $res = array('fn' => '', 'ln' => '');\n $a = explode(' ', $name, 2);\n $res['ln'] = $a[0];\n if (count($a) > 1)\n $res['fn'] = $a[1];\n return $res;\n}", "protected function _splitName($name, &$dname, &$aname)\n {\n $dname = null;\n $aname = $name;\n\n if (! Auth::getBackendConfiguration('tryUsernameSplit', TRUE)) {\n return;\n }\n\n $pos = strpos($name, '@');\n if ($pos) {\n $dname = substr($name, $pos + 1);\n $aname = substr($name, 0, $pos);\n } else {\n $pos = strpos($name, '\\\\');\n if ($pos) {\n $dname = substr($name, 0, $pos);\n $aname = substr($name, $pos + 1);\n }\n }\n }", "function split_name($name){\n\t$names = array('first_name' => '', 'last_name' => '');\n\t$last_name = strrchr($name, ' ');\n\tif($last_name){\n\t\t$names['first_name'] = trim(substr($name, 0, strlen($name)-strlen($last_name)));\n\t\t$names['last_name'] = trim($last_name);\n\t}else{\n\t\t$names['first_name'] = $name;\n\t}\n\treturn $names;\n}", "function split_uri($file_name_uri)\n {\n $tmp = explode('/',$file_name_uri);\n $res['data'] = $tmp[(count($tmp)-1)];\n $tmp[(count($tmp)-1)] = '';\n $res['path'] = implode('/',$tmp);\n return $res;\n }", "function splitFile($name){\n\t\t$rc = array();\n\t\t$ix = strrpos($name, \"/\");\n\t\tif ($ix === false)\n\t\t\t$rc[\"dir\"] = \"\";\n\t\telse{\n\t\t\t$ix++;\n\t\t\t$rc[\"dir\"] = substr($name, 0, $ix);\n\t\t\t$name = substr($name, $ix);\n\t\t}\n\t\t$ix = strrpos($name, \".\");\n\t\tif ($ix === false){\n\t\t\t$rc[\"ext\"] = \"\";\n\t\t\t$rc [\"name\"] = $name;\n\t\t} else {\n\t\t\t$rc[\"ext\"] = substr($name, $ix);\n\t\t\t$rc [\"name\"] = substr($name, 0, $ix);\n\t\t}\n\t\treturn $rc;\n\t}", "public function splitns($name)\n {\n $list = explode(':', $name, 2);\n if (count($list) < 2) {\n array_unshift($list, '');\n }\n return $list;\n }", "function splitName($name)\n {\n $parts = explode(\" \", $name);\n $split['surname'] = array_pop($parts);\n $split['firstname'] = implode(\" \", $parts);\n\n return $split;\n }", "private function splitName() {\n\t\t$matches = null;\n\t\t$success = preg_match('#^(.+)( - | ~ |_-_|_~_)(.+)$#U', $this->name, $matches);\n\t\tif ($success) {\n\t\t\treturn array(\n\t\t\t\t'artist' => $matches[1],\n\t\t\t\t'album' => $matches[3]\n\t\t\t);\n\t\t}\n\n\t\treturn array(\n\t\t\t'artist' => 'Unknown artist',\n\t\t\t'album' => $this->name\n\t\t);\n }", "public static function split_name($name) {\n $name = trim($name);\n $last_name = (strpos($name, ' ') === false) ? '' : preg_replace('#.*\\s([\\w-]*)$#', '$1', $name);\n $first_name = trim( preg_replace('#'.$last_name.'#', '', $name ) );\n\n return array($first_name, $last_name);\n }", "private static function splitNameInNameparts( string $name ) : array\n {\n switch( true ) {\n case ( ctype_upper( $name ) || ctype_lower( $name )) :\n $nameParts = [ $name ];\n break;\n case ( str_contains( $name, Util::$DOT )) :\n $nameParts = explode( Util::$DOT, $name );\n foreach( $nameParts as $k => $part ) {\n $nameParts[$k] = ucfirst( $part );\n }\n break;\n default : // split camelCase\n $nameParts = [$name[0]];\n $k = 0;\n $x = 1;\n $len = strlen( $name );\n while( $x < $len ) {\n if( ctype_upper( $name[$x] )) {\n ++$k;\n $nameParts[$k] = Util::$SP0;\n }\n $nameParts[$k] .= $name[$x];\n $x++;\n } // end while\n break;\n } // end switch\n return $nameParts;\n }", "function doSplitName($name)\n{\n $results = array();\n\n $r = explode(' ', $name);\n $size = count($r);\n\n //check first for period, assume salutation if so\n if (mb_strpos($r[0], '.') === false)\n {\n $results['salutation'] = '';\n $results['first'] = $r[0];\n }\n else\n {\n $results['salutation'] = $r[0];\n $results['first'] = $r[1];\n }\n\n //check last for period, assume suffix if so\n if (mb_strpos($r[$size - 1], '.') === false)\n {\n $results['suffix'] = '';\n }\n else\n {\n $results['suffix'] = $r[$size - 1];\n }\n\n //combine remains into last\n $start = ($results['salutation']) ? 2 : 1;\n $end = ($results['suffix']) ? $size - 2 : $size - 1;\n\n $last = '';\n for ($i = $start; $i <= $end; $i++)\n {\n $last .= ' '.$r[$i];\n }\n $results['last'] = trim($last);\n\n return $results;\n}", "public static function splitName($name)\n\t{\n\t\t$parts = explode(' ', $name);\n\t\t$results = [];\n\t\tif (count($parts) === 1) return [$parts];\n\t\tfor ($i = 1; $i < count($parts); $i++) {\n\t\t\t$firstname = implode(' ', array_slice($parts, 0, $i));\n\t\t\t$lastname = implode(' ', array_slice($parts, $i));\n\t\t\t$results[] = ['firstname' => $firstname, 'lastname' => $lastname];\n\t\t}\n\t\treturn $results;\n\t}", "function nameGetFirstPart(string $name): string\n{\n $parts = explode('\\\\', $name, 3);\n if ($parts[0] === '' && count($parts) > 1) {\n return $parts[1];\n } else {\n return $parts[0];\n }\n}", "public function getNameSplitPattern()\n {\n return $this->names->getSplitPattern();\n }", "abstract public function split();", "public static function split($path)\n {\n return preg_split('/[\\\\\\\\\\/]+/', $path);\n }", "private static function split($path)\n {\n if ('' === $path) {\n return [ '', '' ];\n }\n\n $root = '';\n $length = strlen($path);\n\n // Remove and remember root directory\n if ('/' === $path[ 0 ]) {\n $root = '/';\n $path = $length > 1 ? substr($path, 1) : '';\n } elseif ($length > 1 && ctype_alpha($path[ 0 ]) && ':' === $path[ 1 ]) {\n if (2 === $length) {\n // Windows special case: \"C:\"\n $root = $path . '/';\n $path = '';\n } elseif ('/' === $path[ 2 ]) {\n // Windows normal case: \"C:/\"..\n $root = substr($path, 0, 3);\n $path = $length > 3 ? substr($path, 3) : '';\n }\n }\n\n return [ $root, $path ];\n }", "function splitUri($s){\n if(preg_match('@^(.+[/#]+)([^#/]+[#/]*)$@', $s, $m)){\n return array($m[1], $m[2]);\n }\n return array($s,'');\n }", "function html_split_name($page)\n{\n\tglobal $UpperPtn, $LowerPtn;\n\n\t$title = get_title($page);\n\tif(validate_page($page) != 1)\n\t\t{ return $title; }\n\t$page = preg_replace(\"/(?<=$UpperPtn|$LowerPtn)($UpperPtn$LowerPtn)/\",\n\t\t\t\t\t\t\t\t\t\t\t ' \\\\1', $title, -1);\n\t$page = preg_replace(\"/($LowerPtn)($UpperPtn)/\",\n\t\t\t\t\t\t\t\t\t\t\t '\\\\1 \\\\2', $title, -1);\n\treturn $page;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the value of the given key in prop.
public function setPropByKey($key, $value) { $this->prop_arr[$key] = $value; }
[ "public function setDynamicProp($key, $value);", "abstract function update(string $key, string $value);", "public function updateProperty($property) {\n\t\t$cmd = \"zfs get -H \" . $property . \" \\\"\" . $this->name . \"\\\" 2>&1\";\n\t\tOMVModuleZFSUtil::exec($cmd,$out,$res);\n\t\t$tmpary = preg_split('/\\t+/', $out[0]);\n\t\t$this->properties[\"$tmpary[1]\"] = array(\"value\" => $tmpary[2], \"source\" => $tmpary[3]);\n\t}", "public function update($key, $value)\n {\n }", "public function addProperty($key, $value);", "public function __set($prop, $value)\n {\n $this->data[$prop] = $value;\n }", "public function update($ssh_key, array $properties = []);", "abstract public function updateSetting($key,$value);", "protected function set_prop( $prop, $value ) {\n\n\t\tif ( 'switch_data' == $prop ) {\n\t\t\t$prop = 'subscription_switch_data';\n\t\t}\n\n\t\t$this->$prop = $value;\n\n\t\t// The requires manual renewal prop uses boolean values but it stored as a string\n\t\tif ( 'requires_manual_renewal' === $prop ) {\n\t\t\tif ( false === $value || '' === $value ) {\n\t\t\t\t$value = 'false';\n\t\t\t} else {\n\t\t\t\t$value = 'true';\n\t\t\t}\n\t\t}\n\n\t\tupdate_post_meta( $this->get_id(), '_' . $prop, $value );\n\t}", "public function __set($key, $value){\n $this->properties[$key] = $value;\n }", "function __set($key, $value) {\n if (method_exists($this, 'set_' . $key)) {\n $this->{'set_' . $key}($value);\n } else {\n $this->properties->{$key} = $value;\n $this->update($key);\n }\n }", "public function setProperty($key, $value)\n {\n $this->_beanContext->setProperty($key, $value);\n $this->_arrayContext[$key] = $value;\n }", "function updateProperty($property) {\n $propertyID = (int) $property['property_id'];\n $sqlQuery = \"UPDATE property SET \";\n $sqlQuery .= \" _typeofhouse_id = '\" . $property['_typeofhouse_id'] . \"',\";\n $sqlQuery .= \" _county_id = '\" . $property['_county_id'] . \"',\";\n $sqlQuery .= \" address1 = '\" . $property['address1'] . \"',\";\n $sqlQuery .= \" price = '\" . $property['price'] . \"', \";\n $sqlQuery .= \" _houseprice_id = '\" . $property['_houseprice_id'] . \"', \";\n $sqlQuery .= \" status = '\" . $property['status'] . \"'\";\n\n $sqlQuery .= \" WHERE property_id = $propertyID\";\n\n $result = mysql_query($sqlQuery);\n\n if (!$result) {\n die(\"error\" . mysql_error());\n }\n}", "public function __set($prop, $val) {\n\t\t$this->props[$prop] = $val;\n }", "protected function updateProperties() {\n\t\tglobal $ilDB;\n\t\tforeach ($this->property as $key => $value) {\n\t\t\t$ilDB->update('il_dcl_field_prop', array(\n\t\t\t\t'value' => array( 'integer', $value ),\n\t\t\t), array(\n\t\t\t\t'field_id' => array( 'integer', $this->getId() ),\n\t\t\t\t'datatype_prop_id' => array( 'integer', $key ),\n\t\t\t));\n\t\t}\n\t}", "public function set_the_single_property($key, $value) {\n\n self::$the_single_property[$key] = $value;\n\n }", "function set($prop_name,$prop_value,$id=false){\n $this->changed = true;\n $this->data[$prop_name] = $prop_value;\n if($id){\n $this->id = $prop_value;\n }\n }", "public function putMapEntry(PropertyMapKey $property, $key, $value): void\n {\n $map = &$this->get($property);\n if (!$property->allowsOverwrite() && array_key_exists($key, $map)) {\n throw new ProcessEngineException(\"Cannot overwrite property key \" . $key . \". Key already exists\");\n }\n $map[$key] = $value;\n\n if (!$this->contains($property)) {\n $this->set($property, $map);\n }\n }", "public function __set(string $key, mixed $value)\n\t{\n\t\tif ($this->__isset($key))\n\t\t{\n\t\t\t$property = $this->_get_property($key);\n\n\t\t\tif ($property !== NULL)\n\t\t\t{\n\t\t\t\t$property->setValue($this->_friend_, $value);\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test prepending a new node (adding as the first child)
public function testPrepend() { $node = $this->loadNode(0,NI_LEVELS-2); $descendantCount = $node->descendants()->count(); $new = new NestedInterval(); $new->name = $node->name.'.'.(NI_CHILDREN+1); $node->prepend($new,false); $children = $node->children()->findAll(); $this->assertEquals($descendantCount+1,$node->descendants()->count()); $this->assertCount(NI_CHILDREN+1,$children); foreach ($children as $n=>$child) { if ($n===0) { $this->assertEquals($new->name,$child->name); $this->assertEquals(0,$child->children()->count()); } $n++; $this->assertTrue($child->isChildOf($node)); $this->assertEquals($n,$child->getPosition()); } }
[ "public function testAppendChildNewNode()\n {\n $this->_testAppend(true, false);\n }", "public function insertAsFirstChildOf(\\App\\DomainObject\\Node $node);", "public function testPrepend()\n {\n $dom = new DomQuery('<a>X</a>');\n $dom->find('a')->prepend('<span></span>', '<i></i>');\n $this->assertEquals('<a><i></i><span></span>X</a>', (string) $dom);\n $this->assertEquals(1, $dom->find('span')->length);\n }", "public function insertBefore (DOMNode $newnode , $refnode = null) {}", "public function testPrependChild_prependsElement_ifZeroChildrenExist()\n\t{\n\t\t$child = new Element();\n\t\t\n\t\t$group = new Group();\n\t\t$group->prependChild($child);\n\t\t\n\t\t$this->assertTrue(is_array($group->getChildren()));\n\t\t$this->assertTrue(count($group->getChildren()) == 1);\n\t\t$this->assertSame($child, reset($group->getChildren()));\n\t\t$this->assertSame($group, $child->getParent());\n\t\t\n\t\treturn;\n\t}", "function prependSibling($newnode, $context) {\n $this->createContext($newnode, 'xml');\n $this->createContext($context, 'xpath');\n \n if (!$context || !$newnode) {\n return FALSE;\n }\n \n return $context->parentNode->insertBefore($newnode, $context);\n }", "public function prepend(DOMElement &$parent, &$child);", "public function makeFirstChildOf($node);", "public function insertBefore (DOMNode $newnode, DOMNode $refnode = null) {}", "function prepend($data) {\n\t\tif ($this->firstNode == null) {\n\t\t\t$this->firstNode = new Node($data);\n\t\t} else {\n\t\t\t$node = new Node($data);\n\t\t\t$aux = $this->firstNode;\n\t\t\t$this->firstNode = $node;\n\n\t\t\t$node->setNextNode($aux); \n\t\t}\n\n\t}", "public function prepend_to($node) {\n\t \treturn $this->move($node, 'child');\n\t }", "public function testMoveToFirstChildNodeReturnsTrueAndMovesCursorWhenCursorOnElementNodeWhithChildNode(): void\n {\n $sut = new XmlTraverser($this->getXml('firstchildnode_0002.xml'));\n \n // Before.\n $beforeValue = \"\\n\".\n \" <!-- Comment -->\\n\".\n \" <first>foo</first>\\n\";\n self::assertSame('root', $sut->getLocalName());\n self::assertSame('http://example.org', $sut->getNamespace());\n self::assertSame($beforeValue, $sut->getValue());\n \n self::assertTrue($sut->moveToFirstChildNode());\n \n // After.\n self::assertSame('', $sut->getLocalName());\n self::assertSame('', $sut->getNamespace());\n self::assertSame(\"\\n \", $sut->getValue());\n }", "public function prependChild(DOMNode $node)\n {\n if (is_null($this->firstChild)) {\n $this->appendChild($node);\n }\n\n else {\n $this->insertBefore($node, $this->firstChild);\n }\n }", "public function test_insert_as_first_child()\r\n\t{\r\n\t\t$node_3 = ORM::factory('test_orm_mptt', 3);\r\n\t\t$node_4 = ORM::factory('test_orm_mptt', 4);\r\n\t\t\r\n\t\t$child_node = ORM::factory('test_orm_mptt')->insert_as_first_child($node_3);\r\n\t\t\r\n\t\t$node_3->reload();\r\n\t\t$node_4->reload();\r\n\t\t\r\n\t\t$this->assertTrue($child_node->is_child($node_3));\r\n\r\n\t\t// Make sure the parent_id was set correctly\r\n\t\t$this->assertEquals(3, $child_node->parent_id);\r\n\t\t\r\n\t\t// Make sure the space was adjusted correctly\r\n\t\t$this->assertEquals(5, $child_node->lft);\r\n\t\t$this->assertEquals(11, $node_3->rgt);\r\n\t\t$this->assertEquals(7, $node_4->lft);\r\n\t}", "public function testMoveToFirstChildNodeReturnsFalseAndDoesNotMoveCursorWhenCursorOnElementNodeWhithNoChildNode(): void\n {\n $sut = new XmlTraverser($this->getXml('firstchildnode_0001.xml'));\n \n $localName = 'root';\n $namespace = 'http://example.org';\n $value = '';\n \n // Before.\n self::assertSame($localName, $sut->getLocalName());\n self::assertSame($namespace, $sut->getNamespace());\n self::assertSame($value, $sut->getValue());\n \n self::assertFalse($sut->moveToFirstChildNode());\n \n // After.\n self::assertSame($localName, $sut->getLocalName());\n self::assertSame($namespace, $sut->getNamespace());\n self::assertSame($value, $sut->getValue());\n }", "public function prepend(XMLNode $value)\n\t\t{\n\t\t\treturn array_unshift($this->nodes, $value);\n\t\t}", "public function prepend(DOMElement &$parent, &$child)\n {\n if (empty($child)) {\n throw new InvalidArgumentException('You are trying to prepend an empty element.');\n }\n\n // Append before first child\n if ($parent->childNodes->length > 0) {\n $parent->insertBefore($child, $parent->childNodes->item(0));\n } else {\n $this->append($parent, $child);\n }\n\n // Return the DOMElement\n return $parent;\n }", "function newItemBefore()\n\t{\n\t\t$li =& $this->getNode();\n\t\t$new_li =& $this->dom->create_element(\"ListItem\");\n\t\t$new_li =& $li->insert_before($new_li, $li);\n\t}", "public function test_move_to_first_child_above()\r\n\t{\r\n\t\t$node_3 = ORM::factory('test_orm_mptt', 3);\r\n\t\t$node_2 = ORM::factory('test_orm_mptt', 2);\r\n\t\t\r\n\t\t$node_2->move_to_first_child($node_3);\r\n\t\t\r\n\t\t$node_3->reload();\r\n\t\t$node_4 = ORM::factory('test_orm_mptt', 4);\r\n\r\n\t\t// Make sure the parent_id was set correctly\r\n\t\t$this->assertEquals(3, $node_2->parent_id);\r\n\t\t\r\n\t\t// Make sure the space was adjusted correctly\r\n\t\t$this->assertEquals(3, $node_2->left());\r\n\t\t$this->assertEquals(4, $node_2->right());\r\n\t\t$this->assertEquals(9, $node_3->right());\r\n\t\t$this->assertEquals(5, $node_4->left());\r\n\t\t$this->assertEquals(8, $node_4->right());\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines if a class implements the given interface.
function implementsInterface($interface) { if ($interface) { return (array_search($interface, $this->_classInterfaces) !== false); } return false; }
[ "public static function classImplementsInterface($class, $interface) {\r\n if (!class_exists($class)) return false;\r\n\r\n $tmp_impl = class_implements($class);\r\n if (isset($tmp_impl[$interface])) return true;\r\n\r\n return false;\r\n }", "function is_implementation($class, string $interface): bool\n{\n assert(interface_exists($interface), 'Expected valid `$interface`');\n return is_string($class) && !empty(class_implements($class)[$interface]);\n}", "public function isInterface() {\n return INTERFACE_CLASS == $this->classType();\n }", "private static function implementsInterface($class)\n {\n $interfaces = class_implements($class);\n\n return isset($interfaces[EvaluationRules\\EvaluationRuleInterface::class]);\n }", "public function isInterface();", "public static function has_interface($class_name, $interface_name)\n {\n self::_check_class($class_name);\n \n /**\n * Check interface implementation via reflection.\n */\n $reflection = new ReflectionClass($class_name);\n return $reflection->implementsInterface($interface_name);\n }", "public function isInterface($class)\n {\n return (new \\ReflectionClass($class))->isInterface();\n }", "public static function implementsInterface($class, $interfaceClass)\n {\n $interfaces = class_implements($class);\n return isset($interfaces[$interfaceClass]);\n }", "public function isInterface()\n {\n return $this->type == 'interface';\n }", "public function has(string $interface): bool;", "protected function component_implements(string $component, string $interface) : bool {\n $providerclass = $this->get_provider_classname($component);\n if (class_exists($providerclass)) {\n $rc = new \\ReflectionClass($providerclass);\n return $rc->implementsInterface($interface);\n }\n return false;\n }", "private static function implementsInterface($class)\n {\n $interfaces = class_implements($class);\n\n return isset($interfaces[ColumnInterface::class]);\n }", "public static function implementsInterface(string $implementerClassName, string $interfaceName) : bool\n {\n return \\in_array($interfaceName, \\class_implements($implementerClassName), true);\n }", "public function isInterface() {\n return $this->_reflect->isInterface();\n }", "public function implementsInterface($interface);", "function has_contract($object,$interface)\n {\n $interfaces = class_implements($object);\n return isset($interfaces[$interface]);\n }", "public function isInterface() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }", "public function hasInterface(string $name): bool\n {\n return interface_exists($this->normalizeName($name));\n }", "public function implementsInterface($interface){}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fin extraer datos del archivo XML. Obtener RFC Proveedores.
public function obtenerRFCProveedores($rfcEmisor) { $Conexion = new dataBaseConn(); $queryRFCPr = $Conexion -> prepare("SELECT rfc_prov FROM proveedores_datos_fiscales WHERE rfc_prov = :emisorRFC;"); $queryRFCPr -> bindParam(':emisorRFC', $rfcEmisor); $queryRFCPr -> execute(); $rowsRFCPr = $queryRFCPr -> rowCount(); if ($rowsRFCPr != 0) { $this -> msjErr = "Proveedor con el RFC: ".$rfcEmisor." guardado anteriormente."; } }
[ "public static function GetProveedores(){\n $objArray = Archivos::ExtraerMatizArchCsv(ProveedorDb::$fileUrlTxt); \n $listaProveedores = array(); \n \n for($i =0; $i<count($objArray); $i++){ \n $proveedor = new Proveedor($objArray[$i], $objArray[$i][\"urlImagen\"]); \n $listaProveedores[] = $proveedor; \n }\n \n return $listaProveedores;\n }", "function obtenerProveedores(){\n \t$db = obtenerBaseDeDatos();\n \t$sentencia = $db->query(\"SELECT * FROM empresas\");\n \treturn $sentencia->fetchAll();\n }", "function listar_proveedores(){\n\t\t$sql=\"\n\tSELECT\n\t\tcp.IDPROVEEDOR IDPROV, cp.NOMBREFISCAL, cp.NOMBRECOMERCIAL, \n\t\tcp.IDTIPODOCUMENTO, cp.IDDOCUMENTO, cp.EMAIL1, cp.EMAIL2, cp.EMAIL3,\n\t\tcp.BRSCH, csb.RAMO, cp.FDGRV, cp.ZTERM, cp.MWSKZ, cp.PARVO, cp.PAVIP,\n\t\tcp.ACTIVO,cp.INTERNO,\n\t\tcp.ARREVALRANKING,\n\t\tcp.CDE,\n\t\tcp.SKILL,\n\t\tcp.EVALFIDELIDAD,\n\t\tcp.EVALINFRAESTRUCTURA,\n\t\tcp.EVALSATISFACCION,\n\t\tcp.IDMONEDA,\n\t\tYEAR(cp.FECHAINICIOACTIVIDADES) ANIO,\n\t\tMONTH(cp.FECHAINICIOACTIVIDADES) MES, \n\t\tDAY(cp.FECHAINICIOACTIVIDADES) DIA,\n\t\tcpu.*,\n\t\tcpt.*\n\tFROM\n\t$this->catalogo.catalogo_proveedor cp\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_ubigeo cpu ON cp.IDPROVEEDOR=cpu.IDPROVEEDOR \n\t\tLEFT JOIN $this->catalogo.catalogo_sap_brsch csb ON cp.BRSCH = csb.BRSCH\t\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_telefono cpt ON cp.IDPROVEEDOR = cpt.IDPROVEEDOR AND cpt.PRIORIDAD=1\n\t\n\t\t\";\n\n\t$result =$this->query($sql);\n\treturn $result;\n\t}", "public function getProveedorRfc()\n {\n\n return $this->proveedor_rfc;\n }", "public function getProveedores() {\n $database = new database();\n $db = $database->getConnection();\n $query = $db->prepare('SELECT p.* FROM proveedor as p');\n $query->execute();\n if ($query->rowCount() > 0) {\n $query->setFetchMode(PDO::FETCH_OBJ);\n return $query->fetchAll();\n } else {\n return false;\n }\n }", "private function leeGrupo(){\n\t\t$xml_file= $this->GRUPO;\n\t\t$aux=array();\n\n\t\tif(!is_file($xml_file)) {\n\t\t\tdie(\"Error opening xml file\");\n\t\t}\n\n\t\t$dom = new DOMDocument(\"1.0\");\n\n\t\t$dom = new DomDocument;\n\t\t$dom->validateOnParse = true;\n\n\t\t$dom->load($xml_file);\n\t\t$params = $dom->getElementsByTagName('grupo_tipoprop');\n\n\t\tforeach ($params as $param) {\n\t\t\t$aux[]=array('grupo'=>$param->getAttribute('grupo'),'id_tipo_prop'=>$param->nodeValue);\n\t\t}\n\t\t$this->lista=$aux;\n//\t\tprint_r($this->lista);\n\t}", "public static function GetProveedoresByNombre($nombre){\n $objArray = Archivos::ExtraerMatizArchCsv(ProveedorDb::$fileUrlTxt); \n $listaProveedores = array(); \n\n for($i =0; $i<count($objArray); $i++){ \n $proveedor = new Proveedor($objArray[$i], $objArray[$i][\"urlImagen\"]); \n if($proveedor->nombre == $nombre){\n $listaProveedores[] = $proveedor; \n }\n }\n \n return $listaProveedores;\n }", "function lugarExpedicion() {\n\t\t$this -> xml -> registerXPathNamespace('c', $this -> namespaces['tfd']);\n\n\t\tforeach ($this -> xml ->xpath('//cfdi:Comprobante') as $Comprobante) {\n\t\t\t$this -> lugarExpedicion = \"{$Comprobante['LugarExpedicion']}\";\n\t\t}\n\t\treturn $this -> lugarExpedicion;\n }", "public function select($proveedores){\n $idPROVEEDORES=$proveedores->getIdPROVEEDORES();\n\n try {\n $sql= \"SELECT `idPROVEEDORES`, `NOMBREEMPRESA_PROVEEDORES`, `NOMBREEMPLEADO_PROVEEDORES`, `DESCUENTO_PROVEEDOR`, `FECHAINGRESO_PROVEEDORES`\"\n .\"FROM `proveedores`\"\n .\"WHERE `idPROVEEDORES`='$idPROVEEDORES'\";\n $data = $this->ejecutarConsulta($sql);\n for ($i=0; $i < count($data) ; $i++) {\n $proveedores->setIdPROVEEDORES($data[$i]['idPROVEEDORES']);\n $proveedores->setNOMBREEMPRESA_PROVEEDORES($data[$i]['NOMBREEMPRESA_PROVEEDORES']);\n $proveedores->setNOMBREEMPLEADO_PROVEEDORES($data[$i]['NOMBREEMPLEADO_PROVEEDORES']);\n $proveedores->setDESCUENTO_PROVEEDOR($data[$i]['DESCUENTO_PROVEEDOR']);\n $proveedores->setFECHAINGRESO_PROVEEDORES($data[$i]['FECHAINGRESO_PROVEEDORES']);\n\n }\n return $proveedores; } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n return null;\n }\n }", "public function getIdProveedores(){\n return $this->idProveedores;\n }", "public function getDireccionProveedor(){\n return $this->direccionProveedor;\n }", "public static function getProveedoresLista()\n {\n $dropciones = Proveedores::find()->asArray()->all();\n return ArrayHelper::map($dropciones,'id','razonSocial');\n }", "function listarProcesos(){\r\n log_message('DEBUG', '#TRAZA | TRAZ-PROD-TRAZASOFT | Procesos | listarProcesos');\r\n $resource = '/procesos/list/empresa/'.empresa();\r\n $url = REST_PRD_ETAPAS . $resource;\r\n $array = $this->rest->callApi('GET', $url);\r\n return json_decode($array['data']);\r\n }", "public function obteterDatos($id_Proveedor){\n\t\t\techo '---'.$id_Proveedor.'---';\n\t\t\t$conexion = $this->conn;\n\t\t\t$sth = $conexion->prepare('SELECT id_Proveedor, nombre_proveedor as nombre, fecha_registro ,prop.tipo_procedencia , rfc, telefono , email , direccion , tipop.tipo , nickname , password , url_image from '.$this->nombreTabla.' proveedor , procendias_proveedor prop, tipos tipop where estado = 1 and proveedor.id_tipo_procedencia= prop.id_tipo_procedencia and proveedor.id_tipo = tipop.id_tipo and id_Proveedor = :id_Proveedor', array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\t\n\t\t\t$sth->bindParam(':id_Proveedor', $id_Proveedor, PDO::PARAM_INT );\n\t\t\t$sth->execute();\n\t\t\t$row = $sth->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row;\n\t\t}", "function rfcReceptor() {\n\n foreach ($this->xml->xpath('//cfdi:Comprobante//cfdi:Receptor') as $receptor) {\n $this->rfcReceptor = $receptor['rfc'] != \"\" ? $receptor['rfc'] : $receptor['Rfc'];\n }\n\n if (gettype($this->rfcReceptor) == 'object') {\n $_receptor = (array) $this->rfcReceptor;\n $this->rfcReceptor = $_receptor[0];\n }\n\n return $this->rfcReceptor;\n }", "function f_get_x_proveedor($cod_pk_proveedor,$num_limit=null){\n\t \t\tif(!$cod_pk_proveedor)return false;\n\t\t\tglobal $db;\n\n\n\t \t\tif($num_limit > 0){\n\t \t\t\t$condicion_extra = \"limit 0,\".$num_limit;\n\t \t\t}\n\t\t\t\n\t\t\t$query = \"select \tep.*,\n\t\t\t\t\t\t\t\tpr.txt_nombre as txt_producto,\n\t\t\t\t\t\t\t\tconcat(p.txt_nombre,' ',ifnull(p.txt_apellido, '')) as txt_proveedor,\n\t\t\t\t\t\t\t\tifnull(su.txt_nombre, su.txt_login) as txt_usuario,\n\t\t\t\t\t\t\t\tum.txt_nombre as txt_unidad_medida\t\t\t\t\t\t\t\n\t\t\t\t\t\tfrom \tentrada_producto \tep \t,\n\t\t\t\t\t\t\t\tproveedor \t\t\tp\t,\n\t\t\t\t\t\t\t\tunidad_medida\t\tum\t,\n\t\t\t\t\t\t\t\tseg_usuario\t\t\tsu\t,\n\t\t\t\t\t\t\t\tproducto\t\t\tpr\n\t\t\t\t\t\twhere \tep.cod_proveedor \t\t= $cod_pk_proveedor\n\t\t\t\t\t\tand\t\tep.cod_proveedor \t\t= p.cod_proveedor\n\t\t\t\t\t\tand\t\tum.cod_unidad_medida \t= ep.cod_unidad_medida\n\t\t\t\t\t\tand\t\tep.cod_usuario\t\t\t= su.cod_usuario_pk\t \n\t\t\t\t\t\tand\t\tep.cod_producto\t\t\t= pr.cod_producto\n\t\t\t\t\t\tand\t\tep.cod_estado_entrada_producto\t= 1\n\t\t\t\t\t\tand \tep.ind_bloqueado = 0 order by fec_registro desc \".$condicion_extra;\n\n\t\t\t$cursor = $db->consultar($query);\n\t\t\treturn $cursor;\n\t\t\t\n\t\t\n\t\t}", "public function cargarProyectos() {\n try {\n if ($_SESSION['posicion'] == 0) {\n $query = $this->db->connect()->prepare('SELECT nombre \n FROM proyecto');\n\n $query->execute();\n }\n else if ($_SESSION['posicion'] == 1) {\n $query = $this->db->connect()->prepare('SELECT nombre \n FROM proyecto\n WHERE departamento = :departamento');\n\n $query->execute(['departamento' => $_SESSION['departamento']]);\n }\n else {\n $query = $this->db->connect()->prepare('SELECT nombre \n FROM proyecto\n WHERE administrador = :cedula');\n\n $query->execute(['cedula' => $_SESSION['cedula']]);\n }\n\n $proyectos = [];\n\n while ($registro = $query->fetch()) {\n array_push($proyectos, $registro['nombre']);\n }\n\n return $proyectos;\n }\n catch (PDOException $e) {\n return $e;\n }\n }", "private function cargar_Contactos(){\n\t\t$query = \"SELECT fk_contacto\n\t\t\t\t\tFROM proveedores_rel_contactos\n\t\t\t\t\tWHERE fk_proveedor = '$this->NIF' AND fk_contacto <> '0'\";\n\n\t\t$result = mysql_query($query);\n\n\t\t$this->contactos = array();\n\t\twhile($row = mysql_fetch_array($result))\n\t\t$this->contactos[] = $row['fk_contacto'];\n\t}", "public function get_etiquetas_proyectos() {\r\n $this->dbh = Conexion::singleton_conexion();\r\n \r\n try {\r\n $query = $this->dbh->prepare('SELECT etiquetas FROM fichaproyecto');\r\n $query->execute();\r\n $this->dbh = null;\r\n return $query->fetchAll();\r\n }catch (PDOException $e) {\r\n $e->getMessage();\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Let us know if the search engine is currently available
public function isAvailable() { return $this->_searchHandler->isAvailable(); }
[ "public function isSearchEngine()\n {\n return $this->_store['search_engine'];\n }", "function wp_ozh_wsa_is_fromsearchengine() {\r\n\tglobal $wp_ozh_wsa;\r\n\t$ref = $_SERVER['HTTP_REFERER'];\r\n\tif (isset($wp_ozh_wsa['my_search_engines'])) {\r\n\t\t$SE = $wp_ozh_wsa['my_search_engines'];\r\n\t} else {\r\n\t\t$SE = array('/search?', '.google.', 'web.info.com', 'search.', 'del.icio.us/search',\r\n\t\t'soso.com', '/search/', '.yahoo.', \r\n\t\t);\r\n\t}\r\n\tforeach ($SE as $url) {\r\n\t\tif (strpos($ref,$url)!==false) return true;\r\n\t}\r\n\treturn false;\t\r\n}", "public function is_search()\n {\n }", "function site_uses_google_search() {\n\treturn site_uses_search() && gcse_id();\n}", "public function searchQueryChecker();", "public function requires_search() {\n\t\treturn false;\n\t}", "public function Check_Search_Engines ($search_engine_name, $search_engine = null) {\r\n\t\t\r\n\t\t\tif( strstr($search_engine, $search_engine_name) ) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t}", "private function detectRefererSearchEngine()\n\t{\n\t\t/*\n\t\t * A referer is a search engine if the URL's host is in the SearchEngines array\n\t\t * and if we found the keyword in the URL.\n\t\t *\n\t\t * For example if someone comes from http://www.google.com/partners.html this will not\n\t\t * be counted as a search engines, but as a website referer from google.com (because the\n\t\t * keyword couldn't be found in the URL)\n\t\t */\n\t\trequire \"modules/DataFiles/SearchEngines.php\";\n\n\t\tif(array_key_exists($this->refererHost, $GLOBALS['Piwik_SearchEngines']))\n\t\t{\n\t\t\t// which search engine ?\n\t\t\t$searchEngineName = $GLOBALS['Piwik_SearchEngines'][$this->refererHost][0];\n\t\t\t$variableName = $GLOBALS['Piwik_SearchEngines'][$this->refererHost][1];\n\n\t\t\t// if there is a query, there may be a keyword...\n\t\t\tif(isset($this->refererUrlParse['query']))\n\t\t\t{\n\t\t\t\t$query = $this->refererUrlParse['query'];\n\n\t\t\t\t// search for keywords now &vname=keyword\n\t\t\t\t$key = trim(strtolower(Piwik_Common::getParameterFromQueryString($query, $variableName)));\n\n\t\t\t\tif((function_exists('iconv'))\n\t\t\t\t\t&& (isset($GLOBALS['Piwik_SearchEngines'][$this->refererHost][2])))\n\t\t\t\t{\n\t\t\t\t\t$charset = trim($GLOBALS['Piwik_SearchEngines'][$this->refererHost][2]);\n\n\t\t\t\t\tif(!empty($charset))\n\t\t\t\t\t{\n\t\t\t\t\t\t$key = htmlspecialchars(\n\t\t\t\t\t\t\t\t\t@iconv(\t$charset,\n\t\t\t\t\t\t\t\t\t\t\t'utf-8//TRANSLIT',\n\t\t\t\t\t\t\t\t\t\t\t//TODO testthis fnction exists!! use upgrade.php\n\t\t\t\t\t\t\t\t\t\t\thtmlspecialchars_decode($key, Piwik_Common::HTML_ENCODING_QUOTE_STYLE))\n\t\t\t\t\t\t\t\t\t, Piwik_Common::HTML_ENCODING_QUOTE_STYLE);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tif(!empty($key))\n\t\t\t\t{\n\t\t\t\t\t$this->typeRefererAnalyzed = Piwik_Common::REFERER_TYPE_SEARCH_ENGINE;\n\t\t\t\t\t$this->nameRefererAnalyzed = $searchEngineName;\n\t\t\t\t\t$this->keywordRefererAnalyzed = $key;\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function inspiry_is_search_page_configured() {\n\n\t\t/* Check search page */\n\t\t$inspiry_search_page = get_option('inspiry_search_page');\n\t\tif ( ! empty( $inspiry_search_page ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/* Check search url which is deprecated and this code is to provide backward compatibility */\n\t\t$theme_search_url = get_option('theme_search_url');\n\t\tif ( ! empty( $theme_search_url ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t/* Return false if all fails */\n\t\treturn false;\n\t}", "private function should_display_search_engines_discouraged_notice()\n {\n }", "function aecom_is_office_search() {\n if ( function_exists( 'urs_content_is_office_search' ) ) {\n return urs_content_is_office_search();\n }\n return is_search();\n}", "function is_search() {\n\t$search = SEARCH;\n\treturn(!empty($search));\n}", "public function isSearchRequest() : bool;", "public function supportsTermSearch() {\n \treturn $this->manager->supportsTermSearch();\n\t}", "protected function sphinxSearchEnabled() {\n\t\treturn $this->pObj->extConfPremium['enableSphinxSearch'] && !$this->pObj->isEmptySearch;\n\t}", "private function getCurrentSearchEngine()\n {\n return $this->klevuHelperConfig->getCurrentEngine();\n }", "public function isCatalogSearch()\n {\n $pathInfo = $this->_getRequest()->getPathInfo();\n if (stripos($pathInfo, '/catalogsearch/result') !== false) {\n return true;\n }\n return false;\n }", "protected function checkIfQueryIsForSearchingPurpose()\n {\n if( $this->request->isSearchable() )\n {\n $this->searchQuery();\n }\n }", "private function getSupportedSearchEngines()\n {\n return $this->supportedSearchEngines;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new UnidadHabitacional entity.
public function createAction(Request $request) { $entity = new UnidadHabitacional(); $user = $this->getUser(); $fecha = new \DateTime(date('d-M-y')); $form = $this->createCreateForm($entity); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); // seteando usuario logeado $entity->setUsuario($user); // buscando al objeto fuente datos de entrada $datosEntrada = $em->getRepository('SrpvProtocolizacionBundle:FuenteDatosEntrada')->find(1); //seteando la entrada por defecto $entity->setFuenteDatosEntrada($datosEntrada); //seteando fecha de creacion $entity->setFechaCreacion($fecha); $em->persist($entity); $em->flush(); // verificando si hay cantidad de unidades en desarrollo $desarrollo = $em->getRepository('SrpvProtocolizacionBundle:Desarrollo')->find($entity->getDesarrollo()); // si hay cantidades se suma 1 nueva unidad if($desarrollo->getTotalUnidades() != NULL){ $cantidad = $desarrollo->getTotalUnidades() + 1; $desarrollo->setTotalUnidades($cantidad); $em->persist($desarrollo); $em->flush(); // si cantidad de unidades es null, esta es su primer unidad }else{ $desarrollo->setTotalUnidades(1); $em->persist($desarrollo); $em->flush(); } return $this->redirect($this->generateUrl('unidad_show', array('id' => $entity->getId()))); } return $this->render('SrpvProtocolizacionBundle:UnidadHabitacional:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); }
[ "public function createAction(Request $request)\n {\n $user = $this->getUser(); if ($user == '') { return $this->redirect($this->generateUrl('LIHotelBundle_homepage')); }\n $entity = new Habitacion();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $tipo = $entity->getTipo();\n $bebidas = $tipo->getbebidasMinibar();\n $servicios = $tipo->getServicios();\n\n if($bebidas != null){\n foreach ($bebidas as $bebida) {\n $bebida->settipoHabitacion($tipo);\n }\n }else{\n $this->get('session')\n ->getFlashBag()\n ->add('msj_habitacion', 'No has agregado bebidas al minibar.');\n }\n\n if($servicios != null){\n foreach ($servicios as $servicio) {\n $servicio->setTipo($tipo);\n }\n }else{\n $this->get('session')\n ->getFlashBag()\n ->add('msj_habitacion', 'No has agregado ningun servicio.');\n }\n\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('habitacion_show', array('id' => $entity->getId())));\n }\n\n return $this->render('LIHotelBundle:Habitacion:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function store(HabitatRequest $request)\n {\n $proprio = Auth::user()->id;\n\n $image = Storage::disk('public')->put('', $request->file('image'));\n\n Habitat::create([\n 'id_proprietaire' => $proprio,\n 'id_type_habitat' => $request->type_habitat,\n 'titre' => $request->titre,\n 'description' => $request->description,\n 'photo' => $image,\n 'adresse' => $request->adresse,\n 'code_postal' => $request->code_postal,\n 'ville' => $request->ville,\n 'nb_lit_simple' => $request->nb_lit_simple,\n 'nb_lit_double' => $request->nb_lit_double,\n 'nb_personne_max' => $request->nb_personne_max,\n 'date_debut_dispo' => date('Y-m-d', strtotime($request->date_debut_dispo)),\n 'date_fin_dispo' => date('Y-m-d', strtotime($request->date_fin_dispo)),\n 'prix' => $request->prix,\n ]);\n\n return redirect(route('home'));\n }", "private function createCreateForm(UnidadHabitacional $entity)\n {\n $form = $this->createForm(new UnidadHabitacionalType(), $entity, array(\n 'action' => $this->generateUrl('unidad_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Crear'));\n\n return $form;\n }", "public function newAction()\n {\n $user = $this->getUser(); if ($user == '' || !$this->es_admin()) { return $this->redirect($this->generateUrl('LIHotelBundle_homepage')); }\n $entity = new Habitacion();\n $form = $this->createCreateForm($entity);\n\n return $this->render('LIHotelBundle:Habitacion:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n}", "public function store(Createtipo_habitacionRequest $request)\n {\n $input = $request->all();\n\n $tipoHabitacion = $this->tipoHabitacionRepository->create($input);\n\n Flash::success('Tipo Habitacion saved successfully.');\n\n return redirect(route('tipoHabitacions.index'));\n }", "public function store(CreateHabitRequest $request)\n {\n $input = $request->all();\n\n $habit = $this->habitRepository->create($input);\n\n Flash::success('Habit saved successfully.');\n\n return redirect(route('habits.index'));\n }", "public function actionCreate()\n {\n $model = new HabitanteHasMascota();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idHabitante_has_mascota]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function save(Habiter $habiter)\n {\n $this->em->persist($habiter);\n $this->em->flush();\n }", "public function createAction(Request $request)\n {\n $entity = new TipoHab();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('tipohab_show', array('id' => $entity->getId())));\n }\n\n return $this->render(\n 'NomencladorBundle:TipoHab:new.html.twig',\n array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n )\n );\n }", "public function Create()\n\t{\n\t\ttry\n\t\t{\n\t\t\t\t\t\t\n\t\t\t$json = json_decode(RequestUtil::GetBody());\n\n\t\t\tif (!$json)\n\t\t\t{\n\t\t\t\tthrow new Exception('The request body does not contain valid JSON');\n\t\t\t}\n\n\t\t\t$safhuman = new SafHuman($this->Phreezer);\n\n\t\t\t// TODO: any fields that should not be inserted by the user should be commented out\n\n\t\t\t// this is an auto-increment. uncomment if updating is allowed\n\t\t\t// $safhuman->Id = $this->SafeGetVal($json, 'id');\n\n\t\t\t$safhuman->Ci = $this->SafeGetVal($json, 'ci');\n\t\t\t$safhuman->Name = $this->SafeGetVal($json, 'name');\n\t\t\t$safhuman->BloodType = $this->SafeGetVal($json, 'bloodType');\n\t\t\t$safhuman->PhoneNumber = $this->SafeGetVal($json, 'phoneNumber');\n\t\t\t$safhuman->Enabled = $this->SafeGetVal($json, 'enabled');\n\n\t\t\t$safhuman->Validate();\n\t\t\t$errors = $safhuman->GetValidationErrors();\n\n\t\t\tif (count($errors) > 0)\n\t\t\t{\n\t\t\t\t$this->RenderErrorJSON('Please check the form for errors',$errors);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$safhuman->Save();\n\t\t\t\t$this->RenderJSON($safhuman, $this->JSONPCallback(), true, $this->SimpleObjectParams());\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\t$this->RenderExceptionJSON($ex);\n\t\t}\n\t}", "public function createAction()\n {\n $entity = new CineDebat();\n $request = $this->getRequest();\n $form = $this->createForm(new CineDebatType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $entity->getJour()->setTime($entity->getHeure()->format('H'),$entity->getHeure()->format('i'));\n// $lesintervenants = $entity->getLesintervenants();\n $existetelle = $em->getRepository('SiteParnalBundle:Seance')->findOneByJour($entity->getJour());\n if(!(isset($existetelle)))\n {\n $em->persist($entity); \n $em->flush();\n $val=1;\n } else $val=2;\n \n $response = new \\Symfony\\Component\\HttpFoundation\\Response();\n $response->setContent($val);\n return $response; \n \n }\n\n return $this->render('SiteParnalBundle:CineDebat:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function setCantidadHabitacion($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->cantidad_habitacion !== $v) {\n $this->cantidad_habitacion = $v;\n $this->modifiedColumns[] = RequerimientoPeer::CANTIDAD_HABITACION;\n }\n\n\n return $this;\n }", "public function Create()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t$json = json_decode(RequestUtil::GetBody());\r\n\r\n\t\t\tif (!$json)\r\n\t\t\t{\r\n\t\t\t\tthrow new Exception('The request body does not contain valid JSON');\r\n\t\t\t}\r\n\r\n\t\t\t$hospedagem = new Hospedagem($this->Phreezer);\r\n\r\n\t\t\t// TODO: any fields that should not be inserted by the user should be commented out\r\n\r\n\t\t\t// this is an auto-increment. uncomment if updating is allowed\r\n\t\t\t// $hospedagem->Id = $this->SafeGetVal($json, 'id');\r\n\r\n\t\t\t$hospedagem->Hospede = $this->SafeGetVal($json, 'hospede');\r\n\t\t\t$hospedagem->TpHospede = $this->SafeGetVal($json, 'tpHospede');\r\n\t\t\t$hospedagem->Quarto = $this->SafeGetVal($json, 'quarto');\r\n\t\t\t$hospedagem->DtEntrada = date('Y-m-d H:i:s',strtotime($this->SafeGetVal($json, 'dtEntrada')));\r\n\t\t\t$hospedagem->DtSaida = date('Y-m-d H:i:s',strtotime($this->SafeGetVal($json, 'dtSaida')));\r\n\t\t\t$hospedagem->MotivoViagem = $this->SafeGetVal($json, 'motivoViagem');\r\n\t\t\t$hospedagem->MeioTransporte = $this->SafeGetVal($json, 'meioTransporte');\r\n\t\t\t$hospedagem->UltimaProcedenciaPais = $this->SafeGetVal($json, 'ultimaProcedenciaPais');\r\n\t\t\t$hospedagem->UltimaProcedenciaEstado = $this->SafeGetVal($json, 'ultimaProcedenciaEstado');\r\n\t\t\t$hospedagem->UltimaProcedenciaCidade = $this->SafeGetVal($json, 'ultimaProcedenciaCidade');\r\n\t\t\t$hospedagem->ProxDestinoPais = $this->SafeGetVal($json, 'proxDestinoPais');\r\n\t\t\t$hospedagem->ProxDestinoEstado = $this->SafeGetVal($json, 'proxDestinoEstado');\r\n\t\t\t$hospedagem->ProxDestinoCidade = $this->SafeGetVal($json, 'proxDestinoCidade');\r\n\r\n\t\t\t$hospedagem->Validate();\r\n\t\t\t$errors = $hospedagem->GetValidationErrors();\r\n\r\n\t\t\tif (count($errors) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->RenderErrorJSON('Please check the form for errors',$errors);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$hospedagem->Save();\r\n\t\t\t\t$this->RenderJSON($hospedagem, $this->JSONPCallback(), true, $this->SimpleObjectParams());\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tcatch (Exception $ex)\r\n\t\t{\r\n\t\t\t$this->RenderExceptionJSON($ex);\r\n\t\t}\r\n\t}", "public function createAction(Request $request)\r\n {\r\n $entity = new Unidad();\r\n $form = $this->createForm(new UnidadType(1), $entity);\r\n $form->handleRequest($request);\r\n\r\n if ($form->isValid()) {\r\n //$currentUser = $this->container->get('security.context')->getToken()->getUser();\r\n //$entity->setUser($currentUser);\r\n $em = $this->getDoctrine()->getManager();\r\n /*foreach ($entity->getLineatrabajos() as $item) {\r\n $item->getMeds()->minusCount($item->getCount());\r\n }*/\r\n $em->persist($entity);\r\n $em->flush();\r\n\r\n $this->get('session')->getFlashBag()->add('info', \"La Unidad ha sido creada exitosamente.\");\r\n return $this->redirect($this->generateUrl('unidad_show', array('id' => $entity->getId())));\r\n }\r\n\r\n return $this->render('BenDoctorsBundle:Unidad:new.html.twig', array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n ));\r\n }", "public function createAction()\n {\n $entity = new Tribunal();\n $request = $this->getRequest();\n $form = $this->createForm(new TribunalType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $entity->setHabilitado(true);\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('tribunal_show', array('id' => $entity->getId(),\n 'status' => $this->container->getParameter('EXITO_REGISTRO'),)));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'status' => $this->container->getParameter('FALLO_REGISTRO'),\n );\n }", "public function createPetition(){\n Petition::create([\n 'title' => $this->title,\n 'description' => $this->description,\n 'users_id' => $this->users_id,\n ]);\n }", "public function createEntity();", "public function createAction()\n {\n $entity = new EnfantTiteur();\n $request = $this->getRequest();\n $form = $this->createForm(new EnfantTiteurType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\t\t\t$this->get('session')->setFlash('notice', 'Enfant titeur a été ajouté avec succès');\n\n return $this->redirect($this->generateUrl('enfanttiteur_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function createAction(Request $request) {\n $em = $this->getDoctrine()->getManager();\n\n $data = $request->get('planillas_id');\n\n $entity = new CHorario();\n if (isset($data['id']) && !empty($data['id'])) {\n $entity = $em->getRepository('PlanillasCoreBundle:CHorario')->find((int) $data['id']);\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find CHorario entity.');\n } else {\n\n //unset($request->get('id'));\n $form = $this->createEditForm($entity);\n }\n } else {\n //$entity->setMontoRestante(0);\n $form = $this->createCreateForm($entity);\n }\n $form = $this->createCreateForm($entity);\n\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n\n try {\n\n $em->persist($entity);\n $em->flush();\n $this->get('session')->getFlashBag()->add('info', 'Los datos han sido guardados correctamente');\n return $this->redirect($this->generateUrl('chorario'));\n } catch (Exception $e) {\n\n $this->get('session')->getFlashBag()->add('danger', $e->getMessage());\n return $this->redirect($this->generateUrl('chorario'));\n //exit;\n }\n }\n $this->get('session')->getFlashBag()->add('danger', 'No se pudieron guardar los datos');\n return $this->redirect($this->generateUrl('chorario'));\n /* return $this->render('PlanillasCoreBundle:CHorario:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n\n )); */\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true if the alert type specified is valid
private function isValidAlertType($type = '') { if(in_array($type, ['success', 'info', 'warning', 'danger'])) { return true; } return false; }
[ "function IsAlert($type) {\r\n return (is_array($_SESSION[$type]) && count($_SESSION[$type]) > 0);\r\n }", "public function can_handle( Alert $alert ) {\n\n\t\treturn in_array( $alert->get_type(), [ Alerts::FAILED_EMAIL ], true );\n\t}", "public function validateType( $type ) {\n\t\t$validated = parent::validateType( $type );\n\n\t\t// Any lite notification should pass here.\n\t\tif ( 'lite' === $type ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\treturn $validated;\n\t}", "function is_valid_type($type){\n\t\treturn in_array($type, $this->valid_types);\n\t}", "public function validType ($type) {\r\n return in_array($type, static::$types);\r\n }", "public function validateType()\n {\n $validTalkTypes = array(\n 'half-day-tutorial',\n 'full-day-tutorial',\n 'regular',\n 'lightning'\n );\n\n if (empty($this->_cleanData['type']) || !isset($this->_cleanData['type'])) {\n $this->_addErrorMessage(\"You must choose what type of talk you are submitting\");\n return false;\n }\n\n if (!in_array($this->_cleanData['type'], $validTalkTypes)) {\n $this->_addErrorMessage(\"You did not choose a valid talk type\");\n return false;\n }\n\n return true;\n }", "protected function validateType()\n {\n $types = [null, 'proportion', 'portion_num', 'portion_str'];\n\n return in_array($this->input['type'], $types, true);\n }", "protected function validateType($type)\n {\n $types = config('antares/licensing::types');\n if (!in_array($type, $types)) {\n $this->info(sprintf('Name of type called \"%s\" is not valid. Only {%s} can be used.', $type, implode(', ', $types)));\n return false;\n }\n return true;\n }", "public function validateType( $type ) {\n\t\t$validated = parent::validateType( $type );\n\n\t\t// Any pro notification should pass here.\n\t\tif ( 'all-pro' === $type ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\t// If we are targeting unlicensed users.\n\t\tif ( 'unlicensed' === $type && ! aioseo()->license->isActive() ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\t// If we are targeting licensed users.\n\t\tif ( 'licensed' === $type && aioseo()->license->isActive() ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\t// If we are targeting a specific user level.\n\t\tif ( aioseo()->internalOptions->internal->license->level === $type ) {\n\t\t\t$validated = true;\n\t\t}\n\n\t\treturn $validated;\n\t}", "public function is_setting_type_valid($type)\n {\n }", "public static function isValid($type)\n {\n return in_array($type, [\n self::STATE_DESIGN,\n self::STATE_PENDING,\n self::STATE_STARTED,\n self::STATE_RUNNING,\n self::STATE_PAUSED,\n self::STATE_ABORT,\n self::STATE_DONE,\n ]);\n }", "public function validateType(Type $type): bool;", "public static function validateActionType($type);", "public static function validate($type){\n return in_array($type, self::DESIGNER_TYPE);\n }", "public function is_allowed($alert_identifier)\n {\n }", "public function validateOptionType() {\r\n\t\t$isValid = false;\r\n\t\tforeach($this->optionTypes as $application => $optionTypes) {\r\n\t\t\tif(isset($optionTypes[$this->optionType])) {\r\n\t\t\t\t$isValid = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!$isValid) $this->errorType['optionType'] = 'invalid';\r\n\t}", "public function valid($type)\n\t{\n\n\t\t//Pluralize Module\n\t\t$module = $this->CoreForm->pluralize($this->Module);\n\t\t$coreModule = ucwords($this->Core).ucwords($module);\n\t\t$routeURL = (is_null($this->Route)) ? $module : $this->Route;\n\t\t$baseLoadPath = $this->CoreForm->pluralize($this->Folder).$this->SubFolder.'/';\n\n\t\t//Set Allowed Files\n\t\t$allowed_files = (is_null($this->AllowedFile))? 'jpg|jpeg|png|doc|docx|pdf|xls|txt' : $this->AllowedFile;\n\n\t\t//Check Validation\n\t\tif ($type == 'some condintion') {\n\n\t\t}\n\t\telse{\n session()->flash('notification','notify'); //Notification Type\n\t\t\t$this->index(); //Index Page\n\t\t}\n\t}", "function validAppType($apptype)\n {\n $validAppArray = array(\"individual\",\"group\",\"organization\", \"school\", \"courtordered\");\n\t\t \n\t if (!in_array($apptype, $validAppArray))\n {\n return false;\n }\n // if we made it this far, the app is valid\n return true;\n }", "public static function isValidType(String $type){\n return array_key_exists(strtoupper($type), self::userTypes());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
When getting Decisions, they can be filtered or ordered by some of the field names in the LP table
private function addDecisionParameters() { foreach ($this->requestParameters as $key => $value) { if ($key == 'sort') { $ascdsc = $value[0] == '-' ? 'DESC' : 'ASC'; $key = $value[0] == '-' ? substr($value, 1) : $value; $ord = array_key_exists($key, $this->dbfields) ? $this->dbfields[$key] : 'lp.landing_pageid'; $this->db->order_by($ord, $ascdsc); } else if (array_key_exists($key, $this->dbfields)) { $k = $this->dbfields[$key]; $this->db->where($k, $value); } } }
[ "public function getSortFields () {}", "private function getDecisions($lpd = FALSE) {\r\n $this->clientOwnsProject();\r\n $goalid = array_key_exists('goalid', $this->requestParameters) ? $this->requestParameters['goalid'] : FALSE;\r\n $isPrimaryGoal = self::isPrimaryGoal($goalid);\r\n\r\n\r\n $select = 'lp.landing_pageid, lp.lp_index, lp.name, lp.pagetype, lp.lp_url, lp.canonical_url, ctrl.lp_url AS ctrl_url, ' .\r\n ' lp.z_score, lp.is_maximum, lp.impressions, lp.dom_modification_code, lp.rule_id, lp.page_groupid, lp.allocation, ' .\r\n ' lpc.testtype, lpc.testtype, lpc.progress, lpc.personalization_mode, lpc.smartmessage';\r\n\r\n if ($isPrimaryGoal) {\r\n $select .= ', lp.conversions, lp.conversion_value_aggregation, lp.standard_deviation, ';\r\n if ($this->is_timeonpage) {\r\n $select .= ' CAST((lp.conversion_value_aggregation / lp.conversions) AS DECIMAL(30, 6)) AS cr ';\r\n } elseif ($this->is_pi_lift) {\r\n $select .= ' CAST((lp.conversion_value_aggregation / lp.conversions) AS DECIMAL(30, 6)) AS cr ';\r\n } else {\r\n $select .= ' CAST(lp.cr AS DECIMAL(8,6)) AS cr ';\r\n }\r\n } else {\r\n $select .= ', cg.conversions, cg.conversion_value_aggregation, cg.standard_deviation, ';\r\n if ($this->is_timeonpage) {\r\n $select .= ' CAST((cg.conversion_value_aggregation / cg.conversions) AS DECIMAL(30, 6)) AS cr ';\r\n } elseif ($this->is_pi_lift) {\r\n $select .= ' CAST((cg.conversion_value_aggregation / cg.conversions) AS DECIMAL(30, 6)) AS cr ';\r\n } else {\r\n $select .= ' CAST(cg.conversions / lp.impressions AS DECIMAL(8,6)) AS cr ';\r\n }\r\n }\r\n\r\n $ctrl = '(SELECT landingpage_collectionid AS lpcid, lp_url '\r\n . ' FROM landing_page '\r\n . ' WHERE pagetype = 1 AND landingpage_collectionid = ' . $this->project . ') ctrl';\r\n\r\n $cg = '(SELECT landing_pageid, goal_id, conversions, conversion_value_aggregation , standard_deviation '\r\n . ' FROM collection_goal_conversions '\r\n . ' WHERE landingpage_collectionid = ' . $this->project . ') cg';\r\n\r\n $this->db->select($select, FALSE)\r\n ->from('landing_page lp')\r\n ->join('landingpage_collection lpc', 'lpc.landingpage_collectionid = lp.landingpage_collectionid', 'INNER')\r\n ->join($ctrl, 'ctrl.lpcid = lp.landingpage_collectionid', 'INNER')\r\n ->where('lp.landingpage_collectionid', $this->project)\r\n ->where('lp.pagetype !=', 3)\r\n ->where('lp.page_groupid', $this->decisiongroup);\r\n\r\n if (!$isPrimaryGoal) {\r\n $this->db->join($cg, 'cg.landing_pageid = lp.landing_pageid', 'INNER');\r\n $this->db->where('cg.goal_id', $goalid);\r\n }\r\n\r\n self::addDecisionParameters();\r\n\r\n $query = $this->db->group_by('lp.landing_pageid')\r\n ->order_by('pagetype', 'ASC')\r\n ->order_by('landing_pageid', 'ASC')\r\n ->get();\r\n\r\n $pages = $isPrimaryGoal ? $query->result() : self::getResultsForSecondaryGoal($query->result());\r\n $decisions = array();\r\n foreach ($pages as $q) {\r\n if (!$lpd || $q->landing_pageid == $lpd) {\r\n $result = self::decisionResult($q);\r\n $addFields = !array_key_exists('result', $this->requestParameters) || $this->requestParameters['result'] == $result;\r\n\r\n if ($addFields) {\r\n $decisions[] = self::allDecisionFields($q, $result);\r\n }\r\n }\r\n }\r\n\r\n $ret = $lpd ? $decisions[0] : $decisions;\r\n return $this->successResponse(200, $ret);\r\n }", "public function getSortFields() {}", "public function getAvailableSortingFields(): array;", "public function getSortFields(): array {}", "public function getOrderByClause();", "public function GetFieldOrder ();", "function alphaOrderFields($describeSObject_result){\r\n\tif(isset($describeSObject_result->fields)){\r\n\t\tforeach($describeSObject_result->fields as $field){\r\n\t\t\t$fieldNames[] = $field->name;\r\n\t\t}\r\n\t\r\n\t\t$describeSObject_result->fields = array_combine($fieldNames, $describeSObject_result->fields);\r\n\t\tksort($describeSObject_result->fields);\r\n\t}\r\n\treturn $describeSObject_result;\r\n}", "public function getIndexAllowedSortFields();", "public function getCriteria();", "public static function listCampusBy ($field, $order='DESC') {}", "function get_special_on_clause($field_list) {\n\t$field_array = explode(',', $field_list);\n\t$ret_str = '';\n\t$sel_clause = '';\n\t$i=1;\n\t$cnt = count($field_array);\n\t$spl_chk = ($_REQUEST['modulename'] != '')?$_REQUEST['modulename']:$_REQUEST['module'];\n\tforeach ($field_array as $fld) {\n\t\t$sub_arr = explode('.', $fld);\n\t\t$tbl_name = $sub_arr[0];\n\t\t$col_name = $sub_arr[1];\n\n\t\t//need to handle aditional conditions with sub tables for further modules of duplicate check\n\t\tif ($tbl_name == 'vtiger_leadsubdetails' || $tbl_name == 'vtiger_contactsubdetails') {\n\t\t\t$tbl_alias = 'subd';\n\t\t} elseif ($tbl_name == 'vtiger_leadaddress' || $tbl_name == 'vtiger_contactaddress') {\n\t\t\t$tbl_alias = 'addr';\n\t\t} elseif ($tbl_name == 'vtiger_account' && $spl_chk == 'Contacts') {\n\t\t\t$tbl_alias = 'acc';\n\t\t} elseif ($tbl_name == 'vtiger_accountbillads') {\n\t\t\t$tbl_alias = 'badd';\n\t\t} elseif ($tbl_name == 'vtiger_accountshipads') {\n\t\t\t$tbl_alias = 'sadd';\n\t\t} elseif ($tbl_name == 'vtiger_crmentity') {\n\t\t\t$tbl_alias = 'crm';\n\t\t} elseif ($tbl_name == 'vtiger_customerdetails') {\n\t\t\t$tbl_alias = 'custd';\n\t\t} elseif ($tbl_name == 'vtiger_contactdetails' && $spl_chk == 'HelpDesk') {\n\t\t\t$tbl_alias = 'contd';\n\t\t} elseif (stripos($tbl_name, 'cf') === (strlen($tbl_name) - strlen('cf'))) {\n\t\t\t$tbl_alias = 'tcf'; // Custom Field Table Prefix to use in subqueries\n\t\t} else {\n\t\t\t$tbl_alias = 't';\n\t\t}\n\n\t\t$sel_clause .= $tbl_alias.'.'.$col_name.',';\n\t\t$ret_str .= \" $tbl_name.$col_name = $tbl_alias.$col_name\";\n\t\tif ($cnt != $i) {\n\t\t\t$ret_str .= ' and ';\n\t\t}\n\t\t$i++;\n\t}\n\t$ret_arr['on_clause'] = $ret_str;\n\t$ret_arr['sel_clause'] = trim($sel_clause, ',');\n\treturn $ret_arr;\n}", "public function getBoostQueryFields();", "protected function _FormatCriteria()\t\t\t\t\t\t\t\t\t\t\t\t {}", "protected function prepareOrderByStatement() {\n\t\tif ($GLOBALS['TCA'][$this->table]['ctrl']['label']) {\n\t\t\t$this->orderByStatement = $GLOBALS['TCA'][$this->table]['ctrl']['label'];\n\t\t}\n\t\t// Get the label field for the current language, if any is available\n\t\t$lang = LocalizationUtility::getCurrentLanguage();\n\t\t$lang = LocalizationUtility::getIsoLanguageKey($lang);\n\t\t$labelFields = LocalizationUtility::getLabelFields($this->table, $lang);\n\t\t$this->orderByStatement = implode(',' , $labelFields);\n\t}", "function getImportCriteria() {\n\n return ['designation' => 'equal',\n 'manufacturers_id' => 'equal'];\n }", "protected function getOrderFields() {\n return 'FirstName, LastName';\n }", "public function sort($fields) {}", "function get_order_by_clause() {\n $result = parent::get_order_by_clause();\n\n //make sure the result is actually valid\n if ($result != '') {\n //always sort by course in addition to everything else\n $result .= ', coursename, courseid';\n }\n\n return $result;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation getAudiencesAsync Get the list of Audiences.
public function getAudiencesAsync($authorization, $advertiser_id = null) { return $this->getAudiencesAsyncWithHttpInfo($authorization, $advertiser_id) ->then( function ($response) { return $response[0]; } ); }
[ "public function getAudiencesAsync($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null)\n {\n return $this->getAudiencesAsyncWithHttpInfo($pageSize, $skip, $sort, $withTotalResultSize)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function setAudiences($var)\n {\n GPBUtil::checkString($var, True);\n $this->audiences = $var;\n\n return $this;\n }", "public function getEventAudiences(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collEventAudiencesPartial && !$this->isNew();\n if (null === $this->collEventAudiences || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collEventAudiences) {\n // return empty collection\n $this->initEventAudiences();\n } else {\n $collEventAudiences = ChildEventAudienceQuery::create(null, $criteria)\n ->filterByEvent($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collEventAudiencesPartial && count($collEventAudiences)) {\n $this->initEventAudiences(false);\n\n foreach ($collEventAudiences as $obj) {\n if (false == $this->collEventAudiences->contains($obj)) {\n $this->collEventAudiences->append($obj);\n }\n }\n\n $this->collEventAudiencesPartial = true;\n }\n\n return $collEventAudiences;\n }\n\n if ($partial && $this->collEventAudiences) {\n foreach ($this->collEventAudiences as $obj) {\n if ($obj->isNew()) {\n $collEventAudiences[] = $obj;\n }\n }\n }\n\n $this->collEventAudiences = $collEventAudiences;\n $this->collEventAudiencesPartial = false;\n }\n }\n\n return $this->collEventAudiences;\n }", "public function getAsync(array $params = [])\n {\n return $this->handleMiddleware('get', $params, function(MiddlewareRequest $request) {\n $params = $request->getApiMethodArguments();\n $accountId = isset($params['account_id']) ? $params['account_id'] : null;\n $audienceId = isset($params['audience_id']) ? $params['audience_id'] : null;\n $page = isset($params['page']) ? $params['page'] : null;\n $pageSize = isset($params['page_size']) ? $params['page_size'] : null;\n $platform = isset($params['platform']) ? $params['platform'] : null;\n $fields = isset($params['fields']) ? $params['fields'] : null;\n $response = $this->apiInstance->customAudiencesGetAsync($accountId, $audienceId, $page, $pageSize, $platform, $fields);\n return $response;\n });\n }", "public function setAudiences($val)\n {\n $this->_propDict[\"audiences\"] = $val;\n return $this;\n }", "public function setAudiences($audiences)\n {\n $this->audiences = $audiences;\n return $this;\n }", "public function getAllAgencesAction( ){\r\n\t\t\r\n\t\t $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('ComDaufinBundle:Agence')->findAll();\r\n\r\n $response = array(\"agences\" => $entities,);\r\n \r\n \r\n return $response;\r\n\t}", "public function getAgences()\n {\n return $this->agences;\n }", "public function getAudiencesAsyncWithHttpInfo($pageSize = 1000, $skip = null, $sort = null, $withTotalResultSize = null)\n {\n $returnType = '\\TalonOne\\Client\\Model\\InlineResponse20029';\n $request = $this->getAudiencesRequest($pageSize, $skip, $sort, $withTotalResultSize);\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 get(array $params = [])\n {\n return $this->handleMiddleware('get', $params, function(MiddlewareRequest $request) {\n $params = $request->getApiMethodArguments();\n $accountId = isset($params['account_id']) ? $params['account_id'] : null;\n $audienceId = isset($params['audience_id']) ? $params['audience_id'] : null;\n $page = isset($params['page']) ? $params['page'] : null;\n $pageSize = isset($params['page_size']) ? $params['page_size'] : null;\n $platform = isset($params['platform']) ? $params['platform'] : null;\n $fields = isset($params['fields']) ? $params['fields'] : null;\n $response = $this->apiInstance->customAudiencesGet($accountId, $audienceId, $page, $pageSize, $platform, $fields);\n return $this->handleResponse($response);\n });\n }", "function get_audiences( $id = false )\n\t{\n\t\t$sql = \"SELECT * FROM event_audiences WHERE true\";\n\t\tif ( $id ) {\n\t\t\tif (is_array($id)) {\n\t\t\t\t$id = implode(',', $id);\n\t\t\t}\n\t\t\t$sql .= \" AND id IN ({$id})\";\n\t\t}\n\t\t$sql .= \" ORDER BY name ASC\";\n\t\treturn $this->db->query($sql);\n\t}", "public function absences()\n {\n return $this->hasMany(Absence::class);\n }", "public function listAll($projectId)\n {\n $uri = sprintf('projects/%s/audiences/', $projectId);\n $request = $this->createRequest('GET', $uri);\n\n return $this->handleRequest($request);\n }", "public function geofencesGetAsync($all = null, $user_id = null, $device_id = null, $group_id = null, $refresh = null)\n {\n return $this->geofencesGetAsyncWithHttpInfo($all, $user_id, $device_id, $group_id, $refresh)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function listTradesAsync($associative_array)\n {\n return $this->listTradesAsyncWithHttpInfo($associative_array)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function all()\n {\n return new AgenceCollection($this->Agence->all());\n }", "public function absences()\n {\n return $this->hasMany('App\\Absence', 'advisor_id');\n }", "public function multilanguageGetAllActiveLanguagesAsync()\n {\n return $this->multilanguageGetAllActiveLanguagesAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "protected function getAudiencesRequest($authorization, $advertiser_id = null)\n {\n // verify the required parameter 'authorization' is set\n if ($authorization === null || (is_array($authorization) && count($authorization) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $authorization when calling getAudiences'\n );\n }\n\n $resourcePath = '/v1/audiences';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($advertiser_id !== null) {\n $queryParams['advertiserId'] = ObjectSerializer::toQueryValue($advertiser_id);\n }\n // header params\n if ($authorization !== null) {\n $headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/html']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'text/html'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
palindrome.php for in /home/paolin_t/PHP1/palindrome Made by PAOLINI Tom
function palindrome($param) { for ($c = 0; isset($param[$c]); $c++); for ($o = --$c, $z = 0; $z < $c / 2; $o--, $z++) { while (!($param[$o] >= 'a' && $param[$o] <= 'z' || $param[$o] >= 'A' && $param[$o] <= 'Z')) $o--; while (!($param[$z] >= 'a' && $param[$z] <= 'z' || $param[$z] >= 'A' && $param[$z] <= 'Z')) $z++; $fin = ord($param[$o]); $ascii = ord($param[$z]); if ($param[$z] < 'a') $ascii = ord($param[$z]) +32; if ($param[$o] < 'a') $fin = ord($param[$o]) +32; if ($ascii != $fin) { echo "False\n"; return; } } echo "True\n"; }
[ "function palindromefinder($str)\n\t\t\t{\n\t\t\t\tfor ($y=0;$y < strlen($str)-1; $y++)\n\t\t\t\t{\n\t\t\t\t\t$x=2;\n\t\t\t\t\twhile ($x <= strlen($str))\n\t\t\t\t\t{\n\t\t\t\t\t\t$palindrome_iso = substr($str,$y,$x);\n\t\t\t\t\t\tif (check_pal($palindrome_iso))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprint ($palindrome_iso);\n\t\t\t\t\t\t\tprint (\" \");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$x++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function Palindrome($test){\n if(strrev($test) == $test){\n // RESULT AFTER CHECKING IF THE INPUTED IF IT WAS A PALINDROME\n echo $test . ' is a palindrome';\n }else{\n\n echo $test. 'is not a palindrome';\n }\n}", "function check_palindrome($string) \r\n{ \r\n if ($string == strrev($string)) \r\n return 1; \r\n else \r\n return 0; \r\n}", "function palindrome($word){\n\t$reverse = strrev($word);\n\tif($word == $reverse){\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "function Palindrome($str){ \r\n if (strrev($str) == $str){ \r\n return 1; \r\n }\r\n else{\r\n return 0;\r\n }\r\n}", "function palindrom($palindrom)\n{\n $palindrom = strtolower($palindrom);\n $palindromChecker ='';\n\n for ($i = strlen($palindrom)-1; $i >= 0; $i--)\n {\n $palindromChecker .= $palindrom[$i];\n\n }\n\n if($palindrom === $palindromChecker)\n {\n echo \"słowo <b>$palindrom</b> jest palindromem\";\n }\n else\n {\n echo \"słowo <b>$palindrom</b> nie jest palindromem, jest nim np kajak\";\n }\n\n return $palindromChecker;\n}", "function is_palindrome($word) {\n\t$word = preg_replace(\"/[^a-z]/\", '', strtolower($word));\n\t$reverse = strrev($word);\n\tif ($word == $reverse) {\n\t\treturn TRUE;\n\t} else {\n\t\treturn FALSE;\n\t}\n}", "function palindrome($n)\n{\n $r=strrev($n);\n if(strcmp($n,$r) == 0)\n {\n return true;\n }\n else{\n return false; \n }\n}", "function palindrom($str){\r\n $str = strtolower($str);\r\n return ( $str == strrev($str))?\"True\":\"False\";\r\n}", "function isPalindrome($s) {\n return $s == strrev($s);\n}", "function isPalindrome($string) {\n $string = preg_replace(\"/[^A-Za-z0-9 ]/\", '', $string);\n $newString = str_replace(' ', '',strtolower($string));\n $revString = strrev($newString);\n if ($newString == $revString) {\n echo \"palindrome\";\n return true;\n } else {\n echo \"not palindrome\";\n return false;\n }\n}", "function is_palindrome_1($string) {\n\t// figure out how long half the string is, as we only need to look at half\n\t// the string to know if it matches the other half\n\t$halfLength = floor(strlen($string)/2);\n\t$length = strlen($string);\n\t// iterate from beginning and end of string comparing characters as you go\n\tfor ($i = 0; $i <= $halfLength; $i ++) {\n\t\tif($debug) {\n\t\t\techo 'Comparing: '.substr($string, $i, 1).' and '. substr($string,\n\t\t\t\t($length-1-$i), 1);\n\t\t}\n\t\tif (substr($string, $i, 1) != substr($string, ($length-1-$i), 1)) {\n\t\t\t// return false if fails test\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\t// otherwise, return true\n\treturn TRUE;\n\t\n}", "function find_palindromic_seqs ($seq,$min,$max){\r\n $result=\"\";\r\n $seq_len=strlen($seq);\r\n for($i=0;$i<$seq_len-$min+1;$i++){\r\n $j=$min;\r\n while($j<$max+1 and ($i+$j)<=$seq_len){\r\n $sub_seq=substr($seq,$i,$j);\r\n if (DNA_is_palindrome($sub_seq)==1){\r\n $results [$i]=$sub_seq;\r\n }\r\n $j++;\r\n }\r\n\r\n }\r\n return $results;\r\n}", "function checkPalindrome( $string ) \n{\n // strip out whitespace\n $string = str_replace( ' ', '', $string );\n // return bool\n return $string == strrev( $string );\n}", "function palindrome($word)\n{\n $originalWord = $word;\n $word = strtolower($word);\n $word = str_replace(\" \", \"\", $word);\n $hasSpaces = sizeof(explode(\" \", $originalWord)) > 1;\n\n if (empty($word)) {\n echo 'Please enter a string as an argument' . PHP_EOL;\n\n return false;\n }\n\n $chars = str_split($word);\n $numChars = sizeof($chars);\n if ($numChars == 1 || $numChars == 0) {\n return true;\n }\n\n for ($i = 0; $i < $numChars; $i++) {\n\n $firstIndex = $i;\n $lastIndex = ($numChars - $i - 1);\n\n if ($chars[ $firstIndex ] != $chars[ $lastIndex ]) {\n echo $originalWord . ' is not a plaindrome' . PHP_EOL;\n\n return false;\n }\n }\n\n echo '\"' . $originalWord . '\" is a ' . $numChars . ' character long palindrome ' . ($hasSpaces ? 'sentence' : 'word') . PHP_EOL;\n\n return true;\n}", "public function checkPalindrom($postMessage){\n // echo 'test';exit;\n $strLen = strlen($postMessage)-1;\n $revStr = '';\n for($i=$strLen; $i>=0; $i--){\n $revStr.=$postMessage[$i];\n }\n if($revStr == $postMessage)\n return 1;\n else\n return 0;\n\t}", "function isPalindrome(string $inputString) : string\n{\n $lowerCaseString = strtolower($inputString);\n $onlyAlphabeticString = preg_replace(\"/[^a-z]/\", '', $lowerCaseString);\n $reversedString = strrev($onlyAlphabeticString);\n\n $isPalindrome = $reversedString === $onlyAlphabeticString ? \"yes\" : \"no\";\n\n return $isPalindrome;\n}", "function findPalindromes( $file ) {\n\n\n /*\n * @var stream $data requires named resource specified by $file\n * @var timestamp $date used to append to output file\n * @var array $output placeholder for final output \n * @var string $outputFile file where JSON data will be written\n * @var array $foundPalindromes placeholder for the found palindromes while in loop\n * @var string $testLine the single line being tested\n * @var string $originalLine the unmodified line being tested from file\n * @var string $testString the partial line being tested\n * @var int $charCount the character count of found palindromes on a single line\n * @var int $mainCount main count moving along $testString\n * @var int $stringEnd counter moving from the string end to the beginning\n * @var bool $foundPalindrome returns TRUE|FALSE if palindrome is found or not\n */ \n $data = fopen($file,\"r\");\n $date = date('m-d-Y-His');\n $output = array();\n $outputFile = 'output'.$date.'.txt';\n $foundPalindromes = array();\n $originalLine = '';\n $testLine = '';\n $testString = '';\n $charCount = 0;\n $mainCount = 0;\n $stringEnd = 0;\n $foundPalindrome = FALSE;\n\n /*\n * while we are not at the end of the file, read it line-by-line and setting each line to $testLine \n */\n while (!feof($data)) {\n $originalLine = preg_replace( \"/\\r|\\n/\", \"\", fgets($data));\n $testLine = $originalLine;\n if (strlen($testLine) != 0) {\n\n /* \n * remove all spaces\n */\n $testLine = str_replace(' ', '', $testLine);\n\n /*\n * remove anything that is not a letter or number \n */\n $testLine = preg_replace(\"/[^a-zA-Z 0-9]+/\",\"\", $testLine);\n\n /*\n * change case to lower\n */\n $testLine = strtolower($testLine);\n\n /*\n * begin a count going from beginning to end of the entire LINE \n */\n for ($mainCount=0; $mainCount < strlen($testLine); $mainCount++) {\n /*\n * begin a count in order to create strings from the test line \n */\n for ($stringEnd = strlen($testLine); $stringEnd >=0; $stringEnd--) {\n /*\n * Create first chunk to test\n */\n $testString = substr($testLine, $mainCount, strlen($testLine) - $stringEnd); \n /*\n * Check if string is > 1 char, reverse it and compare against original string\n * If the string is a palindrome it gets added to $foundPalindromes and we continue \n * to add to the $charCount\n */\n if (strlen($testString) > 1) {\n $reverse = strrev($testString);\n $foundPalindrome = ($testString == $reverse) ? TRUE : FALSE;\n if ($foundPalindrome == TRUE) {\n $foundPalindromes[] = $testString;\n $charCount += strlen($testString);\n break;\n }//if foundPalindrome\n unset($testString);\n }//if strlen\n }//for stringEnd\n }//for mainCount\n\n /*\n * If we found any palindromes, sort them by string size and add the original line, all palindromes and char count \n * to $output\n */\n if (sizeof($foundPalindromes) > 0) {\n array_multisort(array_map('strlen', $foundPalindromes),SORT_DESC, $foundPalindromes);\n $output[] = array ( 'originalLine' => $originalLine , 'foundPalindromes' => $foundPalindromes , 'totalChars' => $charCount );\n }\n\n /*\n * clear Variables\n */\n unset($foundPalindromes);\n unset($charCount);\n unset($foundPalindrome);\n }\n }\n\n /*\n * close file stream\n */\n fclose($data);\n\n /*\n * JSON encode final output array\n */\n $data = json_encode($output, true);\n file_put_contents($outputFile,$data);\n}", "function palindrome_str_func(string $str){\n if(strrev($str) == $str){\n return true;\n }\n return false;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Renders a progress bar until the specified reindexing task is completed
protected function renderProgressBar(array $task): void { // Use a progress bar to indicate how far a long the re-indexing has come $progressBar = null; do { $response = ['completed' => false]; // Ignore ServerErrorResponseException, re-indexing can make these requests time out try { $response = $this->elasticsearchService->tasks()->get([ 'task_id' => $task['task'], ]); $total = $response['task']['status']['total']; // Initialize the progress bar once Elasticsearch knows the total amount of items if ($progressBar === null && $total > 0) { $progressBar = new ProgressBar(new ConsoleOutput(), $total); } elseif ($progressBar !== null) { /** @var ProgressBar $progressBar */ $progressBar->setProgress($response['task']['status']['created']); } } catch (ServerErrorResponseException $e) { } sleep(1); } while ((bool)$response['completed'] === false); // For very short migrations we may never get a progress bar, because the task finishes too quickly if ($progressBar !== null) { $progressBar->finish(); } echo PHP_EOL; }
[ "function simplerdf_batch_index_finished($success, $results, $operations) {\n if ($success) {\n drupal_set_message(t('The site has been indexed.'));\n if ($results['summary']) {\n // Show all messages\n drupal_set_message(theme('item_list', $results['summary']));\n }\n }\n else {\n // An error occurred.\n $operation = reset($operations);\n $args = $operation[1];\n $task = $args[0];\n\n $types = simplerdf_get_types();\n $type_title = $types[$task['type']];\n\n $message = t('An error occurred while indexing %type.', array('%type' => $type_title));\n drupal_set_message($message, 'error');\n }\n}", "public function updateProgressBar(): void\n {\n if ($this->exposeProgressBar) {\n $this->progressBar->advance();\n }\n }", "public function advanceProgressBar();", "public function makeProgress()\n {\n $this->bar->advance();\n }", "function progress()\n {\n $this->isParent();\n $page_data['page_name'] = 'progress';\n $page_data['page_title'] = getEduAppGTLang('progress');\n $this->load->view('backend/index', $page_data);\n }", "public function progressFinish() {}", "function _batch_progress_page_nojs() {\n $batch =& batch_get();\n $current_set = _batch_current_set();\n\n drupal_set_title($current_set['title']);\n\n $new_op = 'do_nojs';\n\n if (!isset($batch['running'])) {\n // This is the first page so we return some output immediately.\n $percentage = 0;\n $message = $current_set['init_message'];\n $batch['running'] = TRUE;\n }\n else {\n // This is one of the later requests: do some processing first.\n\n // Error handling: if PHP dies due to a fatal error (e.g. non-existant\n // function), it will output whatever is in the output buffer,\n // followed by the error message.\n ob_start();\n $fallback = $current_set['error_message'] .'<br/>'. $batch['error_message'];\n drupal_maintenance_theme();\n $fallback = theme('maintenance_page', $fallback, FALSE, FALSE);\n\n // We strip the end of the page using a marker in the template, so any\n // additional HTML output by PHP shows up inside the page rather than\n // below it. While this causes invalid HTML, the same would be true if\n // we didn't, as content is not allowed to appear after </html> anyway.\n list($fallback) = explode('<!--partial-->', $fallback);\n print $fallback;\n\n // Perform actual processing.\n list($percentage, $message) = _batch_process($batch);\n if ($percentage == 100) {\n $new_op = 'finished';\n }\n\n // PHP did not die : remove the fallback output.\n ob_end_clean();\n }\n\n $url = url($batch['url'], array('query' => array('id' => $batch['id'], 'op' => $new_op)));\n drupal_set_html_head('<meta http-equiv=\"Refresh\" content=\"0; URL='. $url .'\">');\n $output = theme('progress_bar', $percentage, $message);\n return $output;\n}", "protected function completeReindexMode() {}", "public function progressFinish();", "function vmoodle_send_cli_progress($numhosts, $i, $operation = '') {\n global $CFG, $SITE;\n static $progressmem = 0;\n\n $sitename = (is_object($SITE)) ? $SITE->shortname : 'unknown';\n\n $progress = floor($i / $numhosts * 10) * 10;\n if ($progressmem != $progress) {\n $progressmem = $progress;\n vmoodle_cli_notify_admin(\"[$sitename] {$operation} : progress : $progress %\");\n }\n}", "protected function _progressBar()\n {\n if ($this->_current > $this->_total) {\n return;\n }\n\n $percent = $this->_current / $this->_total;\n $nb = $percent * $this->_size;\n\n $b = str_repeat($this->_chars['bar'], floor($nb));\n $i = '';\n\n if ($nb < $this->_size) {\n $i = str_pad($this->_chars['indicator'], $this->_size - strlen($b));\n }\n\n $p = floor($percent * 100);\n\n $string = Text::insert($this->_format, compact('p', 'b', 'i'));\n\n $this->write(\"\\r\" . $string, $this->_color);\n }", "private function waitForIndexCompletion()\n {\n while(!$this->noIndexersRunning()) {\n sleep(5);\n }\n }", "public function rescanprogress()\n\t{\n\t\treturn $this->CLI->arrayQuery(\"rescanprogress\");\n\t}", "function print_progress_bar($total_recs, $current_rec_num) {\n global $num_progress_bar_chunks;\n // Print 1 per object.\n if ($total_recs < $num_progress_bar_chunks) {\n print \"#\";\n }\n else {\n // Print 1 per $progress_bar_chunk_size objects.\n $progress_bar_chunk_size = $total_recs / $num_progress_bar_chunks;\n if ($current_rec_num % $progress_bar_chunk_size == 0) {\n print \"#\";\n }\n }\n}", "protected function reportIndexingDone()\n {\n $this->container->indexManager->reportIndexingDone();\n }", "function outputProgress($current, $total) {\n echo \"<span style='position: absolute;z-index:$current;background:#FFF;'>Processed \" . round($current / $total * 100) . \"% </span>\";\n myFlush();\n //sleep(1);\n}", "private function showProgress()\n {\n $this->output->progressStart(3);\n for ($i = 0; $i < 3; $i++) {\n sleep(1);\n $this->output->progressAdvance();\n }\n $this->output->progressFinish();\n }", "public function progress() {\n $data = array();\n if (!$this->user->is_logged_in()) {\n redirect(\"/account/info\");\n }\n\n $this->user->get_user($this->user->getMyId());\n $data['user'] = $this->user;\n $data['current'] = str_replace('overview', 'play', $this->user->get_next_step());\n $this->load->view('account/progress', $data);\n }", "private function display_progress_bar($args){\n $number_of_steps = count($this->step_ids);\n $current_step = $args['step'];\n $percent_complete = ($current_step / $number_of_steps) * 100;\n\n echo '<div id=\"progress-bar\">';\n echo '<h4>' . sprintf(esc_html('Step %1$d of %2$d', 'caims'), $current_step, $number_of_steps) . '</h4>';\n echo '<div class=\"progress\">';\n echo '<div class=\"progress-bar\" role=\"progressbar\" style=\"width:' . $percent_complete . '%\" aria-valuenow=\"' . $percent_complete . '\" aria-valuemin=\"0\" aria-valuemax=\"100\"></div>';\n echo '</div></div>';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Moves the key currently stored from the request for this page (in $_GET) into the request for the next. If there isn't one found then it is replaced with the alt value given. The value persisted is also returned so you can both persist and get the value in one. By default the alt is false and so if the key is not stored then false will also be returned.
public function persist( $key, $alt=false ) { $val = $this->get( $key, $alt ); $this->setHref( $key, $val ); return $val; }
[ "function set_current_key($new_key) {\n $this->current_key=$new_key;\n}", "public static function switchAlt() {\n\t\tif(AdminHTML::$alt == 'alt1') {\n\t\t\tAdminHTML::$alt = 'alt2';\n\t\t}\n\n\t\telse {\n\t\t\tAdminHTML::$alt = 'alt1';\n\t\t}\n\t}", "function db_alt_parameter_restore()\n\t{\n\t\t$this->db_alt_parameter = $_SESSION['update']['db_alt_parameter'];\n\t}", "public function testAltKeyValue() : void {\n\t\t$this->assertEquals('kc_page_alt_key', FieldName::AltKey->value);\n\t}", "public function get1_mwalt($key) {\n // This code initially copied from mw/web/webtc/dal_sqlite.php\n // and adjusted for use within Dal class.\n // 01-28-2020. replaced\n$dbg=False;\nif ($this->keydoc_db) { // use keydoc if it is available\n return $this->get1_keydoc($key);\n}else {\n return $this->get1_mwalt_prev($key);\n}\n}", "function prevEntry($key=null) {\n $container =& mime_handle_image_container::singleton();\n if($key === null) $key = $container->_pointer->file();\n reset($container->images);\n while(current($container->images)!== false) {\n if(key($container->images) == $key) {\n prev($container->images);\n if(!current($container->images)) {\n log::trace(_(\"No prev entry. choosing last...\"));\n end($container->images);\n }\n $container->_pointer =& $container->images[key($container->images)];\n return key($container->images);\n }\n next($container->images);\n }\n return false;\n }", "function page_manager_edit_page_next(&$form_state) {\n page_manager_set_page_cache($form_state['page']);\n}", "public function toggle( string $key )\n {\n $_SESSION[ $key ] = $_SESSION[ $key ] ? false : true;\n Core::jump( $this->return_page );\n\t\t\n }", "function assignGetIfExists(&$var, &$rs, $getKey, $doTrim = false, $entities = \"\", $defaultValue = \"\")\n{\n if (isset ($_GET[$getKey]))\n {\n $getVal = $_GET[$getKey];\n if ($doTrim)\n {\n $getVal = trimStrip($getVal, $entities);\n }\n $var = $rs[$getKey] = $getVal;\n }\n else\n {\n if (!empty ($defaultValue))\n {\n $var = $rs[$getKey] = $defaultValue;\n }\n }\n}", "private function fillAltField($alt) {\n $this->helperContext->iFillInFieldByDataDrupalSelectorWith($this->articlePage->getHiddenField(self::FIELD_ALT), $alt);\n }", "public function keyVal($newKey=true);", "private static function optionsPop( &$options, $key, $alt=null ) {\n if ( $options && isset($options[$key]) ) {\n $val = $options[$key];\n unset( $options[$key] );\n\n return $val;\n } else {\n $iniAlt = @get_cfg_var( ErrorHandler::PHP_ERROR_INI_PREFIX . '.' . $key );\n\n if ( $iniAlt !== false ) {\n return $iniAlt;\n } else {\n return $alt;\n }\n }\n }", "function _store_key()\n {\n if ($this->_current_key === false) return;\n $this->_current_value = str_replace('\\\\n', \"\\n\", $this->_current_value);\n $this->_hash[$this->_current_key] = $this->_current_value;\n $this->_current_key = false;\n $this->_current_value = \"\";\n }", "function upgrade_key($newkey=FALSE) {\n\tstatic $key=false;\n\tif ( !$newkey ) {\n\t\treturn $key;\n\t}\n\t$key = $newkey;\n}", "function save($key) {\n\t\t$referer = PHP::getServerParameter('HTTP_REFERER');\n\t\t$y = parse_url($referer);\n\t\tSession::setAttribute(_FORM_REMINDER_SESSION . $key, array($this, $y['path']));\n\t}", "function tck_edit_link($return, $url, $keyword, $newkeyword, $title, $new_url_already_there, $keyword_is_ok) {\n $prefix = substr($newkeyword, 0, 1);\n $newkeyword = substr($newkeyword, 1, strlen($newkeyword) - 1);\n \n if ( $prefix == tck_get_prefix(0) ) $custom = 0;\n if ( $prefix == tck_get_prefix(1) ) $custom = 1;\n \n global $ydb;\n $table = YOURLS_DB_TABLE_URL;\n $sql = '';\n \n if ( $return['status'] == 'success' && $keyword != $newkeyword && ! $custom ) {\n $sql = 'Update ' . $table . ' Set `' . TCK_COLUMN . '` = 1 Where `keyword` = \\'' . $newkeyword . '\\';';\n } else {\n $sql = 'Update ' . $table . ' Set `' . TCK_COLUMN . '` = ' . ($custom ? 1 : 0) . ' Where `keyword` = \\'' . $newkeyword . '\\';';\n }\n\n if ( $sql != '' ) $ydb->query($sql);\n \n $return['message'] = $sql;\n\n return $return;\n }", "function mlaf_alt_update() {\n\t$mlaf_post_id = absint ( $_POST['post_id'] );\n\t$mlaf_alt_text = wp_strip_all_tags( $_POST['alt_text'] );\n\n\tif ( !empty( $_POST['alt_text'] ) ) {\n\t\tupdate_post_meta( $mlaf_post_id, '_wp_attachment_image_alt', $mlaf_alt_text );\n\t}\n}", "function db_alt_parameter_save()\n\t{\n\t\t$_SESSION['update']['db_alt_parameter'] = $this->db_alt_parameter;\n\t}", "public function altKeyDown()\n {\n return $this->_callParentMethod(__METHOD__, func_get_args());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TO add the new product to the service table
function addService(){ $sql = "insert into service(sp_ID, product_category, product_name, product_image, product_details, product_unit_price) values(:sp_ID, :product_category, :product_name, :product_image, :product_details, :product_unit_price)"; $args = [':sp_ID'=>$this->sp_ID, ':product_category'=>$this->product_category, ':product_name'=>$this->product_name, ':product_image'=>$this->product_image, ':product_details'=>$this->product_details, ':product_unit_price'=>$this->product_unit_price]; $stmt = manageServiceModel::connect()->prepare($sql); $stmt->execute($args); return $stmt; }
[ "public function addProduct()\r\n {\r\n }", "function add(){\n\t\t\t$this->insertData($this->getTblProduct(),$this->getArrayDatas());\n\t}", "public function add()\n {\n \n //$this->layout = false;\n $product = $this->Products->newEntity();\n //Entity is a set of one record of table and their relational table, on that you can perform operation without touch of database and encapsulate property of entity (fields of table) as you want.\n if ($this->request->is('post')) {\n $product = $this->Products->patchEntity($product, $this->request->data); \n $product->created_at = date('Y-m-d H:i:s'); \n if ($this->Products->save($product)) {\n $this->Flash->success(__('Your product has been saved.'));\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('Unable to add your product.'));\n }\n $this->set('product', $product);\n }", "public function addproduct($product) \n {\n $this->products[] = $product; \n }", "public function addProduct($product) \n {\n $this->products[] = $product; \n }", "public function addProduct(Product $product) : any;", "public function addOrderProducts() {\n \n }", "public function createProduct();", "public function append_product()\n\t{\n\t\t$product_id = $this->input->post(\"product_id\");\n\t\t$vendor_id = $this->input->post(\"vendor_id\");\n\t\t$initial_stock = $this->input->post(\"stock\");\n\t\t$initial_price = $this->input->post(\"price\");\n\t\tif ($this->vendor->add_product($vendor_id, $product_id, $initial_stock, $initial_price)) \n\t\t{\n\t\t\t$this->products();\n\t\t}\t\n\t}", "public function save(){\r\n\t\tif (is_null($this->_id)){\r\n\t\t\tgetDb()->insert('product', [\r\n\t\t 'name' => $this->_name,\r\n\t\t 'price' => $this->_price,\r\n\t\t 'description' => $this->_description,\r\n\t\t 'picture' => $this->_picture,\r\n\t\t \t'isEdited' => $this->_isEdited\r\n\t\t ]);\r\n\t\t}else{\r\n\t\t\tgetDb()->update('product', [\r\n\t\t\t 'name' => $this->_name,\r\n\t\t\t 'price' => $this->_price,\r\n\t\t\t 'description' => $this->_description,\r\n\t\t\t 'picture' => $this->_picture,\r\n\t\t\t 'isEdited' => $this->_isEdited\r\n\t\t\t], ['id' => $this->_id]);\r\n\t\t}\r\n\r\n\t}", "public function addNewProduct()\n {\n $connection = new DatabaseHandler();\n $conn = $connection->connectToDatabase();\n\n if (isset($_POST['submit'])) {\n $name = $this->test_input($_POST['name']);\n $quantity = $this->test_input($_POST['quantity']);\n $price = $this->test_input($_POST['price']);\n\n //Insert the data into the database\n $sql = \"INSERT INTO products (name, quantity, price) VALUES ('$name', '$quantity', '$price')\";\n\n if (mysqli_query($conn, $sql)) {\n $_SESSION['message'] = \"Record added successfully.\";\n header('Location: products_list.php');\n } else {\n echo \"ERROR: Could not able to execute $sql. \" . mysqli_error($conn);\n exit();\n }\n\n // Close connection\n mysqli_close($conn);\n }\n }", "public function insertProduct() {\n $path = '/api/products';\n\n $product = [\n 'name' => 'Testing Product Deletion',\n 'brand' => 'Testing',\n 'price' => 10.20,\n 'stock' => 50\n ];\n\n $response = $this->json('POST', $path, $product);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true\n ]);\n }", "function addService()\r\n {\r\n $sql = \"insert into service (S_Name, Unit_Price, S_Desc, S_Stock, sp_id, S_Photo, Category) values (:sname, :unitprice, :sdesc, :sstock, :spid, :sphoto, :Category)\";\r\n $args = [':sname' => $this->S_Name, ':unitprice' => $this->Unit_Price, ':sdesc' => $this->S_Desc, ':sstock' => $this->S_Stock, ':spid' => $this->sp_id, ':sphoto' => $this->S_Photo, ':Category' => $this->Category];\r\n return DB::run($sql, $args);\r\n }", "function add_product ( )\n {\n if ( isset ( $_REQUEST [ 'prod_name' ] ) && isset ( $_REQUEST [ 'prod_price' ] ) \n && isset ( $_REQUEST [ 'prod_description' ] ) && isset ( $_REQUEST [ 'prod_barcode' ] ) )\n {\n include_once '../models/product.php';\n \n $prod_name = $_REQUEST [ 'prod_name' ];\n $prod_price = $_REQUEST [ 'prod_price' ];\n $prod_description = $_REQUEST [ 'prod_description' ];\n $prod_barcode = $_REQUEST [ 'prod_barcode' ];\n \n $prod = new product ( );\n \n if ( $prod->add_product ( $prod_name, $prod_price, $prod_description, $prod_barcode ) )\n {\n echo ' { \"result\":1, \"status\": \"Product Added\" } ';\n }\n else\n {\n echo ' { \"result\":0, \"status\": \"Failed to Add Product\" } ';\n }\n \n }\n }", "function addServiceFromProduct( $popup = null ) {\n if ($this->RequestHandler->isAjax()) {\t\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->ServiceDevice->create();\n\t\t\tif ($this->ServiceDevice->save($this->request->data)) {\n\t\t\t\t echo \"Successfully Saved.\";\n\t\t\t} else {\n\t\t\t\t echo \"Saved Failed.\";\n\t\t\t}\n Configure::write('debug', 0); \n\t\t\t\t$this->autoRender = false;\n\t\t\t\texit(); \n\t\t}\n\t\t\n }\n\t \n\t\t $brands=$this->ServiceDevice->PosBrand->find('list',array('order'=>'name asc'));\n\t\t $categories=$this->ServiceDevice->PosPcategory->find('list',array('order'=>'name asc'));\n\t\t $this->set(compact('brands','categories'));\n\t\t $this->set('page_titles', 'Service Device From Product'); \n \t \n\t }", "public function creating(Product $product)\n {\n //\n }", "function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }", "public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "private function addProduct()\r\n {\r\n $sku = $_POST['sku'];\r\n $name = $_POST['name'];\r\n $price = $_POST['price'];\r\n $selectOption = $_POST['category'];\r\n // detects which post has been set and defines it as attribute\r\n switch (isset($_POST)) {\r\n case isset($_POST['size']):\r\n $attribute = $_POST['size'];\r\n break;\r\n case isset($_POST['weight']):\r\n $attribute = $_POST['weight'];\r\n break;\r\n case isset($_POST['height']) && isset($_POST['width']) && isset($_POST['length']):\r\n $attribute = $_POST['height'] . \"x\" . $_POST['width'] . \"x\" . $_POST['length'];\r\n break;\r\n case empty($attribute):\r\n header('Location: ./productAdd.php');\r\n }\r\n $this->saveProduct($sku, $name, $price, $selectOption, $attribute);\r\n // redirects user to homepage\r\n header('Location: ./../index.php');\r\n exit;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns Refunded Discount Money.
public function getRefundedDiscountMoney(): ?V1Money { return $this->refundedDiscountMoney; }
[ "public function getDiscountRefunded();", "public function getRefundedTotalAmount();", "public function getRefundedAmount()\n {\n return $this->_getAmount(self::CARD_REFUNDED_AMOUNT_KEY);\n }", "public function getBaseTotalRefunded();", "public function getRefundedTotal(): float;", "public function getBaseSubtotalRefunded();", "public function getRefundableAmount();", "public function getCrowdfundedAmount()\n {\n if ( is_null( $this->_crowdfundedAmount ) )\n {\n /** @var oxArticle $oProduct */\n $oProduct = $this->getCrowdfundingArticle();\n\n // get variants\n $variants = $oProduct->_getVariantsIds();\n\n // calculate already paid money\n $query = 'SELECT OXAMOUNT, OXNETPRICE FROM oxorderarticles b, oxorder a WHERE a.OXID = b.OXORDERID AND (b.OXARTID = \"' . implode( '\" OR b.OXARTID = \"', $variants ) . '\") AND a.OXSTORNO = 0 AND a.OXTRANSSTATUS = \"OK\"';\n $rows = oxDb::getDb()->Execute( $query );\n\n // set result zero\n $result = 0;\n\n if ( $rows != false && $rows->recordCount() > 0 )\n {\n while ( !$rows->EOF )\n {\n $result += $rows->fields [ 0 ] * $rows->fields [ 1 ];\n $rows->moveNext();\n }\n }\n\n $this->_crowdfundedAmount = round( $result, 2 );\n }\n\n return $this->_crowdfundedAmount;\n }", "public function getTotalRefundedAmount()\n {\n return $this->total_refunded_amount;\n }", "public function getBaseTotalRefunded(){\n return $this->_getData(self::BASE_TOTAL_REFUNDED);\n }", "public function discountDollars()\n {\n return $this->discountCurrency();\n }", "public function getGwTaxAmountRefunded();", "public function getDiscountTaxCompensationRefunded();", "public function getRefunded()\n {\n return $this->refunded;\n }", "public function getDiscountedAmount();", "public function revenueInDollars()\n {\n return $this->orders()->sum('amount') / 100;\n }", "public function getTotalRefunded()\n {\n $salesFlatCreditmemo = Mage::getSingleton('core/resource')->getTableName('sales_flat_creditmemo');\n $write = Mage::getSingleton('core/resource')->getConnection('core_write'); \n $supplierId = Mage::getSingleton('admin/session')->getUser()->getUserId();\n $orderId = Mage::app()->getRequest()->getParam('order_id');\n $select = \"SELECT sum(`grand_total`) AS total_refunded, sum(`base_grand_total`) AS base_total_refunded FROM `\".$salesFlatCreditmemo.\"` WHERE `supplier_id` =\".$supplierId.\" AND `order_id` = \".$orderId;\n $result = $write->fetchRow($select);\n if($result['total_refunded']!= null) {\n\t\t\t$totalRefunded['total_refunded'] = $result['total_refunded'];\n\t\t\t$totalRefunded['base_total_refunded'] = $result['base_total_refunded'];\n\t\t}\t\n else {\n\t\t\t$totalRefunded['total_refunded'] = 0;\n\t\t\t$totalRefunded['base_total_refunded'] = 0;\n\t\t}\t\n\t\treturn $totalRefunded;\n }", "public function getBaseDiscountTaxCompensationRefunded();", "public function getFixedDiscountMoney(): ?Money\n {\n return $this->fixedDiscountMoney;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the active Access
public function getActiveAccess(): ?string { return $this->activeAccess; }
[ "public function getAccess();", "public function getAccess(){\n\t\treturn $this->access;\n\t}", "public function getAccess() {\n\t\treturn $this->access;\n\t}", "function getAccessStatus() {\n\t\treturn $this->getData('accessStatus');\n\t}", "public function getAccessState()\n {\n return $this->access_state;\n }", "public function getAccessID() { return $this->get('access_id'); }", "public function getAccess() {\n\t\ttry {\n\t\t\treturn\t$this->getBounded1MInstance(\"BannersAccesRecords\");\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function getActive() {\r\n\treturn $this->active;\r\n }", "public function getActive()\r\n {\r\n return $this->active;\r\n }", "function getActive() {\n\t\treturn $this->_Active;\n\t}", "public function getActivite()\n {\n return $this->activite;\n }", "public function getIsAccess()\n {\n return $this->isAccess;\n }", "public function getAccessInfo() {\n return $this->accessInfo;\n }", "public function getAllowAccessState()\n {\n return $this->allow_access_state;\n }", "public function get_access_id() {\n return $this->access_id;\n }", "private function getAccessLevel() {\n\t\t\t\n\t\t$accessLevel = 0;\n\t\t\n\t\t$sql = \"SELECT * FROM <<\".TABLE_ACCOUNT.\">> LIMIT 1\";\n\t\t$result = $this->core->call('ModuleDatabase', 'executeScalar', $sql);\n\t\t\t\n\t\tif (empty($result)) {\n\t\t\t$accessLevel = array_search(CONF_ACC_SUPERADMIN, CONST_ACCESSLEVEL);\n\t\t} else {\n\t\t\tif (CONST_ACCOUNT_CONFIRMATION != 0) {\n\t\t\t\t$accessLevel = array_search(CONF_ACC_NEWUSER, CONST_ACCESSLEVEL);\n\t\t\t\t$accountCode = MUtil::getRandomString(CONST_ACCOUNT_CODE_LENGTH);\n\t\t\t} else {\n\t\t\t\t$accessLevel = array_search(CONF_ACC_USER, CONST_ACCESSLEVEL);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $accessLevel;\n\t\t\n\t}", "public function get_id_access()\n\t{\n\t\treturn $this->id_access;\n\t}", "function is_active()\r\n {\r\n return $this->userData['user_active'];\r\n }", "public function getAccess_level()\n {\n return $this->access_level;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Take a relative path and make it absolute.
private function makeAbsolute($relativePath) { return $this->rootPath . DIRECTORY_SEPARATOR . $relativePath; }
[ "private static function makeAbsolute($path)\n {\n return ($path{0} == DIRECTORY_SEPARATOR) ? self::$baseDirectory . $path : $path;\n }", "function toAbsPath($path, $basepath = false) {\n\t\t$path = $this->toUnixPath($path);\n\n\t\tif (!$basepath)\n\t\t\t$basepath = dirname(__FILE__) . \"/../\";\n\n\t\t// Is absolute unix or windows\n\t\tif (substr($path, 0, 1) == '/' || strpos($path, \":\") !== false) {\n\t\t\t// Resolve symlinks\n\t\t\t$tmp = realpath($path);\n\n\t\t\tif ($tmp)\n\t\t\t\t$path = $tmp;\n\n\t\t\treturn $this->toUnixPath($path);\n\t\t}\n\n\t\t$path = $this->toUnixPath($this->addTrailingSlash($this->toUnixPath(realpath($basepath))) . $path);\n\n\t\t// Local FS and exists remove any ../../\n\t\tif (strpos($path, \"://\") === false && file_exists($path))\n\t\t\t$path = $this->toUnixPath(realpath($path));\n\n\t\treturn $path;\n\t}", "function absolute_to_relative_path($path)\n{\n $pathParts = explode(DIRECTORY_SEPARATOR, $path);\n $pathParts = array_reverse($pathParts);\n array_splice($pathParts, 5);\n $pathParts = array_reverse($pathParts);\n $returnPath = CCTVALIASPATH . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $pathParts);\n $returnPath = str_replace('\\\\', '/', $returnPath);\n return $returnPath;\n}", "private function relativeToAbsolute($path)\n {\n if (str_contains($path, '//')) {\n return $path;\n }\n\n $path = str_replace('\"', \"\", $path);\n $path = str_replace(\"'\", \"\", $path);\n $path = str_replace(\"../\", \"\", $path);\n\n return $this->baseDir.'/'.$path;\n }", "public static function makePathAbsolute($path) {\n\t\treturn PATH_site . $path;\n\t}", "function absolute_to_relative($filepath) {\n\t\treturn str_replace(G_ROOT_PATH, G_ROOT_PATH_RELATIVE, forward_slash($filepath));\n\t}", "public static function toAbsolute(String $relativePath=''): String\n {\n return __DIR__ . \"/../../$relativePath\";\n }", "function absPath($path) {\t\t\r\n\t\tif(substr($path,-1) != '/') $path .= '/';\r\n\t\tif(substr($path,0,1) != '/') $path = '/' . $path;\r\n\t\treturn $path;\r\n\t}", "static function rel2abs_url($path) {\n if (substr($path, 0, 1) == \"/\") return $path;\n $dir = @getcwd();\n\n if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false))\n return false;\n\n $dir = self::normalize($dir);\n $doc_root = self::normalize(realpath($_SERVER['DOCUMENT_ROOT']));\n\n if (substr($dir, 0, strlen($doc_root)) != $doc_root)\n return false;\n\n $return = self::normalize(substr($dir, strlen($doc_root)) . \"/$path\");\n if (substr($return, 0, 1) !== \"/\")\n $return = \"/$return\";\n\n return $return;\n }", "public function toAbsolute(): AbsolutePathInterface;", "function makeAbsolutePath($path, $prefix)\n {\n\t\tif (\n\t\t\tsubstr($path, 0, 1) == '/' || // unix root\n\t\t\tsubstr($path, 1, 2) == ':\\\\' || // windows root\n\t\t\tsubstr($path, 0, 2) == '~/' || // unix home directory\n\t\t\tsubstr($path, 0, 2) == '\\\\\\\\' || // windows network location\n\t\t\tpreg_match('|^[a-z]+://|', $path) // url\n\t\t) {\n\t\t\treturn $path;\n\t\t} else {\n\t\t $absPath = $this->fixPath($prefix).$path;\n\t\t $count = 1;\n\t\t while ($count > 0) {\n\t\t $absPath = preg_replace('|\\w+/\\.\\./|', '', $absPath, -1, $count);\n\t\t }\n\t\t $absPath = str_replace('./', '', $absPath);\n\t\t\treturn $absPath;\n\t\t}\n\t}", "function absolute_path($relativePath)\n {\n return Path::getAbsolutePath($relativePath);\n }", "public static function buildAbsolutePath($relative_path, $basepath) {\n $basedir = static::dirname($basepath);\n if ($basedir == '.' || $basedir == '/' || $basedir == '\\\\' || $basedir == DIRECTORY_SEPARATOR) {\n $basedir = '';\n }\n return static::normalizePath($basedir . self::PATH_SEGMENT_SEPARATOR . $relative_path);\n }", "public function pathToAbsolute($path) {\n if (!UrlHelper::isExternal($path)) {\n $path = Url::fromUri('base:', ['absolute' => TRUE])->toString() . $path;\n }\n return $path;\n }", "public static function absolutePath( $path ) {\n\n\t\t$absolutePath = realpath( $path );\n\n\t\tif ( $absolutePath === false ) {\n\t\t\t$absolutePath = $path;\n\t\t}\n\n\t\treturn $absolutePath;\n\t}", "function create_abs_path($rel_path)\n {\n return \"http://\".$this->server.$this->url.$rel_path;\n }", "static public function absolutePath ($relPath) {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.2/std/php/_std/sys/FileSystem.hx:71: characters 3-47\n\t\tif (Path::isAbsolute($relPath)) {\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.2/std/php/_std/sys/FileSystem.hx:71: characters 33-47\n\t\t\treturn $relPath;\n\t\t}\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.2/std/php/_std/sys/FileSystem.hx:72: characters 3-44\n\t\treturn Path::join(\\Array_hx::wrap([\n\t\t\t\\Sys::getCwd(),\n\t\t\t$relPath,\n\t\t]));\n\t}", "public function rel2abs_url_path($path)\n\t{\n\t\t$path = strtr($path, '\\\\', '/');\n\t\tif (!FileManagerUtility::startsWith($path, '/'))\n\t\t{\n\t\t\t$based = $this->getRequestPath();\n\t\t\t$path = $based . $path;\n\t\t}\n\t\treturn $this->normalize($path);\n\t}", "function absolutePath($path)\r\n{\r\n return WWW_PATH . $path;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the route "variadic action".
public function testVariadicActionGet() { $controller = new SampleController(); $controller->initialize(); $res = $controller->variadicActionGet("", 0); $this->assertContains("arguments", $res); }
[ "public function testUserControllerWithVariadicArguments()\n {\n $route = new Route();\n \n $route->set(null, \"user\", null, \"Anax\\Route\\MockHandlerController\");\n \n $path = \"user/variadic\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:0\", $res);\n\n $path = \"user/variadic/1\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:1\", $res);\n\n $path = \"user/variadic/1/2/3/moped\";\n $this->assertTrue($route->match($path, \"GET\"));\n $res = $route->handle($path);\n $this->assertEquals(\"variadicAction collection:4\", $res);\n }", "public function testRouteMatchesAndMultipleParamsExtracted() {\n\t\t$resource = 'hello/Josh/and/John';\n\t\t$route = new Route('/hello/:first/and/:second', function () {});\n\t\t$result = $route->matches($resource);\n\t\t$this->assertTrue($result);\n\t\t$this->assertEquals($route->params(), array('first' => 'Josh', 'second' => 'John'));\n\t}", "public function testRouteMatchesAndMultipleParamsExtracted()\n {\n $resource = '/hello/Josh/and/John';\n $route = new \\Slim\\Route('/hello/:first/and/:second', function () {});\n $result = $route->matches($resource);\n $this->assertTrue($result);\n $this->assertEquals(array('first' => 'Josh', 'second' => 'John'), $route->getParams());\n }", "public function testRouteWithTwoArgumentsSeparated()\n {\n $route = new Route();\n\n $route->set(null, null, \"search/{arg1}/what/{arg2}\", function ($arg1, $arg2) {\n return \"$arg1$arg2\";\n });\n\n $this->assertFalse($route->match(\"search\"));\n $this->assertFalse($route->match(\"search/1/2\"));\n $this->assertFalse($route->match(\"search/1/what\"));\n $this->assertFalse($route->match(\"search/1/what/2/3\"));\n $this->assertFalse($route->match(\"search/1/2/3\"));\n\n $this->assertTrue($route->match(\"search/1/what/2\"));\n $this->assertEquals(\"12\", $route->handle());\n }", "public function testRouteWithTwoArguments()\n {\n $route = new Route();\n\n $route->set(null, null, \"search/{arg1}/{arg2}\", function ($arg1, $arg2) {\n return \"$arg1$arg2\";\n });\n\n $this->assertFalse($route->match(\"search\"));\n $this->assertFalse($route->match(\"search/1\"));\n $this->assertFalse($route->match(\"search/1/2/3\"));\n\n $this->assertTrue($route->match(\"search/1/2\"));\n $this->assertEquals(\"12\", $route->handle());\n }", "public function test_match_withMoreThanOneVar()\n {\n $route = new Route('GET', '/{id}/{slug}', 'test');\n $this->assertTrue(\n $route->match('GET', '/50/my-post-title'),\n 'match() must return true if URI pattern with var match pattern provided in constructor.'\n );\n $this->assertSame(\n ['id' => '50', 'slug' => 'my-post-title'],\n $route->getParams(),\n 'getParams() must return params from URI provided to match() method when more than one var is specified.'\n );\n }", "public function testPatternOnAction() {\n\t\t$route = new CakeRoute(\n\t\t\t'/blog/:action/*',\n\t\t\tarray('controller' => 'blog_posts'),\n\t\t\tarray('action' => 'other|actions')\n\t\t);\n\t\t$result = $route->match(array('controller' => 'blog_posts', 'action' => 'foo'));\n\t\t$this->assertFalse($result);\n\n\t\t$result = $route->match(array('controller' => 'blog_posts', 'action' => 'actions'));\n\t\t$this->assertEquals('/blog/actions/', $result);\n\n\t\t$result = $route->parse('/blog/other');\n\t\t$expected = array('controller' => 'blog_posts', 'action' => 'other', 'pass' => array(), 'named' => array());\n\t\t$this->assertEquals($expected, $result);\n\n\t\t$result = $route->parse('/blog/foobar');\n\t\t$this->assertFalse($result);\n\t}", "public function testPathMatchWithMultipleParameters()\n {\n $route = $this\n ->getMockBuilder('Sonno\\Configuration\\Route')\n ->disableOriginalConstructor()\n ->getMock();\n $route\n ->expects($this->any())\n ->method('getPath')\n ->will($this->returnValue('/test/{username}/{action}'));\n $route\n ->expects($this->any())\n ->method('getHttpMethod')\n ->will($this->returnValue('GET'));\n\n $config = $this\n ->getMockBuilder('Sonno\\Configuration\\Configuration')\n ->disableOriginalConstructor()\n ->getMock();\n $config\n ->expects($this->any())\n ->method('getRoutes')\n ->will($this->returnValue(array($route)));\n\n $request = $this->buildMockRequest('GET', '/test/foo/bar');\n\n $router = new Router($config);\n\n $matches = $router->match($request, $params);\n\n $this->assertEquals(1, count($matches));\n $this->assertEquals(2, count($params));\n $this->assertArrayHasKey('username', $params);\n $this->assertArrayHasKey('action', $params);\n $this->assertEquals(\"foo\", $params['username']);\n $this->assertEquals(\"bar\", $params['action']);\n }", "public function testGreedyRouteFailurePassedArg() {\n\t\t$route = new CakeRoute('/:controller/:action', array('plugin' => null));\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'view', '0'));\n\t\t$this->assertFalse($result);\n\n\t\t$route = new CakeRoute('/:controller/:action', array('plugin' => null));\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'test'));\n\t\t$this->assertFalse($result);\n\t}", "public function testMatchWithNamedParametersAndPassedArgs() {\n\t\tRouter::connectNamed(true);\n\n\t\t$route = new CakeRoute('/:controller/:action/*', array('plugin' => null));\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'index', 'plugin' => null, 'page' => 1));\n\t\t$this->assertEquals('/posts/index/page:1', $result);\n\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, 5));\n\t\t$this->assertEquals('/posts/view/5', $result);\n\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, 0));\n\t\t$this->assertEquals('/posts/view/0', $result);\n\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, '0'));\n\t\t$this->assertEquals('/posts/view/0', $result);\n\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, 5, 'page' => 1, 'limit' => 20, 'order' => 'title'));\n\t\t$this->assertEquals('/posts/view/5/page:1/limit:20/order:title', $result);\n\n\t\t$result = $route->match(array('controller' => 'posts', 'action' => 'view', 'plugin' => null, 'word space', 'order' => 'Θ'));\n\t\t$this->assertEquals('/posts/view/word%20space/order:%CE%98', $result);\n\n\t\t$route = new CakeRoute('/test2/*', array('controller' => 'pages', 'action' => 'display', 2));\n\t\t$result = $route->match(array('controller' => 'pages', 'action' => 'display', 1));\n\t\t$this->assertFalse($result);\n\n\t\t$result = $route->match(array('controller' => 'pages', 'action' => 'display', 2, 'something'));\n\t\t$this->assertEquals('/test2/something', $result);\n\n\t\t$result = $route->match(array('controller' => 'pages', 'action' => 'display', 5, 'something'));\n\t\t$this->assertFalse($result);\n\t}", "public function testMatchWithMultipleMethods()\n {\n $this->router->map('GET|POST', '/methods', 'multiple_methods');\n $expected = array(\n 'target' => 'multiple_methods',\n 'params' => array(),\n 'name' => null,\n );\n $this->assertEquals($expected, $this->router->match('/methods', 'GET'));\n $this->assertEquals($expected, $this->router->match('/methods', 'POST'));\n $this->assertFalse($this->router->match('/methods', 'PUT'));\n }", "public function testPassArgRestructure() {\n\t\t$route = new CakeRoute('/:controller/:action/:slug', array(), array(\n\t\t\t'pass' => array('slug')\n\t\t));\n\t\t$result = $route->parse('/posts/view/my-title');\n\t\t$expected = array(\n\t\t\t'controller' => 'posts',\n\t\t\t'action' => 'view',\n\t\t\t'slug' => 'my-title',\n\t\t\t'pass' => array('my-title'),\n\t\t\t'named' => array()\n\t\t);\n\t\t$this->assertEquals($expected, $result, 'Slug should have moved');\n\t}", "function test_action_args_3() {\n\t\t$a1 = new MockAction();\n\t\t$a2 = new MockAction();\n\t\t$a3 = new MockAction();\n\t\t$tag = __FUNCTION__;\n\t\t$val1 = __FUNCTION__ . '_val1';\n\t\t$val2 = __FUNCTION__ . '_val2';\n\n\t\t// a1 accepts two arguments, a2 doesn't, a3 accepts two arguments\n\t\tadd_action( $tag, array( &$a1, 'action' ), 10, 2 );\n\t\tadd_action( $tag, array( &$a2, 'action' ) );\n\t\tadd_action( $tag, array( &$a3, 'action' ), 10, 2 );\n\t\t// call the action with two arguments\n\t\tdo_action( $tag, $val1, $val2 );\n\n\t\t$call_count = $a1->get_call_count();\n\t\t// $a1 should be called with both args.\n\t\t$this->assertSame( 1, $call_count );\n\t\t$argsvar1 = $a1->get_args();\n\t\t$this->assertSame( array( $val1, $val2 ), array_pop( $argsvar1 ) );\n\n\t\t// $a2 should be called with one only.\n\t\t$this->assertSame( 1, $a2->get_call_count() );\n\t\t$argsvar2 = $a2->get_args();\n\t\t$this->assertSame( array( $val1 ), array_pop( $argsvar2 ) );\n\n\t\t// $a3 should be called with both args.\n\t\t$this->assertSame( 1, $a3->get_call_count() );\n\t\t$argsvar3 = $a3->get_args();\n\t\t$this->assertSame( array( $val1, $val2 ), array_pop( $argsvar3 ) );\n\t}", "public function test_route_canonicalized_multiple() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'GET' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => array( 'POST' ),\n\t\t\t\t\t'callback' => '__return_null',\n\t\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t// Check the route was registered correctly.\n\t\t$endpoints = $GLOBALS['wp_rest_server']->get_raw_endpoint_data();\n\t\t$this->assertArrayHasKey( '/test-ns/test', $endpoints );\n\n\t\t// Check the route was wrapped in an array.\n\t\t$endpoint = $endpoints['/test-ns/test'];\n\t\t$this->assertArrayNotHasKey( 'callback', $endpoint );\n\t\t$this->assertArrayHasKey( 'namespace', $endpoint );\n\t\t$this->assertSame( 'test-ns', $endpoint['namespace'] );\n\n\t\t$filtered_endpoints = $GLOBALS['wp_rest_server']->get_routes();\n\t\t$endpoint = $filtered_endpoints['/test-ns/test'];\n\t\t$this->assertCount( 2, $endpoint );\n\n\t\t// Check for both methods.\n\t\tforeach ( array( 0, 1 ) as $key ) {\n\t\t\t$this->assertArrayHasKey( 'callback', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'methods', $endpoint[ $key ] );\n\t\t\t$this->assertArrayHasKey( 'args', $endpoint[ $key ] );\n\t\t}\n\t}", "public function testParamsParseFromPattern()\n {\n $route = new Route('post', 'user/<id>', '#handler');\n $this->assertEquals(['id'], $route->getParams());\n\n $route = new Route('post', 'user/<id>/message/<messageId>', '#handler');\n $this->assertEquals(['id', 'messageId'], $route->getParams());\n\n $route = new Route('post', 'user/<id>/<subId>/<subSubId>', '#handler');\n $this->assertEquals(['id', 'subId', 'subSubId'], $route->getParams());\n }", "public function isValidAction($args)\n\t{\n\t\treturn 0 == strcasecmp($args[0], $this->action) &&\n\t\t\tcount($args) - 1 >= count($this->parameters);\n\t}", "public function testMatchWithOptionalUrlParts()\n {\n $this->router->map(\n 'GET',\n '/bar/[:controller]/[:action].[:type]?',\n 'bar_action',\n 'bar_route'\n );\n $this->assertEquals(\n array(\n 'target' => 'bar_action',\n 'params' => array(\n 'controller' => 'test',\n 'action' => 'do',\n 'type' => 'json',\n 'method' => 'GET'\n ),\n 'name' => 'bar_route'\n ),\n $this->router->match('/bar/test/do.json', 'GET')\n );\n $this->assertEquals(\n array(\n 'target' => 'bar_action',\n 'params' => array(\n 'controller' => 'test',\n 'action' => 'do',\n 'method' => 'GET'\n ),\n 'name' => 'bar_route'\n ),\n $this->router->match('/bar/test/do', 'GET')\n );\n }", "function route($path, $action) {\n if ($_GET['uri'] === $path) {\n call_user_func($action);\n exit;\n }\n}", "public function testGetRoutes()\n {\n $method = 'POST';\n $route = '/[:controller]/[:action]';\n $target = function () {\n };\n $this->assertInternalType('array', $this->router->getRoutes());\n $this->router->map($method, $route, $target);\n $this->assertEquals(\n array(\n $method => array(\n array(\n $route,\n $target,\n null\n )\n )\n ),\n $this->router->getRoutes()\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the version for this block
public function getVersion() { if ($this->version == null) { return BlockHeaderInterface::CURRENT_VERSION; } return $this->version; }
[ "public function getVersion()\n {\n if ($this->version === null) {\n return BlockHeaderInterface::CURRENT_VERSION;\n }\n return $this->version;\n }", "public function getVersion() {\n\t\treturn $this->version;\n\t}", "public static function getVersion()\n\t{\n\t\treturn BLOCKS_VERSION;\n\t}", "public function getVersion(){\n $client = Yii::$app->infoServices;\n return $client->getVersion()->return->version;\n }", "final public function get_version() {\n\t\treturn $this->get_arg_or_plugin_data( 'version', 'Version' );\n\t}", "public function getVersion()\n\t{\n\t\tif($this->_version != \"\")\n\t\t\treturn $this->_version;\n\t\telse\n\t\t{\n\t\t\t$name = $this->_pseudo;\n\t\t\t$retour = self::request(sprintf($this->_URL_VERSION, $this->_region));\n\t\t\tif($retour !== false)\n\t\t\t{\n\t\t\t\t$json = json_decode($retour);\n\t\t\t\treturn $json->v;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn \"\";\n\t\t}\n\t}", "public function version()\n {\n return $this->call_api_url($this->base_url,[\n 'function' => 'version'\n ]);\n }", "public function version() {\n\t\t$response = \\Httpful\\Request::get( $this->api . 'info' )->send();\n\t\treturn $response->body->info->version;\n\t}", "public static function getStoredVersion()\n\t{\n\t\t$storedBlocksInfo = static::_getStoredInfo();\n\t\treturn $storedBlocksInfo ? $storedBlocksInfo->version : null;\n\t}", "public function getVersion() {\n if (!$this->version) {\n $query = $this->db->prepare(\"\n SELECT c.age\n FROM codepoints c, blocks b\n WHERE replace(replace(lower(b.name), '_', ''), ' ', '') = ?\n AND c.cp >= b.first\n AND c.cp <= b.last\n GROUP BY c.age\");\n $query->execute([Toolkit::normalizeName($this->name)]);\n $r = $query->fetchAll(\\PDO::FETCH_COLUMN, 0);\n if (! $r) {\n $this->version = '1.0';\n } else {\n sort($r, SORT_NUMERIC);\n $this->version = $r[0];\n }\n }\n return $this->version;\n }", "protected function _getVersion()\r\n {\r\n if(empty($this->version))\r\n {\r\n $result = $this->cacheHandler->get($this->getTagName());\r\n if(empty($result)) {\r\n $this->ResetTagVersion();\r\n } else {\r\n $this->version = $result;\r\n }\r\n }\r\n return $this->version;\r\n }", "public function get_version(){\n\n\t\t\tswitch( $this->method ){\n\n\t\t\t\tcase 'commit-message':\n\t\t\t\tdefault:\n\t\t\t\t\treturn $this->get_version_from_commit_message();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'file':\n\t\t\t\t\treturn $this->get_version_from_file();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'tag':\n\t\t\t\t\treturn $this->get_version_from_tag();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "public function getVersion(): int\n {\n $this->ensureHoldLock();\n\n return $this->version;\n }", "public function getVersion()\n {\n return $this->get('/version');\n }", "public abstract function get_version();", "public function getCurrentVersion()\n {\n return $this->current_version;\n }", "public function currentLockVersion()\n {\n return $this->getAttribute(static::lockVersionColumn());\n }", "protected function getVersion() {\n return StringHelper::namespaceToVersion($this->componentNamespace);\n }", "public function getVersion()\n {\n $this->_checkInit(self::DATA_VERSION);\n return $this->_data[self::DATA_VERSION];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get RPC error code.
public function getRpcErrorCode(): ?int { return $this->content['error']['code'] ?? null; }
[ "public function get_error_code();", "public function get_error_code()\n {\n }", "public function get_error_code() {\n\n\t\treturn isset( $this->response_data->error->code ) ? (int) $this->response_data->error->code : 500;\n\t}", "public function getErrcode()\n {\n return $this->get(self::ERRCODE);\n }", "public function get_error_code() {\n\t\t$codes = $this->get_error_codes();\n\n\t\tif ( empty($codes) )\n\t\t\treturn '';\n\n\t\treturn $codes[0];\n\t}", "function get_error_code() {\n\t\t$codes = $this->get_error_codes();\n\n\t\tif ( empty($codes) )\n\t\t\treturn '';\n\n\t\treturn $codes[0];\n\t}", "public function get_error_code() {\n $codes = $this->get_error_codes();\n \n if (empty($codes)) {\n return ''; \n } else {\n return $codes[0];\n }\n }", "function getErrorCode()\r\n\t{\r\n \t\tif( $this->request_status == \"ok\" )\r\n \t\t\treturn \"\";\r\n\r\n\t\t$errcode = $this->parser_getTagValue( $this->tmp_res, \"errcode\" );\r\n\r\n\t\treturn $errcode;\r\n\t}", "public function getErrorcode()\n {\n return isset($this->errorcode)? $this->errorcode : \"\";\n }", "public function getErrorCode()\n {\n return $this->readOneof(1);\n }", "public function getRpcError(): ?string\n {\n return $this->content['error']['exception'] ?? null;\n }", "public function get_error_codes() {}", "public function getErrorNumber()\n {\n return curl_errno($this->curl);\n }", "public function getApiCodeError()\n {\n return $this->apiCodeError;\n }", "public function ical_get_error_code() {\n\t\treturn $this->errNo;\n\t}", "public function getErrorNumber()\n {\n return curl_errno($this->handle);\n }", "public function getErrorCode()\n {\n return $this->errorCode;\n }", "function get_result_error_code($result) {\n return $result['errror'];\n}", "public function getErrorStatusCode() {\n return $this->last_error_status_code;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wishitems belong to a Wishlist
public function wishlist() { # Define an inverse one-to-many relationship return $this->belongsTo('App\Wishlist'); }
[ "public function wishlists() \n {\n return $this->hasMany(Wishlist::class);\n }", "function setWishListItem( $wishlist )\r\n {\r\n if ( is_a( $wishlist, \"eZWishListItem\" ) )\r\n {\r\n $this->WishListItemID = $wishlist->id();\r\n }\r\n }", "public function wishlist_items() {\n return $this->hasMany(WishlistProxy::modelClass(), 'customer_id');\n }", "public function wishlist() {\n return $this->belongsToMany('App\\Product', 'wishlists', 'user_id', 'product_id');\n }", "public function getWishlistsByUser();", "public function testGetWishList()\n {\n $this->setRequestParameter('wishid', '_testId');\n $oWishList = oxNew(\"Wishlist\");\n $myDB = oxDb::getDB();\n\n // adding article to basket\n $sQ = 'insert into oxuserbaskets ( oxid, oxuserid, oxtitle, oxpublic ) values ( \"_testBasketId1\", \"' . $this->_oUser->getId() . '\", \"wishlist\", 1 ) ';\n $myDB->Execute($sQ);\n\n $sQ = 'insert into oxuserbasketitems ( oxid, oxbasketid, oxartid, oxamount ) values ( \"_testId1\", \"_testBasketId1\", \"1126\", \"1\" ) ';\n $myDB->Execute($sQ);\n\n $oList = $oWishList->getWishList();\n $this->assertEquals(1, count($oList));\n $oArticle = array_pop($oList);\n $this->assertEquals('1126', $oArticle->getId());\n }", "public function setWishlistItemId($wishlistItemId);", "public function wishlist()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n return $this->hasMany('App\\Wishlist','spsd_id','spsd_id');\n }", "public function wishlists() {\n return $this->hasMany(Wishlist::class, 'host_id');\n }", "public function productWishlist()\n {\n return $this->hasOne(ProductWishList::class, 'products_id')\n ->select('_id as wishlistId', 'products_id', 'users_id as addWishlistUserId');\n }", "public function getWishlists()\n {\n return Wishlist::byUser(Auth::getUser());\n }", "public function addWishOrderItem(AbstractWishOrderItem $item);", "public function getWishList()\n {\n if ($this->wishList === null) {\n $this->wishList = new WishList\\WishList();\n }\n return $this->wishList;\n }", "public function testWishlist() {\n $profile = Profile::create([\n 'type' => 'customer',\n ]);\n $profile->save();\n $profile = $this->reloadEntity($profile);\n\n /** @var \\Drupal\\commerce_wishlist\\Entity\\WishlistItemInterface $wishlist_item */\n $wishlist_item = WishlistItem::create([\n 'type' => 'commerce_product_variation',\n ]);\n $wishlist_item->save();\n $wishlist_item = $this->reloadEntity($wishlist_item);\n /** @var \\Drupal\\commerce_wishlist\\Entity\\WishlistItemInterface $another_wishlist_item */\n $another_wishlist_item = WishlistItem::create([\n 'type' => 'commerce_product_variation',\n 'quantity' => '2',\n ]);\n $another_wishlist_item->save();\n $another_wishlist_item = $this->reloadEntity($another_wishlist_item);\n\n $wishlist = Wishlist::create([\n 'type' => 'default',\n ]);\n $wishlist->save();\n\n $this->assertNotEmpty($wishlist->getCode());\n $wishlist->setCode('new_code');\n $this->assertEquals('new_code', $wishlist->getCode());\n $this->assertEquals('/wishlist/new_code', $wishlist->toUrl()->toString());\n\n $wishlist->setName('My wishlist');\n $this->assertEquals('My wishlist', $wishlist->getName());\n\n $wishlist->setOwner($this->user);\n $this->assertEquals($this->user, $wishlist->getOwner());\n $this->assertEquals($this->user->id(), $wishlist->getOwnerId());\n $wishlist->setOwnerId(0);\n $this->assertEquals(NULL, $wishlist->getOwner());\n $wishlist->setOwnerId($this->user->id());\n $this->assertEquals($this->user, $wishlist->getOwner());\n $this->assertEquals($this->user->id(), $wishlist->getOwnerId());\n\n $wishlist->setShippingProfile($profile);\n $this->assertEquals($profile, $wishlist->getShippingProfile());\n\n $wishlist->setItems([$wishlist_item, $another_wishlist_item]);\n $this->assertEquals([$wishlist_item, $another_wishlist_item], $wishlist->getItems());\n $this->assertTrue($wishlist->hasItems());\n $wishlist->removeItem($another_wishlist_item);\n $this->assertEquals([$wishlist_item], $wishlist->getItems());\n $this->assertTrue($wishlist->hasItem($wishlist_item));\n $this->assertFalse($wishlist->hasItem($another_wishlist_item));\n $wishlist->addItem($another_wishlist_item);\n $this->assertEquals([$wishlist_item, $another_wishlist_item], $wishlist->getItems());\n $this->assertTrue($wishlist->hasItem($another_wishlist_item));\n\n $wishlist->setCreatedTime(635879700);\n $this->assertEquals(635879700, $wishlist->getCreatedTime());\n\n $this->assertFalse($wishlist->isPublic());\n $wishlist->setPublic(TRUE);\n $this->assertTrue($wishlist->isPublic());\n\n $this->assertTrue($wishlist->getKeepPurchasedItems());\n $wishlist->setKeepPurchasedItems(FALSE);\n $this->assertFalse($wishlist->getKeepPurchasedItems());\n }", "public function addWishlistId($wishlist_id);", "public function getByWishlistItemId(int $wishlistItemId);", "public function isInWishList()\n {\n $pdo = static::getDB();\n $sql = \"select count(*) from wishlists w, products p where w.product_id = p.product_id and w.user_id = :user_id and p.product_id = :product_id\";\n $result = $pdo->prepare($sql);\n $result->execute([\n 'user_id' => Auth::getUserId(),\n 'product_id' => $this->PRODUCT_ID\n ]);\n\n $rowsCount = $result->fetchColumn(); \n\n if($rowsCount >= 1){\n return true;\n }\n return false;\n }", "private function createWishlist($p_id){\n return Wishlist::firstOrCreate([\n 'product_id' => $p_id,\n 'user_id' => Auth::id()\n ]);\n }", "public function getWishlist() {\n return $this->wishlist;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation geofencesGetAsync Fetch a list of Geofences
public function geofencesGetAsync($all = null, $user_id = null, $device_id = null, $group_id = null, $refresh = null) { return $this->geofencesGetAsyncWithHttpInfo($all, $user_id, $device_id, $group_id, $refresh) ->then( function ($response) { return $response[0]; } ); }
[ "function fetchVoiceRegions() {\n return (new \\React\\Promise\\Promise(function (callable $resolve, callable $reject) {\n $this->api->endpoints->voice->listVoiceRegions()->then(function ($data) use ($resolve) {\n $collect = new \\CharlotteDunois\\Yasmin\\Utils\\Collection();\n \n foreach($data as $region) {\n $voice = new \\CharlotteDunois\\Yasmin\\Models\\VoiceRegion($this, $region);\n $collect->set($voice->id, $voice);\n }\n \n $resolve($collect);\n }, $reject)->done(null, array($this, 'handlePromiseRejection'));\n }));\n }", "public function geofencesGetAsyncWithHttpInfo($all = null, $user_id = null, $device_id = null, $group_id = null, $refresh = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\Geofence[]';\n $request = $this->geofencesGetRequest($all, $user_id, $device_id, $group_id, $refresh);\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 get_all_geojson_routes() {\n if ( ! wp_verify_nonce( $_POST['get_all_geojson_routes_nonce'], 'get-all-geojson-routes-nonce' ) ) {\n exit;\n } else {\n header( 'Content-Type: application/json' );\n global $wpdb;\n $procedure_name = $wpdb->prefix . 'get_all_geojson_routes';\n $gps_locations = $wpdb->get_results(\"CALL {$procedure_name};\");\n\n if ( 0 == $wpdb->num_rows ) {\n echo '0';\n exit;\n }\n \n $geojson = '{\"type\": \"FeatureCollection\", \"features\": [';\n \n foreach ( $gps_locations as $location ) {\n $geojson .= $location->geojson;\n $geojson .= ','; \n }\n \n $geojson = rtrim($geojson, ',');\n $geojson .= ']}'; \n\n echo $geojson;\n exit;\n } \n }", "public function postGeofence()\n {\n $sl = request()->input('sl', NULL);\n $name = request()->input('name');\n $radius = request()->input('radius', NULL);\n $lat = request()->input('lat', NULL);\n $lng = request()->input('lng', NULL);\n $zoom = request()->input('zoom', NULL);\n $active = (boolean) request()->input('active', false);\n\n if($sl != NULL)\n {\n $qs = Core\\Secure::string2array($sl);\n $geofence = Models\\Geofence::where('id', $qs['geofence_id'])->where('user_id', '=', Core\\Secure::userId())->first();\n }\n else\n {\n // Verify limit\n $geofence_count = Models\\Geofence::where('user_id', '=', Core\\Secure::userId())->count();\n $geofence_count_limit = \\Auth::user()->plan->limitations['geofences']['max'];\n\n if ($geofence_count >= $geofence_count_limit) {\n return response()->json([\n 'type' => 'error', \n 'msg' => trans('global.account_limit_reached'),\n 'reset' => false\n ]);\n } elseif ($geofence_count >= 100) {\n return response()->json([\n 'type' => 'error', \n 'msg' => trans('geofences::global.geofence_limit_reached'),\n 'reset' => false\n ]);\n }\n $geofence = new Models\\Geofence;\n }\n\n $geofence->user_id = Core\\Secure::userId();\n $geofence->funnel_id = Core\\Secure::funnelId();\n $geofence->name = $name;\n $geofence->radius = $radius;\n $geofence->lat = $lat;\n $geofence->lng = $lng;\n $geofence->zoom = $zoom;\n $geofence->active = $active;\n $geofence->setLocationAttribute($lng . ',' . $lat);\n\n if($geofence->save())\n {\n $response = array(\n 'redir' => '#/geofences'\n );\n }\n else\n {\n $response = array(\n 'type' => 'error', \n 'msg' => $geofence->errors()->first(),\n 'reset' => false\n );\n }\n\n return response()->json($response);\n }", "public function getAllAgencesAction( ){\r\n\t\t\r\n\t\t $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('ComDaufinBundle:Agence')->findAll();\r\n\r\n $response = array(\"agences\" => $entities,);\r\n \r\n \r\n return $response;\r\n\t}", "private function getFacets()\n {\n // Don't store this here\n $url = 'NO_ESPOSIBLE';\n $options = array(\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'api-key' => $this->azureApiKey\n ]\n );\n \n $client = new \\GuzzleHttp\\Client();\n\n $result = $client->request('GET', $url, $options);\n\n return $result;\n }", "public function getCities()\n {\n if (Cache::has(self::DPD_CITIES_CACHE_NAME)) {\n $cities = collect(Cache::get(self::DPD_CITIES_CACHE_NAME));\n }\n else {\n $cities = Cache::remember(self::DPD_CITIES_CACHE_NAME, $this->client->cacheLifeTimeInMinutes, function () {\n $client = new \\SoapClient($this->client->url.\"geography2?wsdl\",\n [\n 'trace' => true,\n 'keep_alive' => false\n ]\n );\n\n $data['auth'] = $this->client->getAuthData();\n\n $request['request'] = $data; //помещаем наш масив авторизации в масив запроса request.\n $result = $client->getCitiesCashPay($request); //обращаемся к функции getCitiesCashPay и получаем список городов.\n $result = self::stdToArray($result);\n return collect($result['return']);\n });\n }\n\n return $cities;\n }", "function geofenceEvents(){\n\t\t\n\t\t$login = $this->administrator_model->front_login_session();\n\t\t\n\t\t$userid = $login->user_id;\n\t\t$usertype = $login->usertype;\n\t\t$businessId = $login->businessId;\n\t\t\n\t\t$postDate = $_GET['eventdate'];\n\t\t\n\t\tif($usertype == 6){\n\t\t\t\n\t\t\t$activeGeofences = $this->geofence_model->getActiveGeofences($businessId);\n\t\t\t\n\t\t\t$geofenceId = '';\n\t\t\tforeach($activeGeofences as $geofence){\n\t\t\t\t$geofenceId[] = $geofence->geofenceId;\n\t\t\t}\n\t\t\t\n\t\t\t$where['businessId'] = $businessId;\n\t\t\t$where['geofence_id'] = $geofenceId;\n\t\t\t$where['date'] = $postDate;\n\t\t\t$allGeofence = $this->geofence_model->getBusinessAdminAllGeofence($where);\n\t\t\t\n\t\t\t//echo '<pre>';\n\t\t\t//print_r($allGeofence);\n\t\t}\n\t\tif($usertype == 7){\n\t\t\t$locations = $this->location_model->getUserLocations($login->user_id);\n\t\t\n\t\t\tforeach($locations as $userlocation){\n\t\t\n\t\t\t\t$locationArray[] = $userlocation->locationid;\n\t\t\n\t\t\t}\n\t\t\n\t\t\t$geofences = $this->geofence_model->getBusinessUserGeofence($locationArray);\n\t\t\t$geofenceId = '';\n\t\t\tforeach($geofences as $geofence){\n\t\t\t\t$geofenceId[] = $geofence->geofenceId;\n\t\t\t}\n\t\t\t\n\t\t\t$where['geofence_id'] = $geofenceId;\n\t\t\t$where['date'] = $postDate;\n\t\t\t$allGeofence = $this->geofence_model->getBusinessUserAllGeofence($where);\n\t\t}\n\t\t\n\t\techo json_encode($allGeofence);\n\t\t\n\t}", "public function actionGetGeoLocatedClients(){\n $app = Yii::$app;\n $req = $app->request;\n $res = $app->response;\n $session = $app->session;\n if($req->isAjax){\n $clientsList = [];\n $clients = SpyClient::find()\n ->select(['client_id', 'name', 'coordinates'])\n ->where(['commercial_id' => $app->user->id])\n ->andWhere(['!=', 'coordinates', ''])\n ->all();\n foreach($clients as $client){\n if($client instanceof SpyClient){\n $item = [\n 'client_id' => $client->client_id,\n 'name' => $client->name,\n 'coordinates' => $client->coordinates,\n ];\n in_array($client->client_id, $session->get('routes')) ? $item['route'] = true : $item['route'] = false ;\n array_push($clientsList, $item);\n }\n }\n $res->format = Response::FORMAT_JSON;\n return $clientsList;\n }\n return null;\n }", "public function loadPlacesAction() {\n\t\t$sLat = floatVal( $this->request->getArgument('sLat') );\n\t\t$wLng = floatVal( $this->request->getArgument('wLng') );\n\t\t$nLat = floatVal( $this->request->getArgument('nLat') );\n\t\t$eLng = floatVal( $this->request->getArgument('eLng') );\n\t\t\n\t\t$response = array(\n\t\t\t'places' => $this->placeRepository->findWithinBoundsAsArray($sLat, $wLng, $nLat, $eLng),\n\t\t\t'persons' => array(),\n\t\t\t'objects' => array()\n\t\t);\n\t\treturn json_encode($response); // don't mask slashes in closing htmltags\n\t}", "public function getAllGeonodes() {\n\t\t$qb = $this->createQueryBuilder('n');\n\t\t$qb->innerJoin(\"n.relations\",\"rel\",Join::WITH,\n\t\t\t$qb->expr()->eq(\"n.id\",\"rel.startNode\")\n\t\t);\n\t\t$qb->where(\"rel.geometryvalue IS NOT NULL\");\n\t\treturn $qb->getQuery()->getResult();\n\t}", "public function get_geojson_route() {\n if ( ! wp_verify_nonce( $_POST['get_geojson_route_nonce'], 'get-geojson-route-nonce' ) ) {\n exit;\n } else {\n header( 'Content-Type: application/json' );\n\n global $wpdb;\n $session_id = $_POST['session_id'];\n $procedure_name = $wpdb->prefix . 'get_geojson_route';\n $gps_locations = $wpdb->get_results($wpdb->prepare(\n \"CALL {$procedure_name}(%s);\", \n array(\n $session_id\n )\n )); \n \n if ( 0 == $wpdb->num_rows ) {\n echo '0';\n exit;\n }\n \n $json = '{\"type\": \"FeatureCollection\", \"features\": [';\n \n foreach ( $gps_locations as $location ) {\n $json .= $location->geojson;\n $json .= ','; \n }\n \n $json = rtrim($json, ',');\n $json .= ']}'; \n \n echo $json;\n exit;\n } \n }", "function runListFeatures()\n{\n echo \"Running ListFeatures...\\n\";\n global $client;\n\n $lo_point = new routeguide\\Point();\n $hi_point = new routeguide\\Point();\n\n $lo_point->setLatitude(400000000);\n $lo_point->setLongitude(-750000000);\n $hi_point->setLatitude(420000000);\n $hi_point->setLongitude(-730000000);\n\n $rectangle = new routeguide\\Rectangle();\n $rectangle->setLo($lo_point);\n $rectangle->setHi($hi_point);\n\n // start the server streaming call\n $call = $client->ListFeatures($rectangle);\n // an iterator over the server streaming responses\n $features = $call->responses();\n foreach ($features as $feature) {\n printFeature($feature);\n }\n}", "public function getList($params = array())\n {\n $resource = 'georegion.json';\n $resource .= '?' . $this->buildQueryString($params);\n $response = $this->getServiceResponse($resource);\n\n $geoRegions = new Models\\ResponseGeoRegionsGet($response);\n\n return $geoRegions;\n }", "public function list()\n {\n return $this->getResult($this->client->get('regions'));\n }", "public function all()\n {\n return $this->client->get('regions');\n }", "public function getEntities()\n {\n return $this->makeRequest('GET', 'entities');\n }", "public function actionGeoSearch()\n {\n $request = Yii::app()->request;\n \n $searchType = $request->getParam('searchType', 'byName');\n \n switch ($searchType) {\n case 'byName':\n $where = $request->getParam('q', 'Новосибирск');\n $searchParams = array('q' => $where);\n break;\n case 'byPoint':\n $lat = $request->getParam('lat', '54.991984');\n $lon = $request->getParam('lon', '82.901886');\n $searchParams = array('q' => $lon . ',' . $lat);\n break;\n }\n $searchParams['format'] = 'full';\n //$searchParams['limit'] = 10;\n\n $jst = microtime(true);\n \n try {\n $json = Yii::app()->apiClient->geoSearch($searchParams);\n } catch (Exception $e) {\n $json = '{}';\n }\n\n $jet = microtime(true);\n Yii::trace(print_r($json, true), 'demo.geoSearch.result');\n $xst = microtime(true);\n \n try {\n $xml = Yii::app()->apiClient->geoSearch($searchParams, 'xml');\n } catch (Exception $e) {\n $xml = '';\n }\n \n $xet = microtime(true);\n\n $geoms = json_decode($json);\n switch ($searchType) {\n case 'byName':\n $center = null;\n if (isset($geoms->result) && isset($geoms->result[count($geoms->result) - 1]->centroid)) {\n $center = $geoms->result[count($geoms->result) - 1]->centroid;\n }\n break;\n case 'byPoint':\n $center = 'POINT(' . $lon . ' ' . $lat . ')';\n break;\n }\n\n $this->render('geom_list', array(\n 'geoms' => $geoms,\n 'where' => isset($where) ? $where : null,\n 'lat' => isset($lat) ? $lat : null,\n 'lon' => isset($lon) ? $lon : null,\n 'workingNow' => false,\n 'searchType' => $searchType,\n 'center' => $center,\n 'rawJson' => Helper::jsonPrettify($json),\n 'rawXml' => $xml,\n 'rawRe' => Yii::app()->apiClient->lastRequest,\n 'jsonRespTime' => $jet - $jst,\n 'xmlRespTime' => $xet - $xst,\n ));\n }", "public function getLocations(): array\n {\n $arrLocations = array();\n $objLocations = ContaoEstateManager\\ProviderModel::findAll();\n\n if ($objLocations === null)\n {\n return $arrLocations;\n }\n\n while ($objLocations->next())\n {\n $arrLocations[ $objLocations->id ] = $objLocations->postleitzahl . ' ' . $objLocations->ort . ' (' . $objLocations->firma . ')';\n }\n\n return $arrLocations;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the setNoDossCpta() method.
public function testSetNoDossCpta() { $obj = new Constantes(); $obj->setNoDossCpta("noDossCpta"); $this->assertEquals("noDossCpta", $obj->getNoDossCpta()); }
[ "public function testSetNoDossCpta() {\n\n $obj = new iComptaDroits();\n\n $obj->setNoDossCpta(\"noDossCpta\");\n $this->assertEquals(\"noDossCpta\", $obj->getNoDossCpta());\n }", "public function testSetDossNonCadre() {\n\n $obj = new Organismes();\n\n $obj->setDossNonCadre(\"dossNonCadre\");\n $this->assertEquals(\"dossNonCadre\", $obj->getDossNonCadre());\n }", "public function testSetAnnulationDossierCpta() {\n\n $obj = new Constantes();\n\n $obj->setAnnulationDossierCpta(true);\n $this->assertEquals(true, $obj->getAnnulationDossierCpta());\n }", "public function setDossCpta($dossCpta) {\n $this->dossCpta = $dossCpta;\n return $this;\n }", "public function testSetTpSaisieDos() {\n\n $obj = new Constantes();\n\n $obj->setTpSaisieDos(true);\n $this->assertEquals(true, $obj->getTpSaisieDos());\n }", "public function testCrceDataControlDisable()\n {\n\n }", "public function setNumDossCpta($numDossCpta) {\n $this->numDossCpta = $numDossCpta;\n return $this;\n }", "public function testSetPaiementCpNonPris() {\n\n $obj = new Bulletins();\n\n $obj->setPaiementCpNonPris(true);\n $this->assertEquals(true, $obj->getPaiementCpNonPris());\n }", "public function testSetCreationDossierCpta() {\n\n $obj = new Constantes();\n\n $obj->setCreationDossierCpta(true);\n $this->assertEquals(true, $obj->getCreationDossierCpta());\n }", "public function testSetAccesDossierCpta() {\n\n $obj = new Collaborateurs();\n\n $obj->setAccesDossierCpta(\"accesDossierCpta\");\n $this->assertEquals(\"accesDossierCpta\", $obj->getAccesDossierCpta());\n }", "public function testSetTvaCptDom() {\n\n $obj = new Dossier4();\n\n $obj->setTvaCptDom(\"tvaCptDom\");\n $this->assertEquals(\"tvaCptDom\", $obj->getTvaCptDom());\n }", "public function getNumDossCpta() {\n return $this->numDossCpta;\n }", "public function testSetNoLotEcritures() {\n\n $obj = new DecTva();\n\n $obj->setNoLotEcritures(10);\n $this->assertEquals(10, $obj->getNoLotEcritures());\n }", "public function testSetNoChronoPreparation() {\n\n $obj = new CompteurEcritures();\n\n $obj->setNoChronoPreparation(10);\n $this->assertEquals(10, $obj->getNoChronoPreparation());\n }", "public function testSetNumDoss() {\n\n $obj = new PointageReglementsTetes();\n\n $obj->setNumDoss(\"numDoss\");\n $this->assertEquals(\"numDoss\", $obj->getNumDoss());\n }", "public function testSetSkipDiscounts()\n {\n $oBasketItem = new modFortestSetAsDiscountArticle();\n $oBasketItem->setSkipDiscounts( true );\n $this->assertTrue( $oBasketItem->blSkipDiscounts );\n }", "public function testSetCreationDossierCpta() {\n\n $obj = new Collaborateurs();\n\n $obj->setCreationDossierCpta(true);\n $this->assertEquals(true, $obj->getCreationDossierCpta());\n }", "public function setDossCpta(?string $dossCpta): AccesWeb {\n $this->dossCpta = $dossCpta;\n return $this;\n }", "public function testSetMotifPreavisNonPaye() {\n\n $obj = new AttestationCacm();\n\n $obj->setMotifPreavisNonPaye(\"motifPreavisNonPaye\");\n $this->assertEquals(\"motifPreavisNonPaye\", $obj->getMotifPreavisNonPaye());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation createCouponsAsynchronouslyWithHttpInfo Create coupons asynchronously
public function createCouponsAsynchronouslyWithHttpInfo($applicationId, $campaignId, $body) { $request = $this->createCouponsAsynchronouslyRequest($applicationId, $campaignId, $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() ? (string) $e->getResponse()->getBody() : 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(); switch($statusCode) { case 200: if ('\TalonOne\Client\Model\AsyncCouponCreationResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ ObjectSerializer::deserialize($content, '\TalonOne\Client\Model\AsyncCouponCreationResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\TalonOne\Client\Model\AsyncCouponCreationResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\TalonOne\Client\Model\AsyncCouponCreationResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
[ "public function createCouponsAsynchronously($applicationId, $campaignId, $body)\n {\n list($response) = $this->createCouponsAsynchronouslyWithHttpInfo($applicationId, $campaignId, $body);\n return $response;\n }", "public function createCouponsAsync($createCoupons)\n {\n return $this->createCouponsAsyncWithHttpInfo($createCoupons)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createCouponAsyncWithHttpInfo($coupon_input, string $contentType = self::contentTypes['createCoupon'][0])\n {\n $returnType = '\\LagoClient\\Model\\Coupon';\n $request = $this->createCouponRequest($coupon_input, $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 createCouponWithHttpInfo($coupon_input, string $contentType = self::contentTypes['createCoupon'][0])\n {\n $request = $this->createCouponRequest($coupon_input, $contentType);\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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n 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 (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\LagoClient\\Model\\Coupon' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\LagoClient\\Model\\Coupon' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\LagoClient\\Model\\Coupon', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\LagoClient\\Model\\Coupon';\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 } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\LagoClient\\Model\\Coupon',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function createCouponAsync($coupon_input, string $contentType = self::contentTypes['createCoupon'][0])\n {\n return $this->createCouponAsyncWithHttpInfo($coupon_input, $contentType)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function findAllCouponsWithHttpInfo(string $contentType = self::contentTypes['findAllCoupons'][0])\n {\n $request = $this->findAllCouponsRequest($contentType);\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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n 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 (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\LagoClient\\Model\\CouponsPaginated' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\LagoClient\\Model\\CouponsPaginated' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\LagoClient\\Model\\CouponsPaginated', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\LagoClient\\Model\\CouponsPaginated';\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 } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\LagoClient\\Model\\CouponsPaginated',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function deleteCouponsAsyncWithHttpInfo($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false)\n {\n $returnType = '';\n $request = $this->deleteCouponsRequest($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\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 quotesV2PostAsyncWithHttpInfo($id, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology)\n {\n $returnType = '\\Swagger\\Client\\Model\\QuoteApi';\n $request = $this->quotesV2PostRequest($id, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public static function add_coupon() {\n $response = array(\n 'error' => false,\n 'message' => 'Successfully added Coupon'\n );\n\n if(isset($_REQUEST['fuse-ajax']) && isset($_REQUEST['data'])) {\n\n $data = $_REQUEST['data']['newcoupon'];\n \n if ( !wp_verify_nonce( $data['nonce'], \"fuse_submitting_form\")) {\n $response['error'] = true;\n $response['message'] = 'Could not add Coupon';\n } else {\n\n $data = Stripe::prepare_request($data);\n $response['data'] = $data;\n\n $coupon = Stripe::create_coupon($data);\n if($coupon) {\n if(isset($coupon['error'])) {\n $response['error'] = true;\n $response['message'] = $coupon['error'];\n }\n }\n \n $response['stripe_response'] = $coupon;\n }\n\n echo json_encode($response);\n }\n\n wp_die();\n }", "protected static function listAllFreeItemCouponsAsyncWithHttpInfo(array $parameters = []) \n {\n $returnType = '\\Tradenity\\SDK\\Resources\\FreeItemCoupon[page]'; \n $request = self::listAllFreeItemCouponsRequest($parameters); \n\n return self::getHttpClient()\n ->sendAsync($request, self::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 actionCreate()\n {\n $model = new Coupon();\n\n $model->loadDefaultValues();\n\n $model->start_date = date('d-m-Y');\n $model->end_date = date('d-m-Y');\n\n if ($model->load(Yii::$app->request->post())) {\n\n $data = $this->saveInfo($model);\n\n \\Yii::$app->getSession()->setFlash('message', $data['message']);\n if($data['status']==1){\n return $this->redirect(['index']);\n\n }else{\n return $this->render('create', [\n 'model' => $model,\n 'coupongoods'=>[],\n 'goods' => $this->findGoods(),\n ]);\n }\n\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'coupongoods'=>[],\n 'goods' => $this->findGoods(),\n ]);\n }\n }", "public function checkoutsCouponsByCheckoutIdPostAsyncWithHttpInfo($checkout_id, $accept, $content_type, $body)\n {\n $returnType = '\\BigCommerce\\Api\\V3\\Model\\Checkout\\Checkout1';\n $request = $this->checkoutsCouponsByCheckoutIdPostRequest($checkout_id, $accept, $content_type, $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 candidateCreateAsync($body)\n {\n return $this->candidateCreateAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function customerInvoicesV2PostAsyncWithHttpInfo($id, $eu_third_party, $is_credit_invoice, $currency_code, $currency_rate, $created_by_user_id, $total_amount, $total_vat_amount, $total_roundings, $total_amount_invoice_currency, $total_vat_amount_invoice_currency, $set_off_amount_invoice_currency, $customer_id, $rows, $vat_specification, $invoice_date, $due_date, $delivery_date, $rot_reduced_invoicing_type, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_percent, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $persons, $rot_reduced_invoicing_automatic_distribution, $electronic_reference, $electronic_address, $edi_service_deliverer_id, $our_reference, $your_reference, $buyers_order_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_term_name, $delivery_method_code, $delivery_term_code, $customer_is_private_person, $terms_of_payment_id, $customer_email, $invoice_number, $customer_number, $payment_reference_number, $rot_property_type, $sales_document_attachments, $has_auto_invoice_error, $is_not_delivered, $reverse_charge_on_construction_services, $work_house_other_costs, $remaining_amount, $remaining_amount_invoice_currency, $referring_invoice_id, $created_from_order_id, $created_from_draft_id, $voucher_number, $voucher_id, $created_utc, $modified_utc, $reversed_construction_vat_invoicing, $includes_vat, $send_type, $payment_reminder_issued, $uses_green_technology, $rot_reduced_automatic_distribution = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\CustomerInvoiceApi';\n $request = $this->customerInvoicesV2PostRequest($id, $eu_third_party, $is_credit_invoice, $currency_code, $currency_rate, $created_by_user_id, $total_amount, $total_vat_amount, $total_roundings, $total_amount_invoice_currency, $total_vat_amount_invoice_currency, $set_off_amount_invoice_currency, $customer_id, $rows, $vat_specification, $invoice_date, $due_date, $delivery_date, $rot_reduced_invoicing_type, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_percent, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $persons, $rot_reduced_invoicing_automatic_distribution, $electronic_reference, $electronic_address, $edi_service_deliverer_id, $our_reference, $your_reference, $buyers_order_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_term_name, $delivery_method_code, $delivery_term_code, $customer_is_private_person, $terms_of_payment_id, $customer_email, $invoice_number, $customer_number, $payment_reference_number, $rot_property_type, $sales_document_attachments, $has_auto_invoice_error, $is_not_delivered, $reverse_charge_on_construction_services, $work_house_other_costs, $remaining_amount, $remaining_amount_invoice_currency, $referring_invoice_id, $created_from_order_id, $created_from_draft_id, $voucher_number, $voucher_id, $created_utc, $modified_utc, $reversed_construction_vat_invoicing, $includes_vat, $send_type, $payment_reminder_issued, $uses_green_technology, $rot_reduced_automatic_distribution);\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 createTaxCompoentAsyncWithHttpInfo($body)\n {\n $returnType = '\\Frengky\\Fineract\\Model\\PostTaxesComponentsResponse';\n $request = $this->createTaxCompoentRequest($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 createCartAsync()\n {\n return $this->createCartAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createAsyncPayment(CreateAsyncPaymentRequest $request)\n\t{\n\t\t$this->validateRequest($request);\n\t\t$response = $this->curl_request('payments', 'POST', $request);\n\t\treturn $this->response($response);\n\t}", "public function createAsyncWithHttpInfo($create_subscription_request)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->createRequest($create_subscription_request);\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 accountCreateAsyncWithHttpInfo($body)\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse2015';\n $request = $this->accountCreateRequest($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 }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query on the PodtForeignCost column Example usage: $query>filterByPodtforeigncost(1234); // WHERE PodtForeignCost = 1234 $query>filterByPodtforeigncost(array(12, 34)); // WHERE PodtForeignCost IN (12, 34) $query>filterByPodtforeigncost(array('min' => 12)); // WHERE PodtForeignCost > 12
public function filterByPodtforeigncost($podtforeigncost = null, $comparison = null) { if (is_array($podtforeigncost)) { $useMinMax = false; if (isset($podtforeigncost['min'])) { $this->addUsingAlias(PurchaseOrderDetailTableMap::COL_PODTFOREIGNCOST, $podtforeigncost['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($podtforeigncost['max'])) { $this->addUsingAlias(PurchaseOrderDetailTableMap::COL_PODTFOREIGNCOST, $podtforeigncost['max'], Criteria::LESS_EQUAL); $useMinMax = true; } if ($useMinMax) { return $this; } if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(PurchaseOrderDetailTableMap::COL_PODTFOREIGNCOST, $podtforeigncost, $comparison); }
[ "public function filterByCosto($costo = null, $comparison = null)\n {\n if (is_array($costo)) {\n $useMinMax = false;\n if (isset($costo['min'])) {\n $this->addUsingAlias(ProductoPeer::COSTO, $costo['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($costo['max'])) {\n $this->addUsingAlias(ProductoPeer::COSTO, $costo['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::COSTO, $costo, $comparison);\n }", "public function filterByCostDoc($costDoc, $comparison = null)\n {\n if ($costDoc instanceof CostDoc) {\n return $this\n ->addUsingAlias(CostPeer::ID, $costDoc->getCostId(), $comparison);\n } elseif ($costDoc instanceof PropelObjectCollection) {\n return $this\n ->useCostDocQuery()\n ->filterByPrimaryKeys($costDoc->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByCostDoc() only accepts arguments of type CostDoc or PropelCollection');\n }\n }", "public function filterByCost($cost = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($cost)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $cost)) {\n $cost = str_replace('*', '%', $cost);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TourPeer::COST, $cost, $comparison);\n }", "public function filterByCost($cost)\n {\n $this->filter[] = $this->field('cost').' = '.$this->quote($cost);\n return $this;\n }", "public function filterByCostDoc($costDoc, $comparison = null)\n {\n if ($costDoc instanceof CostDoc) {\n return $this\n ->addUsingAlias(DocPeer::ID, $costDoc->getDocId(), $comparison);\n } elseif ($costDoc instanceof PropelObjectCollection) {\n return $this\n ->useCostDocQuery()\n ->filterByPrimaryKeys($costDoc->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByCostDoc() only accepts arguments of type CostDoc or PropelCollection');\n }\n }", "public function getMaxCostFilter()\n {\n return $this->getFilter(Product::PRODUCT_DB_FIELDS['COST'], new CustomAssert\\LessThan(ProductValidator::MAX_COST));\n }", "public function filterByPrecio($precio = null, $comparison = null)\n\t{\n\t\tif (is_array($precio)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($precio['min'])) {\n\t\t\t\t$this->addUsingAlias(ProductoPeer::PRECIO, $precio['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($precio['max'])) {\n\t\t\t\t$this->addUsingAlias(ProductoPeer::PRECIO, $precio['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(ProductoPeer::PRECIO, $precio, $comparison);\n\t}", "function where14(){\n dd(DB::table('products')->showDeleted()\n ->select(['name', 'cost', 'id'])\n ->where(['belongs_to', 90])\n ->where([ \n ['cost', 100, '>='],\n ['cost', 500, '<']\n ])\n ->whereNotNull('description')\n ->get());\n }", "public function filterByPrecio($precio = null, $comparison = null)\n\t{\n\t\tif (is_array($precio)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($precio['min'])) {\n\t\t\t\t$this->addUsingAlias(DetalleFacturaPeer::PRECIO, $precio['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($precio['max'])) {\n\t\t\t\t$this->addUsingAlias(DetalleFacturaPeer::PRECIO, $precio['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(DetalleFacturaPeer::PRECIO, $precio, $comparison);\n\t}", "public function filterByPrecio($precio = null, $comparison = null)\n {\n if (is_array($precio)) {\n $useMinMax = false;\n if (isset($precio['min'])) {\n $this->addUsingAlias(ProductoPeer::PRECIO, $precio['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($precio['max'])) {\n $this->addUsingAlias(ProductoPeer::PRECIO, $precio['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::PRECIO, $precio, $comparison);\n }", "public function filterByFileId($fileId = null, $comparison = null)\n {\n if (is_array($fileId)) {\n $useMinMax = false;\n if (isset($fileId['min'])) {\n $this->addUsingAlias(CostPeer::FILE_ID, $fileId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($fileId['max'])) {\n $this->addUsingAlias(CostPeer::FILE_ID, $fileId['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(CostPeer::FILE_ID, $fileId, $comparison);\n }", "function getItemsFiltered($alldata, $cdad, $tipo, $preciobj, $precioat) {\n $priceFilter = array_filter($alldata, function($val, $key) use ($preciobj, $precioat) {\n $priceNum = intval(str_replace(',','',substr($val['Precio'],1)));\n if($priceNum >= $preciobj and $priceNum <= $precioat) {\n return $priceNum;\n }\n }, ARRAY_FILTER_USE_BOTH);\n $cityFilter = $cdad != '' ? array_filter($priceFilter, function($val, $key) use ($cdad) {\n return $val['Ciudad'] == $cdad;\n }, ARRAY_FILTER_USE_BOTH) : $priceFilter;\n $typeFilter = $tipo != '' ? array_filter($cityFilter, function($val, $key) use ($tipo) {\n return $val['Tipo'] == $tipo;\n }, ARRAY_FILTER_USE_BOTH) : $cityFilter;\n return $typeFilter;\n}", "private function filterbyfuel ($query,Request $request){\n\n if (isset($request->search)) {\n $query->where('vehicle.vehicle_name', 'LIKE', \"%{$request->search}%\");\n \n }\n if (isset($request->type)) {\n $query->where(DB::raw(\"'fuel'\"), '=', $request->type);\n }\n\n if (isset($request->mincost)) {\n \n $query->where('fuel_entries.cost', '>' , $request->mincost);\n }\n if (isset($request->maxcost)) {\n $query->where('fuel_entries.cost', '<' , $request->maxcost);\n \n }\n if (isset($request->mindate)) {\n $query->whereDate('fuel_entries.entry_date', '>' , $request->mindate);\n \n }\n if (isset($request->maxdate)) {\n $query->whereDate('fuel_entries.entry_date', '<' , $request->maxdate);\n \n }\n\n }", "public function filterByCepTrabalho($cepTrabalho = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($cepTrabalho)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $cepTrabalho)) {\n $cepTrabalho = str_replace('*', '%', $cepTrabalho);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TbalunoAtualPeer::CEP_TRABALHO, $cepTrabalho, $comparison);\n }", "function returnCostOfWine($minCost,$maxCost,&$queryString,&$valueArray){\n \n if($minCost == '' && $maxCost == ''){\n return;\n }elseif($minCost == '' && $maxCost != ''){\n $queryString .= ' AND (inventory.cost <= :maxCost)'; \n $valueArray[':maxCost'] = $maxCost;\n }elseif($minCost != '' && $maxCost == ''){\n $queryString .= ' AND (inventory.cost >= :minCost)'; \n $valueArray[':minCost'] = $minCost;\n }else{\n $queryString .= ' AND (inventory.cost BETWEEN :minCost AND :maxCost)'; \n $valueArray[':minCost'] = $minCost;\n $valueArray[':maxCost'] = $maxCost; \n }\n}", "public function filterByCpf($cpf = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($cpf)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $cpf)) {\n $cpf = str_replace('*', '%', $cpf);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(TbalunoPeer::CPF, $cpf, $comparison);\n }", "function setRevenueFilter($min) {\n $this->WHERE['rev_avg >= '] = $min;\n }", "private function filterbyservices ($query,Request $request){\n if (isset($request->search)) {\n $query->where('vehicle.vehicle_name', 'LIKE', \"%{$request->search}%\");\n }\n if (isset($request->type)) {\n $query->where(DB::raw(\"'service'\"), '=', $request->type);\n }\n if (isset($request->mincost)) {\n \n $query->where('services_entries.total', '>' , $request->mincost);\n }\n if (isset($request->maxcost)) {\n $query->where('services_entries.total', '<' , $request->maxcost);\n \n }\n if (isset($request->mindate)) {\n $query->whereDate('services_entries.created_at', '>' , $request->mindate);\n \n }\n if (isset($request->maxdate)) {\n $query->whereDate('services_entries.created_at', '<' , $request->maxdate);\n \n }\n \n }", "public function filterByTo($to = null, $comparison = null)\n\t{\n\t\tif (is_array($to)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($to['min'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_SpecificPricePeer::TO, $to['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($to['max'])) {\n\t\t\t\t$this->addUsingAlias(Oops_Db_SpecificPricePeer::TO, $to['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(Oops_Db_SpecificPricePeer::TO, $to, $comparison);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds and returns the name of the script running Terminus functions
private function getTerminusScript() { if (isset($this->config['script'])) { return $this->config['script']; } if (defined('TERMINUS_SCRIPT')) { return TERMINUS_SCRIPT; } $debug = debug_backtrace(); $script_location = array_pop($debug); $script_name = str_replace( $this->config['root'] . '/', '', $script_location['file'] ); return $script_name; }
[ "public static function getScriptName() {\n \n }", "public static function getScriptName(){}", "public function getScriptName();", "public function getScriptGetFileName() {\n\t\t\treturn SCRIPT_HOME_DIR . \"/\". $this->db_user . \"_\" . $this->name . \"_get.sh\";\n\t\t}", "private function _getScriptName() {\n $script_name = $_SERVER['SCRIPT_NAME'];\n\n return substr($script_name, strripos($script_name, '/') + 1);\n }", "public function getScriptName()\n\t{\n\t\treturn craft()->request->getScriptName();\n\t}", "public function getExecutableName()\n {\n return $this->executableName ?: strtolower($this->getName());\n }", "function getRunningJobName() {\n\t$tmp = pathinfo(realpath($_SERVER['argv'][0]));\n\treturn $tmp['filename'];\n}", "private function getScriptBaseName()\n {\n $this->file_name = $_SERVER[\"SCRIPT_NAME\"];\n $this->file_parts = explode('/', $this->file_name);\n $this->script_name = $this->file_parts[count($this->file_parts) - 1];\n $this->script_parts = explode('.', $this->script_name);\n\n // If file doesn't exists don't add line break\n if (!file_exists($this->script_parts[0] . \".log\")) {\n $this->first_run = false;\n }\n return $this->script_parts[0];\n }", "public function restartScript(): string;", "function smrScriptname( $url ) {\n\t$posBarra=strrpos( $url, \"/\" );\n\t$scriptname=substr( $url, $posBarra+1 );\n\t$posPunto=strrpos( $scriptname, \".\" );\n\t$scriptname=substr( $scriptname, 0, $posPunto +4 );\n\treturn ( $scriptname ) ;\n}", "public function scriptFileName() {\n\t return $this->script_file_name;\n\t}", "function application_name()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t//////////////////////////\n\t\t\t\t// Check argument count //\n\t\t\t\t//////////////////////////\n\t\t\t\t//\n\t\t\t\t$arg_count=func_num_args();\n\t\t\t\tif ($arg_count!==0)\n\t\t\t\t{\n\t\t\t\t\tthrow new phocus_fault(\"Invalid args [$arg_count]\", origin());\n\t\t\t\t} // if ($arg_count!==0)\n\t\t\t\t//\n\t\t\t\t//\n\t\t\t\t$pieces=explode('/', __FILE__);\n\t\t\t\t//\n\t\t\t\t$last=end($pieces);\n\t\t\t\t//\n\t\t\t\t$parts=explode('.', $last);\n\t\t\t\t//\n\t\t\t\t$name=array_shift($parts);\n\t\t\t\t//\n\t\t\t\treturn $name;\n\t\t\t}\n\t\t\tcatch (Throwable $e)\n\t\t\t{\n\t\t\t\tthrow new phocus_fault('Could not get application name', origin(), $e);\n\t\t\t} // try\n\t\t}", "public function getScriptFileName(): string;", "private function _getCallingCronName()\r\n\t{\r\n\t\t$callers = debug_backtrace();\r\n\t\t$filePath = $callers[1]['file'];\r\n\t\t$filename = basename($filePath);\r\n\t\tif(strlen($filename))\r\n\t\t{\r\n\t\t\treturn $filename;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function getScriptName() \n { \n $pathParts = pathinfo( PerlFileUpload::DEF_LOCATION_JAVASCRIPT ); \n return $pathParts['basename'];\n \n }", "protected function initScriptName () {\n\t\t$this->indexScriptName = str_replace('\\\\', '/', $this->serverGlobals['SCRIPT_NAME']);\n\t\tif (!$this->Console)\n\t\t\t$this->ScriptName = '/' . substr($this->indexScriptName, strrpos($this->indexScriptName, '/') + 1);\n\t}", "public function getName(): string {\n if($this->name !== \"\") {\n return $this->name;\n }\n $className = join('', array_slice(explode('\\\\', static::class), -1));\n return strtolower(str_replace(\"Command\", \"\", $className));\n }", "public abstract function getConsoleName(): string;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a Flysystem instance with the given adapter.
protected function createFlysystem(AdapterInterface $adapter, array $config) { $cache = Arr::pull($config, 'cache'); if ($cache) { $adapter = new CachedAdapter($adapter, $this->createCacheStore($cache)); } return new FilesystemWrapper($adapter, count($config) > 0 ? $config : null); }
[ "protected function createFlysystem( AdapterInterface $adapter, array $config )\n\t{\n\t\t$config = Arr::only( $config, ['visibility'] );\n\n\t\treturn new Flysystem( $adapter, count( $config ) > 0 ? $config : null );\n\t}", "protected function createFlysystem(FlysystemAdapter $adapter, array $config)\n {\n if ($config['read-only'] ?? false === true) {\n $adapter = new ReadOnlyFilesystemAdapter($adapter);\n }\n\n if (! empty($config['prefix'])) {\n $adapter = new PathPrefixedAdapter($adapter, $config['prefix']);\n }\n\n return new Flysystem($adapter, Arr::only($config, [\n 'directory_visibility',\n 'disable_asserts',\n 'temporary_url',\n 'url',\n 'visibility',\n ]));\n }", "protected function createFlysystem(AdapterInterface $adapter, array $config, array $driverConfig = null)\n {\n if (class_exists('League\\Flysystem\\EventableFilesystem\\EventableFilesystem')) {\n $fsClass = \\League\\Flysystem\\EventableFilesystem\\EventableFilesystem::class;\n } else {\n $fsClass = \\League\\Flysystem\\Filesystem::class;\n }\n\n if (class_exists('League\\Flysystem\\Cached\\CachedAdapter')) {\n $adapter = $this->decorateWithCachedAdapter($adapter, Arr::get($config, 'cache', []));\n }\n\n $config = Arr::only($config, ['visibility']);\n $config = array_merge($config, (array) $driverConfig);\n\n return new $fsClass($adapter, count($config) > 0 ? $config : null);\n }", "public function createAdapter() : AdapterInterface;", "function flysystem_manager($path = null)\n {\n # here, if there is assigned path\n # we should directly create an instance\n # based on the $path provided\n # whilist the adapter is 'local'\n if ($path !== null) {\n return new League\\Flysystem\\Filesystem(\n new League\\Flysystem\\Adapter\\Local($path, 0)\n );\n }\n\n return di()->get('flysystem_manager');\n }", "private function getAdapter(string $path): FilesystemAdapter\n {\n $parsedPath = parse_url($path);\n\n if (!is_array($parsedPath) || !isset($parsedPath['host'], $parsedPath['scheme']) || !in_array($parsedPath['scheme'], ['ftp', 'sftp'])) {\n return new LocalFilesystemAdapter($path);\n } elseif ('ftp' === $parsedPath['scheme']) {\n return new FtpAdapter(\n FtpConnectionOptions::fromArray([\n 'host' => $parsedPath['host'],\n 'root' => $parsedPath['path'] ?? '/',\n 'username' => $parsedPath['user'] ?? get_current_user(),\n $parsedPath['pass'] ?? null,\n 'port' => $parsedPath['port'] ?? 21,\n ])\n );\n } elseif ('sftp' === $parsedPath['scheme']) {\n return new SftpAdapter(\n new SftpConnectionProvider($parsedPath['host'], $parsedPath['user'] ?? get_current_user(), $parsedPath['pass'] ?? null, null, null, $parsedPath['port'] ?? 22, $parsedPath['pass'] ? false : true),\n $parsedPath['path'] ?? '/'\n );\n }\n\n throw new RuntimeException('Unable to create a filesystem adapter');\n }", "public function getFilesystemAdapter() : FilesystemAdapterInterface;", "private function createFilesystem(): void\n {\n $this->createAwsAdapter();\n $this->createAzureAdapter();\n $this->createDropboxAdapter();\n $this->createGoogleAdapter();\n\n $this->filesystem = new Filesystem($this->adapter);\n }", "private function get_filesystem_adapter()\n {\n return new Filesystem(new Adapter(__DIR__.'/cache'));\n }", "public static function adapter()\n {\n $instance = self::spawn(func_get_args(), 'Desarrolla2\\\\Cache\\\\Adapter');\n\n self::app()->instance('Desarrolla2\\\\Cache\\\\Adapter\\\\AbstractAdapter', $instance);\n\n return $instance;\n }", "protected function filesystem(array $config = []): FlysystemFilesystem\n {\n // Constructing a Filesystem is super cheap and we always get the config we want, so no caching.\n return new FlysystemFilesystem($this->adapter(), $config);\n }", "public function __construct(AdapterInterface $adapter)\n {\n $this->adapter = $adapter;\n\n $this->filesystem = new Filesystem($this->adapter);\n\n $this->filesystem->addPlugin(new ListPaths());\n $this->filesystem->addPlugin(new GetDirectoryProperties());\n }", "protected function registerFlysystem()\n {\n $this->registerManager();\n\n $this->app->singleton('filesystem.disk', function () {\n return $this->app['filesystem']->disk($this->getDefaultDriver());\n });\n\n $this->app->alias('filesystem.disk', \\Illuminate\\Contracts\\Filesystem\\Filesystem::class);\n\n $this->app->singleton('filesystem.cloud', function () {\n return $this->app['filesystem']->disk($this->getCloudDriver());\n });\n\n $this->app->alias('filesystem.cloud', Cloud::class);\n }", "public function getFileSystemObject()\n {\n $adapter = $this->getConfigurationObject()->getAdapter();\n $filesystem = new \\League\\Flysystem\\Filesystem($adapter);\n\n return $filesystem;\n }", "protected function createFilesystem(AdapterInterface $adapter, array $config)\n {\n $config = Arr::only($config, ['visibility', 'disable_asserts', 'url']);\n\n return new Filesystem($adapter, count($config) > 0 ? $config : null);\n }", "protected function createAdapter($adapterClassName)\n {\n return $this->app->make($adapterClassName);\n }", "public function adapter()\n\t{\n\t\tif (!$this->get('scope'))\n\t\t{\n\t\t\t$this->set('scope', 'site');\n\t\t}\n\n\t\t$scope = strtolower($this->get('scope'));\n\t\t$cls = __NAMESPACE__ . '\\\\Adapters\\\\' . ucfirst($scope);\n\n\t\tif (!class_exists($cls))\n\t\t{\n\t\t\t$path = __DIR__ . DS . 'adapters' . DS . $scope . '.php';\n\t\t\tif (!is_file($path))\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException(Lang::txt('Invalid scope of \"%s\"', $scope));\n\t\t\t}\n\t\t\tinclude_once $path;\n\t\t}\n\n\t\treturn new $cls($this->get('scope_id'));\n\t}", "protected function getOneupFlysystem_CacheFactory_AdapterService()\n {\n return $this->services['oneup_flysystem.cache_factory.adapter'] = new \\Oneup\\FlysystemBundle\\DependencyInjection\\Factory\\Cache\\AdapterFactory();\n }", "public function testMakeFilesystemDriver()\n {\n $factory = new Factory($this->config());\n $this->assertInstanceOf(FilesystemAdapter::class, $factory->make('file'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Show archive threads action
public function archiveAction() { if ($this->getRequest()->getParam('param')) { $this->showThreadAction($this->getRequest()->getParam('param')); return; } $this->_topMenu->selectItem('archive'); $mail = $this->_user->getMail(); $this->view->threads = $mail->getThreadsList(App_Mail_Thread::STATE_ARCHIVE); }
[ "public function testThreadActionArchiveThreadWhenThreadsFound()\n {\n $postArray = ['thread_action' => 'archive_thread', 'selected_threads' => ['1'], 'folder' => 'outbox'];\n $this->request = new Request([], $postArray);\n\n $this->expectsLoggedInUser();\n\n $thread = $this->getMock('Miliooo\\Messaging\\Model\\ThreadInterface');\n $this->threadProvider->expects($this->once())\n ->method('findThreadForParticipant')\n ->with($this->loggedInUser, 1)\n ->will($this->returnValue($thread));\n\n $threadStatusObject = new ThreadStatus(ThreadMetaInterface::STATUS_ARCHIVED);\n $this->threadStatusManager->expects($this->once())->method('updateThreadStatusForParticipant')\n ->with($threadStatusObject, $thread, $this->loggedInUser);\n\n $this->flashProvider->expects($this->once())->method('addFlash')\n ->with(FlashMessageProviderInterface::TYPE_SUCCESS, 'flash.thread_updates.archived_success');\n\n $this->expectsRouterCallWith('miliooo_message_outbox');\n\n $this->controller->threadAction($this->request);\n }", "static public function archiveThread($thread_id) {\n global $config, $board;\n\n // If archiving is turned off return\n if(!$config['archive']['threads'])\n return;\n\n // Check if it is a thread\n $thread_query = prepare(sprintf(\"SELECT `thread`, `subject`, `body_nomarkup`, `trip` FROM ``posts_%s`` WHERE `id` = :id\", $board['uri']));\n $thread_query->bindValue(':id', $thread_id, PDO::PARAM_INT);\n $thread_query->execute() or error(db_error($thread_query));\n $thread_data = $thread_query->fetch(PDO::FETCH_ASSOC);\n\n if($thread_data['thread'] !== NULL)\n error($config['error']['invalidpost']);\n\n // Create Snippet of thread text\n $thread_data['snippet_body'] = strtok($thread_data['body_nomarkup'], \"\\r\\n\");\n $thread_data['snippet_body'] = substr($thread_data['snippet_body'], 0, $config['archive']['snippet_len'] - strlen($thread_data['subject']));\n archive_list_markup($thread_data['snippet_body']);\n $thread_data['snippet'] = '<b>' . $thread_data['subject'] . '</b> ';\n $thread_data['snippet'] .= $thread_data['snippet_body'];\n \n // Select thread and replies in one query\n $query = prepare(sprintf(\"SELECT `id`,`thread`,`files`,`slug` FROM ``posts_%s`` WHERE `id` = :id OR `thread` = :id\", $board['uri']));\n $query->bindValue(':id', $thread_id, PDO::PARAM_INT);\n $query->execute() or error(db_error($query));\n\n // List of files associated with thread\n $file_list = array();\n\n while ($post = $query->fetch(PDO::FETCH_ASSOC)) {\n // Copy Static HTML page for Thread\n if (!$post['thread']) {\n // Read Content of HTML\n $thread_file_content = @file_get_contents($board['dir'] . $config['dir']['res'] . link_for($post));\n \n // Replace links and posting mode to Archived\n $thread_file_content = str_replace(sprintf('src=\"/' . $config['board_path'], $board['uri']), sprintf('src=\"/' . $config['board_path'] . $config['dir']['archive'], $board['uri']), $thread_file_content);\n $thread_file_content = str_replace(sprintf('href=\"/' . $config['board_path'], $board['uri']), sprintf('href=\"/' . $config['board_path'] . $config['dir']['archive'], $board['uri']), $thread_file_content);\n $thread_file_content = str_replace('Posting mode: Reply', 'Archived thread', $thread_file_content);\n // Remove Post Form from HTML (First Form)\n $thread_file_content = preg_replace(\"/<form name=\\\"post\\\"(.*?)<\\/form>/i\", \"\", $thread_file_content);\n\n // Refix archive link that will be wrong\n $thread_file_content = str_replace(sprintf('href=\"/' . $config['board_path'] . $config['dir']['archive'] . $config['dir']['archive'], $board['uri']), sprintf('href=\"/' . $config['board_path'] . $config['dir']['archive'], $board['uri']), $thread_file_content);\n\n // Remove Form from HTML\n $thread_file_content = preg_replace(\"/<form(.*?)>/i\", \"\", $thread_file_content);\n $thread_file_content = preg_replace(\"/<\\/form>/i\", \"\", $thread_file_content);\n $thread_file_content = preg_replace(\"/<input (.*?)>/i\", \"\", $thread_file_content);\n\n // Remove Redundant code from HTML\n $thread_file_content = preg_replace(\"/<div id=\\\"report\\-fields\\\"(.*?)<\\/div>/i\", \"\", $thread_file_content);\n $thread_file_content = preg_replace(\"/<div id=\\\"thread\\-interactions\\\"(.*?)<\\/div>/i\", \"\", $thread_file_content);\n\n // Write altered thread HTML to archive location\n @file_put_contents($board['dir'] . $config['dir']['archive'] . $config['dir']['res'] . sprintf($config['file_page'], $thread_id), $thread_file_content, LOCK_EX);\n }\n\n\n // Copy json file to Archive\n // Read Content of Json file\n $json_file_content = @file_get_contents($board['dir'] . $config['dir']['res'] . json_scrambler($thread_id, true));\n // Replace links and posting mode to Archived\n $json_file_content = str_replace(substr($board['dir'], 0, -1) . '\\/' . substr($config['dir']['res'], 0, -1), substr($board['dir'], 0, -1) . '\\/' . substr($config['dir']['archive'], 0, -1) . '\\/' . substr($config['dir']['res'], 0, -1), $json_file_content);\n // Write altered thread json to archive location\n @file_put_contents($board['dir'] . $config['dir']['archive'] . $config['dir']['res'] . json_scrambler($thread_id, true), $json_file_content, LOCK_EX);\n \n\n // Copy Images and Files Associated with Thread\n if ($post['files']) {\n foreach (json_decode($post['files']) as $i => $f) {\n if ($f->file !== 'deleted') {\n @copy($board['dir'] . $config['dir']['img'] . $f->file, $board['dir'] . $config['dir']['archive'] . $config['dir']['img'] . $f->file);\n @copy($board['dir'] . $config['dir']['thumb'] . $f->thumb, $board['dir'] . $config['dir']['archive'] . $config['dir']['thumb'] . $f->thumb);\n\n $file_list[] = $f;\n\n // $file_list[$i]['file'] = $f->file;\n // $file_list[$i]['thumb'] = $f->thumb;\n }\n }\n }\n }\n\n // Insert Archive Data in Database\n $query = prepare(sprintf(\"INSERT INTO ``archive_%s`` VALUES (:thread_id, :snippet, :lifetime, :files, 0, 0, 0)\", $board['uri']));\n $query->bindValue(':thread_id', $thread_id, PDO::PARAM_INT);\n $query->bindValue(':snippet', $thread_data['snippet'], PDO::PARAM_STR);\n $query->bindValue(':lifetime', \ttime(), PDO::PARAM_INT);\n $query->bindValue(':files', json_encode($file_list));\n $query->execute() or error(db_error($query));\n\n\n // Check if Thread should be Auto Featured based on OP Trip\n if(in_array($thread_data['trip'], $config['archive']['auto_feature_trips']))\n self::featureThread($thread_id);\n \n\n // Purge Threads that have timed out\n if(!$config['archive']['cron_job']['purge'])\n self::purgeArchive();\n\n // Rebuild Archive Index\n self::buildArchiveIndex();\n\n return true;\n }", "protected function show_archive($p){}", "public function displayArchivedTiles() {\n }", "static public function archiveThread($thread_id) {\n global $config, $board;\n\n // If archiving is turned off return\n if(!$config['archive']['threads']){\n return;\n }\n\n Hazuki::insertIntoArchive($thread_id, $board['uri']);\n // the thread that's being sent will be deleted after this\n // will have to be inserted now\n Hazuki::send();\n // Purge Threads that have timed out\n self::purgeArchive();\n\n // Rebuild Archive Index\n self::buildArchiveIndex();\n return true;\n }", "public function archive()\n {\n $this->cache()->deactivate();\n $this->view = $this->makeView(sprintf('newsletter/templates/%s/archive', $this->router()->language()));\n $this->view->records = R::dispense('newsletter')->getArchived();\n echo $this->view->render();\n }", "function performThreadsActionObject()\n\t{\n\t\tglobal $lng, $ilUser, $ilAccess;\n\n\t\tunset($_SESSION['threads2move']);\n\t\tunset($_SESSION['forums_search_submitted']);\n\t\tunset($_SESSION['frm_topic_paste_expand']);\t\n\n\t\tif (is_array($_POST['thread_ids']))\n\t\t{\n\t\t\tif ($_POST['selected_cmd'] == 'move')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['threads2move'] = $_POST['thread_ids'];\n\t\t\t\t\t$this->moveThreadsObject();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($_POST['selected_cmd'] == 'enable_notifications' && $this->ilias->getSetting('forum_notification') != 0)\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t{\n\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t$tmp_obj->enableNotification($ilUser->getId());\n\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'disable_notifications' && $this->ilias->getSetting('forum_notification') != 0)\n\t\t\t{\n\n\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t{\n\n\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t$tmp_obj->disableNotification($ilUser->getId());\n\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'close')\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->close();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'reopen')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->reopen();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'makesticky')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->makeSticky();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'unmakesticky')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->unmakeSticky();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if($_POST['selected_cmd'] == 'editThread')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\t\t\t\t\t$count = count($_POST['thread_ids']);\n\t\t\t\t\tif($count != 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);\n\t\t\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\tforeach($_POST['thread_ids'] as $thread_id);\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->editThreadObject($thread_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\t\t\telse if ($_POST['selected_cmd'] == 'html')\n\t\t\t{\n\t\t\t\t$this->ctrl->setCmd('exportHTML');\n\t\t\t\t$this->ctrl->setCmdClass('ilForumExportGUI');\n\t\t\t\t$this->executeCommand();\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'confirmDeleteThreads')\n\t\t\t{\n\t\t\t\treturn $this->confirmDeleteThreads();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tilUtil::sendInfo($this->lng->txt('topics_please_select_one_action'), true);\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);\n\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t}\n\t}", "public function showThread()\n\t{\n\t}", "public function actionIndex()\n {\n $searchModel = new ThreadSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionArchiveList()\n {\n }", "function show_thread_row() {\n\t\t\n\t\t# Indent to current depth\n\t\tfor ( $i = 0; $i < $this->$depth; $i++ ) {\n\t\t\techo \"&nbsp;&nbsp;\";\n\t\t}\n\t\t\n\t\tif ( $this->$has_children ) {\n\t\t\techo \"<a href=\\\"#\\\" id=\\\"collapse\\\">-</a>\\n\";\n\t\t}\n\t\t\n\t\techo \"<strong>$this->$subject</strong> | Author: <strong>$this->$user</strong> | Posted: <strong>$this->$created_on</strong><br />\\n\";\n\t\techo \"$this->$content\\n\";\n\t\t\n\t}", "public function activeAction()\n {\n if ($this->getRequest()->getParam('param')) {\n $this->showThreadAction($this->getRequest()->getParam('param'));\n return;\n }\n $this->_topMenu->selectItem('active');\n\n $mail = $this->_user->getMail();\n $this->view->threads = $mail->getThreadsList(App_Mail_Thread::STATE_ACTIVE);\n }", "function unarchiveList( $task='unarchive', $alt='Unarchive' ) {\n\t\t$alt= JText::_( $alt );\n\n\t\tmosToolBar::custom( $task, 'unarchive_f2.png', '', $alt, true );\n\t}", "function quick_merge_showthread_start()\n{\n\tglobal $mybb, $thread, $qm_cache;\n\n\tif($thread['replies'] >= $mybb->settings['quick_merge_max_replies'] || !quick_merge_check_user_permissions($mybb->settings['quick_merge_groups']))\n\t{\n\t\treturn;\n\t}\n\n\tQuickMergeCache::load_cache();\n\t$threads = $qm_cache->read('threads');\n\tif(empty($threads))\n\t{\n\t\treturn;\n\t}\n\n\t$tid_list = array_keys($threads);\n\tif(in_array($thread['tid'], $tid_list))\n\t{\n\t\treturn;\n\t}\n\n\tglobal $lang, $quick_merge, $templates;\n\tif(!$lang->quick_merge)\n\t{\n\t\t$lang->load('quick_merge');\n\t}\n\n\t$thread_count = 0;\n\t$options = '';\n\tforeach($threads as $tid => $title)\n\t{\n\t\tif($tid == $thread['tid'])\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\tif(strlen($title) > ($mybb->settings['quick_merge_title_length'] - 3))\n\t\t{\n\t\t\t$title = substr($title, 0, $mybb->settings['quick_merge_title_length']) . '...';\n\t\t}\n\t\t++$thread_count;\n\t\teval(\"\\$options .= \\\"\" . $templates->get('qm_thread_row') . \"\\\";\");\n\t}\n\n\t// only show the Quick Merge selector if there is at least one thread to choose from\n\tif($thread_count)\n\t{\n\t\t// build the quick merge select box\n\t\teval(\"\\$quick_merge = \\\"\" . $templates->get('qm_form') . \"\\\";\");\n\t}\n}", "function _hs_print_archives( $args = [] )\n{\n\t$defaults = [\n\t\t'type' => 'monthly',\n\t\t'limit' => 6, // last six months\n\t\t'format' => 'html', \n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'show_post_count' => false,\n\t\t'echo' => 1,\n\t\t'order' => 'DESC',\n\t\t'classlist' => 'archives'\n\t];\n\n\t$args = wp_parse_args( $args, $defaults );\n\n\t?><ul class=\"<?= $args[classlist] ?>\"><?php\n\twp_get_archives( $args );\n\t?></ul><?php\n}", "public function index()\n {\n $threads = Thread::orderBy('updated_at', 'DESC')->get();\n return view('all_threads')->with([\n 'threads' => $threads\n ]);\n }", "public function archivingAction() {\n\t\tif (Minz_Request::isPost()) {\n\t\t\tFreshRSS_Context::$user_conf->old_entries = Minz_Request::param('old_entries', 3);\n\t\t\tFreshRSS_Context::$user_conf->keep_history_default = Minz_Request::param('keep_history_default', 0);\n\t\t\tFreshRSS_Context::$user_conf->ttl_default = Minz_Request::param('ttl_default', -2);\n\t\t\tFreshRSS_Context::$user_conf->save();\n\t\t\tinvalidateHttpCache();\n\n\t\t\tMinz_Request::good(_t('feedback.conf.updated'),\n\t\t\t array('c' => 'configure', 'a' => 'archiving'));\n\t\t}\n\n\t\tMinz_View::prependTitle(_t('conf.archiving.title') . ' · ');\n\n\t\t$entryDAO = FreshRSS_Factory::createEntryDao();\n\t\t$this->view->nb_total = $entryDAO->count();\n\t\t$this->view->size_user = $entryDAO->size();\n\n\t\tif (FreshRSS_Auth::hasAccess('admin')) {\n\t\t\t$this->view->size_total = $entryDAO->size(true);\n\t\t}\n\t}", "function unarchiveList($task = 'unarchive', $alt = 'Unarchive')\n\t{\n\t\t$bar = & JToolBar::getInstance('toolbar');\n\t\t// Add an unarchive button (list)\n\t\t$bar->appendButton( 'Standard', 'unarchive', $alt, $task, true, false );\n\t}", "protected function _threadListOptions()\r\n\t{\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Select & return a field by an IDfield value
function selectFieldByID($tablename, $field, $id, $idfield = 'id') { $pntables = pnDBGetTables(); $cols = $pntables["{$tablename}_column"]; $where = $cols[$idfield] . "='" . DataUtil::formatForStore($id) . "'"; return DBUtil::selectField($tablename, $field, $where); }
[ "function getField($id, $table, $field){\n\t$q = mysql_query(\"SELECT `$field` FROM `$table` WHERE `id`='$id'\");\n\t$qd = mysql_fetch_assoc($q);\n\treturn f($qd[$field]);\n}", "public function selectFieldById($fields,$id){\n\t\t \t$sql = \"SELECT $fields FROM $this->tb WHERE id=:id\";\n\t\t \t$stmt = $this->prepare($sql);\n\t\t \t$stmt->bindParam(':id',$id);\n\t\t \t$stmt->execute();\n\t\t \treturn $stmt->fetchAll();\n\t\t}", "function field_id($table, $id, $nombre_field)\n {\n $field = NULL;\n \n if ( strlen($id) > 0 ) \n {\n $query = $this->db->query(\"SELECT {$nombre_field} FROM {$table} WHERE id = {$id} LIMIT 1\");\n if ( $query->num_rows() > 0 ){ $field = $query->row()->$nombre_field; }\n }\n \n return $field;\n }", "public function field($id)\n {\n return $this->entities->field($id);\n }", "public function getFieldById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Query set up\t\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_field', '*', \"id = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function findFieldById($id)\n\t{\n\t\treturn $this->Field->findOrFail($id);\n\t}", "function getSingleFieldValue($tablename, $fieldname, $idname, $id)\n{\n\tglobal $log, $adb;\n\t$log->debug(\"Entering into function getSingleFieldValue()\");\n\t$result = $adb->query(\"select $fieldname from $tablename where $idname = $id\");\n\t$fieldval = $adb->query_result($result,0,$fieldname);\n\n\t$log->debug(\"Exit from function getSingleFieldValue()\");\n\n\treturn $fieldval;\n}", "function getSpecificFieldFromAnyTable($table, $field, $id) {\n $getFieldValue = $this->CI->manageCommonTaskModel->getRecord($table, $field, array('id' => $id));\n return $getFieldValue[$field];\n }", "function getIdField() {return $this->_idfield;}", "function fetch_field ($id = -1) {\n\t\tif (!isset ($id) OR $id == -1)\n\t\t\t$id = $this->res_point;\n//debug(\"fetch_field; id = \".$this->res_id[$id]);\n\t\t// $res_id = mysql_fetch_field ($this->res_id[$id]);\n\t\t$res_id = mysqli_fetch_field ($this->res_id[$id]);\n\t\t// if (mysql_errno ())\n\t\tif (mysqli_errno ())\n\t\t\t$this->errores ($this->consulta);\t/* nuevo */\n\t\treturn $res_id;\n\t}", "public function getProductByField($id, $field_name);", "function field_info_field_by_id($field_id) {\n $cache = _field_info_field_cache();\n return $cache->getFieldById($field_id);\n}", "public function get($id) {\n /* @var $field FormField */\n foreach($this->items as $field) {\n if($field->getId() == $id) {\n return $field;\n }\n }\n }", "public function val_by_id($table, $field, $id, $col='id'){\n return $this->select_one($table, $field, [$col => $id]);\n }", "static function getField($id) {\n\t\t\t$mod = new BigTreeModule(\"btx_form_builder_fields\");\n\t\t\t\n\t\t\treturn $mod->get($id);\n\t\t}", "public function getFieldById($field, $id)\n {\n // Find records by field-value parameters\n $multiple = (is_array($id)) ? true : false;\n $records = $this->getByParameters(['id'=>$id], \"object\", $multiple);\n\n // Return\n if (is_array($id)) {\n // Get multiple values\n $values = [];\n foreach ($records AS $record) {\n $values[] = $record->{'get' . ucfirst($field)}();\n }\n\n return $values;\n } else {\n return $records->{'get' . ucfirst($field)}();\n }\n }", "public function getUserByField($id, $field_name);", "public function field($field_id_or_external_id) {\n $key = is_int($field_id_or_external_id) ? 'field_id' : 'external_id';\n foreach ($this->fields as $field) {\n if ($field->{$key} == $field_id_or_external_id) {\n return $field;\n }\n }\n return null;\n }", "function getFieldNameById ($id)\n {\n $db = &JFactory::getDBO();\n $sql = $db->getQuery(true);\n\n $sql->select($db->quoteName('name'))\n ->from($db->quoteName('#__virtuemart_userfields'))\n ->where(array($db->quoteName('virtuemart_userfield_id') . '=' . $id));\n\n $db->setQuery($sql);\n\n if (! $db->query()) {\n $this->_app->enqueueMessage(\n 'Error fetching field by name: ' . $db->stderr(),\n 'error'\n );\n return 0;\n }\n return $db->loadResult();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
metodo que un arreglo con las tuplas de la tabla step_in_plaque_well dado un Id de plate y un ID de step
public function getWellsForStepsPlate($plateID,$stepID){ $query = $this->connection->prepare("SELECT s.id_well, s.id_status, s.quantity, w.fila, w.columna FROM step_in_plaque_well s INNER JOIN well w ON s.id_well = w.id_well WHERE s.id_step = :step AND s.id_plaque = :plate ;" ); $query->bindParam("step", $stepID); $query->bindParam("plate", $plateID); $query->execute(); $resultado = $query->fetchAll(); $rta=[]; //por cada tupla foreach($resultado as $tupla){ $id = $tupla["id_well"]; $s = $tupla["id_status"]; $q = $tupla["quantity"]; $f = $tupla["fila"]; $c = $tupla["columna"]; //pongo la tupla en un arreglo $r = array("id" => $id, "status" => $s, "quantity" => $q, "fila" => $f, "columna" => $c ); $rta[] = $r; } return $rta; }
[ "public function getStepsFromPlate($plateId){\n $query = $this->connection->prepare(\"select s.id_step, s.description, s.id_status, sp.ordina, s.amount, s.type from step s inner join step_plaque sp on s.id_step = sp.id_step inner join plaque p on p.id_plaque = sp.id_plaque where p.id_plaque = :plateID ;\" );\n $query->bindParam(\"plateID\", $plateId);\n $query->execute();\n $resultado = $query->fetchAll();\n $rta=[];\n //por cada tupla\n foreach($resultado as $tupla){\n $id = $tupla[\"id_step\"];\n $d = $tupla[\"description\"];\n $s = $tupla[\"id_status\"];\n $o = $tupla[\"ordina\"];\n $a = $tupla[\"amount\"];\n $t = $tupla[\"type\"];\n $wells = $this->getWellsForStepsPlate($plateId,$id);\n //pongo la tupla en un arreglo\n $r = array(\"id\" => $id, \"descr\" => $d, \"status\" => $s, \"ordinal\" => $o, \"amount\" => $a, \"type\" => $t, \"wells\" => $wells );\n //agrego el arreglo al arreglo de respuesta (INCEPTION!)\n $rta[] = $r;\n }\n return $rta;\n }", "function get_stepData() {\n $sql = \"SELECT * FROM stepdata WHERE Step_id = ?\";\n $stepData_list = prepared_select($this->con, $sql, [$this->id])->fetch_all(MYSQLI_ASSOC);\n $stepData = array();\n foreach ($stepData_list as $row)\n {\n $stepData[] = new StepData($row['id'],$this->con);\n }\n return $stepData;\n }", "function ladeSpiele() {\r\n $spieleIds = array();\r\n $query = $this->pdo->prepare(\"SELECT ID FROM Spiel WHERE Spieler_1 = :spieler1 AND Spieler_2 = :spieler2\");\r\n $query->bindParam(':spieler1', $this->spieler0);\r\n $query->bindParam(':spieler2', $this->spieler1);\r\n $query->execute();\r\n $spieleIds = $query->fetchAll(PDO::FETCH_NUM);\r\n return $this->array_2d_to_1d($spieleIds);\r\n }", "public function generarPartidasEquiposDB($vueltas){\n \n $equipos = $this->getInscritoEquipo();\n \n $equipos_ids = array();\n $equipos_ids_i = array();\n $max = count($equipos);\n if($max%2!=0){\n $libre = new Inscritoequipo(); \n $libre->id = -1; \n $libre->nombre = \"LIBRE\";\n $equipos[] = $libre;\n $max++;\n }\n for($i= 0 ; $i< $max ;$i++){\n $equipos_ids[$i] = $equipos[$i]->id; \n }\n $rondas = array();\n for($i = 0; $i<$vueltas;$i++){\n $ronda = $this->roundRobin($equipos_ids);\n $rondas = array_merge($rondas,$ronda); \n }\n \n $i = 1 ; \n foreach($rondas as $round => $games){\n $jornada = new Jornada();\n $jornada->competicion_id = $this->id;\n $jornada->estado = \"pendiente\";\n $jornada->guardarDB();\n \n foreach($games as $play){\n \n \n $partida = new Partida();\n $partida->competicion_id = $this->id ;\n $partida->jornada_id = $jornada->id;\n $partida->estado =\"pendiente\";\n \n \n $partida->guardarDB();\n $juegalocal = new Juegaequipo();\n $juegavisi = new Juegaequipo();\n if ($i % 2 == 0){\n $juegalocal->equipoinscrito_id = $play[\"Home\"];\n $juegavisi->equipoinscrito_id = $play[\"Away\"];\n }else{\n $juegalocal->equipoinscrito_id = $play[\"Away\"];\n $juegavisi->equipoinscrito_id = $play[\"Home\"];\n }\n \n $juegalocal->competicion_id = $this->id;\n $juegavisi->competicion_id = $this->id;\n $juegalocal->partida_id = $partida->id;\n $juegavisi->partida_id = $partida->id;\n $juegalocal->posicion = 0;\n $juegavisi->posicion = 1;\n \n \n if($play[\"Home\"] == -1){ \n $partida->comentario = \"LIBRE\";\n $partida->guardarDB(); \n }else{ \n $juegalocal->guardarDB();\n }\n if($play[\"Away\"] == -1){ \n $partida->comentario = \"LIBRE\";\n $partida->guardarDB();\n }else{\n \n $juegavisi->guardarDB();\n }\n }\n $i++;\n } \n }", "abstract protected function get_tupla();", "public function plates()\n {\n return $this->belongsToMany('App\\Models\\Plate', 'pedidoplato', 'codigopedido', 'idplato')\n ->withPivot('precio_unitario', 'cantidad');\n }", "private function findFromPathDB($step = array())\n\t\t{\n\t\t\tif (isset($step[0])) {\n\t\t\t\t$result = $this->DB->query(\"SELECT * FROM path WHERE end_x = \".$step[0][1].\" AND end_y = \".$step[0][0]);\n\t\t\t\twhile($row = $result->fetchArray()) {\n\t\t\t\t\t$path = unserialize($row['array']);\n\t\t\t\t\tunset($step[0]); //remove the step prepare for merging steps\n\t\t\t\t\t$npath = array_merge($path, $step);// merge steps to create path\n\t\t\t\t\t$this->insertIntoPath($npath);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function generarTablaPosiciones($idCampeonato)\n\t{\n\t\t$em = $this->getEntityManager();\n\n\t\t$tabla = array();\n\t\t$equipos = $em->getRepository('Area4CampeonatoBundle:Equipo')->findByCampeonato($idCampeonato);\n\t\t\n\t\t$repositoryPartido = $em->getRepository('Area4CampeonatoBundle:Partido');\n\n\t\tforeach ($equipos as $equipo) {\n \t\t$nombre = $equipo->getNombre();\n \t\t$tabla[$nombre]['PJ'] = $repositoryPartido->partidosJugados($equipo->getId(), $idCampeonato);\n \t\t$tabla[$nombre]['PG'] = $repositoryPartido->partidosGanados($equipo->getId(), $idCampeonato);\n \t\t$tabla[$nombre]['PE'] = $repositoryPartido->partidosEmpatados($equipo->getId(), $idCampeonato);\n \t\t$tabla[$nombre]['PP'] = $repositoryPartido->partidosPerdidos($equipo->getId(), $idCampeonato);\n \t\t$tabla[$nombre]['GF'] = $repositoryPartido->golesFavor($equipo->getId(), $idCampeonato);\n \t\t$tabla[$nombre]['GC'] = $repositoryPartido->golesContra($equipo->getId(), $idCampeonato);\n \t\t$tabla[$nombre]['DIF'] = $tabla[$nombre]['GF'] - $tabla[$nombre]['GC'];\n \t\t$tabla[$nombre]['Pts'] = $tabla[$nombre]['PG'] * 3 + $tabla[$nombre]['PE'] * 2 + $tabla[$nombre]['PP'] * 1 ;\n \t}\n\n\n \tforeach ($tabla as $key => $row) {\n \t\t$PTS[$key] = $row['Pts'];\n \t\t$DIF[$key] = $row['DIF'];\n \t}\n\n \tarray_multisort($PTS,SORT_DESC,$DIF,SORT_ASC,$tabla);\n\n\n\t\treturn $tabla;\n\n\t}", "public final function getStepIds()\n {\n }", "public function obtenerLayoutParcialValidar($id){\n $layout_parcial = LayoutParcial::find($id);\n\n $detalles = array();\n if($layout_parcial->campos_con_diferencia != null){\n\n foreach($layout_parcial->detalles as $detalle){//COMIENZO FOREACH POR DETALLE\n $linea = new \\stdClass();\n $maquina= Maquina::find($detalle->id_maquina);\n $detalle_aux = $detalle->campos_con_diferencia->where('entidad', 'maquina');\n\n //variable auxiliar, si existio diferncia en el campo en cuestion\n $aux = $detalle_aux->where('columna', 'nro_admin');\n if($aux->count() == 1){\n foreach ($aux as $cd) {\n $linea->nro_admin = ['correcto' => false, 'valor' => $cd->valor, 'valor_antiguo' => $maquina->nro_admin];\n }\n }else{\n $linea->nro_admin = ['correcto' => true, 'valor' => $maquina->nro_admin, 'valor_antiguo' => ''];\n }\n\n $aux = $detalle_aux->where('columna' , 'nro_isla');\n if($aux->count() == 1){\n foreach ($aux as $cd) {\n $linea->nro_isla = ['correcto' => false, 'valor' => $cd->valor, 'valor_antiguo' => $maquina->isla->nro_isla];\n }\n }else{\n $linea->nro_isla = ['correcto' => true, 'valor' => $maquina->isla->nro_isla, 'valor_antiguo' => ''];\n }\n\n $aux = $detalle_aux->where('columna', 'marca');\n if($aux->count() == 1){\n foreach ($aux as $cd) {\n $linea->marca = ['correcto' => false, 'valor' => $cd->valor, 'valor_antiguo' => $maquina->marca];\n }\n }else{\n $linea->marca = ['correcto' => true, 'valor' => $maquina->marca, 'valor_antiguo' => ''];\n }\n\n $aux = $detalle_aux->where('columna', 'nombre_juego');\n if($aux->count() == 1){\n foreach ($aux as $cd) {\n $linea->juego = ['correcto' => false, 'valor' => $cd->valor, 'valor_antiguo' => $maquina->juego_activo->nombre_juego];\n }\n }else{\n $linea->juego = ['correcto' => true, 'valor' => $maquina->juego_activo->nombre_juego, 'valor_antiguo' => ''];\n }\n\n if($maquina->id_pack!=null){\n $pack=PackJuego::find($maquina->id_pack);\n $linea->tiene_pack_bandera=true;\n $juegos_pack_habilitados=array();\n foreach($maquina->juegos as $j){\n if($j->pivot->habilitado!=0){\n array_push( $juegos_pack_habilitados,$j);\n }\n }\n $linea->juegos_pack=$juegos_pack_habilitados;\n }else{\n $linea->tiene_pack_bandera=false;\n }\n\n $aux = $detalle_aux->where('columna', 'nro_serie');\n if($aux->count() == 1){\n foreach ($aux as $cd) {\n $linea->nro_serie = ['correcto' => false, 'valor' => $cd->valor, 'valor_antiguo' => $maquina->nro_serie];\n }\n }else{\n $linea->nro_serie = ['correcto' => true, 'valor' => $maquina->nro_serie, 'valor_antiguo' => ''];\n }\n\n $linea->id_maquina = $maquina->id_maquina;\n\n $linea->denominacion = $detalle->denominacion;\n $linea->porcentaje_dev = $detalle->porcentaje_devolucion;\n $linea->no_toma = (($detalle->denominacion == null && $detalle->porcentaje_devolucion == null) ? true : false);\n\n //sigue misma logica que para la configuracion de la maquina\n\n $linea->progresivo = $this->obtenerDetallesProgresivo($maquina , $detalle);\n\n $linea->niveles = $this->obtenerDetallesNivelesProgresivo($maquina , $detalle);\n\n\n $detalles[] = $linea;\n }//FIN FOREACH POR DETALLE\n }else {\n\n foreach($layout_parcial->detalles as $detalle){\n $linea = new \\stdClass();\n $maquina= Maquina::find($detalle->id_maquina);\n //si no hubo diferencia mando todo;\n\n $linea->nro_admin = ['correcto' => true, 'valor' => $maquina->nro_admin, 'valor_antiguo' => ''];\n\n $linea->nro_isla = ['correcto' => true, 'valor' => $maquina->isla->nro_isla, 'valor_antiguo' => ''];\n\n $linea->marca = ['correcto' => true, 'valor' => $maquina->marca, 'valor_antiguo' => ''];\n\n $linea->juego = ['correcto' => true, 'valor' => $maquina->juego_activo->nombre_juego, 'valor_antiguo' => ''];\n\n $linea->nro_serie = ['correcto' => true, 'valor' => $maquina->nro_serie, 'valor_antiguo' => ''];\n\n $linea->progresivo = $this->obtenerDetallesProgresivo($maquina , null);\n\n $linea->niveles = $this->obtenerDetallesNivelesProgresivo($maquina , null);\n }\n\n }\n\n\n return ['layout_parcial' => $layout_parcial,\n 'casino' => $layout_parcial->sector->casino->nombre,\n 'id_casino' => $layout_parcial->sector->casino->id_casino,\n 'sector' => $layout_parcial->sector->descripcion,\n 'detalles' => $detalles,\n 'usuario_cargador' => $layout_parcial->usuario_cargador,\n 'usuario_fiscalizador' => $layout_parcial->usuario_fiscalizador,\n ];\n }", "public function visualizza_tappe(){\n $ris = array();\n foreach ($this->itineraryComponents as $elemento) {\n $tappe = $elemento->visualizza_tappe();\n foreach($tappe as $tappa){\n $ris[$tappa->getId()] = $tappa;\n }\n }\n return $ris; \n }", "public static function pegarPorIdPaciente($id_paciente) {\n $pt1 = \\App\\AnamneseGigantePsicopedaNeuroPsicomotoPt1::where('id_paciente', $id_paciente)->first();\n\n // Verifica se tem aquela anamnese\n if(!$pt1) {\n return false;\n }\n\n // Se foi, vou pegar a tabela index\n $id_tp = $pt1->id_tp;\n\n // O id_tp = id de todas as tabelas, já que são criadas todas ao mesmo tempo\n // Ai pq ter o id_tp e o id? Clareza, eles são o mesmo numero com nomes convenientes\n // Pegar as partes 2 e 3, já que já tem a 1, sendo a parte 1 que tem o id do paciente\n $pt2 = \\App\\AnamneseGigantePsicopedaNeuroPsicomotoPt2::where('id_tp', $id_tp)->first();\n $pt3 = \\App\\AnamneseGigantePsicopedaNeuroPsicomotoPt3::where('id_tp', $id_tp)->first();\n\n // Pega os atributos de todas as partes\n $atributos_pt1 = getProtectedMember( (object) ((array)$pt1), \"attributes\");\n $atributos_pt2 = getProtectedMember( (object) ((array)$pt2), \"attributes\");\n $atributos_pt3 = getProtectedMember( (object) ((array)$pt3), \"attributes\");\n\n // Transforma os 3 arrays de atributos em 1 array, dando merge neles, e transforma de volta num objeto std\n $pt1_pt2_pt3 = (object) array_merge(array_merge($atributos_pt1, $atributos_pt2), $atributos_pt3);\n\n /* Cria um objeto de classe anonima que pode ter chamada de metodo normal\n * que pode ser chamado como $obj->metodo();\n * A função __get e __set garante que todos os objetos da anamnese são acessiveis\n * como se essa classe anonima fosse a classe de anamnese.\n * Em resumo, agora a classe anamnese tem o metodo save() que pode ser chamando\n * padrão.\n */\n $anamnese_proxy = new class($pt1_pt2_pt3) {\n private $anamnese_original;\n private $id_tp;\n private $pt1;\n private $pt2;\n private $pt3;\n\n public function __construct($orig) {\n $this->anamnese_original = $orig;\n $this->id_tp = $orig->id_tp;\n $this->pt1 = \\App\\AnamneseGigantePsicopedaNeuroPsicomotoPt1::where('id_tp', $this->id_tp)->first();\n $this->pt2 = \\App\\AnamneseGigantePsicopedaNeuroPsicomotoPt2::where('id_tp', $this->id_tp)->first();\n $this->pt3 = \\App\\AnamneseGigantePsicopedaNeuroPsicomotoPt3::where('id_tp', $this->id_tp)->first();\n }\n\n public function __get($name) {\n return ($this->anamnese_original->$name);\n }\n\n public function __set($name, $value) {\n $this->anamnese_original->$name = $value;\n }\n\n public function __call($name, $arguments) {\n $anamnese = \\App\\AnamneseGigantePsicopedaNeuroPsicomoto::where('id_tp', $this->id_tp)->first();\n return $anamnese->$name($arguments);\n }\n\n public function get_pt1() {\n return $this->pt1;\n }\n public function get_pt2() {\n return $this->pt2;\n }\n public function get_pt3() {\n return $this->pt3;\n }\n\n public function fill($entrada) {\n $this->pt1->fill($entrada);\n $this->pt2->fill($entrada);\n $this->pt3->fill($entrada);\n }\n\n public function save() {\n $this->pt1->save();\n $this->pt2->save();\n $this->pt3->save();\n }\n };\n\n return $anamnese_proxy;\n\n }", "public function steps()\n {\n return $this->belongsToMany('App\\Step');\n }", "public function registeredStep()\n\t{\t\n\n\t\t$steps = collect([]);\n\n\t\tif(!is_null($this->flow)):\n\n\t\tStep::whereNull('fk_jfs_step')\n\t\t\t->where('fk_jf_flow',$this->flow->id)\n\t\t\t->get()->each(function ($item, $key) use($steps){\n\n\t\t\t$matrix['item'] = $item;\n\t\t\t$matrix['child'] = $this->getChilds($item->id);\n\n\t\t\t$steps->put($item->jfs_code,$matrix);\n\n\t\t});\n\n\t\tendif;\n\n\t\treturn $steps;\n\t}", "public function buscarInconclusas(){\n $ls_Sql = \"SELECT * FROM partida WHERE estado='I'\";\n $this->f_Con();\n $lr_Tabla = $this->f_Filtro($ls_Sql);\n $x = 0;\n while($la_Tupla=$this->f_Arreglo($lr_Tabla)){\n $la_Registros[$x]['id']=$la_Tupla[\"id\"];\n //me dice el jugador que esta en turno\n $la_Registros[$x]['jugador']=$la_Tupla[\"jugador\"];\n $la_Registros[$x]['estado']=$la_Tupla[\"estado\"];\n $x++;\n }\n $this->f_Cierra($lr_Tabla);\n $this->f_Des();\n return $la_Registros;\n }", "public function testGetValidStepByStepTaskId() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"step\");\n\n\t\t// create a new Step and insert to into mySQL\n\t\t$stepId = generateUuidV4();\n\t\t$step = new Step($stepId, $this->task->getTaskId(), $this->VALID_STEP_CONTENT, $this->VALID_STEP_ORDER);\n\t\t$step->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Step::getStepByStepTaskId($this->getPDO(), $step->getStepTaskId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"step\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"Club\\\\KidTask\\\\Step\", $results);\n\n\t\t// grab the result from the array and validate it\n\t\t$pdoStep = $results[0];\n\n\t\t$this->assertEquals($pdoStep->getStepId(), $stepId);\n\t\t$this->assertEquals($pdoStep->getStepTaskId(), $this->task->getTaskId());\n\t\t$this->assertEquals($pdoStep->getStepContent(), $this->VALID_STEP_CONTENT);\n\t\t$this->assertEquals($pdoStep->getStepOrder(), $this->VALID_STEP_ORDER);\n\t}", "function nextTransect($step=1)\n {\n $next_seq = $this->sequence + $step;\n $query = \"SELECT id FROM transect_defs WHERE sequence=$next_seq;\";\n $result = submit_query($query, \"nearshore_v1\");\n $vals = mysqli_fetch_array($result); \n return $vals['id'];\n }", "public function getIdStep()\n {\n return $this->id_step;\n }", "public function getPhasesInTreatment() {\n $phases = array();\n try {\n\t\t\t$host_db_link = new PDO( OPAL_DB_DSN, OPAL_DB_USERNAME, OPAL_DB_PASSWORD );\n $host_db_link->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n\n $sql = \"\n SELECT DISTINCT \n p.PhaseInTreatmentSerNum,\n p.Name_EN,\n p.Name_FR\n FROM\n PhaseInTreatment p\n \";\n\t\t $query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t$query->execute();\n\n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n $phaseArray = array(\n 'serial' => $data[0],\n 'name_EN' => $data[1],\n 'name_FR' => $data[2]\n );\n\n array_push($phases, $phaseArray); \n }\n\n return $phases;\n\n } catch (PDOException $e) {\n\t\t\techo $e->getMessage();\n\t\t\treturn $phases;\n\t\t}\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
(PHP 5 &gt;= 5.2.0, PECL yaml &gt;= 0.5.0) Send the YAML representation of a value to a file
function yaml_emit_file($filename, $data, $encoding = YAML_ANY_ENCODING, $linebreak = YAML_ANY_BREAK, array $callbacks = []) {}
[ "private function write()\n\t{\n\t\t$this->config->write($this->path, 'yaml');\n\t}", "public function toYaml();", "function yml_set_file($key, $value, $ymlfile)\n {\n return yml::setFile($key, $value, $ymlfile);\n }", "function yaml_emit_file(\n $filename,\n $data,\n $encoding = YAML_ANY_ENCODING,\n $linebreak = YAML_ANY_BREAK,\n array $callbacks = array()\n) {\n}", "public static function dumpYaml($data=array(),$yamlPath=null){\n if(is_array($data)){\n $yaml = Yaml::dump($data);\n return file_put_contents($yamlPath, $yaml);\n }\n\n }", "public function store($file,\n\t\t\t$yaml)\n {\n Debug::checkArgs(0,\n\t\t 1, 'string', $file,\n\t\t 1, 'nonempty', $file,\n\t\t 2, 'nonempty', $yaml);\n \n if (is_array($yaml))\n $yaml = syck_dump($yaml);\n try {\n file_put_contents($file, $value, LOCK_EX);}\n catch (\\ErrorException $e) {\n throw new FtpException(mb_substr(mb_strstr($e->getMessage()), ']:'),3);}\n }", "function escapeYamlValue($value)\n{\n return str_replace('%', '%%', $value);\n}", "private function _writeYamlToFile($filename, $yaml)\n {\n file_put_contents($filename, $yaml);\n }", "public function toYaml(): string {\n return yaml_emit($this->toArray());\n }", "function yaml_encode($struct, $opt = array()) {\n\t// Si PHP4\n\tif (_LIB_YAML == 'spyc-php4') {\n\t\trequire_once _DIR_PLUGIN_YAML.'spyc/spyc-php4.php';\n\t\treturn Spyc::YAMLDump($struct);\n\t}\n\t// test temporaire\n\tif (_LIB_YAML == 'spyc') {\n\t\trequire_once _DIR_PLUGIN_YAML.'spyc/spyc.php';\n\t\treturn Spyc::YAMLDump($struct);\n\t}\n\n\trequire_once _DIR_PLUGIN_YAML.'inc/yaml_sfyaml.php';\n\treturn yaml_sfyaml_encode($struct, $opt);\n}", "public function testSaveArrayToYaml( )\n {\n $file = OUTPUT_DIR . 'array.yml';\n \n $array = array( 'this', 'that', 'and', 'all', 'this' );\n \n $this->yaml->save($array, $file );\n \n $this->assertEquals(\n\"- this\n- that\n- and\n- all\n- this\n\",\n file_get_contents( $file ) );\n }", "function buildYamlFile($fields_name, $trans_key = \"FormInputLabel_\")\n{\n print '<pre>';\n foreach ($fields_name as $name) {\n print \"- name: $name\\n\";\n print \" label: $trans_key$name\\n\";\n //print \" selected: \\n\";\n //print \" required: \\n\";\n //print \" id: \\n\";\n //print \" type: \\n\";\n //print \" more_class: \\n\";\n //print \" more_options: \\n\";\n }\n print '</pre>';\n}", "function createTravisConfigYml()\n{\n $fileContent = <<<CONTENT\nparameters:\n database_driver: pdo_mysql\n database_host: localhost\n database_port: ~\n database_name: tickit\n database_user: root\n database_password:\n\n mailer_transport: smtp\n mailer_host: localhost\n mailer_user: ~\n mailer_password: ~\n\n locale: en\n secret: SomeRandomValue\nCONTENT;\n\n $configDir = getProjectRoot() . '/app/config';\n file_put_contents($configDir . '/parameters.yml', $fileContent);\n\n}", "final public function readYaml() {}", "public function save($path, $data) {\n $yaml = self::YAMLDump($data);\n file_put_contents($path, $yaml);\n }", "public function toYaml(): string\n {\n return Yaml::dump($this->toArray(), 20);\n }", "public static function saveToYml($form){\n wfPlugin::includeonce('wf/array');\n wfPlugin::includeonce('wf/yml');\n $form = new PluginWfArray($form);\n if($form->get('yml/file') && $form->get('yml/path_to_key') && $form->get('items')){\n $yml = new PluginWfYml($form->get('yml/file'), $form->get('yml/path_to_key'));\n foreach ($form->get('items') as $key => $value) {\n $yml->set($key, wfArray::get($value, 'post_value'));\n }\n $yml->save();\n return true;\n }else{\n return false;\n }\n return false;\n }", "static function convertPropertyFileToYamlFile( $infile, $outfile='pake/options.yaml', $transform = array(), $prepend='' )\n {\n $current = array();\n $out = array();\n foreach ( file( $infile ) as $line )\n {\n $line = trim( $line );\n if ( $line == '' )\n {\n $out[] = '';\n }\n else if ( strpos( $line, '<!--' ) === 0 )\n {\n $out[] .= preg_replace( '/^<!-- *(.*) *-->$/', '# $1', $line );\n }\n else if ( strpos( $line, '=' ) != 0 )\n {\n $line = explode( '=', $line, 2 );\n $path = explode( '.', trim( $line[0] ) );\n foreach( $transform as $src => $dst )\n {\n foreach( $path as $i => $element )\n {\n if ( $element == $src )\n {\n if ( $dst == '' )\n {\n unset( $path[$i] );\n }\n else if ( is_array( $dst ) )\n {\n array_splice( $path, $i-1, 1, $dst );\n }\n else\n {\n $path[$i] = $dst;\n }\n }\n }\n }\n // elements index can have holes here, cannot trust them => reorder\n $path = array_values( $path );\n\n $value = $line[1];\n $token = array_pop( $path );\n\n if ( $path != $current )\n {\n $skip = 0;\n foreach( $path as $j => $element )\n {\n if ( $element == @$current[$j] )\n {\n $skip++;\n }\n else\n {\n break;\n }\n }\n\n for( $j = $skip; $j < count( $path ); $j++ )\n //foreach( $path as $j => $element )\n {\n $line = '';\n for ( $i = 0; $i < $j; $i++ )\n {\n $line .= ' ';\n }\n $line .= $path[$j] . ':';\n $out[] = $line;\n }\n }\n $line = '';\n for ( $i = 0; $i < count( $path ); $i++ )\n {\n $line .= ' ';\n }\n $line .= $token . ': ' . $value;\n $out[] = $line;\n $current = $path;\n }\n else\n {\n /// @todo log warning?\n }\n }\n pake_mkdirs( 'pake' );\n // ask confirmation if file exists\n $ok = !file_exists( $outfile ) || ( pake_input( \"Destionation file $outfile exists. Overwrite? [y/n]\", 'n' ) == 'y' );\n if ( $ok )\n {\n file_put_contents( $outfile, $prepend . implode( $out, \"\\n\" ) );\n pake_echo_action( 'file+', $outfile );\n }\n }", "protected final function response_as_yaml($whatever)\n {\n header('Content-Type: application/x-yaml');\n print($whatever); die;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }